aboutsummaryrefslogtreecommitdiff
path: root/scumm/scumm.h
diff options
context:
space:
mode:
authorMax Horn2004-07-26 17:14:57 +0000
committerMax Horn2004-07-26 17:14:57 +0000
commitf045cbf17c8e489e37f9a2f5f72137e82c1c9a42 (patch)
treea8f1c5df73f14523d8da28c237dc0300ea39d1d7 /scumm/scumm.h
parent17ec7c5d6abdbaba0fa55023ac896ff560315e46 (diff)
downloadscummvm-rg350-f045cbf17c8e489e37f9a2f5f72137e82c1c9a42.tar.gz
scummvm-rg350-f045cbf17c8e489e37f9a2f5f72137e82c1c9a42.tar.bz2
scummvm-rg350-f045cbf17c8e489e37f9a2f5f72137e82c1c9a42.zip
Add support for the mac (rescumm) container file format used by Sam&Max and DOTT, making it possible to play those directly from the original CDs (no game detector support yet, so you have to add them to your config file manually for now)
svn-id: r14342
Diffstat (limited to 'scumm/scumm.h')
-rw-r--r--scumm/scumm.h40
1 files changed, 25 insertions, 15 deletions
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 82ba9704a5..6736e974ff 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -61,23 +61,28 @@ struct ScummGameSettings;
typedef Common::Map<Common::String, int> ObjectIDMap;
-class XORFile : public File {
+class ScummFile : public File {
private:
byte _encbyte;
+ uint32 _subFileStart;
+ uint32 _subFileLen;
+ Common::String _subFileName;
public:
- XORFile() : _encbyte(0) {}
- void setEnc(byte value) { _encbyte = value; }
-
- uint32 read(void *ptr, uint32 len) {
- uint32 realLen = File::read(ptr, len);
- if (_encbyte) {
- byte *p = (byte *)ptr;
- byte *end = p + realLen;
- while (p < end)
- *p++ ^= _encbyte;
- }
- return realLen;
- }
+ ScummFile();
+ void setEnc(byte value);
+
+ void setSubfileRange(uint32 start, uint32 len);
+ void resetSubfile();
+
+ bool open(const char *filename, AccessMode mode = kFileReadMode, const char *directory = NULL);
+ bool openSubFile(const char *filename);
+
+ bool eof();
+ uint32 pos();
+ uint32 size();
+ void seek(int32 offs, int whence = SEEK_SET);
+ uint32 read(void *ptr, uint32 size);
+ uint32 write(const void *ptr, uint32 size);
};
// Use g_scumm from error() ONLY
@@ -619,8 +624,13 @@ protected:
void doSentence(int c, int b, int a);
/* Should be in Resource class */
- XORFile _fileHandle;
+ ScummFile _fileHandle;
uint32 _fileOffset;
+public:
+ /** The name of the (macintosh/rescumm style) container file, if any. */
+ Common::String _containerFile;
+
+protected:
int _resourceHeaderSize;
Common::String _gameName; // This is the name we use for opening resource files
Common::String _targetName; // This is the game the user calls it, so use for saving