mirror of
https://github.com/GTAmodding/re3.git
synced 2024-11-16 02:09:00 +00:00
Fix unsigned comparison in CStreaming::MakeSpaceFor(int32 size)
This commit is contained in:
parent
fec01aeff1
commit
6bae5a6031
1 changed files with 9 additions and 4 deletions
|
@ -2936,10 +2936,15 @@ CStreaming::DeleteRwObjectsNotInFrustumInSectorList(CPtrList &list, size_t mem)
|
||||||
void
|
void
|
||||||
CStreaming::MakeSpaceFor(int32 size)
|
CStreaming::MakeSpaceFor(int32 size)
|
||||||
{
|
{
|
||||||
// BUG: ms_memoryAvailable can be uninitialized
|
#ifdef FIX_BUGS
|
||||||
// the code still happens to work in that case because ms_memoryAvailable is unsigned
|
#define MB (1024 * 1024)
|
||||||
// but it's not nice....
|
if(ms_memoryAvailable == 0) {
|
||||||
|
extern size_t _dwMemAvailPhys;
|
||||||
|
ms_memoryAvailable = (_dwMemAvailPhys - 10 * MB) / 2;
|
||||||
|
if(ms_memoryAvailable < 65 * MB) ms_memoryAvailable = 65 * MB;
|
||||||
|
}
|
||||||
|
#undef MB
|
||||||
|
#endif
|
||||||
while(ms_memoryUsed >= ms_memoryAvailable - size)
|
while(ms_memoryUsed >= ms_memoryAvailable - size)
|
||||||
if(!RemoveLeastUsedModel(STREAMFLAGS_20)){
|
if(!RemoveLeastUsedModel(STREAMFLAGS_20)){
|
||||||
DeleteRwObjectsBehindCamera(ms_memoryAvailable - size);
|
DeleteRwObjectsBehindCamera(ms_memoryAvailable - size);
|
||||||
|
|
Loading…
Reference in a new issue