diff options
author | Johannes Schickel | 2007-04-01 13:10:50 +0000 |
---|---|---|
committer | Johannes Schickel | 2007-04-01 13:10:50 +0000 |
commit | 397c10f059308f575ea75ea767c87148a7406f33 (patch) | |
tree | 6853ed5dca76f46ad6e907aa9bdf5c2fe95c0c8c /engines | |
parent | b7e499b64a1b1dc88c375a6151b7789d1970f4d5 (diff) | |
download | scummvm-rg350-397c10f059308f575ea75ea767c87148a7406f33.tar.gz scummvm-rg350-397c10f059308f575ea75ea767c87148a7406f33.tar.bz2 scummvm-rg350-397c10f059308f575ea75ea767c87148a7406f33.zip |
made _vm/_engine usage consistent. (_engine -> _vm all over the place now).
svn-id: r26342
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/resource.cpp | 20 | ||||
-rw-r--r-- | engines/kyra/resource.h | 8 | ||||
-rw-r--r-- | engines/kyra/sound.cpp | 20 | ||||
-rw-r--r-- | engines/kyra/sound.h | 12 | ||||
-rw-r--r-- | engines/kyra/sound_adlib.cpp | 14 | ||||
-rw-r--r-- | engines/kyra/sound_towns.cpp | 12 | ||||
-rw-r--r-- | engines/kyra/sprites.cpp | 60 | ||||
-rw-r--r-- | engines/kyra/sprites.h | 4 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 20 |
9 files changed, 85 insertions, 85 deletions
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index e8b6801bc2..193ce839c1 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -35,10 +35,10 @@ #include "kyra/screen.h" namespace Kyra { -Resource::Resource(KyraEngine *engine) { - _engine = engine; +Resource::Resource(KyraEngine *vm) { + _vm = vm; - if (_engine->game() == GI_KYRA1) { + if (_vm->game() == GI_KYRA1) { // we're loading KYRA.DAT here too (but just for Kyrandia 1) if (!loadPakFile("KYRA.DAT", true) || !StaticResource::checkKyraDat()) { GUI::MessageDialog errorMsg("You're missing the 'KYRA.DAT' file or it got corrupted, (re)get it from the ScummVM website"); @@ -47,13 +47,13 @@ Resource::Resource(KyraEngine *engine) { } // We only need kyra.dat for the demo. - if (_engine->gameFlags().isDemo) + if (_vm->gameFlags().isDemo) return; // only VRM file we need in the *whole* game for kyra1 - if (_engine->gameFlags().isTalkie) + if (_vm->gameFlags().isTalkie) loadPakFile("CHAPTER1.VRM"); - } else if (_engine->game() == GI_KYRA3) { + } else if (_vm->game() == GI_KYRA3) { // load the installation package file for kyra3 INSFile *insFile = new INSFile("WESTWOOD.001"); assert(insFile); @@ -68,7 +68,7 @@ Resource::Resource(KyraEngine *engine) { if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) error("invalid game path '%s'", dir.path().c_str()); - if (_engine->game() == GI_KYRA1 && _engine->gameFlags().isTalkie) { + if (_vm->game() == GI_KYRA1 && _vm->gameFlags().isTalkie) { static const char *list[] = { "ADL.PAK", "CHAPTER1.VRM", "COL.PAK", "FINALE.PAK", "INTRO1.PAK", "INTRO2.PAK", "INTRO3.PAK", "INTRO4.PAK", "MISC.PAK", "SND.PAK", "STARTUP.PAK", "XMI.PAK", @@ -100,9 +100,9 @@ Resource::Resource(KyraEngine *engine) { } } - if (_engine->gameFlags().platform == Common::kPlatformFMTowns) { + if (_vm->gameFlags().platform == Common::kPlatformFMTowns) { Common::List<ResourceFile*>::iterator start = _pakfiles.begin(); - uint unloadHash = (_engine->gameFlags().lang == Common::EN_ANY) ? Common::hashit_lower("JMC.PAK") : Common::hashit_lower("EMC.PAK"); + uint unloadHash = (_vm->gameFlags().lang == Common::EN_ANY) ? Common::hashit_lower("JMC.PAK") : Common::hashit_lower("EMC.PAK"); for (;start != _pakfiles.end(); ++start) { if ((*start)->filename() == unloadHash) { @@ -144,7 +144,7 @@ bool Resource::loadPakFile(const Common::String &filename, const bool forcePC) { return false; } - PAKFile *file = new PAKFile(filename.c_str(), handle.name(), handle, (_engine->gameFlags().platform == Common::kPlatformAmiga) && !forcePC); + PAKFile *file = new PAKFile(filename.c_str(), handle.name(), handle, (_vm->gameFlags().platform == Common::kPlatformAmiga) && !forcePC); handle.close(); if (!file) diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index c7fe88a719..27e3917c3f 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -102,7 +102,7 @@ protected: class Resource { public: - Resource(KyraEngine *engine); + Resource(KyraEngine *vm); ~Resource(); bool loadPakFile(const Common::String &filename, const bool forcePC = false); @@ -119,7 +119,7 @@ public: bool loadFileToBuf(const char *file, void *buf, uint32 maxSize); protected: - KyraEngine *_engine; + KyraEngine *_vm; Common::List<ResourceFile*> _pakfiles; }; @@ -207,7 +207,7 @@ struct Room; class StaticResource { public: - StaticResource(KyraEngine *engine) : _engine(engine), _resList(), _fileLoader(0), _builtIn(0), _filenameTable(0) {} + StaticResource(KyraEngine *vm) : _vm(vm), _resList(), _fileLoader(0), _builtIn(0), _filenameTable(0) {} ~StaticResource() { deinit(); } static bool checkKyraDat(); @@ -228,7 +228,7 @@ public: bool prefetchId(int id); void unloadId(int id); private: - KyraEngine *_engine; + KyraEngine *_vm; struct FilenameTable; struct ResData; diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index ad0933464f..d2e3a64d2d 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -35,8 +35,8 @@ namespace Kyra { -Sound::Sound(KyraEngine *engine, Audio::Mixer *mixer) - : _engine(engine), _mixer(mixer), _currentVocFile(0), _vocHandle(), _compressHandle(), +Sound::Sound(KyraEngine *vm, Audio::Mixer *mixer) + : _vm(vm), _mixer(mixer), _currentVocFile(0), _vocHandle(), _compressHandle(), _musicEnabled(1), _sfxEnabled(true), _soundFileList(0), _soundFileListSize(0) { } @@ -54,7 +54,7 @@ void Sound::voicePlay(const char *file) { strcat(filenamebuffer, _supportedCodes[i].fileext); _compressHandle.close(); - _engine->resource()->getFileHandle(filenamebuffer, &fileSize, _compressHandle); + _vm->resource()->getFileHandle(filenamebuffer, &fileSize, _compressHandle); if (!_compressHandle.isOpen()) continue; @@ -67,7 +67,7 @@ void Sound::voicePlay(const char *file) { strcpy(filenamebuffer, file); strcat(filenamebuffer, ".VOC"); - fileData = _engine->resource()->fileData(filenamebuffer, &fileSize); + fileData = _vm->resource()->fileData(filenamebuffer, &fileSize); if (!fileData) return; @@ -94,7 +94,7 @@ bool Sound::voiceIsPlaying() { #pragma mark - -SoundMidiPC::SoundMidiPC(KyraEngine *engine, Audio::Mixer *mixer, MidiDriver *driver) : Sound(engine, mixer) { +SoundMidiPC::SoundMidiPC(KyraEngine *vm, Audio::Mixer *mixer, MidiDriver *driver) : Sound(vm, mixer) { _driver = driver; _passThrough = false; _eventFromMusic = false; @@ -250,7 +250,7 @@ void SoundMidiPC::loadSoundFile(uint file) { sprintf(filename, "%s.%s", soundFilename(file), _useC55 ? "C55" : "XMI"); uint32 size; - uint8 *data = (_engine->resource())->fileData(filename, &size); + uint8 *data = (_vm->resource())->fileData(filename, &size); if (!data) { warning("couldn't load '%s'", filename); @@ -287,7 +287,7 @@ void SoundMidiPC::loadSoundEffectFile(uint file) { sprintf(filename, "%s.%s", soundFilename(file), _useC55 ? "C55" : "XMI"); uint32 size; - uint8 *data = (_engine->resource())->fileData(filename, &size); + uint8 *data = (_vm->resource())->fileData(filename, &size); if (!data) { warning("couldn't load '%s'", filename); @@ -356,8 +356,8 @@ void SoundMidiPC::onTimer(void *refCon) { // this should be set to the fadeToBlack value static const uint32 musicFadeTime = 2 * 1000; - if (music->_fadeMusicOut && music->_fadeStartTime + musicFadeTime > music->_engine->_system->getMillis()) { - byte volume = (byte)((musicFadeTime - (music->_engine->_system->getMillis() - music->_fadeStartTime)) * 255 / musicFadeTime); + if (music->_fadeMusicOut && music->_fadeStartTime + musicFadeTime > music->_vm->_system->getMillis()) { + byte volume = (byte)((musicFadeTime - (music->_vm->_system->getMillis() - music->_fadeStartTime)) * 255 / musicFadeTime); music->setVolume(volume); } else if (music->_fadeStartTime) { music->_fadeStartTime = 0; @@ -428,7 +428,7 @@ void SoundMidiPC::playSoundEffect(uint8 track) { void SoundMidiPC::beginFadeOut() { _fadeMusicOut = true; - _fadeStartTime = _engine->_system->getMillis(); + _fadeStartTime = _vm->_system->getMillis(); } #pragma mark - diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index 5b08166242..3f2e2efc80 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -65,7 +65,7 @@ class AUDStream; class Sound { public: - Sound(KyraEngine *engine, Audio::Mixer *mixer); + Sound(KyraEngine *vm, Audio::Mixer *mixer); virtual ~Sound(); virtual bool init() = 0; @@ -99,7 +99,7 @@ protected: int _musicEnabled; bool _sfxEnabled; - KyraEngine *_engine; + KyraEngine *_vm; Audio::Mixer *_mixer; private: const char * const *_soundFileList; @@ -121,7 +121,7 @@ class AdlibDriver; class SoundAdlibPC : public Sound { public: - SoundAdlibPC(KyraEngine *engine, Audio::Mixer *mixer); + SoundAdlibPC(KyraEngine *vm, Audio::Mixer *mixer); ~SoundAdlibPC(); bool init(); @@ -164,7 +164,7 @@ private: class SoundMidiPC : public MidiDriver, public Sound { public: - SoundMidiPC(KyraEngine *engine, Audio::Mixer *mixer, MidiDriver *driver); + SoundMidiPC(KyraEngine *vm, Audio::Mixer *mixer, MidiDriver *driver); ~SoundMidiPC(); bool init() { return true; } @@ -234,7 +234,7 @@ private: class FMT_EuphonyDriver; class SoundTowns : public MidiDriver, public Sound { public: - SoundTowns(KyraEngine *engine, Audio::Mixer *mixer); + SoundTowns(KyraEngine *vm, Audio::Mixer *mixer); ~SoundTowns(); bool init(); @@ -295,7 +295,7 @@ private: class MixedSoundDriver : public Sound { public: - MixedSoundDriver(KyraEngine *engine, Audio::Mixer *mixer, Sound *music, Sound *sfx) : Sound(engine, mixer), _music(music), _sfx(sfx) {} + MixedSoundDriver(KyraEngine *vm, Audio::Mixer *mixer, Sound *music, Sound *sfx) : Sound(vm, mixer), _music(music), _sfx(sfx) {} ~MixedSoundDriver() { delete _music; delete _sfx; } bool init() { return _music->init() | _sfx->init(); } diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index 3cb309278e..48f6761ab8 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -2213,10 +2213,10 @@ const int SoundAdlibPC::_kyra1SoundTriggers[] = { const int SoundAdlibPC::_kyra1NumSoundTriggers = ARRAYSIZE(SoundAdlibPC::_kyra1SoundTriggers); -SoundAdlibPC::SoundAdlibPC(KyraEngine *engine, Audio::Mixer *mixer) - : Sound(engine, mixer), _driver(0), _trackEntries(), _soundDataPtr(0) { +SoundAdlibPC::SoundAdlibPC(KyraEngine *vm, Audio::Mixer *mixer) + : Sound(vm, mixer), _driver(0), _trackEntries(), _soundDataPtr(0) { memset(_trackEntries, 0, sizeof(_trackEntries)); - _v2 = (_engine->gameFlags().gameID == GI_KYRA2); + _v2 = (_vm->gameFlags().gameID == GI_KYRA2); _driver = new AdlibDriver(mixer, _v2); assert(_driver); @@ -2284,7 +2284,7 @@ void SoundAdlibPC::playTrack(uint8 track) { void SoundAdlibPC::haltTrack() { unk1(); unk2(); - //_engine->_system->delayMillis(3 * 60); + //_vm->_system->delayMillis(3 * 60); } void SoundAdlibPC::playSoundEffect(uint8 track) { @@ -2305,7 +2305,7 @@ void SoundAdlibPC::play(uint8 track) { while ((_driver->callback(16, 0) & 8)) { // We call the system delay and not the game delay to avoid concurrency issues. - _engine->_system->delayMillis(10); + _vm->_system->delayMillis(10); } if (_sfxPlayingSound != -1) { @@ -2359,7 +2359,7 @@ void SoundAdlibPC::loadSoundFile(uint file) { char filename[25]; sprintf(filename, "%s.ADL", soundFilename(file)); - file_data = _engine->resource()->fileData(filename, &file_size); + file_data = _vm->resource()->fileData(filename, &file_size); if (!file_data) { warning("Couldn't find music file: '%s'", filename); return; @@ -2400,7 +2400,7 @@ void SoundAdlibPC::loadSoundFile(uint file) { void SoundAdlibPC::unk1() { playSoundEffect(0); - //_engine->_system->delayMillis(5 * 60); + //_vm->_system->delayMillis(5 * 60); } void SoundAdlibPC::unk2() { diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 4781ae14c5..bfc4655277 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -894,7 +894,7 @@ void MidiParser_EuD::resetTracking() { setTempo(_initialTempo); } -SoundTowns::SoundTowns(KyraEngine *engine, Audio::Mixer *mixer) : Sound(engine, mixer), _lastTrack(-1), +SoundTowns::SoundTowns(KyraEngine *vm, Audio::Mixer *mixer) : Sound(vm, mixer), _lastTrack(-1), _currentSFX(0), _sfxFileData(0), _sfxFileIndex((uint)-1), _sfxWDTable(0), _parser(0), _musicTrackData(0) { _driver = new FMT_EuphonyDriver(_mixer); @@ -920,9 +920,9 @@ SoundTowns::~SoundTowns() { } bool SoundTowns::init() { - _engine->checkCD(); + _vm->checkCD(); int unused = 0; - _sfxWDTable = _engine->staticres()->loadRawData(kKyra1TownsSFXTable, unused); + _sfxWDTable = _vm->staticres()->loadRawData(kKyra1TownsSFXTable, unused); return loadInstruments(); } @@ -1049,7 +1049,7 @@ void SoundTowns::loadSoundFile(uint file) { return; _sfxFileIndex = file; delete [] _sfxFileData; - _sfxFileData = _engine->resource()->fileData(soundFilename(file), 0); + _sfxFileData = _vm->resource()->fileData(soundFilename(file), 0); } void SoundTowns::playSoundEffect(uint8 track) { @@ -1182,7 +1182,7 @@ bool SoundTowns::loadInstruments() { _musicTrackData = new uint8[0xC58A]; memset(_musicTrackData, 0, 0xC58A); - uint8 * twm = _engine->resource()->fileData("twmusic.pak", 0); + uint8 * twm = _vm->resource()->fileData("twmusic.pak", 0); if (!twm) return false; Screen::decodeFrame4(twm, _musicTrackData, 0x8BF0); @@ -1201,7 +1201,7 @@ void SoundTowns::playEuphonyTrack(uint32 offset, int loop) { _musicTrackData = new uint8[0xC58A]; memset(_musicTrackData, 0, 0xC58A); - uint8 * twm = _engine->resource()->fileData("twmusic.pak", 0); + uint8 * twm = _vm->resource()->fileData("twmusic.pak", 0); Screen::decodeFrame4(twm + 0x4b70 + offset, _musicTrackData, 0xC58A); delete [] twm; diff --git a/engines/kyra/sprites.cpp b/engines/kyra/sprites.cpp index d79004aa09..a8825751ac 100644 --- a/engines/kyra/sprites.cpp +++ b/engines/kyra/sprites.cpp @@ -33,10 +33,10 @@ namespace Kyra { -Sprites::Sprites(KyraEngine *engine, OSystem *system) { - _engine = engine; - _res = engine->resource(); - _screen = engine->screen(); +Sprites::Sprites(KyraEngine *vm, OSystem *system) { + _vm = vm; + _res = vm->resource(); + _screen = vm->screen(); _system = system; _dat = 0; memset(_anims, 0, sizeof(_anims)); @@ -76,8 +76,8 @@ void Sprites::setupSceneAnims() { _anims[i].unk2 = READ_LE_UINT16(data); data += 4; - if ((_engine->_northExitHeight & 0xFF) > READ_LE_UINT16(data)) - _anims[i].drawY = _engine->_northExitHeight & 0xFF; + if ((_vm->_northExitHeight & 0xFF) > READ_LE_UINT16(data)) + _anims[i].drawY = _vm->_northExitHeight & 0xFF; else _anims[i].drawY = READ_LE_UINT16(data); data += 4; @@ -183,7 +183,7 @@ void Sprites::updateSceneAnims() { data += 2; debugC(6, kDebugLevelSprites, "func: Set time to wait"); debugC(6, kDebugLevelSprites, "Time %i", READ_LE_UINT16(data)); - _anims[i].nextRun = _system->getMillis() + READ_LE_UINT16(data) * _engine->tickLength(); + _anims[i].nextRun = _system->getMillis() + READ_LE_UINT16(data) * _vm->tickLength(); _anims[i].nextRun -= _system->getMillis() - _anims[i].lastRefresh; data += 2; break; @@ -195,7 +195,7 @@ void Sprites::updateSceneAnims() { data += 2; debugC(6, kDebugLevelSprites, "Maximum time %i", READ_LE_UINT16(data)); data += 2; - _anims[i].nextRun = _system->getMillis() + rndNr * _engine->tickLength(); + _anims[i].nextRun = _system->getMillis() + rndNr * _vm->tickLength(); _anims[i].nextRun -= _system->getMillis() - _anims[i].lastRefresh; break; case 0xFF8C: @@ -315,45 +315,45 @@ void Sprites::updateSceneAnims() { data += 2; debugC(6, kDebugLevelSprites, "func: Set Brandon's X coordinate"); debugC(6, kDebugLevelSprites, "X %i", READ_LE_UINT16(data)); - _engine->currentCharacter()->x1 = READ_LE_UINT16(data); + _vm->currentCharacter()->x1 = READ_LE_UINT16(data); data += 2; break; case 0xFFAE: data += 2; debugC(6, kDebugLevelSprites, "func: Set Brandon's Y coordinate"); debugC(6, kDebugLevelSprites, "Y %i", READ_LE_UINT16(data)); - _engine->currentCharacter()->y1 = READ_LE_UINT16(data); + _vm->currentCharacter()->y1 = READ_LE_UINT16(data); data += 2; break; case 0xFFAF: data += 2; debugC(6, kDebugLevelSprites, "func: Set Brandon's sprite"); debugC(6, kDebugLevelSprites, "Sprite %i", READ_LE_UINT16(data)); - _engine->currentCharacter()->currentAnimFrame = READ_LE_UINT16(data); + _vm->currentCharacter()->currentAnimFrame = READ_LE_UINT16(data); data += 2; break; case 0xFFAA: data += 2; debugC(6, kDebugLevelSprites, "func: Reset Brandon's sprite"); - _engine->animator()->actors()->sceneAnimPtr = 0; - _engine->animator()->actors()->bkgdChangeFlag = 1; - _engine->animator()->actors()->refreshFlag = 1; - _engine->animator()->restoreAllObjectBackgrounds(); - _engine->animator()->flagAllObjectsForRefresh(); - _engine->animator()->updateAllObjectShapes(); + _vm->animator()->actors()->sceneAnimPtr = 0; + _vm->animator()->actors()->bkgdChangeFlag = 1; + _vm->animator()->actors()->refreshFlag = 1; + _vm->animator()->restoreAllObjectBackgrounds(); + _vm->animator()->flagAllObjectsForRefresh(); + _vm->animator()->updateAllObjectShapes(); break; case 0xFFAB: data += 2; debugC(6, kDebugLevelSprites, "func: Update Brandon's sprite"); - _engine->animator()->animRefreshNPC(0); - _engine->animator()->flagAllObjectsForRefresh(); - _engine->animator()->updateAllObjectShapes(); + _vm->animator()->animRefreshNPC(0); + _vm->animator()->flagAllObjectsForRefresh(); + _vm->animator()->updateAllObjectShapes(); break; case 0xFFB0: data += 2; debugC(6, kDebugLevelSprites, "func: Play sound"); debugC(6, kDebugLevelSprites, "Sound index %i", READ_LE_UINT16(data)); - _engine->snd_playSoundEffect(READ_LE_UINT16(data)); + _vm->snd_playSoundEffect(READ_LE_UINT16(data)); data += 2; break; case 0xFFB1: @@ -373,7 +373,7 @@ void Sprites::updateSceneAnims() { debugC(6, kDebugLevelSprites, "Percentage %i", READ_LE_UINT16(data)); rndNr = _rnd.getRandomNumber(100); if (rndNr <= READ_LE_UINT16(data)) - _engine->snd_playSoundEffect(sound); + _vm->snd_playSoundEffect(sound); data += 2; break; case 0xFFA7: @@ -411,20 +411,20 @@ void Sprites::loadDat(const char *filename, SceneExits &exits) { assert(fileSize > 0x6D); memcpy(_drawLayerTable, (_dat + 0x0D), 8); - _engine->_northExitHeight = READ_LE_UINT16(_dat + 0x15); - if (_engine->_northExitHeight & 1) - _engine->_northExitHeight += 1; + _vm->_northExitHeight = READ_LE_UINT16(_dat + 0x15); + if (_vm->_northExitHeight & 1) + _vm->_northExitHeight += 1; // XXX - _engine->_paletteChanged = 1; + _vm->_paletteChanged = 1; - if (_engine->gameFlags().platform == Common::kPlatformAmiga) { - if (_engine->queryGameFlag(0xA0)) + if (_vm->gameFlags().platform == Common::kPlatformAmiga) { + if (_vm->queryGameFlag(0xA0)) memcpy(_screen->getPalette(3), _screen->getPalette(4), 32*3); else memcpy(_screen->getPalette(3), _screen->getPalette(0), 32*3); } else { - if (_engine->queryGameFlag(0xA0)) + if (_vm->queryGameFlag(0xA0)) memcpy(_screen->getPalette(1), _screen->getPalette(3), 768); else memcpy(_screen->getPalette(1), _screen->getPalette(0), 768); @@ -549,7 +549,7 @@ void Sprites::loadSceneShapes() { void Sprites::refreshSceneAnimObject(uint8 animNum, uint8 shapeNum, uint16 x, uint16 y, bool flipX, bool unkFlag) { debugC(9, kDebugLevelSprites, "Sprites::refreshSceneAnimObject(%i, %i, %i, %i, %i, %i", animNum, shapeNum, x, y, flipX, unkFlag); - AnimObject &anim = _engine->animator()->sprites()[animNum]; + AnimObject &anim = _vm->animator()->sprites()[animNum]; anim.refreshFlag = 1; anim.bkgdChangeFlag = 1; diff --git a/engines/kyra/sprites.h b/engines/kyra/sprites.h index 8a8149f237..965e2888dc 100644 --- a/engines/kyra/sprites.h +++ b/engines/kyra/sprites.h @@ -61,7 +61,7 @@ struct Anim { class Sprites { public: - Sprites(KyraEngine *engine, OSystem *system); + Sprites(KyraEngine *vm, OSystem *system); ~Sprites(); void updateSceneAnims(); @@ -80,7 +80,7 @@ public: protected: void freeSceneShapes(); - KyraEngine *_engine; + KyraEngine *_vm; Resource *_res; OSystem *_system; Screen *_screen; diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 9013cd111f..14dc5041d7 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -214,10 +214,10 @@ bool StaticResource::init() { { 0, 0, 0 } }; - if (_engine->game() == GI_KYRA1) { + if (_vm->game() == GI_KYRA1) { _builtIn = 0; _filenameTable = kyra1StaticRes; - } else if (_engine->game() == GI_KYRA2 || _engine->game() == GI_KYRA3) { + } else if (_vm->game() == GI_KYRA2 || _vm->game() == GI_KYRA3) { return true; } else { error("unknown game ID"); @@ -240,11 +240,11 @@ bool StaticResource::init() { if (version != RESFILE_VERSION) { error("invalid KYRA.DAT file version (%d, required %d)", version, RESFILE_VERSION); } - if (gameID != _engine->game()) { + if (gameID != _vm->game()) { error("invalid game id (%d)", gameID); } - uint32 gameFeatures = createFeatures(_engine->gameFlags()); + uint32 gameFeatures = createFeatures(_vm->gameFlags()); if ((featuresValue & GAME_FLAGS) != gameFeatures) { error("your data file has a different game flags (0x%.08X has the data and your version has 0x%.08X)", (featuresValue & GAME_FLAGS), gameFeatures); } @@ -416,7 +416,7 @@ const void *StaticResource::getData(int id, int requesttype, int &size) { bool StaticResource::loadLanguageTable(const char *filename, void *&ptr, int &size) { char file[64]; for (int i = 0; languages[i].ext; ++i) { - if (languages[i].flags != createLanguage(_engine->gameFlags())) { + if (languages[i].flags != createLanguage(_vm->gameFlags())) { continue; } @@ -609,18 +609,18 @@ void StaticResource::freePaletteTable(void *&ptr, int &size) { uint8 *StaticResource::getFile(const char *name, int &size) { char buffer[64]; const char *ext = ""; - if (_engine->gameFlags().isTalkie) { + if (_vm->gameFlags().isTalkie) { ext = ".CD"; - } else if (_engine->gameFlags().isDemo) { + } else if (_vm->gameFlags().isDemo) { ext = ".DEM"; - } else if (_engine->gameFlags().platform == Common::kPlatformFMTowns) { + } else if (_vm->gameFlags().platform == Common::kPlatformFMTowns) { ext = ".TNS"; - } else if (_engine->gameFlags().platform == Common::kPlatformAmiga) { + } else if (_vm->gameFlags().platform == Common::kPlatformAmiga) { ext = ".AMG"; } snprintf(buffer, 64, "%s%s", name, ext); uint32 tempSize = 0; - uint8 *data = _engine->resource()->fileData(buffer, &tempSize); + uint8 *data = _vm->resource()->fileData(buffer, &tempSize); size = tempSize; return data; } |