Files
dusklight/include/JSystem/JUtility/JUTNameTab.h
T
CraftyBoss 83eb869cee update some actors to use sizeof for mSize, endian swap J2DScreen related structs, add 64bit endian swapping
game appears to be hanging on fully initing some processes, so while there isnt an immediate crash, nothing seems to be happening
2026-03-01 14:46:16 +01:00

46 lines
927 B
C++

#ifndef JUTNAMETAB_H
#define JUTNAMETAB_H
#include <dolphin/types.h>
/**
* @ingroup jsystem-jutility
*
*/
struct ResNTAB {
BE(u16) mEntryNum;
BE(u16) mPad0;
struct Entry {
BE(u16) mKeyCode;
BE(u16) mOffs;
} mEntries[1];
inline const char* getName(u32 index) const {
return ((const char*)mEntries) + mEntries[index].mOffs - 4;
}
};
/**
* @ingroup jsystem-jutility
*
*/
class JUTNameTab {
public:
JUTNameTab();
JUTNameTab(const ResNTAB* pNameTable);
virtual ~JUTNameTab() {};
void setResource(const ResNTAB* pNameTable);
s32 getIndex(char const*) const;
const char* getName(u16 index) const;
u16 calcKeyCode(char const* pName) const;
const ResNTAB* getResNameTable() const { return mNameTable; }
private:
/* 0x4 */ const ResNTAB* mNameTable;
/* 0x8 */ const char* mpStrData;
/* 0xC */ u16 mNameNum;
};
#endif /* JUTNAMETAB_H */