diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-12 11:08:30 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-12 11:08:30 +0200 |
commit | cbb298c8dd0ff23007ba403157a47da1ddf134d5 (patch) | |
tree | 6f069af03c21d9af52cdcebd6fef7117454394d1 /src/rw/TxdStore.h | |
parent | Merge branch 'master' into garages_dev (diff) | |
parent | Merge pull request #402 from Nick007J/master (diff) | |
download | re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar.gz re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar.bz2 re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar.lz re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar.xz re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar.zst re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.zip |
Diffstat (limited to 'src/rw/TxdStore.h')
-rw-r--r-- | src/rw/TxdStore.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/rw/TxdStore.h b/src/rw/TxdStore.h new file mode 100644 index 00000000..12ac708f --- /dev/null +++ b/src/rw/TxdStore.h @@ -0,0 +1,44 @@ +#pragma once + +#include "templates.h" + +struct TxdDef { + RwTexDictionary *texDict; + int refCount; + char name[20]; +}; + +class CTxdStore +{ + static CPool<TxdDef,TxdDef> *&ms_pTxdPool; + static RwTexDictionary *&ms_pStoredTxd; +public: + static void Initialise(void); + static void Shutdown(void); + static void GameShutdown(void); + static int AddTxdSlot(const char *name); + static void RemoveTxdSlot(int slot); + static int FindTxdSlot(const char *name); + static char *GetTxdName(int slot); + static void PushCurrentTxd(void); + static void PopCurrentTxd(void); + static void SetCurrentTxd(int slot); + static void Create(int slot); + static int GetNumRefs(int slot); + static void AddRef(int slot); + static void RemoveRef(int slot); + static void RemoveRefWithoutDelete(int slot); + static bool LoadTxd(int slot, RwStream *stream); + static bool LoadTxd(int slot, const char *filename); + static bool StartLoadTxd(int slot, RwStream *stream); + static bool FinishLoadTxd(int slot, RwStream *stream); + static void RemoveTxd(int slot); + + static TxdDef *GetSlot(int slot) { + assert(slot >= 0); + assert(ms_pTxdPool); + assert(slot < ms_pTxdPool->GetSize()); + return ms_pTxdPool->GetSlot(slot); + } + static bool isTxdLoaded(int slot); +}; |