Skip to content

Commit

Permalink
Remove virtual memory size check.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Nov 11, 2015
1 parent ab829e1 commit 24130eb
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions src/xrEngine/x_ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,43 +605,6 @@ struct damn_keys_filter
#undef dwFilterKeysStructSize
#undef dwToggleKeysStructSize

// Ôóíöèÿ äëÿ òóïûõ òðåáîâàíèé THQ è òóïûõ àìåðèêàíñêèõ ïîëüçîâàòåëåé
BOOL IsOutOfVirtualMemory()
{
#define VIRT_ERROR_SIZE 256
#define VIRT_MESSAGE_SIZE 512
MEMORYSTATUSEX statex;
DWORD dwPageFileInMB = 0;
DWORD dwPhysMemInMB = 0;
HINSTANCE hApp = 0;
char pszError[VIRT_ERROR_SIZE];
char pszMessage[VIRT_MESSAGE_SIZE];

ZeroMemory(&statex, sizeof(MEMORYSTATUSEX));
statex.dwLength = sizeof(MEMORYSTATUSEX);

if (!GlobalMemoryStatusEx(&statex))
return 0;

dwPageFileInMB = (DWORD)(statex.ullTotalPageFile / (1024 * 1024));
dwPhysMemInMB = (DWORD)(statex.ullTotalPhys / (1024 * 1024));

// Äîâîëüíî îòôîíàðíîå óñëîâèå
if ((dwPhysMemInMB > 500) && ((dwPageFileInMB + dwPhysMemInMB) > 2500))
return 0;

hApp = GetModuleHandle(NULL);

if (!LoadString(hApp, RC_VIRT_MEM_ERROR, pszError, VIRT_ERROR_SIZE))
return 0;

if (!LoadString(hApp, RC_VIRT_MEM_TEXT, pszMessage, VIRT_MESSAGE_SIZE))
return 0;

MessageBox(NULL, pszMessage, pszError, MB_OK | MB_ICONHAND);
return 1;
}

#include "xr_ioc_cmd.h"

//typedef void DUMMY_STUFF (const void*,const u32&,void*);
Expand Down Expand Up @@ -726,10 +689,6 @@ int APIENTRY WinMain_impl(HINSTANCE hInstance,

// foo();
#ifndef DEDICATED_SERVER

// Check for virtual memory
if ((strstr(lpCmdLine, "--skipmemcheck") == NULL) && IsOutOfVirtualMemory())
return 0;
// Check for another instance
#ifdef NO_MULTI_INSTANCES
#define STALKER_PRESENCE_MUTEX "Local\\STALKER-COP"
Expand Down

0 comments on commit 24130eb

Please sign in to comment.