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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Tue Jun 24 15:59:49 CEST 2008


Revision: 32763
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32763&view=rev
Author:   lordhoto
Date:     2008-06-24 06:59:48 -0700 (Tue, 24 Jun 2008)

Log Message:
-----------
Added const to some static data.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/animator_lok.cpp
    scummvm/trunk/engines/kyra/gui_lok.cpp
    scummvm/trunk/engines/kyra/gui_lok.h
    scummvm/trunk/engines/kyra/items_lok.cpp
    scummvm/trunk/engines/kyra/scene_hof.cpp
    scummvm/trunk/engines/kyra/scene_lok.cpp
    scummvm/trunk/engines/kyra/script.cpp
    scummvm/trunk/engines/kyra/script_tim.cpp
    scummvm/trunk/engines/kyra/seqplayer.cpp
    scummvm/trunk/engines/kyra/sound_towns.cpp

Modified: scummvm/trunk/engines/kyra/animator_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/animator_lok.cpp	2008-06-24 13:21:22 UTC (rev 32762)
+++ scummvm/trunk/engines/kyra/animator_lok.cpp	2008-06-24 13:59:48 UTC (rev 32763)
@@ -665,7 +665,7 @@
 
 void Animator_LoK::setCharacterDefaultFrame(int character) {
 	debugC(9, kDebugLevelAnimator, "Animator_LoK::setCharacterDefaultFrame()");
-	static uint16 initFrameTable[] = {
+	static const uint16 initFrameTable[] = {
 		7, 41, 77, 0, 0
 	};
 	assert(character < ARRAYSIZE(initFrameTable));
@@ -678,7 +678,7 @@
 
 void Animator_LoK::setCharactersHeight() {
 	debugC(9, kDebugLevelAnimator, "Animator_LoK::setCharactersHeight()");
-	static int8 initHeightTable[] = {
+	static const int8 initHeightTable[] = {
 		48, 40, 48, 47, 56,
 		44, 42, 47, 38, 35,
 		40

Modified: scummvm/trunk/engines/kyra/gui_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_lok.cpp	2008-06-24 13:21:22 UTC (rev 32762)
+++ scummvm/trunk/engines/kyra/gui_lok.cpp	2008-06-24 13:59:48 UTC (rev 32763)
@@ -188,6 +188,7 @@
 #pragma mark -
 
 GUI_LoK::GUI_LoK(KyraEngine_LoK *vm, Screen_LoK *screen) : GUI(vm), _vm(vm), _screen(screen) {
+	_lastScreenUpdate = 0;
 	_menu = 0;
 	initStaticResource();
 	_scrollUpFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::scrollUp);
@@ -479,7 +480,6 @@
 
 void GUI_LoK::getInput() {
 	Common::Event event;
-	static uint32 lastScreenUpdate = 0;
 	uint32 now = _vm->_system->getMillis();
 
 	_mouseWheel = 0;
@@ -496,7 +496,7 @@
 			break;
 		case Common::EVENT_MOUSEMOVE:
 			_vm->_system->updateScreen();
-			lastScreenUpdate = now;
+			_lastScreenUpdate = now;
 			break;
 		case Common::EVENT_WHEELUP:
 			_mouseWheel = -1;
@@ -512,9 +512,9 @@
 		}
 	}
 
-	if (now - lastScreenUpdate > 50) {
+	if (now - _lastScreenUpdate > 50) {
 		_vm->_system->updateScreen();
-		lastScreenUpdate = now;
+		_lastScreenUpdate = now;
 	}
 
 	_vm->_system->delayMillis(3);
@@ -1056,7 +1056,7 @@
 	if (_vm->gameFlags().platform == Common::kPlatformAmiga)
 		return;
 
-	static int16 menuPalIndexes[] = {248, 249, 250, 251, 252, 253, 254, -1};
+	static const int16 menuPalIndexes[] = {248, 249, 250, 251, 252, 253, 254, -1};
 	int index = 0;
 
 	memcpy(_screen->getPalette(2), _screen->_currentPalette, 768);

Modified: scummvm/trunk/engines/kyra/gui_lok.h
===================================================================
--- scummvm/trunk/engines/kyra/gui_lok.h	2008-06-24 13:21:22 UTC (rev 32762)
+++ scummvm/trunk/engines/kyra/gui_lok.h	2008-06-24 13:59:48 UTC (rev 32763)
@@ -157,6 +157,8 @@
 	KyraEngine_LoK *_vm;
 	Screen_LoK *_screen;
 
+	uint32 _lastScreenUpdate;
+
 	bool _menuRestoreScreen;
 	uint8 _toplevelMenu;
 	int _savegameOffset;

Modified: scummvm/trunk/engines/kyra/items_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/items_lok.cpp	2008-06-24 13:21:22 UTC (rev 32762)
+++ scummvm/trunk/engines/kyra/items_lok.cpp	2008-06-24 13:59:48 UTC (rev 32763)
@@ -39,7 +39,7 @@
 namespace Kyra {
 
 int KyraEngine_LoK::findDuplicateItemShape(int shape) {
-	static uint8 dupTable[] = {
+	static const uint8 dupTable[] = {
 		0x48, 0x46, 0x49, 0x47, 0x4a, 0x46, 0x4b, 0x47,
 		0x4c, 0x46, 0x4d, 0x47, 0x5b, 0x5a, 0x5c, 0x5a,
 		0x5d, 0x5a, 0x5e, 0x5a, 0xFF, 0xFF

Modified: scummvm/trunk/engines/kyra/scene_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_hof.cpp	2008-06-24 13:21:22 UTC (rev 32762)
+++ scummvm/trunk/engines/kyra/scene_hof.cpp	2008-06-24 13:59:48 UTC (rev 32763)
@@ -723,7 +723,7 @@
 
 bool KyraEngine_HoF::lineIsPassable(int x, int y) {
 	debugC(9, kDebugLevelMain, "KyraEngine_HoF::lineIsPassable(%d, %d)", x, y);
-	static int unkTable[] = { 1, 1, 1, 1, 1, 2, 4, 6, 8 };
+	static const int widthTable[] = { 1, 1, 1, 1, 1, 2, 4, 6, 8 };
 
 	if (_pathfinderFlag & 2) {
 		if (x >= 320)
@@ -743,7 +743,7 @@
 	if (y > 143)
 		return false;
 
-	int unk1 = unkTable[getScale(x, y) >> 5];
+	int unk1 = widthTable[getScale(x, y) >> 5];
 
 	if (y < 0)
 		y = 0;

Modified: scummvm/trunk/engines/kyra/scene_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_lok.cpp	2008-06-24 13:21:22 UTC (rev 32762)
+++ scummvm/trunk/engines/kyra/scene_lok.cpp	2008-06-24 13:59:48 UTC (rev 32763)
@@ -1144,11 +1144,11 @@
 }
 
 void KyraEngine_LoK::setCharactersPositions(int character) {
-	static uint16 initXPosTable[] = {
+	static const uint16 initXPosTable[] = {
 		0x3200, 0x0024, 0x2230, 0x2F00, 0x0020, 0x002B,
 		0x00CA, 0x00F0, 0x0082, 0x00A2, 0x0042
 	};
-	static uint8 initYPosTable[] = {
+	static const uint8 initYPosTable[] = {
 		0x00, 0xA2, 0x00, 0x42, 0x00,
 		0x67, 0x67, 0x60, 0x5A, 0x71,
 		0x76

Modified: scummvm/trunk/engines/kyra/script.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script.cpp	2008-06-24 13:21:22 UTC (rev 32762)
+++ scummvm/trunk/engines/kyra/script.cpp	2008-06-24 13:59:48 UTC (rev 32763)
@@ -35,7 +35,7 @@
 namespace Kyra {
 EMCInterpreter::EMCInterpreter(KyraEngine_v1 *vm) : _vm(vm) {
 #define COMMAND(x) { &EMCInterpreter::x, #x }
-	static CommandEntry commandProcs[] = {
+	static const CommandEntry commandProcs[] = {
 		// 0x00
 		COMMAND(cmd_jmpTo),
 		COMMAND(cmd_setRetValue),

Modified: scummvm/trunk/engines/kyra/script_tim.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_tim.cpp	2008-06-24 13:21:22 UTC (rev 32762)
+++ scummvm/trunk/engines/kyra/script_tim.cpp	2008-06-24 13:59:48 UTC (rev 32763)
@@ -34,7 +34,7 @@
 TIMInterpreter::TIMInterpreter(KyraEngine_v1 *vm, OSystem *system) : _vm(vm), _system(system), _currentTim(0) {
 #define COMMAND(x) { &TIMInterpreter::x, #x }
 #define COMMAND_UNIMPL() { 0, 0 }
-	static CommandEntry commandProcs[] = {
+	static const CommandEntry commandProcs[] = {
 		// 0x00
 		COMMAND(cmd_initFunc0),
 		COMMAND(cmd_stopCurFunc),

Modified: scummvm/trunk/engines/kyra/seqplayer.cpp
===================================================================
--- scummvm/trunk/engines/kyra/seqplayer.cpp	2008-06-24 13:21:22 UTC (rev 32762)
+++ scummvm/trunk/engines/kyra/seqplayer.cpp	2008-06-24 13:59:48 UTC (rev 32763)
@@ -500,7 +500,7 @@
 	debugC(9, kDebugLevelSequence, "SeqPlayer::seq_playSequence(%p, %d)", (const void *)seqData, skipSeq);
 	assert(seqData);
 
-	static SeqEntry floppySeqProcs[] = {
+	static const SeqEntry floppySeqProcs[] = {
 		// 0x00
 		SEQOP(3, s1_wsaOpen),
 		SEQOP(2, s1_wsaClose),
@@ -541,7 +541,7 @@
 		SEQOP(1, s1_endOfScript)
 	};
 
-	static SeqEntry cdromSeqProcs[] = {
+	static const SeqEntry cdromSeqProcs[] = {
 		// 0x00
 		SEQOP(3, s1_wsaOpen),
 		SEQOP(2, s1_wsaClose),

Modified: scummvm/trunk/engines/kyra/sound_towns.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_towns.cpp	2008-06-24 13:21:22 UTC (rev 32762)
+++ scummvm/trunk/engines/kyra/sound_towns.cpp	2008-06-24 13:59:48 UTC (rev 32763)
@@ -878,7 +878,7 @@
 				pos += 6;
 			}
 		} else if (cmd == 0xF2) {
-			static uint16 tickTable [] = { 0x180, 0xC0, 0x80, 0x60, 0x40, 0x30, 0x20, 0x18 };
+			static const uint16 tickTable[] = { 0x180, 0xC0, 0x80, 0x60, 0x40, 0x30, 0x20, 0x18 };
 			_baseTick += tickTable[_nextBaseTickStep >> 4] * ((_nextBaseTickStep & 0x0f) + 1);
 			_nextBaseTickStep = pos[1];
 			pos += 6;


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