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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Mar 20 11:02:05 CET 2006


Revision: 21394
Author:   lordhoto
Date:     2006-03-20 11:01:39 -0800 (Mon, 20 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21394&view=rev

Log Message:
-----------
Implements cmd_shakeScreen.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/screen.cpp
    scummvm/trunk/engines/kyra/screen.h
    scummvm/trunk/engines/kyra/script_v1.cpp
Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp	2006-03-20 18:28:35 UTC (rev 21393)
+++ scummvm/trunk/engines/kyra/screen.cpp	2006-03-20 19:01:39 UTC (rev 21394)
@@ -2094,4 +2094,17 @@
 	copyBackgroundBlock(x, 4, 1);
 }
 
+void Screen::shakeScreen(int times) {
+	debugC(9, kDebugLevelScreen, "Screen::shakeScreen(%d)", times);
+	
+	while (times--) {
+		// seems to be 1 line (320 pixels) offset in the original
+		// 4 looks more like dosbox though, maybe check this again
+		_system->setShakePos(4);
+		_system->updateScreen();
+		_system->setShakePos(0);
+		_system->updateScreen();
+	}
+}
+
 } // End of namespace Kyra

Modified: scummvm/trunk/engines/kyra/screen.h
===================================================================
--- scummvm/trunk/engines/kyra/screen.h	2006-03-20 18:28:35 UTC (rev 21393)
+++ scummvm/trunk/engines/kyra/screen.h	2006-03-20 19:01:39 UTC (rev 21394)
@@ -130,7 +130,9 @@
 	static void decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch, int noXor);
 	uint8 *encodeShape(int x, int y, int w, int h, int flags);
 	void copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *dest);
-		
+
+	void shakeScreen(int times);
+
 	int getRectSize(int x, int y);
 	void hideMouse();
 	void showMouse();

Modified: scummvm/trunk/engines/kyra/script_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v1.cpp	2006-03-20 18:28:35 UTC (rev 21393)
+++ scummvm/trunk/engines/kyra/script_v1.cpp	2006-03-20 19:01:39 UTC (rev 21394)
@@ -1371,7 +1371,15 @@
 }
 
 int KyraEngine::cmd_shakeScreen(ScriptState *script) {
-	warning("STUB: cmd_shakeScreen");
+	debugC(3, kDebugLevelScriptFuncs, "cmd_shakeScreen(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+	int waitTicks = stackPos(1);
+	int times = stackPos(0);
+
+	for (int i = 0; i < times; ++i) {
+		_screen->shakeScreen(1);
+		delay(waitTicks * _tickLength);
+	}
+
 	return 0;
 }
 


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