diff options
| author | Filippos Karapetis | 2009-09-23 10:55:35 +0000 | 
|---|---|---|
| committer | Filippos Karapetis | 2009-09-23 10:55:35 +0000 | 
| commit | 13ad217cdd6bf1dcb74fe9cb4f40622b58c8792a (patch) | |
| tree | f0e1021c9235d3ad9c03a4a02688f9ba9111bc99 /engines/sci/sci.h | |
| parent | 63208a20fdc466bb6ec88dc09c7f2901ef144794 (diff) | |
| download | scummvm-rg350-13ad217cdd6bf1dcb74fe9cb4f40622b58c8792a.tar.gz scummvm-rg350-13ad217cdd6bf1dcb74fe9cb4f40622b58c8792a.tar.bz2 scummvm-rg350-13ad217cdd6bf1dcb74fe9cb4f40622b58c8792a.zip | |
- Moved the SCI version in a global variable
- Changed all the SCI version checks to use getSciVersion()
- Also made getSciVersionDesc a global function (removes some ugly accessing of the SCI engine)
The fallback detector should work correctly now
svn-id: r44269
Diffstat (limited to 'engines/sci/sci.h')
| -rw-r--r-- | engines/sci/sci.h | 38 | 
1 files changed, 34 insertions, 4 deletions
| diff --git a/engines/sci/sci.h b/engines/sci/sci.h index 6f7eb90c6a..a48fc2e202 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -109,7 +109,6 @@ public:  	const char* getGameID() const;  	int getResourceVersion() const; -	SciVersion getVersion() const;  	Common::Language getLanguage() const;  	Common::Platform getPlatform() const;  	uint32 getFlags() const; @@ -126,8 +125,6 @@ public:  	/** Remove the 'TARGET-' prefix of the given filename, if present. */  	Common::String unwrapFilename(const Common::String &name) const; -	Common::String getSciVersionDesc(SciVersion version) const; -  private:  	const SciGameDescription *_gameDescription;  	ResourceManager *_resMan; @@ -137,13 +134,46 @@ private:  	Console *_console;  }; +extern SciVersion _sciVersion; +  /**   * Convenience function to obtain the active SCI version.   */  inline static SciVersion getSciVersion() { -	return ((SciEngine*)g_engine)->getVersion(); +	assert (_sciVersion != SCI_VERSION_AUTODETECT); +	return _sciVersion;  } +inline static Common::String getSciVersionDesc(SciVersion version) { +	switch (version) { +	case SCI_VERSION_AUTODETECT: +		return "Autodetect"; +	case SCI_VERSION_0_EARLY: +		return "Early SCI0"; +	case SCI_VERSION_0_LATE: +		return "Late SCI0"; +	case SCI_VERSION_01: +		return "SCI01"; +	case SCI_VERSION_1_EGA: +		return "SCI1 EGA"; +	case SCI_VERSION_1_EARLY: +		return "Early SCI1"; +	case SCI_VERSION_1_MIDDLE: +		return "Middle SCI1"; +	case SCI_VERSION_1_LATE: +		return "Late SCI1"; +	case SCI_VERSION_1_1: +		return "SCI1.1"; +	case SCI_VERSION_2: +		return "SCI2"; +	case SCI_VERSION_2_1: +		return "SCI2.1"; +	case SCI_VERSION_3: +		return "SCI3"; +	default: +		return "Unknown"; +	} +}  } // End of namespace Sci | 
