diff options
Diffstat (limited to 'engines/sci/resource.h')
-rw-r--r-- | engines/sci/resource.h | 57 |
1 files changed, 11 insertions, 46 deletions
diff --git a/engines/sci/resource.h b/engines/sci/resource.h index bc08154fed..48b5f095b1 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -26,9 +26,8 @@ #ifndef SCI_SCICORE_RESOURCE_H #define SCI_SCICORE_RESOURCE_H -#include "common/fs.h" -#include "common/macresman.h" #include "common/str.h" +#include "common/fs.h" #include "sci/graphics/helpers.h" // for ViewType #include "sci/decompressor.h" @@ -109,31 +108,14 @@ enum ResourceType { kResourceTypeUnknown1, // Translation, currently unsupported kResourceTypeUnknown2, kResourceTypeRobot, - kResourceTypeInvalid, - - // Mac-only resources, these resource types are self-defined - // Numbers subject to change - kResourceTypeMacIconBarPictN = -1, // IBIN resources (icon bar, not selected) - kResourceTypeMacIconBarPictS = -2, // IBIS resources (icon bar, selected) - kResourceTypeMacPict = -3 // PICT resources (inventory) + kResourceTypeInvalid }; const char *getResourceTypeName(ResourceType restype); class ResourceManager; - -struct ResourceSource { - ResSourceType source_type; - bool scanned; - Common::String location_name; // FIXME: Replace by FSNode ? - const Common::FSNode *resourceFile; - int volume_number; - ResourceSource *associated_map; - uint32 audioCompressionType; - int32 *audioCompressionOffsetMapping; - Common::MacResManager macResMan; -}; +struct ResourceSource; class ResourceId { public: @@ -145,7 +127,7 @@ public: ResourceId(ResourceType type_, uint16 number_, uint32 tuple_ = 0) : type(type_), number(number_), tuple(tuple_) { - if (type < kResourceTypeMacPict || type > kResourceTypeInvalid) + if ((type < kResourceTypeView) || (type > kResourceTypeInvalid)) type = kResourceTypeInvalid; } @@ -291,19 +273,6 @@ public: // Detects, if standard font of current game includes extended characters (>0x80) bool detectFontExtended(); - /** - * Finds the internal Sierra ID of the current game from script 0 - */ - Common::String findSierraGameId(); - - /** - * Finds the location of the game object from script 0 - * @param addSci11ScriptOffset: Adjust the return value for SCI1.1 and newer - * games. Needs to be false when the heap is accessed directly inside - * findSierraGameId(). - */ - reg_t findGameObject(bool addSci11ScriptOffset = true); - protected: // Maximum number of bytes to allow being allocated for resources // Note: maxMemory will not be interpreted as a hard limit, only as a restriction @@ -321,8 +290,8 @@ protected: ResourceMap _resMap; Common::List<Common::File *> _volumeFiles; ///< list of opened volume files ResourceSource *_audioMapSCI1; ///< Currently loaded audio map for SCI1 - ResVersion _volVersion; ///< resource.0xx version - ResVersion _mapVersion; ///< resource.map version + ResVersion _volVersion; ///< RESOURCE.0xx version + ResVersion _mapVersion; ///< RESOURCE.MAP version /** * Initializes the resource manager @@ -358,7 +327,7 @@ protected: */ ResourceSource *addExternalMap(const char *file_name, int volume_nr = 0); - ResourceSource *addExternalMap(const Common::FSNode *mapFile, int volume_nr = 0); + ResourceSource *addExternalMap(const Common::FSNode *mapFile); /** * Add an internal (i.e., resource) map to the resource manager's list of sources. @@ -395,11 +364,11 @@ protected: Common::File *getVolumeFile(const char *filename); void loadResource(Resource *res); - bool loadPatch(Resource *res, Common::SeekableReadStream *file); + bool loadPatch(Resource *res, Common::File &file); bool loadFromPatchFile(Resource *res); - bool loadFromWaveFile(Resource *res, Common::SeekableReadStream *file); - bool loadFromAudioVolumeSCI1(Resource *res, Common::SeekableReadStream *file); - bool loadFromAudioVolumeSCI11(Resource *res, Common::SeekableReadStream *file); + bool loadFromWaveFile(Resource *res, Common::File &file); + bool loadFromAudioVolumeSCI1(Resource *res, Common::File &file); + bool loadFromAudioVolumeSCI11(Resource *res, Common::File &file); void freeOldResources(); int decompress(Resource *res, Common::SeekableReadStream *file); int readResourceInfo(Resource *res, Common::SeekableReadStream *file, uint32&szPacked, ResourceCompression &compression); @@ -512,7 +481,6 @@ public: Track *getDigitalTrack(); int getChannelFilterMask(int hardwareMask, bool wantsRhythm); byte getInitialVoiceCount(byte channel); - bool isChannelUsed(byte channel) const { return _channelsUsed & (1 << channel); } private: SciVersion _soundVersion; @@ -520,9 +488,6 @@ private: Track *_tracks; Resource *_innerResource; ResourceManager *_resMan; - uint16 _channelsUsed; - - void setChannelUsed(byte channel) { _channelsUsed |= (1 << channel); } }; } // End of namespace Sci |