aboutsummaryrefslogtreecommitdiff
path: root/scumm/scumm.h
diff options
context:
space:
mode:
authorMax Horn2005-10-17 15:00:23 +0000
committerMax Horn2005-10-17 15:00:23 +0000
commitbb8afe3839493eac79cb6cc747c0d46d41f183ab (patch)
treeb700102b868350487cba3f8b1aa1f0e378906915 /scumm/scumm.h
parentb4a4f779e3f45e5034f5985a5bc50d4dfb9b06f0 (diff)
downloadscummvm-rg350-bb8afe3839493eac79cb6cc747c0d46d41f183ab.tar.gz
scummvm-rg350-bb8afe3839493eac79cb6cc747c0d46d41f183ab.tar.bz2
scummvm-rg350-bb8afe3839493eac79cb6cc747c0d46d41f183ab.zip
Added ResourceManager::isLocked; made ResourceManager::flags protected; moved some stuff around
svn-id: r19137
Diffstat (limited to 'scumm/scumm.h')
-rw-r--r--scumm/scumm.h78
1 files changed, 40 insertions, 38 deletions
diff --git a/scumm/scumm.h b/scumm/scumm.h
index b2e9177cab..c353612ed2 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -160,6 +160,13 @@ enum {
DEBUG_SMUSH = 1 << 10 // Track SMUSH
};
+/**
+ * Internal header for any memory block allocated by the resource manager.
+ *
+ * @todo Hide MemBlkHeader; no code outside the resource manager should
+ * have to use it, ever. Currently script code needs it to detect whether
+ * some scripts have moved (in fetchScriptByte()).
+ */
struct MemBlkHeader {
uint32 size;
};
@@ -167,38 +174,6 @@ struct MemBlkHeader {
struct VerbSlot;
struct ObjectData;
-struct V2MouseoverBox {
- Common::Rect rect;
- byte color;
- byte hicolor;
-};
-
-enum ResTypes {
- rtFirst = 1,
- rtRoom = 1,
- rtScript = 2,
- rtCostume = 3,
- rtSound = 4,
- rtInventory = 5,
- rtCharset = 6,
- rtString = 7,
- rtVerb = 8,
- rtActorName = 9,
- rtBuffer = 10,
- rtScaleTable = 11,
- rtTemp = 12,
- rtFlObject = 13,
- rtMatrix = 14,
- rtBox = 15,
- rtObjectName = 16,
- rtRoomScripts = 17,
- rtRoomImage = 18,
- rtImage = 19,
- rtTalkie = 20,
- rtLast = 20,
- rtNumTypes = 21
-};
-
enum {
LIGHTMODE_dark = 0,
LIGHTMODE_actor_base = 1,
@@ -291,11 +266,6 @@ enum WhereIsObject {
WIO_FLOBJECT = 4
};
-struct LangIndexNode {
- char tag[12+1];
- int32 offset;
-};
-
struct AuxBlock {
bool visible;
Common::Rect r;
@@ -312,12 +282,39 @@ struct AuxEntry {
int subIndex;
};
+// TODO: Rename InfoStuff to something more descriptive
struct InfoStuff {
uint32 date;
uint16 time;
uint32 playtime;
};
+enum ResTypes {
+ rtFirst = 1,
+ rtRoom = 1,
+ rtScript = 2,
+ rtCostume = 3,
+ rtSound = 4,
+ rtInventory = 5,
+ rtCharset = 6,
+ rtString = 7,
+ rtVerb = 8,
+ rtActorName = 9,
+ rtBuffer = 10,
+ rtScaleTable = 11,
+ rtTemp = 12,
+ rtFlObject = 13,
+ rtMatrix = 14,
+ rtBox = 15,
+ rtObjectName = 16,
+ rtRoomScripts = 17,
+ rtRoomImage = 18,
+ rtImage = 19,
+ rtTalkie = 20,
+ rtLast = 20,
+ rtNumTypes = 21
+};
+
class ResourceManager {
friend class ScummDebugger;
friend class ScummEngine;
@@ -330,7 +327,9 @@ public:
uint32 tags[rtNumTypes];
const char *name[rtNumTypes];
byte **address[rtNumTypes];
+protected:
byte *flags[rtNumTypes];
+public:
byte *roomno[rtNumTypes];
uint32 *roomoffs[rtNumTypes];
uint32 *globsize[rtNumTypes];
@@ -347,17 +346,20 @@ public:
void freeResources();
- bool validateResource(const char *str, int type, int index) const;
bool isResourceLoaded(int type, int index) const;
void lock(int type, int i);
void unlock(int type, int i);
+ bool isLocked(int type, int i) const;
void setResourceCounter(int type, int index, byte flag);
void increaseResourceCounter();
void resourceStats();
void expireResources(uint32 size);
+
+protected:
+ bool validateResource(const char *str, int type, int index) const;
};
class ScummEngine : public Engine {