aboutsummaryrefslogtreecommitdiff
path: root/scumm/resource_v7he.h
diff options
context:
space:
mode:
authorEugene Sandulenko2005-01-31 03:53:35 +0000
committerEugene Sandulenko2005-01-31 03:53:35 +0000
commitc32e93672363c2b38b1a636498ce7930864d25e1 (patch)
tree4b5017bd075e332e4f02a252e6173338a89d7b9d /scumm/resource_v7he.h
parent0c827c0fcf43a764f0e9176d23ccf4567282934a (diff)
downloadscummvm-rg350-c32e93672363c2b38b1a636498ce7930864d25e1.tar.gz
scummvm-rg350-c32e93672363c2b38b1a636498ce7930864d25e1.tar.bz2
scummvm-rg350-c32e93672363c2b38b1a636498ce7930864d25e1.zip
Support for Mac cursors.
TODO: o Allow reading from non-processed game executable. Now you need to get .bin file out of it o Use color versions of cursors o Combine MacResExtractor with Win32ResExtractor. Now I just stupidly create 2 objects and do not use new cursor caching code. svn-id: r16713
Diffstat (limited to 'scumm/resource_v7he.h')
-rw-r--r--scumm/resource_v7he.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/scumm/resource_v7he.h b/scumm/resource_v7he.h
index 3aef799933..8144cdd35b 100644
--- a/scumm/resource_v7he.h
+++ b/scumm/resource_v7he.h
@@ -481,6 +481,57 @@ class Win32ResExtractor {
void fix_win32_image_data_directory(Win32ImageDataDirectory *obj);
};
+class MacResExtractor {
+
+public:
+ MacResExtractor(ScummEngine_v70he *scumm);
+ ~MacResExtractor() { }
+ void setCursor(int id) ;
+
+private:
+ int extractResource(int id, byte **buf);
+ bool init(File in);
+ void readMap(File in);
+ byte *getResource(File in, const char *typeID, int16 resID, int *size);
+ void convertIcons(byte *data, int datasize, byte **cursor, int *w, int *h,
+ int *hotspot_x, int *hotspot_y, int *keycolor);
+
+ struct ResMap {
+ int16 resAttr;
+ int16 typeOffset;
+ int16 nameOffset;
+ int16 numTypes;
+ };
+
+ struct ResType {
+ char id[5];
+ int16 items;
+ int16 offset;
+ };
+
+ struct Resource {
+ int16 id;
+ int16 nameOffset;
+ byte attr;
+ int32 dataOffset;
+ byte *name;
+ };
+
+ typedef Resource *ResPtr;
+
+private:
+ ScummEngine_v70he *_vm;
+ char _fileName[256];
+ int _resOffset;
+ int32 _dataOffset;
+ int32 _dataLength;
+ int32 _mapOffset;
+ int32 _mapLength;
+ ResMap _resMap;
+ ResType *_resTypes;
+ ResPtr *_resLists;
+};
+
} // End of namespace Scumm
#endif