diff options
author | Filippos Karapetis | 2009-01-16 23:20:17 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-01-16 23:20:17 +0000 |
commit | 68a20e2aba09dd366341ab62bbdfb05cd3f04534 (patch) | |
tree | c85327c1e0b88431557ddcf22343f32955b5413d /engines/made/resource.h | |
parent | d53a340a4d79c2b00a7ac4c0c346607e5d1d0eb8 (diff) | |
download | scummvm-rg350-68a20e2aba09dd366341ab62bbdfb05cd3f04534.tar.gz scummvm-rg350-68a20e2aba09dd366341ab62bbdfb05cd3f04534.tar.bz2 scummvm-rg350-68a20e2aba09dd366341ab62bbdfb05cd3f04534.zip |
- Removed _gameVersion, engine versions are set in the game detection entries now
- Renamed ProjectReader -> ResourceReader
- Added some WIP code for the EGA version of the Manhole (still not working/disabled)
- The resource reader now closes the files it has opened correctly when it's deleted
svn-id: r35877
Diffstat (limited to 'engines/made/resource.h')
-rw-r--r-- | engines/made/resource.h | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/engines/made/resource.h b/engines/made/resource.h index 9151b2ad97..a57c9d5cc9 100644 --- a/engines/made/resource.h +++ b/engines/made/resource.h @@ -103,8 +103,8 @@ protected: class SoundResource : public Resource { public: SoundResource(); - ~SoundResource(); - void load(byte *source, int size); + virtual ~SoundResource(); + virtual void load(byte *source, int size); Audio::AudioStream *getAudioStream(int soundRate, bool loop = false); SoundEnergyArray *getSoundEnergyArray() const { return _soundEnergyArray; } protected: @@ -113,6 +113,13 @@ protected: SoundEnergyArray *_soundEnergyArray; }; +class SoundResourceV1 : public SoundResource { +public: + SoundResourceV1() {} + ~SoundResourceV1() {} + void load(byte *source, int size); +}; + class MenuResource : public Resource { public: MenuResource(); @@ -162,13 +169,13 @@ struct ResourceSlot { } }; -class ProjectReader { +class ResourceReader { public: - - ProjectReader(); - ~ProjectReader(); + ResourceReader(); + ~ResourceReader(); void open(const char *filename); + void openResourceBlocks(); PictureResource *getPicture(int index); AnimationResource *getAnimation(int index); @@ -183,9 +190,12 @@ public: protected: Common::File *_fd; + Common::File *_fdPics, *_fdSounds, *_fdMusic; // V1 + bool _isV1; typedef Common::Array<ResourceSlot> ResourceSlots; typedef Common::HashMap<uint32, ResourceSlots*> ResMap; + void openResourceBlock(const char *filename, Common::File *blockFile, uint32 resType); ResMap _resSlots; int _cacheCount; @@ -201,6 +211,22 @@ protected: if (!res) { byte *buffer; uint32 size; + + // Read from the correct file for V1 games + if (_isV1) { + switch (resType) { + case kResSNDS: + _fd = _fdSounds; + break; + case kResMIDI: + _fd = _fdMusic; + break; + default: + _fd = _fdPics; + break; + } + } + if (loadResource(slot, buffer, size)) { res = new T(); res->slot = slot; |