diff options
author | Filippos Karapetis | 2009-07-07 11:14:18 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-07-07 11:14:18 +0000 |
commit | a9aaf56b3e81d46776a6fba574ab9833a8f21be1 (patch) | |
tree | bbf78615a1e9418f98bd4cc48b86d6cd888b543d /engines/sci/engine/kernel.h | |
parent | d55f7e72d0af649c472ccc8bb34a408ead3ae7f4 (diff) | |
download | scummvm-rg350-a9aaf56b3e81d46776a6fba574ab9833a8f21be1.tar.gz scummvm-rg350-a9aaf56b3e81d46776a6fba574ab9833a8f21be1.tar.bz2 scummvm-rg350-a9aaf56b3e81d46776a6fba574ab9833a8f21be1.zip |
Cleanup: added an enum for the auto-detected features, removed the selectors which are only used for auto-detection from the convenience selector map and placed feature auto-detection in a separate function. Also, now the automatically detected graphics resources are shown in the console.
svn-id: r42212
Diffstat (limited to 'engines/sci/engine/kernel.h')
-rw-r--r-- | engines/sci/engine/kernel.h | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index e73914a7e7..4814bd0317 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -55,6 +55,15 @@ struct KernelFuncWithSignature { Common::String orig_name; /**< Original name, in case we couldn't map it */ }; +enum AutoDetectedFeatures { + kFeatureOldScriptHeader = 1 << 0, + kFeatureOldGfxFunctions = 1 << 1, + kFeatureLofsAbsolute = 1 << 2, + kFeatureSci01Sound = 1 << 3, + kFeatureSci1Sound = 1 << 4, + kFeatureSci0Sci1Table = 1 << 5 +}; + class Kernel { public: Kernel(ResourceManager *resmgr); @@ -91,7 +100,7 @@ public: * Also, old SCI versions assign 120 degrees to left & right, and 60 to up * and down. Later versions use an even 90 degree distribution. */ - bool hasOldScriptHeader() const { return _oldScriptHeader; } + bool hasOldScriptHeader() const { return (features & kFeatureOldScriptHeader); } /** * Applies to all versions before 0.000.502 @@ -100,14 +109,24 @@ public: * Also, they used 15 priority zones from 42 to 200 instead of 14 priority * zones from 42 to 190. */ - bool usesOldGfxFunctions() const { return _oldGfxFunctions; } + bool usesOldGfxFunctions() const { return (features & kFeatureOldGfxFunctions); } /** * Applies to all SCI1 versions after 1.000.200 * In late SCI1 versions, the argument of lofs[as] instructions * is absolute rather than relative. */ - bool hasLofsAbsolute() const { return _hasLofsAbsolute; } + bool hasLofsAbsolute() const { return (features & kFeatureLofsAbsolute); } + + /** + * Determines if the game is using SCI01 sound functions + */ + bool usesSci01SoundFunctions() const { return (features & kFeatureSci01Sound); } + + /** + * Determines if the game is using SCI1 sound functions + */ + bool usesSci1SoundFunctions() const { return (features & kFeatureSci1Sound); } // Script dissection/dumping functions void dissectScript(int scriptNumber, Vocabulary *vocab); @@ -145,14 +164,9 @@ private: void mapSelectors(); /** - * Prints auto-detected features from selectors - */ - void printAutoDetectedFeatures(); - - /** - * Detects if the game is using older script headers + * Detects SCI features based on the existence of certain selectors */ - void detectOldScriptHeader(); + void detectSciFeatures(); /** * Maps kernel functions @@ -166,9 +180,7 @@ private: bool loadOpcodes(); ResourceManager *_resmgr; - bool _oldScriptHeader; - bool _oldGfxFunctions; - bool _hasLofsAbsolute; + uint32 features; // Kernel-related lists /** |