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);
233 void resourceStats();
236 bool validateResource(
const char *str,
ResType type, ResId idx)
const;
238 void expireResources(uint32 size);
Definition: resource.h:42
Definition: resource.h:158
uint32 _tag
Definition: resource.h:171
ResTypeMode _mode
Definition: resource.h:164
Definition: resource.h:88
byte * _address
Definition: resource.h:93
byte _roomno
Definition: resource.h:122
uint32 _size
Definition: resource.h:98
uint32 _roomoffs
Definition: resource.h:132
byte _status
Definition: resource.h:116
byte _flags
Definition: resource.h:110
Definition: resource.h:80
void increaseExpireCounter()
void increaseResourceCounters()
void setResourceCounter(ResType type, ResId idx, byte counter)
ResTypeMode
Definition: resource.h:70
@ kDynamicResTypeMode
Resource is generated during runtime and may change.
Definition: resource.h:71
@ kStaticResTypeMode
Resource comes from data files, does not change.
Definition: resource.h:72
@ kSoundResTypeMode
Resource comes from data files, but may change.
Definition: resource.h:73
ResType
Definition: scumm.h:243