diff options
author | aap <aap@papnet.eu> | 2020-08-20 12:55:41 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-08-20 12:55:41 +0200 |
commit | 517e2ee9a5fa6f9100378cdcb24a3acd68c01f89 (patch) | |
tree | a194c407c50f764dc286dae851e60e4d62f53d0d /src/rw | |
parent | update librw (diff) | |
download | re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar.gz re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar.bz2 re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar.lz re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar.xz re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar.zst re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.zip |
Diffstat (limited to 'src/rw')
-rw-r--r-- | src/rw/NodeName.cpp | 4 | ||||
-rw-r--r-- | src/rw/TexRead.cpp | 3 | ||||
-rw-r--r-- | src/rw/TxdStore.cpp | 14 |
3 files changed, 7 insertions, 14 deletions
diff --git a/src/rw/NodeName.cpp b/src/rw/NodeName.cpp index ad4acffb..a7185e4f 100644 --- a/src/rw/NodeName.cpp +++ b/src/rw/NodeName.cpp @@ -50,8 +50,8 @@ NodeNameStreamWrite(RwStream *stream, RwInt32 binaryLength, const void *object, RwInt32 NodeNameStreamGetSize(const void *object, RwInt32 offsetInObject, RwInt32 sizeInObject) { - // game checks for null pointer on node name extension but that really happen - return (RwInt32)rwstrlen(NODENAMEEXT(object)); + char *name = NODENAMEEXT(object); // can't be nil + return name ? (RwInt32)rwstrlen(name) : 0; } bool diff --git a/src/rw/TexRead.cpp b/src/rw/TexRead.cpp index 0ef260b1..33d9a4cb 100644 --- a/src/rw/TexRead.cpp +++ b/src/rw/TexRead.cpp @@ -202,9 +202,6 @@ WriteVideoCardCapsFile(void) } } -bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha); -void DoRWStuffEndOfFrame(void); - void ConvertingTexturesScreen(uint32 num, uint32 count, const char *text) { diff --git a/src/rw/TxdStore.cpp b/src/rw/TxdStore.cpp index 51d018f6..a9e29729 100644 --- a/src/rw/TxdStore.cpp +++ b/src/rw/TxdStore.cpp @@ -58,11 +58,10 @@ CTxdStore::RemoveTxdSlot(int slot) int CTxdStore::FindTxdSlot(const char *name) { - char *defname; int size = ms_pTxdPool->GetSize(); for(int i = 0; i < size; i++){ - defname = GetTxdName(i); - if(defname && !CGeneral::faststricmp(defname, name)) + TxdDef *def = GetSlot(i); + if(def && !CGeneral::faststricmp(def->name, name)) return i; } return -1; @@ -71,8 +70,7 @@ CTxdStore::FindTxdSlot(const char *name) char* CTxdStore::GetTxdName(int slot) { - TxdDef *def = GetSlot(slot); - return def ? def->name : nil; + return GetSlot(slot)->name; } void @@ -91,9 +89,7 @@ CTxdStore::PopCurrentTxd(void) void CTxdStore::SetCurrentTxd(int slot) { - TxdDef *def = GetSlot(slot); - if(def) - RwTexDictionarySetCurrent(def->texDict); + RwTexDictionarySetCurrent(GetSlot(slot)->texDict); } void @@ -118,7 +114,7 @@ void CTxdStore::RemoveRef(int slot) { if(--GetSlot(slot)->refCount <= 0) - CStreaming::RemoveModel(slot + STREAM_OFFSET_TXD); + CStreaming::RemoveTxd(slot); } void |