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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Mon Mar 9 02:57:45 CET 2009


Revision: 39251
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39251&view=rev
Author:   athrxx
Date:     2009-03-09 01:57:42 +0000 (Mon, 09 Mar 2009)

Log Message:
-----------
LOL: added scene animations (like that fountain right at the start)

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/lol.h
    scummvm/trunk/engines/kyra/scene_lol.cpp
    scummvm/trunk/engines/kyra/script_lol.cpp
    scummvm/trunk/engines/kyra/timer_lol.cpp

Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h	2009-03-09 00:54:27 UTC (rev 39250)
+++ scummvm/trunk/engines/kyra/lol.h	2009-03-09 01:57:42 UTC (rev 39251)
@@ -312,7 +312,7 @@
 	void timerProcessMonsters(int timerNum);
 	void timerSub3(int timerNum);
 	void timerSub4(int timerNum);
-	void timerSub5(int timerNum);
+	void timerUpdateSceneAnims(int timerNum);
 	void timerSub6(int timerNum);
 	void timerUpdatePortraitAnimations(int skipUpdate);
 	void timerUpdateLampState(int timerNum);
@@ -526,6 +526,7 @@
 	int olol_getGlobalVar(EMCState *script);
 	int olol_setGlobalVar(EMCState *script);
 	int olol_triggerDoorSwitch(EMCState *script);
+	int olol_updateSceneAnimations(EMCState *script);
 	int olol_mapShapeToBlock(EMCState *script);
 	int olol_resetBlockShapeAssignment(EMCState *script);
 	int olol_initMonster(EMCState *script);
@@ -729,6 +730,7 @@
 	void drawDecorations(int index);
 	void drawIceShapes(int index, int iceShapeIndex);
 	void drawScriptShapes(int pageNum);
+	void updateSceneAnimations(int block, int wall, int val);
 	void updateSceneWindow();
 
 	void setSequenceGui(int x, int y, int w, int h, int enableFlags);

Modified: scummvm/trunk/engines/kyra/scene_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_lol.cpp	2009-03-09 00:54:27 UTC (rev 39250)
+++ scummvm/trunk/engines/kyra/scene_lol.cpp	2009-03-09 01:57:42 UTC (rev 39251)
@@ -1138,6 +1138,23 @@
 	_sceneUpdateRequired = false;
 }
 
+void LoLEngine::updateSceneAnimations(int block, int wall, int val) {
+	if (wall == -1) {
+		for (int i = 0; i < 4; i++)
+			_levelBlockProperties[block].walls[i] = val;
+		if (_wllBuffer4[val] == 17) {
+			_levelBlockProperties[block].flags &= 0xef;
+			_levelBlockProperties[block].flags |= 0x20;
+		} else {
+			_levelBlockProperties[block].flags &= 0xdf;
+		}		
+	} else {
+		_levelBlockProperties[block].walls[wall] = val;
+	}
+
+	checkSceneUpdateNeed(block);
+}
+
 void LoLEngine::updateSceneWindow() {
 	_screen->hideMouse();
 	_screen->copyRegion(112, 0, 112, 0, 176, 120, 0, _sceneDrawPage2, Screen::CR_NO_P_CHECK);

Modified: scummvm/trunk/engines/kyra/script_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_lol.cpp	2009-03-09 00:54:27 UTC (rev 39250)
+++ scummvm/trunk/engines/kyra/script_lol.cpp	2009-03-09 01:57:42 UTC (rev 39251)
@@ -582,6 +582,14 @@
 	return 1;
 }
 
+int LoLEngine::olol_updateSceneAnimations(EMCState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_updateSceneAnimations(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+	int block = stackPos(0);
+	int wall = stackPos(1);
+	updateSceneAnimations(block, wall, _levelBlockProperties[block].walls[(wall == -1) ? 0 : wall] == stackPos(2) ? stackPos(3) : stackPos(2));
+	return 0;
+}
+
 int LoLEngine::olol_mapShapeToBlock(EMCState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_mapShapeToBlock(%p) (%d)", (const void *)script, stackPos(0));
 	return assignLevelShapes(stackPos(0));
@@ -1209,7 +1217,7 @@
 	OpcodeUnImpl();
 
 	// 0x34
-	OpcodeUnImpl();
+	Opcode(olol_updateSceneAnimations);
 	Opcode(olol_mapShapeToBlock);
 	Opcode(olol_resetBlockShapeAssignment);
 	OpcodeUnImpl();

Modified: scummvm/trunk/engines/kyra/timer_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/timer_lol.cpp	2009-03-09 00:54:27 UTC (rev 39250)
+++ scummvm/trunk/engines/kyra/timer_lol.cpp	2009-03-09 01:57:42 UTC (rev 39251)
@@ -42,9 +42,9 @@
 	_timer->setNextRun(0x11, _system->getMillis() + 3 * _tickLength);
 	_timer->addTimer(3, TimerV2(timerSub3), 15, true);
 	_timer->addTimer(4, TimerV2(timerSub4), 1, true);
-	_timer->addTimer(0x50, TimerV2(timerSub5), 0, false);
-	_timer->addTimer(0x51, TimerV2(timerSub5), 0, false);
-	_timer->addTimer(0x52, TimerV2(timerSub5), 0, false);
+	_timer->addTimer(0x50, TimerV2(timerUpdateSceneAnims), 0, false);
+	_timer->addTimer(0x51, TimerV2(timerUpdateSceneAnims), 0, false);
+	_timer->addTimer(0x52, TimerV2(timerUpdateSceneAnims), 0, false);
 	_timer->addTimer(8, TimerV2(timerSub6), 1200, true);
 	_timer->addTimer(9, TimerV2(timerUpdatePortraitAnimations), 10, true);
 	_timer->addTimer(10, TimerV2(timerUpdateLampState), 360, true);
@@ -119,7 +119,7 @@
 
 }
 
-void LoLEngine::timerSub5(int timerNum) {
+void LoLEngine::timerUpdateSceneAnims(int timerNum) {
 	runLevelScript(0x401 + (timerNum & 0x0f), -1);
 }
 


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