diff options
author | David Corrales | 2007-08-05 19:34:20 +0000 |
---|---|---|
committer | David Corrales | 2007-08-05 19:34:20 +0000 |
commit | 6856535010bd2fa4449bcfde1c88dc06cd46e26f (patch) | |
tree | b81a2234c2beff0312c93e039d6cafda4babeca6 /engines/parallaction/disk.h | |
parent | 1400d28bfb37fc94f3c44dec0a4d0cef65fb8fb7 (diff) | |
parent | ec1803f838d5efc7decf75c05a1fb4a9633751e5 (diff) | |
download | scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.tar.gz scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.tar.bz2 scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.zip |
Merged fsnode with trunk: r27971:28460
svn-id: r28462
Diffstat (limited to 'engines/parallaction/disk.h')
-rw-r--r-- | engines/parallaction/disk.h | 122 |
1 files changed, 77 insertions, 45 deletions
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index 14ea4f0e16..ae572b1122 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::SeekableReadStream* 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); @@ -157,11 +154,11 @@ public: 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::SeekableReadStream* loadMusic(const char* name); Common::ReadStream* loadSound(const char* name); }; -class AmigaDisk : public Disk { +class AmigaDisk_ns : public Disk_ns { protected: Cnv* makeCnv(Common::SeekableReadStream &stream); @@ -176,8 +173,8 @@ 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); @@ -191,10 +188,45 @@ public: 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::SeekableReadStream* 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); + 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::SeekableReadStream* loadMusic(const char* name); + Common::ReadStream* loadSound(const char* name); +}; + + } // namespace Parallaction |