diff options
author | aap <aap@papnet.eu> | 2020-05-08 15:59:57 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-05-08 15:59:57 +0200 |
commit | 2eee4c51764d0d73986f2aae64fbaf4c0beeb9c1 (patch) | |
tree | 25f43ed9e6a30b05603d3f1b75be3d3f8d2fee5f /src/core/Streaming.cpp | |
parent | Merge pull request #522 from Nick007J/miami (diff) | |
download | re3-2eee4c51764d0d73986f2aae64fbaf4c0beeb9c1.tar re3-2eee4c51764d0d73986f2aae64fbaf4c0beeb9c1.tar.gz re3-2eee4c51764d0d73986f2aae64fbaf4c0beeb9c1.tar.bz2 re3-2eee4c51764d0d73986f2aae64fbaf4c0beeb9c1.tar.lz re3-2eee4c51764d0d73986f2aae64fbaf4c0beeb9c1.tar.xz re3-2eee4c51764d0d73986f2aae64fbaf4c0beeb9c1.tar.zst re3-2eee4c51764d0d73986f2aae64fbaf4c0beeb9c1.zip |
Diffstat (limited to 'src/core/Streaming.cpp')
-rw-r--r-- | src/core/Streaming.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp index 9ff34cdf..138d84ed 100644 --- a/src/core/Streaming.cpp +++ b/src/core/Streaming.cpp @@ -358,7 +358,7 @@ CStreaming::LoadCdDirectory(const char *dirname, int n) *dot = '\0'; - if(!CGeneral::faststricmp(dot+1, "DFF")){ + if(strncasecmp(dot+1, "DFF", 3) == 0){ if(CModelInfo::GetModelInfo(direntry.name, &modelId)){ bAddToStreaming = true; }else{ @@ -370,13 +370,13 @@ CStreaming::LoadCdDirectory(const char *dirname, int n) #endif lastID = -1; } - }else if(!CGeneral::faststricmp(dot+1, "TXD")){ + }else if(strncasecmp(dot+1, "TXD", 3) == 0){ modelId = CTxdStore::FindTxdSlot(direntry.name); if(modelId == -1) modelId = CTxdStore::AddTxdSlot(direntry.name); modelId += STREAM_OFFSET_TXD; bAddToStreaming = true; - }else if(!CGeneral::faststricmp(dot+1, "COL")){ + }else if(strncasecmp(dot+1, "COL", 3) == 0){ modelId = CColStore::FindColSlot(direntry.name); if(modelId == -1) modelId = CColStore::AddColSlot(direntry.name); @@ -413,7 +413,7 @@ GetObjectName(int streamId) sprintf(objname, "%s.dff", CModelInfo::GetModelInfo(streamId)->GetName()); else if(streamId >= STREAM_OFFSET_TXD && streamId < STREAM_OFFSET_COL) sprintf(objname, "%s.txd", CTxdStore::GetTxdName(streamId-STREAM_OFFSET_TXD)); - else if(streamId >= STREAM_OFFSET_COL && streamId < NUMSTREAMINFO) + else if(streamId >= STREAM_OFFSET_COL && streamId < STREAM_OFFSET_ANIM) sprintf(objname, "%s.col", CColStore::GetColName(streamId-STREAM_OFFSET_COL)); // TODO(MIAMI): IFP return objname; @@ -506,7 +506,7 @@ CStreaming::ConvertBufferToObject(int8 *buf, int32 streamId) RwStreamClose(stream, &mem); return false; } - }else if(streamId >= STREAM_OFFSET_COL && streamId < NUMSTREAMINFO){ + }else if(streamId >= STREAM_OFFSET_COL && streamId < STREAM_OFFSET_ANIM){ if(!CColStore::LoadCol(streamId-STREAM_OFFSET_COL, mem.start, mem.length)){ debug("Failed to load %s.col\n", CColStore::GetColName(streamId - STREAM_OFFSET_COL)); RemoveModel(streamId); @@ -514,6 +514,8 @@ CStreaming::ConvertBufferToObject(int8 *buf, int32 streamId) RwStreamClose(stream, &mem); return false; } + }else if(streamId >= STREAM_OFFSET_ANIM){ + assert(streamId < NUMSTREAMINFO); // TODO(MIAMI): IFP } @@ -829,7 +831,7 @@ CStreaming::RemoveModel(int32 id) CModelInfo::GetModelInfo(id)->DeleteRwObject(); else if(id >= STREAM_OFFSET_TXD && id < STREAM_OFFSET_COL) CTxdStore::RemoveTxd(id - STREAM_OFFSET_TXD); - else if(id >= STREAM_OFFSET_COL && id < NUMSTREAMINFO) + else if(id >= STREAM_OFFSET_COL && id < STREAM_OFFSET_ANIM) CColStore::RemoveCol(id - STREAM_OFFSET_COL); // TODO(MIAMI): IFP ms_memoryUsed -= ms_aInfoForModel[id].GetCdSize()*CDSTREAM_SECTOR_SIZE; @@ -854,7 +856,7 @@ CStreaming::RemoveModel(int32 id) RpClumpGtaCancelStream(); else if(id >= STREAM_OFFSET_TXD && id < STREAM_OFFSET_COL) CTxdStore::RemoveTxd(id - STREAM_OFFSET_TXD); - else if(id >= STREAM_OFFSET_COL && id < NUMSTREAMINFO) + else if(id >= STREAM_OFFSET_COL && id < STREAM_OFFSET_ANIM) CColStore::RemoveCol(id - STREAM_OFFSET_COL); // TODO(MIAMI): IFP } |