1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-06-29 11:47:05 +00:00
re3/src/rw/TxdStore.h

52 lines
1.5 KiB
C
Raw Normal View History

2019-05-15 14:52:37 +00:00
#pragma once
#include "templates.h"
struct TxdDef {
RwTexDictionary *texDict;
2021-01-23 18:23:26 +00:00
int16 refCount;
int16 refCountGu;
2019-05-15 14:52:37 +00:00
char name[20];
};
class CTxdStore
{
2020-04-16 08:50:45 +00:00
static CPool<TxdDef,TxdDef> *ms_pTxdPool;
static RwTexDictionary *ms_pStoredTxd;
2019-05-15 14:52:37 +00:00
public:
static void Initialise(void);
2019-05-15 14:52:37 +00:00
static void Shutdown(void);
2019-06-13 10:25:55 +00:00
static void GameShutdown(void);
2019-05-15 14:52:37 +00:00
static int AddTxdSlot(const char *name);
2019-05-22 18:28:53 +00:00
static void RemoveTxdSlot(int slot);
2019-05-15 14:52:37 +00: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 10:25:55 +00:00
static int GetNumRefs(int slot);
2019-05-15 14:52:37 +00:00
static void AddRef(int slot);
2021-01-23 18:23:26 +00:00
static void AddRefEvenIfNotInMemory(int slot);
static void AddRefGu(int slot);
2019-05-15 14:52:37 +00:00
static void RemoveRef(int slot);
2021-01-23 18:23:26 +00:00
static void RemoveRefGu(int slot);
2019-05-15 14:52:37 +00:00
static void RemoveRefWithoutDelete(int slot);
static bool LoadTxd(int slot, RwStream *stream);
2021-01-23 18:23:26 +00:00
static bool LoadTxd(int slot, void *data, void *chunk);
2019-05-15 14:52:37 +00:00
static bool LoadTxd(int slot, const char *filename);
2019-06-13 10:25:55 +00:00
static bool StartLoadTxd(int slot, RwStream *stream);
static bool FinishLoadTxd(int slot, RwStream *stream);
2021-01-23 18:23:26 +00:00
static void RemoveTxd(int slot, bool notChunk = false);
static void Load(RwTexDictionary *stored, CPool<TxdDef> *pool);
2019-05-15 14:52:37 +00:00
2019-06-15 09:41:27 +00: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 14:52:37 +00:00
static bool isTxdLoaded(int slot);
};