summaryrefslogtreecommitdiffstats
path: root/src/rw/TxdStore.cpp
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2020-08-27 19:35:14 +0200
committerGitHub <noreply@github.com>2020-08-27 19:35:14 +0200
commita8999bbf38cae233e39b5995118fa03bca7894ef (patch)
treeada9bd1935512f4b46fe6b4f42d9160eb2281262 /src/rw/TxdStore.cpp
parentbike shooting fix + trace temp fix (diff)
parentupdate librw (diff)
downloadre3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar
re3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar.gz
re3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar.bz2
re3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar.lz
re3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar.xz
re3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar.zst
re3-a8999bbf38cae233e39b5995118fa03bca7894ef.zip
Diffstat (limited to 'src/rw/TxdStore.cpp')
-rw-r--r--src/rw/TxdStore.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/rw/TxdStore.cpp b/src/rw/TxdStore.cpp
index 51d018f6..0bd29718 100644
--- a/src/rw/TxdStore.cpp
+++ b/src/rw/TxdStore.cpp
@@ -13,7 +13,7 @@ void
CTxdStore::Initialise(void)
{
if(ms_pTxdPool == nil)
- ms_pTxdPool = new CPool<TxdDef,TxdDef>(TXDSTORESIZE);
+ ms_pTxdPool = new CPool<TxdDef,TxdDef>(TXDSTORESIZE, "TexDictionary");
}
void
@@ -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