22 #ifndef SWORD1_RESMAN_H 23 #define SWORD1_RESMAN_H 25 #include "sword1/memman.h" 26 #include "sword1/swordres.h" 27 #include "common/file.h" 28 #include "sword1/sworddefs.h" 29 #include "common/endian.h" 30 #include "common/mutex.h" 34 #define MAX_LABEL_SIZE (31+1) 37 #define MAX_OPEN_CLUS 4 // the PSP can't have more than 8 files open simultaneously 41 #define MAX_OPEN_CLUS 8 // don't open more than 8 files at once 54 char label[MAX_LABEL_SIZE];
67 ResMan(
const char *fileName,
bool isMacFile,
bool isKorean);
70 void resClose(uint32
id);
71 void resOpen(uint32
id);
72 void *fetchRes(uint32
id);
73 void dumpRes(uint32
id);
74 void *openFetchRes(uint32
id);
75 void *cptResOpen(uint32
id);
76 Header *lockScript(uint32 scrID);
77 void unlockScript(uint32 scrID);
78 FrameHeader *fetchFrame(
void *resourceData, uint32 frameNo);
80 uint16 getUint16(uint16 value) {
81 return (_isBigEndian) ? FROM_BE_16(value) : FROM_LE_16(value);
83 uint32 getUint32(uint32 value) {
84 return (_isBigEndian) ? FROM_BE_32(value) : FROM_LE_32(value);
86 uint16 getLEUint16(uint16 value) {
87 return FROM_LE_16(value);
89 uint32 getLEUint32(uint32 value) {
90 return FROM_LE_32(value);
92 uint16 readUint16(
const void *ptr) {
93 return (_isBigEndian) ? READ_BE_UINT16(ptr) : READ_LE_UINT16(ptr);
95 uint32 readUint32(
const void *ptr) {
96 return (_isBigEndian) ? READ_BE_UINT32(ptr) : READ_LE_UINT32(ptr);
98 uint32 readLEUint32(
const void *ptr) {
99 return READ_LE_UINT32(ptr);
101 uint16 toUint16(uint16 value) {
102 return (_isBigEndian) ? TO_BE_16(value) : TO_LE_16(value);
104 uint32 toUint32(uint32 value) {
105 return (_isBigEndian) ? TO_BE_32(value) : TO_LE_32(value);
108 uint32 getDeathFontId();
111 uint32 resLength(uint32
id);
113 uint32 resOffset(uint32
id);
116 void openCptResourceBigEndian(uint32
id);
117 void openScriptResourceBigEndian(uint32
id);
118 void openCptResourceLittleEndian(uint32
id);
119 void openScriptResourceLittleEndian(uint32
id);
121 void loadCluDescript(
const char *fileName);
122 void freeCluDescript();
125 static const uint32 _scriptList[TOTAL_SECTIONS];
126 Clu *_openCluStart, *_openCluEnd;
129 bool _isKorTrs =
false;
133 uint32 _srIdList[29] = {
Definition: animation.h:38