* Added ScummEngine_v8::initScummVars()

* Moved VAR_LANGUAGE to class ScummEngine_v8
* Minor cleanup

svn-id: r22223
This commit is contained in:
Max Horn 2006-04-29 13:56:36 +00:00
parent daed55b789
commit 39e9853d91
5 changed files with 53 additions and 49 deletions

View File

@ -312,11 +312,7 @@ void ScummEngine::processKbd(bool smushMode) {
#ifdef _WIN32_WCE
if (_lastKeyHit == KEY_ALL_SKIP) {
// Skip cutscene
if (smushMode) {
_lastKeyHit = (VAR_CUTSCENEEXIT_KEY != 0xFF) ? (uint)VAR(VAR_CUTSCENEEXIT_KEY) : 27;
}
else
if (vm.cutScenePtr[vm.cutSceneStackPointer])
if (smushMode || vm.cutScenePtr[vm.cutSceneStackPointer])
_lastKeyHit = (VAR_CUTSCENEEXIT_KEY != 0xFF) ? (uint)VAR(VAR_CUTSCENEEXIT_KEY) : 27;
else
// Skip talk

View File

@ -890,6 +890,7 @@ protected:
virtual const char *getOpcodeDesc(byte i);
virtual void setupScummVars();
virtual void initScummVars();
virtual void decodeParseString(int m, int n);
virtual void readArrayFromIndexFile();
@ -940,6 +941,7 @@ protected:
void o8_getStringWidth();
byte VAR_LANGUAGE;
};
#endif

View File

@ -434,7 +434,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
//
// Init all VARS to 0xFF
//
VAR_LANGUAGE = 0xFF;
VAR_KEYPRESS = 0xFF;
VAR_SYNC = 0xFF;
VAR_EGO = 0xFF;
@ -923,6 +922,8 @@ ScummEngine_v7::~ScummEngine_v7() {
ScummEngine_v8::ScummEngine_v8(OSystem *syst, const DetectorResult &dr)
: ScummEngine_v7(syst, dr) {
_objectIDMap = 0;
VAR_LANGUAGE = 0xFF;
}
ScummEngine_v8::~ScummEngine_v8() {
@ -955,12 +956,13 @@ int ScummEngine::init() {
_system->endGFXTransaction();
// On some systems it's not safe to run CD audio games from the CD.
if (_game.features & GF_AUDIOTRACKS)
if (_game.features & GF_AUDIOTRACKS) {
checkCD();
int cd_num = ConfMan.getInt("cdrom");
if (cd_num >= 0 && (_game.features & GF_AUDIOTRACKS))
_system->openCD(cd_num);
int cd_num = ConfMan.getInt("cdrom");
if (cd_num >= 0)
_system->openCD(cd_num);
}
// Create the sound manager
if (_game.heversion > 0)

View File

@ -1243,7 +1243,6 @@ protected:
public:
/* Scumm Vars */
byte VAR_LANGUAGE;
byte VAR_KEYPRESS;
byte VAR_SYNC;
byte VAR_EGO;

View File

@ -572,43 +572,7 @@ void ScummEngine_v5::initScummVars() {
void ScummEngine_v7::initScummVars() {
ScummEngine::initScummVars();
if (_game.version == 8) { // FIXME: How do we deal with non-cd installs?
VAR(VAR_CURRENTDISK) = 1;
switch (_language) {
case Common::EN_ANY:
case Common::EN_USA:
case Common::EN_GRB:
VAR(VAR_LANGUAGE) = 0;
break;
case Common::DE_DEU:
VAR(VAR_LANGUAGE) = 1;
break;
case Common::FR_FRA:
VAR(VAR_LANGUAGE) = 2;
break;
case Common::IT_ITA:
VAR(VAR_LANGUAGE) = 3;
break;
case Common::PT_BRA:
VAR(VAR_LANGUAGE) = 4;
break;
case Common::ES_ESP:
VAR(VAR_LANGUAGE) = 5;
break;
case Common::JA_JPN:
VAR(VAR_LANGUAGE) = 6;
break;
case Common::ZH_TWN:
VAR(VAR_LANGUAGE) = 7;
break;
case Common::KO_KOR:
VAR(VAR_LANGUAGE) = 8;
break;
default:
VAR(VAR_LANGUAGE) = 0; // Default to english
}
} else {
if (_game.version != 8) {
VAR(VAR_V6_EMSSPACE) = 10000;
VAR(VAR_NUM_GLOBAL_OBJS) = _numGlobalObjects - 1;
}
@ -616,6 +580,47 @@ void ScummEngine_v7::initScummVars() {
VAR(VAR_DEFAULT_TALK_DELAY) = 60;
VAR(VAR_VOICE_MODE) = ConfMan.getBool("subtitles");
}
void ScummEngine_v8::initScummVars() {
ScummEngine_v7::initScummVars();
// FIXME: How do we deal with non-cd installs?
VAR(VAR_CURRENTDISK) = 1;
switch (_language) {
case Common::EN_ANY:
case Common::EN_USA:
case Common::EN_GRB:
VAR(VAR_LANGUAGE) = 0;
break;
case Common::DE_DEU:
VAR(VAR_LANGUAGE) = 1;
break;
case Common::FR_FRA:
VAR(VAR_LANGUAGE) = 2;
break;
case Common::IT_ITA:
VAR(VAR_LANGUAGE) = 3;
break;
case Common::PT_BRA:
VAR(VAR_LANGUAGE) = 4;
break;
case Common::ES_ESP:
VAR(VAR_LANGUAGE) = 5;
break;
case Common::JA_JPN:
VAR(VAR_LANGUAGE) = 6;
break;
case Common::ZH_TWN:
VAR(VAR_LANGUAGE) = 7;
break;
case Common::KO_KOR:
VAR(VAR_LANGUAGE) = 8;
break;
default:
VAR(VAR_LANGUAGE) = 0; // Default to english
}
}
#endif
#ifndef DISABLE_HE