From 8e4ca815b14cd1c1067355192fe2dd6b5e6a67b6 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Sun, 12 Jun 2016 14:54:58 -0700 Subject: [PATCH] less stupid memory management --- .../SwgClient/src/win32/SwgClient.rc | 4 +- .../SwgClient/src/win32/WinMain.cpp | 38 ++++--------------- .../src/win32/SwgClientSetup.rc | 4 +- 3 files changed, 11 insertions(+), 35 deletions(-) diff --git a/src/game/client/application/SwgClient/src/win32/SwgClient.rc b/src/game/client/application/SwgClient/src/win32/SwgClient.rc index f0fb375cb..5da7901c8 100644 --- a/src/game/client/application/SwgClient/src/win32/SwgClient.rc +++ b/src/game/client/application/SwgClient/src/win32/SwgClient.rc @@ -61,8 +61,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,0,0,0 - PRODUCTVERSION 2,0,0,0 + FILEVERSION 2,0,0,1 + PRODUCTVERSION 2,0,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L diff --git a/src/game/client/application/SwgClient/src/win32/WinMain.cpp b/src/game/client/application/SwgClient/src/win32/WinMain.cpp index 6d5ac63f7..b0a5e7281 100644 --- a/src/game/client/application/SwgClient/src/win32/WinMain.cpp +++ b/src/game/client/application/SwgClient/src/win32/WinMain.cpp @@ -49,36 +49,19 @@ static bool SetUserSelectedMemoryManagerTarget() static void SetDefaultMemoryManagerTargetSize() { - int megabytes = 0; + // just use all available up to 2048gb, else ALL available, since we're 99% guranteed to be on a modern machine MEMORYSTATUSEX memoryStatus = { sizeof memoryStatus }; - megabytes = memoryStatus.ullTotalPhys / 1048576; + GlobalMemoryStatusEx(&memoryStatus); + int ramMB = (memoryStatus.ullTotalPhys / 1048576); - // clamp it between 250 and 2048MB - if (megabytes >= 2040) - { - megabytes = 2048; - } - else if (megabytes >= 1020) - { - megabytes = 1024; - } - else if (megabytes <= 760) - { - megabytes = 768; - } - else if (megabytes <= 250) - { - megabytes = 256; - } - else - { - megabytes = 768; + // without PAE enabled 2048 is the max we can do + if (ramMB >= 2048){ + ramMB = 2048; } - MemoryManager::setLimit(megabytes, false, false); + MemoryManager::setLimit(ramMB, false, false); } - void externalCommandHandler(const char* command) { if (strcmp(command, "npe_continue") == 0) @@ -88,13 +71,6 @@ void externalCommandHandler(const char* command) Unicode::String url; - /* - if ((Game::getSubscriptionFeatureBits() & ClientSubscriptionFeature::NPENagForRental) != 0) - { - url = rentalNagId.localize(); - } - else - */ if ((Game::getSubscriptionFeatureBits() & ClientSubscriptionFeature::NPENagForTrial) != 0) { url = trialNagId.localize(); diff --git a/src/game/client/application/SwgClientSetup/src/win32/SwgClientSetup.rc b/src/game/client/application/SwgClientSetup/src/win32/SwgClientSetup.rc index 573c5f1a6..3cc3c7f21 100644 --- a/src/game/client/application/SwgClientSetup/src/win32/SwgClientSetup.rc +++ b/src/game/client/application/SwgClientSetup/src/win32/SwgClientSetup.rc @@ -537,8 +537,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,0,0,0 - PRODUCTVERSION 2,0,0,0 + FILEVERSION 2,0,0,1 + PRODUCTVERSION 2,0,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L