summaryrefslogtreecommitdiffstats
path: root/src/core/FileLoader.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-11-28 18:52:44 +0100
committerGitHub <noreply@github.com>2020-11-28 18:52:44 +0100
commitc57fee38caed4cc770aa8e57b74672ca85aa0fa3 (patch)
treed9b0a02ad6c0d81fc78b9c8f0bbb018189d92d39 /src/core/FileLoader.cpp
parentMake texture conversion work a bit faster (diff)
parentmoved some stuff to MemoryMgr (diff)
downloadre3-c57fee38caed4cc770aa8e57b74672ca85aa0fa3.tar
re3-c57fee38caed4cc770aa8e57b74672ca85aa0fa3.tar.gz
re3-c57fee38caed4cc770aa8e57b74672ca85aa0fa3.tar.bz2
re3-c57fee38caed4cc770aa8e57b74672ca85aa0fa3.tar.lz
re3-c57fee38caed4cc770aa8e57b74672ca85aa0fa3.tar.xz
re3-c57fee38caed4cc770aa8e57b74672ca85aa0fa3.tar.zst
re3-c57fee38caed4cc770aa8e57b74672ca85aa0fa3.zip
Diffstat (limited to 'src/core/FileLoader.cpp')
-rw-r--r--src/core/FileLoader.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index f46b6134..88a99fa9 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -24,6 +24,7 @@
#include "ZoneCull.h"
#include "CdStream.h"
#include "FileLoader.h"
+#include "MemoryHeap.h"
char CFileLoader::ms_line[256];
@@ -71,11 +72,13 @@ CFileLoader::LoadLevel(const char *filename)
if(strncmp(line, "IMAGEPATH", 9) == 0){
RwImageSetPath(line + 10);
}else if(strncmp(line, "TEXDICTION", 10) == 0){
+ PUSH_MEMID(MEMID_TEXTURES);
strcpy(txdname, line+11);
LoadingScreenLoadingFile(txdname);
RwTexDictionary *txd = LoadTexDictionary(txdname);
AddTexDictionaries(savedTxd, txd);
RwTexDictionaryDestroy(txd);
+ POP_MEMID();
}else if(strncmp(line, "COLFILE", 7) == 0){
int level;
sscanf(line+8, "%d", &level);
@@ -94,12 +97,16 @@ CFileLoader::LoadLevel(const char *filename)
LoadObjectTypes(line + 4);
}else if(strncmp(line, "IPL", 3) == 0){
if(!objectsLoaded){
+ PUSH_MEMID(MEMID_DEF_MODELS);
CModelInfo::ConstructMloClumps();
+ POP_MEMID();
CObjectData::Initialise("DATA\\OBJECT.DAT");
objectsLoaded = true;
}
+ PUSH_MEMID(MEMID_WORLD);
LoadingScreenLoadingFile(line + 4);
LoadScene(line + 4);
+ POP_MEMID();
}else if(strncmp(line, "MAPZONE", 7) == 0){
LoadingScreenLoadingFile(line + 8);
LoadMapZones(line + 8);
@@ -188,6 +195,8 @@ CFileLoader::LoadCollisionFile(const char *filename)
CBaseModelInfo *mi;
ColHeader header;
+ PUSH_MEMID(MEMID_COLLISION);
+
debug("Loading collision file %s\n", filename);
fd = CFileMgr::OpenFile(filename, "rb");
@@ -211,6 +220,8 @@ CFileLoader::LoadCollisionFile(const char *filename)
}
CFileMgr::CloseFile(fd);
+
+ POP_MEMID();
}
void