22 #ifndef SCUMM_RESOURCE_H 23 #define SCUMM_RESOURCE_H 25 #include "common/array.h" 26 #include "scumm/scumm.h" 49 const byte *findNext(uint32 tag);
53 RES_INVALID_OFFSET = 0xFFFFFFFF
140 inline void setResourceCounter(byte counter);
141 inline byte getResourceCounter()
const;
145 bool isLocked()
const;
149 bool isModified()
const;
152 bool isOffHeap()
const;
180 uint32 _allocatedSize;
181 uint32 _maxHeapThreshold, _minHeapThreshold;
188 void setHeapThreshold(
int min,
int max);
189 uint32 getHeapSize() {
return _allocatedSize; }
192 void freeResources();
194 byte *createResource(
ResType type, ResId idx, uint32 size);
195 void nukeResource(
ResType type, ResId idx);
200 bool isResourceLoaded(
ResType type, ResId idx)
const;
202 void lock(
ResType type, ResId idx);
203 void unlock(
ResType type, ResId idx);
204 bool isLocked(
ResType type, ResId idx)
const;
207 void setModified(
ResType type, ResId idx);
208 bool isModified(
ResType type, ResId idx)
const;
209 void setOffHeap(
ResType type, ResId idx);
210 bool isOffHeap(
ResType type, ResId idx)
const;
211 void setOnHeap(
ResType type, ResId idx);
218 void increaseExpireCounter();
223 void setResourceCounter(
ResType type, ResId idx, byte counter);
231 void increaseResourceCounters();
233 void resourceStats();
236 bool validateResource(
const char *str,
ResType type, ResId idx)
const;
238 void expireResources(uint32 size);
ResTypeMode _mode
Definition: resource.h:164
Resource comes from data files, does not change.
Definition: resource.h:72
uint32 _roomoffs
Definition: resource.h:132
Definition: resource.h:42
Definition: resource.h:80
ResType
Definition: scumm.h:243
byte _flags
Definition: resource.h:110
Definition: resource.h:88
uint32 _tag
Definition: resource.h:171
byte _status
Definition: resource.h:116
byte _roomno
Definition: resource.h:122
byte * _address
Definition: resource.h:93
uint32 _size
Definition: resource.h:98
ResTypeMode
Definition: resource.h:70
Definition: resource.h:158
Resource is generated during runtime and may change.
Definition: resource.h:71
Resource comes from data files, but may change.
Definition: resource.h:73