[Scummvm-cvs-logs] SF.net SVN: scummvm: [26342] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Apr 1 15:10:51 CEST 2007


Revision: 26342
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26342&view=rev
Author:   lordhoto
Date:     2007-04-01 06:10:50 -0700 (Sun, 01 Apr 2007)

Log Message:
-----------
made _vm/_engine usage consistent. (_engine -> _vm all over the place now).

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/resource.cpp
    scummvm/trunk/engines/kyra/resource.h
    scummvm/trunk/engines/kyra/sound.cpp
    scummvm/trunk/engines/kyra/sound.h
    scummvm/trunk/engines/kyra/sound_adlib.cpp
    scummvm/trunk/engines/kyra/sound_towns.cpp
    scummvm/trunk/engines/kyra/sprites.cpp
    scummvm/trunk/engines/kyra/sprites.h
    scummvm/trunk/engines/kyra/staticres.cpp

Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp	2007-04-01 12:45:42 UTC (rev 26341)
+++ scummvm/trunk/engines/kyra/resource.cpp	2007-04-01 13:10:50 UTC (rev 26342)
@@ -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 @@
 		}
 
 		// 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 @@
 	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 @@
 			}
 		}
 
-		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 @@
 		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)

Modified: scummvm/trunk/engines/kyra/resource.h
===================================================================
--- scummvm/trunk/engines/kyra/resource.h	2007-04-01 12:45:42 UTC (rev 26341)
+++ scummvm/trunk/engines/kyra/resource.h	2007-04-01 13:10:50 UTC (rev 26342)
@@ -102,7 +102,7 @@
 
 class Resource {
 public:
-	Resource(KyraEngine *engine);
+	Resource(KyraEngine *vm);
 	~Resource();
 	
 	bool loadPakFile(const Common::String &filename, const bool forcePC = false);
@@ -119,7 +119,7 @@
 	bool loadFileToBuf(const char *file, void *buf, uint32 maxSize); 
 
 protected:
-	KyraEngine *_engine;
+	KyraEngine *_vm;
 	Common::List<ResourceFile*> _pakfiles;
 };
 
@@ -207,7 +207,7 @@
 
 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 @@
 	bool prefetchId(int id);
 	void unloadId(int id);
 private:
-	KyraEngine *_engine;
+	KyraEngine *_vm;
 
 	struct FilenameTable;
 	struct ResData;

Modified: scummvm/trunk/engines/kyra/sound.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound.cpp	2007-04-01 12:45:42 UTC (rev 26341)
+++ scummvm/trunk/engines/kyra/sound.cpp	2007-04-01 13:10:50 UTC (rev 26342)
@@ -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 @@
 		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 @@
 		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 @@
 
 #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 @@
 	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 @@
 	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 @@
 	// 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::beginFadeOut() {
 	_fadeMusicOut = true;
-	_fadeStartTime = _engine->_system->getMillis();
+	_fadeStartTime = _vm->_system->getMillis();
 }
 
 #pragma mark -

Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h	2007-04-01 12:45:42 UTC (rev 26341)
+++ scummvm/trunk/engines/kyra/sound.h	2007-04-01 13:10:50 UTC (rev 26342)
@@ -65,7 +65,7 @@
 
 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 @@
 	int _musicEnabled;
 	bool _sfxEnabled;
 
-	KyraEngine *_engine;
+	KyraEngine *_vm;
 	Audio::Mixer *_mixer;
 private:
 	const char * const *_soundFileList;
@@ -121,7 +121,7 @@
 
 class SoundAdlibPC : public Sound {
 public:
-	SoundAdlibPC(KyraEngine *engine, Audio::Mixer *mixer);
+	SoundAdlibPC(KyraEngine *vm, Audio::Mixer *mixer);
 	~SoundAdlibPC();
 
 	bool init();
@@ -164,7 +164,7 @@
 
 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 @@
 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 @@
 
 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(); }

Modified: scummvm/trunk/engines/kyra/sound_adlib.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_adlib.cpp	2007-04-01 12:45:42 UTC (rev 26341)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp	2007-04-01 13:10:50 UTC (rev 26342)
@@ -2213,10 +2213,10 @@
 
 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::haltTrack() {
 	unk1();
 	unk2();
-	//_engine->_system->delayMillis(3 * 60);
+	//_vm->_system->delayMillis(3 * 60);
 }
 
 void SoundAdlibPC::playSoundEffect(uint8 track) {
@@ -2305,7 +2305,7 @@
 
 	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 @@
 	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::unk1() {
 	playSoundEffect(0);
-	//_engine->_system->delayMillis(5 * 60);
+	//_vm->_system->delayMillis(5 * 60);
 }
 
 void SoundAdlibPC::unk2() {

Modified: scummvm/trunk/engines/kyra/sound_towns.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_towns.cpp	2007-04-01 12:45:42 UTC (rev 26341)
+++ scummvm/trunk/engines/kyra/sound_towns.cpp	2007-04-01 13:10:50 UTC (rev 26342)
@@ -894,7 +894,7 @@
 	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 @@
 }
 
 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 @@
 		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 @@
 		_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 @@
 		_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;
 

Modified: scummvm/trunk/engines/kyra/sprites.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sprites.cpp	2007-04-01 12:45:42 UTC (rev 26341)
+++ scummvm/trunk/engines/kyra/sprites.cpp	2007-04-01 13:10:50 UTC (rev 26342)
@@ -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 @@
 			_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 @@
 			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 @@
 			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 @@
 			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 @@
 			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 @@
 	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::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;
 

Modified: scummvm/trunk/engines/kyra/sprites.h
===================================================================
--- scummvm/trunk/engines/kyra/sprites.h	2007-04-01 12:45:42 UTC (rev 26341)
+++ scummvm/trunk/engines/kyra/sprites.h	2007-04-01 13:10:50 UTC (rev 26342)
@@ -61,7 +61,7 @@
 class Sprites {
 public:
 
-	Sprites(KyraEngine *engine, OSystem *system);
+	Sprites(KyraEngine *vm, OSystem *system);
 	~Sprites();
 
 	void updateSceneAnims();
@@ -80,7 +80,7 @@
 protected:
 	void freeSceneShapes();
 
-	KyraEngine *_engine;
+	KyraEngine *_vm;
 	Resource *_res;
 	OSystem *_system;
 	Screen *_screen;

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2007-04-01 12:45:42 UTC (rev 26341)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2007-04-01 13:10:50 UTC (rev 26342)
@@ -214,10 +214,10 @@
 		{ 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 @@
 	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 @@
 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 @@
 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;
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list