From 71c9700420237834d2e02a29eb6c0d0508a463b7 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 17 Aug 2009 07:36:08 +0000 Subject: Fix compilation of the SCI engine. It seems that all of the SCI header files I touched (and probably others I luckily didn't touch) seem to assume that files including them will supply needed types. That looks like a major issue in SCI. Someone with knowledge of the SCI code should look into this and cleanup the includes of *all* SCI headers. svn-id: r43459 --- engines/sci/resource.h | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/sci/resource.h') diff --git a/engines/sci/resource.h b/engines/sci/resource.h index 1ab49c834e..d38cff87df 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -33,7 +33,6 @@ #include "sound/audiostream.h" #include "sound/mixer.h" // for SoundHandle -#include "sci/engine/vm.h" // for Object #include "sci/decompressor.h" namespace Common { -- cgit v1.2.3 From 260a2019b6c57646ef32274c2fb197658f542803 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Mon, 17 Aug 2009 15:49:22 +0000 Subject: SCI: Add autodetection for DoSound. Cleanup. svn-id: r43482 --- engines/sci/resource.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/sci/resource.h') diff --git a/engines/sci/resource.h b/engines/sci/resource.h index d38cff87df..0a5336fd3f 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -52,7 +52,8 @@ enum SciVersion { SCI_VERSION_01, // KQ1 and multilingual games (S.old.*) SCI_VERSION_1_EGA, // EGA with parser, QFG2 SCI_VERSION_1_EARLY, // KQ5. (EGA/VGA) - SCI_VERSION_1_LATE, // ECO1, LSL1, LSL5. (EGA/VGA) + SCI_VERSION_1_MIDDLE, // LSL1, JONESCD. (EGA?/VGA) + SCI_VERSION_1_LATE, // ECO1, LSL5. (EGA/VGA) SCI_VERSION_1_1, // KQ6, ECO2 SCI_VERSION_32 // GK }; -- cgit v1.2.3 From 65ac355efa2cb792278e34de5c397ab11c8a46e3 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 18 Aug 2009 09:12:41 +0000 Subject: Removed the maxMemory parameter of the resource manager and replaced it with a define svn-id: r43503 --- engines/sci/resource.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'engines/sci/resource.h') diff --git a/engines/sci/resource.h b/engines/sci/resource.h index 0a5336fd3f..8ab740f463 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -245,15 +245,8 @@ public: /** * Creates a new SCI resource manager. - * @param version The SCI version to look for; use SCI_VERSION_AUTODETECT - * in the default case. - * @param maxMemory Maximum number of bytes to allow allocated for resources - * - * @note maxMemory will not be interpreted as a hard limit, only as a restriction - * for resources which are not explicitly locked. However, a warning will be - * issued whenever this limit is exceeded. */ - ResourceManager(int maxMemory); + ResourceManager(); ~ResourceManager(); /** @@ -294,8 +287,13 @@ public: void setAudioLanguage(int language); 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 + // for resources which are not explicitly locked. However, a warning will be + // issued whenever this limit is exceeded. + #define MAX_MEMORY 256 * 1024 // 256KB + ViewType _viewType; // Used to determine if the game has EGA or VGA graphics - int _maxMemory; //!< Config option: Maximum total byte number allocated Common::List _sources; int _memoryLocked; //!< Amount of resource bytes in locked memory int _memoryLRU; //!< Amount of resource bytes under LRU control -- cgit v1.2.3 From db0cd620f6f5766b6287bb0f0aa1ac9c866c4cba Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 18 Aug 2009 14:10:31 +0000 Subject: Started rewriting the SCI engine to use FSNode instead of file names. This is the proper solution for removing the hack in the fallback detector, but it still needs work. Also, reduced the things needed to be initialized a bit, so that the detection is a bit faster svn-id: r43510 --- engines/sci/resource.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'engines/sci/resource.h') diff --git a/engines/sci/resource.h b/engines/sci/resource.h index 8ab740f463..4250225ffe 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -28,6 +28,7 @@ #include "common/str.h" #include "common/file.h" +#include "common/fs.h" #include "common/archive.h" #include "sound/audiostream.h" @@ -136,6 +137,7 @@ 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; }; @@ -247,6 +249,7 @@ public: * Creates a new SCI resource manager. */ ResourceManager(); + ResourceManager(const Common::FSList &fslist); ~ResourceManager(); /** @@ -305,6 +308,11 @@ protected: ResVersion _mapVersion; //!< RESOURCE.MAP version SciVersion _sciVersion; //!< Detected SCI version */ + /** + * Initializes the resource manager + */ + void init(); + /** * Add a path to the resource manager's list of sources. * @return a pointer to the added source structure, or NULL if an error occurred. @@ -322,12 +330,19 @@ protected: */ ResourceSource *addSource(ResourceSource *map, ResSourceType type, const char *filename, int number); + + ResourceSource *addSource(ResourceSource *map, ResSourceType type, + const Common::FSNode *resFile, int number); + /** * Add an external (i.e., separate file) map resource to the resource manager's list of sources. * @param file_name The name of the volume to add * @return A pointer to the added source structure, or NULL if an error occurred. */ ResourceSource *addExternalMap(const char *file_name); + + ResourceSource *addExternalMap(const Common::FSNode *mapFile); + /** * Add an internal (i.e., resource) map to the resource manager's list of sources. * @param name The name of the resource to add @@ -344,6 +359,7 @@ protected: */ void scanNewSources(); int addAppropriateSources(); + int addAppropriateSources(const Common::FSList &fslist); int addInternalSources(); void freeResourceSources(); -- cgit v1.2.3