diff options
author | Nicola Mettifogo | 2007-07-27 19:02:19 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-07-27 19:02:19 +0000 |
commit | 67869d2c10234479949bd74abc42931a019264e6 (patch) | |
tree | 1cb396a183c2d70c7e6cfbabdc8668647aece0e9 /engines/parallaction/disk.h | |
parent | a32b81d126aee4644adc074b3b091a4c121e4f7c (diff) | |
download | scummvm-rg350-67869d2c10234479949bd74abc42931a019264e6.tar.gz scummvm-rg350-67869d2c10234479949bd74abc42931a019264e6.tar.bz2 scummvm-rg350-67869d2c10234479949bd74abc42931a019264e6.zip |
- Moved disk code for Nippon Safes in new file disk_ns.cpp, adding _ns suffix to classes and member functions.
- Added function stubs into new file disk_br.cpp for Big Red Adventure [IT STILL CRASHES!].
- Modified engine to create the proper Disk manager object.
svn-id: r28246
Diffstat (limited to 'engines/parallaction/disk.h')
-rw-r--r-- | engines/parallaction/disk.h | 118 |
1 files changed, 75 insertions, 43 deletions
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index 14ea4f0e16..d910201f27 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -29,19 +29,8 @@ #include "parallaction/defs.h" #include "common/file.h" -namespace Audio { - class AudioStream; -} - namespace Parallaction { -//------------------------------------------------------ -// ARCHIVE MANAGEMENT -//------------------------------------------------------ - - -#define MAX_ARCHIVE_ENTRIES 384 - class Table; class Parallaction; class Gfx; @@ -51,22 +40,49 @@ class Font; struct Cnv; struct StaticCnv; + +class Disk { + +public: + Disk() { } + virtual ~Disk() { } + + virtual Common::String selectArchive(const Common::String &name) = 0; + virtual void setLanguage(uint16 language) = 0; + + virtual Script* loadLocation(const char *name) = 0; + virtual Script* loadScript(const char* name) = 0; + virtual Cnv* loadTalk(const char *name) = 0; + virtual Cnv* loadObjects(const char *name) = 0; + virtual StaticCnv* loadPointer() = 0; + virtual StaticCnv* loadHead(const char* name) = 0; + virtual Font* loadFont(const char* name) = 0; + virtual StaticCnv* loadStatic(const char* name) = 0; + virtual Cnv* loadFrames(const char* name) = 0; + virtual void loadSlide(const char *filename) = 0; + virtual void loadScenery(const char* background, const char* mask) = 0; + virtual Table* loadTable(const char* name) = 0; + virtual Common::ReadStream* loadMusic(const char* name) = 0; + virtual Common::ReadStream* loadSound(const char* name) = 0; +}; + + + + +#define MAX_ARCHIVE_ENTRIES 384 + class Archive : public Common::SeekableReadStream { protected: - bool _file; uint32 _fileOffset; uint32 _fileCursor; uint32 _fileEndOffset; - Common::String _archiveName; char _archiveDir[MAX_ARCHIVE_ENTRIES][32]; uint32 _archiveLenghts[MAX_ARCHIVE_ENTRIES]; uint32 _archiveOffsets[MAX_ARCHIVE_ENTRIES]; - Common::File _archive; - uint32 _numFiles; protected: @@ -77,21 +93,17 @@ public: void open(const char* file); void close(); - Common::String name() const; - bool openArchivedFile(const char *name); void closeArchivedFile(); - uint32 size() const; uint32 pos() const; bool eos() const; void seek(int32 offs, int whence = SEEK_SET); - uint32 read(void *dataPtr, uint32 dataSize); }; -class Disk { +class Disk_ns : public Disk { protected: Archive _resArchive; @@ -103,29 +115,14 @@ protected: void errorFileNotFound(const char *s); public: - Disk(Parallaction *vm); - virtual ~Disk(); + Disk_ns(Parallaction *vm); + virtual ~Disk_ns(); Common::String selectArchive(const Common::String &name); void setLanguage(uint16 language); - - virtual Script* loadLocation(const char *name) = 0; - virtual Script* loadScript(const char* name) = 0; - virtual Cnv* loadTalk(const char *name) = 0; - virtual Cnv* loadObjects(const char *name) = 0; - virtual StaticCnv* loadPointer() = 0; - virtual StaticCnv* loadHead(const char* name) = 0; - virtual Font* loadFont(const char* name) = 0; - virtual StaticCnv* loadStatic(const char* name) = 0; - virtual Cnv* loadFrames(const char* name) = 0; - virtual void loadSlide(const char *filename) = 0; - virtual void loadScenery(const char* background, const char* mask) = 0; - virtual Table* loadTable(const char* name) = 0; - virtual Common::ReadStream* loadMusic(const char* name) = 0; - virtual Common::ReadStream* loadSound(const char* name) = 0; }; -class DosDisk : public Disk { +class DosDisk_ns : public Disk_ns { private: void unpackBackground(Common::ReadStream *stream, byte *screen, byte *mask, byte *path); @@ -142,8 +139,8 @@ protected: Gfx *_gfx; public: - DosDisk(Parallaction *vm); - virtual ~DosDisk(); + DosDisk_ns(Parallaction *vm); + virtual ~DosDisk_ns(); Script* loadLocation(const char *name); Script* loadScript(const char* name); @@ -161,7 +158,7 @@ public: Common::ReadStream* loadSound(const char* name); }; -class AmigaDisk : public Disk { +class AmigaDisk_ns : public Disk_ns { protected: Cnv* makeCnv(Common::SeekableReadStream &stream); @@ -176,9 +173,43 @@ protected: void loadBackground(const char *name); public: - AmigaDisk(Parallaction *vm); - virtual ~AmigaDisk(); + AmigaDisk_ns(Parallaction *vm); + virtual ~AmigaDisk_ns(); + + Script* loadLocation(const char *name); + Script* loadScript(const char* name); + Cnv* loadTalk(const char *name); + Cnv* loadObjects(const char *name); + StaticCnv* loadPointer(); + StaticCnv* loadHead(const char* name); + Font* loadFont(const char* name); + StaticCnv* loadStatic(const char* name); + Cnv* loadFrames(const char* name); + void loadSlide(const char *filename); + void loadScenery(const char* background, const char* mask); + Table* loadTable(const char* name); + Common::ReadStream* loadMusic(const char* name); + Common::ReadStream* loadSound(const char* name); +}; + + +// for the moment DosDisk_br subclasses Disk. When Amiga support will +// be taken into consideration, it might be useful to add another level +// like we did for Nippon Safes. +class DosDisk_br : public Disk { + +protected: + Parallaction *_vm; + +protected: + void errorFileNotFound(const char *s); + +public: + DosDisk_br(Parallaction *vm); + virtual ~DosDisk_br(); + Common::String selectArchive(const Common::String &name); + void setLanguage(uint16 language); Script* loadLocation(const char *name); Script* loadScript(const char* name); Cnv* loadTalk(const char *name); @@ -195,6 +226,7 @@ public: Common::ReadStream* loadSound(const char* name); }; + } // namespace Parallaction |