22 #ifndef TSAGE_RESOURCES_H 23 #define TSAGE_RESOURCES_H 25 #include "common/scummsys.h" 26 #include "common/array.h" 27 #include "common/file.h" 28 #include "common/list.h" 29 #include "common/str.h" 30 #include "common/str-array.h" 31 #include "common/util.h" 32 #include "graphics/surface.h" 37 const uint32 MEMORY_ENTRY_ID = 0xE11DA722;
39 const int MEMORY_POOL_SIZE = 1000;
41 enum ResourceType { RES_LIBRARY, RES_STRIP, RES_IMAGE, RES_PALETTE, RES_VISAGE, RES_SOUND, RES_MESSAGE,
42 RES_FONT, RES_POINTER, RES_BANK, RES_SND_DRIVER, RES_PRIORITY, RES_CONTROL, RES_WALKRGNS,
43 RES_BITMAP, RES_SAVE, RES_SEQUENCE,
45 RT17, RT18, RT19, RT20, RT21, RT22, RT23, RT24, RT25, RT26, RT27, RT28, RT29, RT30, RT31
74 resType = RES_LIBRARY;
86 uint32 uncompressedSize;
115 uint16 allocate(uint32 size);
116 byte *allocate2(uint32 size);
117 byte *lock(uint32 handle);
118 int indexOf(
const byte *p);
119 void deallocate(
const byte *p);
120 void deallocate(uint16 handle) {
warning(
"TODO: MemoryManager::deallocate(handle)"); }
121 uint32 getSize(
const byte *p);
122 void incLocks(
const byte *p);
128 uint8 _remainder, _bitsLeft;
129 byte readByte() {
return _stream.
eos() ? 0 : _stream.
readByte(); }
148 ResourceList _resources;
151 void loadSection(uint32 fileOffset);
158 const SectionList &getSections() {
return _sections; }
159 byte *getResource(uint16
id,
bool suppressErrors =
false);
160 byte *getResource(ResourceType resType, uint16 resNum, uint16 rlbNum,
bool suppressErrors =
false);
161 uint32 getResourceStart(ResourceType resType, uint16 resNum, uint16 rlbNum,
ResourceEntry &entry);
162 bool getPalette(
int paletteNum, byte *palData, uint *startNum, uint *numEntries);
163 byte *getSubResource(
int resNum,
int rlbNum,
int index, uint *size,
bool suppressErrors =
false);
164 bool getMessage(
int resNum,
int lineNum,
Common::String &result,
bool suppressErrors =
false);
175 byte *getResource(uint16
id,
bool suppressErrors =
false);
176 byte *getResource(ResourceType resType, uint16 resNum, uint16 rlbNum,
bool suppressErrors =
false);
177 void getPalette(
int paletteNum, byte *palData, uint *startNum, uint *numEntries,
bool suppressErrors =
false);
178 byte *getSubResource(
int resNum,
int rlbNum,
int index, uint *size,
bool suppressErrors =
false);
179 Common::String getMessage(
int resNum,
int lineNum,
bool suppressErrors =
false);
180 TLib &first() {
return **_libList.
begin(); }
Definition: resources.h:141
void warning(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
virtual bool eos() const =0
iterator begin()
Definition: array.h:374
byte readByte()
Definition: stream.h:434
Definition: resources.h:167
Definition: resources.h:99
Definition: resources.h:80
Definition: blueforce_dialogs.h:30
Definition: resources.h:67
Definition: resources.h:125
Definition: resources.h:108