summaryrefslogtreecommitdiffstats
path: root/src/core/TxdStore.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-07 13:09:11 +0200
committeraap <aap@papnet.eu>2019-07-07 13:09:11 +0200
commit53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb (patch)
treefc65a6c40fa719f9d43be9e0e15be79c490135e0 /src/core/TxdStore.h
parentfinished CPhysical (diff)
downloadre3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.gz
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.bz2
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.lz
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.xz
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.zst
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.zip
Diffstat (limited to 'src/core/TxdStore.h')
-rw-r--r--src/core/TxdStore.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/core/TxdStore.h b/src/core/TxdStore.h
new file mode 100644
index 00000000..a9e57d31
--- /dev/null
+++ b/src/core/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 Initialize(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);
+};