2019-05-15 16:52:37 +02:00
|
|
|
#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:
|
2020-03-28 21:55:23 +01:00
|
|
|
static void Initialise(void);
|
2019-05-15 16:52:37 +02:00
|
|
|
static void Shutdown(void);
|
2019-06-13 12:25:55 +02:00
|
|
|
static void GameShutdown(void);
|
2019-05-15 16:52:37 +02:00
|
|
|
static int AddTxdSlot(const char *name);
|
2019-05-22 20:28:53 +02:00
|
|
|
static void RemoveTxdSlot(int slot);
|
2019-05-15 16:52:37 +02:00
|
|
|
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);
|
2019-06-13 12:25:55 +02:00
|
|
|
static int GetNumRefs(int slot);
|
2019-05-15 16:52:37 +02:00
|
|
|
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);
|
2019-06-13 12:25:55 +02:00
|
|
|
static bool StartLoadTxd(int slot, RwStream *stream);
|
|
|
|
static bool FinishLoadTxd(int slot, RwStream *stream);
|
2019-05-15 16:52:37 +02:00
|
|
|
static void RemoveTxd(int slot);
|
|
|
|
|
2019-06-15 11:41:27 +02:00
|
|
|
static TxdDef *GetSlot(int slot) {
|
|
|
|
assert(slot >= 0);
|
|
|
|
assert(ms_pTxdPool);
|
|
|
|
assert(slot < ms_pTxdPool->GetSize());
|
|
|
|
return ms_pTxdPool->GetSlot(slot);
|
|
|
|
}
|
2019-05-15 16:52:37 +02:00
|
|
|
static bool isTxdLoaded(int slot);
|
|
|
|
};
|