summaryrefslogtreecommitdiffstats
path: root/src/core/Streaming.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-08-19 22:35:10 +0200
committerSergeanur <s.anureev@yandex.ua>2020-08-19 22:35:10 +0200
commitdab6d6dd6d9f45435daf6634018fef3def0fe6e1 (patch)
tree751cb947cfbf76af048a05b0540bcfe0758eeea1 /src/core/Streaming.cpp
parentMerge branch 'master' into miami (diff)
parentsmall stuff (diff)
downloadre3-dab6d6dd6d9f45435daf6634018fef3def0fe6e1.tar
re3-dab6d6dd6d9f45435daf6634018fef3def0fe6e1.tar.gz
re3-dab6d6dd6d9f45435daf6634018fef3def0fe6e1.tar.bz2
re3-dab6d6dd6d9f45435daf6634018fef3def0fe6e1.tar.lz
re3-dab6d6dd6d9f45435daf6634018fef3def0fe6e1.tar.xz
re3-dab6d6dd6d9f45435daf6634018fef3def0fe6e1.tar.zst
re3-dab6d6dd6d9f45435daf6634018fef3def0fe6e1.zip
Diffstat (limited to 'src/core/Streaming.cpp')
-rw-r--r--src/core/Streaming.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index 3c32b856..b6a4f735 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -199,11 +199,25 @@ CStreaming::Init2(void)
ms_pStreamingBuffer[1] = ms_pStreamingBuffer[0] + ms_streamingBufferSize*CDSTREAM_SECTOR_SIZE;
debug("Streaming buffer size is %d sectors", ms_streamingBufferSize);
+ // PC only, figure out how much memory we got
+#ifdef GTA_PC
#define MB (1024*1024)
+#ifdef FIX_BUGS
+ // do what gta3 does
+ extern size_t _dwMemAvailPhys;
+ ms_memoryAvailable = (_dwMemAvailPhys - 10*MB)/2;
+ if(ms_memoryAvailable < 65*MB)
+ ms_memoryAvailable = 65*MB;
+ desiredNumVehiclesLoaded = (int32)((ms_memoryAvailable / MB - 65) / 3 + 12);
+ if(desiredNumVehiclesLoaded > MAXVEHICLESLOADED)
+ desiredNumVehiclesLoaded = MAXVEHICLESLOADED;
+#else
ms_memoryAvailable = 65 * MB;
desiredNumVehiclesLoaded = 25;
- debug("Memory allocated to Streaming is %dMB", ms_memoryAvailable / MB);
+ debug("Memory allocated to Streaming is %zuMB", ms_memoryAvailable/MB); // original modifier was %d
+#endif
#undef MB
+#endif
// find island LODs