summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-11-11 09:42:30 +0100
committeraap <aap@papnet.eu>2020-11-11 09:42:30 +0100
commit546ed0ff07cad63cb07612d8aff8d63213f71ecd (patch)
tree3d17be9b2b3767a663d73046477fdf4da4e42dc8 /src/core
parentFrontend: Scroll for All, some care for PS2-like menu (diff)
downloadre3-546ed0ff07cad63cb07612d8aff8d63213f71ecd.tar
re3-546ed0ff07cad63cb07612d8aff8d63213f71ecd.tar.gz
re3-546ed0ff07cad63cb07612d8aff8d63213f71ecd.tar.bz2
re3-546ed0ff07cad63cb07612d8aff8d63213f71ecd.tar.lz
re3-546ed0ff07cad63cb07612d8aff8d63213f71ecd.tar.xz
re3-546ed0ff07cad63cb07612d8aff8d63213f71ecd.tar.zst
re3-546ed0ff07cad63cb07612d8aff8d63213f71ecd.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/FileLoader.cpp17
-rw-r--r--src/core/Streaming.cpp1
-rw-r--r--src/core/main.cpp4
3 files changed, 22 insertions, 0 deletions
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index aadafc29..3f731658 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -332,6 +332,16 @@ CFileLoader::FindRelatedModelInfoCB(RpAtomic *atomic, void *data)
return atomic;
}
+#ifdef LIBRW
+void
+InitClump(RpClump *clump)
+{
+ RpClumpForAllAtomics(clump, ConvertPlatformAtomic, nil);
+}
+#else
+#define InitClump(clump)
+#endif
+
void
CFileLoader::LoadModelFile(const char *filename)
{
@@ -343,6 +353,7 @@ CFileLoader::LoadModelFile(const char *filename)
if(RwStreamFindChunk(stream, rwID_CLUMP, nil, nil)){
clump = RpClumpStreamRead(stream);
if(clump){
+ InitClump(clump);
RpClumpForAllAtomics(clump, FindRelatedModelInfoCB, clump);
RpClumpDestroy(clump);
}
@@ -368,6 +379,7 @@ CFileLoader::LoadClumpFile(const char *filename)
GetNameAndLOD(nodename, name, &n);
mi = (CClumpModelInfo*)CModelInfo::GetModelInfo(name, nil);
if(mi){
+ InitClump(clump);
assert(mi->IsClump());
mi->SetClump(clump);
}else
@@ -393,6 +405,7 @@ CFileLoader::LoadClumpFile(RwStream *stream, uint32 id)
if (mi->GetModelType() == MITYPE_PED && id != 0 && RwStreamFindChunk(stream, rwID_CLUMP, nil, nil)) {
// Read LOD ped
clump = RpClumpStreamRead(stream);
+ InitClump(clump);
if(clump){
((CPedModelInfo*)mi)->SetLowDetailClump(clump);
RpClumpDestroy(clump);
@@ -423,6 +436,7 @@ CFileLoader::FinishLoadClumpFile(RwStream *stream, uint32 id)
clump = RpClumpGtaStreamRead2(stream);
if(clump){
+ InitClump(clump);
mi = (CClumpModelInfo*)CModelInfo::GetModelInfo(id);
mi->SetClump(clump);
return true;
@@ -443,6 +457,7 @@ CFileLoader::LoadAtomicFile(RwStream *stream, uint32 id)
clump = RpClumpStreamRead(stream);
if(clump == nil)
return false;
+ InitClump(clump);
gpRelatedModelInfo = (CSimpleModelInfo*)CModelInfo::GetModelInfo(id);
RpClumpForAllAtomics(clump, SetRelatedModelInfoCB, clump);
RpClumpDestroy(clump);
@@ -806,6 +821,8 @@ CFileLoader::LoadAtomicFile2Return(const char *filename)
stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, filename);
if(RwStreamFindChunk(stream, rwID_CLUMP, nil, nil))
clump = RpClumpStreamRead(stream);
+ if(clump)
+ InitClump(clump);
RwStreamClose(stream, nil);
return clump;
}
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index 3c5689fd..4f721f17 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -390,6 +390,7 @@ CStreaming::LoadCdDirectory(const char *dirname, int n)
assert(sizeof(direntry) == 32);
while(CFileMgr::Read(fd, (char*)&direntry, sizeof(direntry))){
dot = strchr(direntry.name, '.');
+ assert(dot);
if(dot) *dot = '\0';
if(direntry.size > (uint32)ms_streamingBufferSize)
ms_streamingBufferSize = direntry.size;
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 2e4b839a..cd234588 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -89,7 +89,11 @@ RwRGBA gColourTop;
bool gameAlreadyInitialised;
float NumberOfChunksLoaded;
+#ifdef GTA_PS2
+#define TOTALNUMCHUNKS 48.0f
+#else
#define TOTALNUMCHUNKS 73.0f
+#endif
bool g_SlowMode = false;
char version_name[64];