22 #ifndef SCUMM_RESOURCE_H 23 #define SCUMM_RESOURCE_H 25 #include "common/array.h" 26 #include "scumm/scumm.h" 44 const byte *findNext(uint32 tag);
48 RES_INVALID_OFFSET = 0xFFFFFFFF
134 inline void setResourceCounter(byte counter);
135 inline byte getResourceCounter()
const;
139 bool isLocked()
const;
143 bool isModified()
const;
146 bool isOffHeap()
const;
174 uint32 _allocatedSize;
175 uint32 _maxHeapThreshold, _minHeapThreshold;
182 void setHeapThreshold(
int min,
int max);
183 uint32 getHeapSize() {
return _allocatedSize; }
186 void freeResources();
188 byte *createResource(
ResType type, ResId idx, uint32 size);
189 void nukeResource(
ResType type, ResId idx);
194 bool isResourceLoaded(
ResType type, ResId idx)
const;
196 void lock(
ResType type, ResId idx);
197 void unlock(
ResType type, ResId idx);
198 bool isLocked(
ResType type, ResId idx)
const;
201 void setModified(
ResType type, ResId idx);
202 bool isModified(
ResType type, ResId idx)
const;
203 void setOffHeap(
ResType type, ResId idx);
204 bool isOffHeap(
ResType type, ResId idx)
const;
205 void setOnHeap(
ResType type, ResId idx);
212 void increaseExpireCounter();
217 void setResourceCounter(
ResType type, ResId idx, byte counter);
225 void increaseResourceCounters();
227 void resourceStats();
230 bool validateResource(
const char *str,
ResType type, ResId idx)
const;
232 void expireResources(uint32 size);
ResTypeMode _mode
Definition: resource.h:158
Resource comes from data files, does not change.
Definition: resource.h:67
uint32 _roomoffs
Definition: resource.h:126
Definition: resource.h:37
Definition: resource.h:75
ResType
Definition: scumm.h:256
byte _flags
Definition: resource.h:104
Definition: resource.h:82
uint32 _tag
Definition: resource.h:165
byte _status
Definition: resource.h:110
byte _roomno
Definition: resource.h:116
byte * _address
Definition: resource.h:87
uint32 _size
Definition: resource.h:92
ResTypeMode
Definition: resource.h:65
Definition: resource.h:152
Resource is generated during runtime and may change.
Definition: resource.h:66
Resource comes from data files, but may change.
Definition: resource.h:68