1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-06 00:35:54 +00:00

cSmallHeap

This commit is contained in:
Sergeanur 2021-01-23 00:03:12 +02:00
parent bdb216bf7c
commit c884edd923
4 changed files with 42 additions and 2 deletions

View file

@ -242,6 +242,7 @@ project "reLCS"
files { addSrcFiles("src/control") }
files { addSrcFiles("src/core") }
files { addSrcFiles("src/entities") }
files { addSrcFiles("src/leeds") }
files { addSrcFiles("src/leeds/base") }
files { addSrcFiles("src/math") }
files { addSrcFiles("src/modelinfo") }
@ -267,6 +268,7 @@ project "reLCS"
includedirs { "src/control" }
includedirs { "src/core" }
includedirs { "src/entities" }
includedirs { "src/leeds" }
includedirs { "src/leeds/base" }
includedirs { "src/math" }
includedirs { "src/modelinfo" }

View file

@ -49,7 +49,7 @@
#include "Timecycle.h"
#include "TxdStore.h"
#include "Bike.h"
#include "memoryManager.h"
#include "smallHeap.h"
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
#include <stdarg.h>
#endif
@ -2632,7 +2632,8 @@ bool CTheScripts::Init(bool loaddata)
CFileMgr::Read(mainf, (char*)&MainScriptSize, sizeof(MainScriptSize));
int nLargestMissionSize = 0;
CFileMgr::Read(mainf, (char*)&nLargestMissionSize, sizeof(nLargestMissionSize));
// some cSmallHeap shit - TODO
if (!cSmallHeap::msInstance.IsLocked())
cSmallHeap::msInstance.Lock();
ScriptSpace = (uint8*)base::cMainMemoryManager::Instance()->Allocate(MainScriptSize + nLargestMissionSize);
memset(ScriptSpace, 0, MainScriptSize + nLargestMissionSize);
CFileMgr::Read(mainf, (char*)ScriptSpace, MainScriptSize);

20
src/leeds/smallHeap.cpp Normal file
View file

@ -0,0 +1,20 @@
#include "common.h"
#include "smallHeap.h"
cSmallHeap cSmallHeap::msInstance;
cSmallHeap::cSmallHeap()
{
bLocked = false;
bUnk = false;
}
void cSmallHeap::Lock()
{
// TODO: PS2 code
}
void cSmallHeap::Unlock()
{
// TODO: PS2 code
}

17
src/leeds/smallHeap.h Normal file
View file

@ -0,0 +1,17 @@
#pragma once
#include "memoryManager.h"
class cSmallHeap : public base::cMemoryManager
{
bool bLocked;
bool bUnk;
public:
cSmallHeap();
void Lock();
void Unlock();
bool IsLocked() const { return bLocked; }
static cSmallHeap msInstance;
};