diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-08-24 21:36:03 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-08-24 21:36:03 +0200 |
commit | cb813bd1abdf7758a7893c354de6d9f81291c6cf (patch) | |
tree | 7639d3175c889f0e2469308d62e3d25ae6f32b4b /src/rw/TxdStore.cpp | |
parent | Revert "remove CFO" (diff) | |
parent | small fix (diff) | |
download | re3-cb813bd1abdf7758a7893c354de6d9f81291c6cf.tar re3-cb813bd1abdf7758a7893c354de6d9f81291c6cf.tar.gz re3-cb813bd1abdf7758a7893c354de6d9f81291c6cf.tar.bz2 re3-cb813bd1abdf7758a7893c354de6d9f81291c6cf.tar.lz re3-cb813bd1abdf7758a7893c354de6d9f81291c6cf.tar.xz re3-cb813bd1abdf7758a7893c354de6d9f81291c6cf.tar.zst re3-cb813bd1abdf7758a7893c354de6d9f81291c6cf.zip |
Diffstat (limited to 'src/rw/TxdStore.cpp')
-rw-r--r-- | src/rw/TxdStore.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
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 |