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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Sat May 30 17:52:09 CEST 2009


Revision: 41035
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41035&view=rev
Author:   athrxx
Date:     2009-05-30 15:52:09 +0000 (Sat, 30 May 2009)

Log Message:
-----------
LOL: - implemented urbish mines gas explosion 

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

Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h	2009-05-30 15:42:29 UTC (rev 41034)
+++ scummvm/trunk/engines/kyra/lol.h	2009-05-30 15:52:09 UTC (rev 41035)
@@ -749,6 +749,7 @@
 	int olol_paletteFlash(EMCState *script);
 	int olol_disableControls(EMCState *script);
 	int olol_enableControls(EMCState *script);
+	int olol_gasExplosion(EMCState *script);
 	int olol_characterSays(EMCState *script);
 	int olol_queueSpeech(EMCState *script);
 	int olol_getItemPrice(EMCState *script);
@@ -982,7 +983,9 @@
 	void movePartySmoothScrollTurnRight(int speed);
 
 	void pitDropScroll(int numSteps);
+
 	void shakeScene(int duration, int width, int height, int restore);
+	void processGasExplosion(int soundId);
 
 	int smoothScrollDrawSpecialGuiShape(int pageNum);
 

Modified: scummvm/trunk/engines/kyra/scene_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_lol.cpp	2009-05-30 15:42:29 UTC (rev 41034)
+++ scummvm/trunk/engines/kyra/scene_lol.cpp	2009-05-30 15:52:09 UTC (rev 41035)
@@ -1021,7 +1021,7 @@
 		_screen->smoothScrollZoomStepBottom(6, 2, _scrollXBottom[i], _scrollYBottom[i]);
 
 		if (d)
-			_screen->copyGuiShapeToSurface(_tempBuffer5120, 2);
+			_screen->copyGuiShapeToSurface(14, 2);
 
 		_screen->restoreSceneWindow(2, 0);
 		_screen->updateScreen();
@@ -1032,7 +1032,7 @@
 	}
 
 	if (d)
-		_screen->copyGuiShapeToSurface(_tempBuffer5120, 12);
+		_screen->copyGuiShapeToSurface(14, 12);
 
 	if (_sceneDefaultUpdate != 2) {
 		_screen->restoreSceneWindow(12, 0);
@@ -1056,7 +1056,7 @@
 		_screen->smoothScrollZoomStepBottom(6, 2, _scrollXBottom[i], _scrollYBottom[i]);
 
 		if (d)
-			_screen->copyGuiShapeToSurface(_tempBuffer5120, 2);
+			_screen->copyGuiShapeToSurface(14, 2);
 
 		_screen->restoreSceneWindow(2, 0);
 		_screen->updateScreen();
@@ -1067,7 +1067,7 @@
 	}
 
 	if (d)
-		_screen->copyGuiShapeToSurface(_tempBuffer5120, 12);
+		_screen->copyGuiShapeToSurface(14, 12);
 
 	if (_sceneDefaultUpdate != 2) {
 		_screen->restoreSceneWindow(6, 0);
@@ -1155,7 +1155,7 @@
 	_smoothScrollTimer = _system->getMillis() + speed * _tickLength;
 	_screen->smoothScrollTurnStep1(_sceneDrawPage1, _sceneDrawPage2, dp);
 	if (d)
-		_screen->copyGuiShapeToSurface(_tempBuffer5120, dp);
+		_screen->copyGuiShapeToSurface(14, dp);
 	_screen->restoreSceneWindow(dp, 0);
 	_screen->updateScreen();
 	fadeText();
@@ -1164,7 +1164,7 @@
 	_smoothScrollTimer = _system->getMillis() + speed * _tickLength;
 	_screen->smoothScrollTurnStep2(_sceneDrawPage1, _sceneDrawPage2, dp);
 	if (d)
-		_screen->copyGuiShapeToSurface(_tempBuffer5120, dp);
+		_screen->copyGuiShapeToSurface(14, dp);
 	_screen->restoreSceneWindow(dp, 0);
 	_screen->updateScreen();
 	fadeText();
@@ -1173,7 +1173,7 @@
 	_smoothScrollTimer = _system->getMillis() + speed * _tickLength;
 	_screen->smoothScrollTurnStep3(_sceneDrawPage1, _sceneDrawPage2, dp);
 	if (d)
-		_screen->copyGuiShapeToSurface(_tempBuffer5120, dp);
+		_screen->copyGuiShapeToSurface(14, dp);
 	_screen->restoreSceneWindow(dp, 0);
 	_screen->updateScreen();
 	fadeText();
@@ -1199,7 +1199,7 @@
 	_smoothScrollTimer = _system->getMillis() + speed * _tickLength;
 	_screen->smoothScrollTurnStep3(_sceneDrawPage2, _sceneDrawPage1, dp);
 	if (d)
-		_screen->copyGuiShapeToSurface(_tempBuffer5120, dp);
+		_screen->copyGuiShapeToSurface(14, dp);
 	_screen->restoreSceneWindow(dp, 0);
 	_screen->updateScreen();
 	fadeText();
@@ -1208,7 +1208,7 @@
 	_smoothScrollTimer = _system->getMillis() + speed * _tickLength;
 	_screen->smoothScrollTurnStep2(_sceneDrawPage2, _sceneDrawPage1, dp);
 	if (d)
-		_screen->copyGuiShapeToSurface(_tempBuffer5120, dp);
+		_screen->copyGuiShapeToSurface(14, dp);
 	_screen->restoreSceneWindow(dp, 0);
 	_screen->updateScreen();
 	fadeText();
@@ -1217,7 +1217,7 @@
 	_smoothScrollTimer = _system->getMillis() + speed * _tickLength;
 	_screen->smoothScrollTurnStep1(_sceneDrawPage2, _sceneDrawPage1, dp);
 	if (d)
-		_screen->copyGuiShapeToSurface(_tempBuffer5120, dp);
+		_screen->copyGuiShapeToSurface(14, dp);
 	_screen->restoreSceneWindow(dp, 0);
 	_screen->updateScreen();
 	fadeText();
@@ -1300,13 +1300,62 @@
 	}
 }
 
+void LoLEngine::processGasExplosion(int soundId) {
+	int cp = _screen->setCurPage(2);
+	_screen->copyPage(0, 12);
+
+	static const uint8 sounds[] = { 0x62, 0xA7, 0xA7, 0xA8 };
+	snd_playSoundEffect(sounds[soundId], -1);
+
+	uint16 targetBlock = 0;
+	int dist = getSpellTargetBlock(_currentBlock, _currentDirection, 3, targetBlock);
+
+	uint8 *p1 = _screen->getPalette(1);
+	uint8 *p2 = _screen->getPalette(3);
+
+	if (dist) {
+		WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+		char file[13];
+		snprintf(file, 13, "gasexp%0d.wsa", dist);
+		mov->open(file, 1, 0);
+		if (!mov->opened())
+			error("Gas: Unable to load gasexp.wsa");
+
+		playSpellAnimation(mov, 0, 6, 1, (176 - mov->width()) / 2 + 112, (120 - mov->height()) / 2, 0, 0, 0, 0, false);
+
+		mov->close();
+		delete mov;
+
+	} else {
+		memcpy(p2, p1, 768);
+
+		for (int i = 1; i < 128; i++)
+			p2[i * 3] = 0x3f;
+
+		uint32 ctime = _system->getMillis();
+		while (_screen->fadePaletteStep(_screen->_currentPalette, p2, _system->getMillis() - ctime, 10))
+			updateInput();
+
+		ctime = _system->getMillis();
+		while (_screen->fadePaletteStep(p2, _screen->_currentPalette, _system->getMillis() - ctime, 50))
+			updateInput();
+	}
+	
+	_screen->copyPage(12, 2);
+	_screen->setCurPage(cp);
+
+	updateDrawPage2();
+	_sceneUpdateRequired = true;
+	gui_drawScene(0);
+}
+
 int LoLEngine::smoothScrollDrawSpecialGuiShape(int pageNum) {
 	if(!_specialGuiShape)
 		return 0;
 
 	_screen->clearGuiShapeMemory(pageNum);
 	_screen->drawShape(pageNum, _specialGuiShape, _specialGuiShapeX, _specialGuiShapeY, 2, 0);
-	_screen->copyGuiShapeFromSceneBackupBuffer(pageNum, _tempBuffer5120);
+	_screen->copyGuiShapeFromSceneBackupBuffer(pageNum, 14);
 	return 1;
 }
 

Modified: scummvm/trunk/engines/kyra/screen_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.cpp	2009-05-30 15:42:29 UTC (rev 41034)
+++ scummvm/trunk/engines/kyra/screen_lol.cpp	2009-05-30 15:52:09 UTC (rev 41035)
@@ -327,9 +327,9 @@
 	}
 }
 
-void Screen_LoL::copyGuiShapeFromSceneBackupBuffer(int srcPageNum,  uint8 *dstBuffer) {
+void Screen_LoL::copyGuiShapeFromSceneBackupBuffer(int srcPageNum,  int dstPageNum) {
 	uint8 *src = getPagePtr(srcPageNum) + 0x79c3;
-	uint8 *dst = dstBuffer;
+	uint8 *dst = getPagePtr(dstPageNum);
 
 	for (int i = 0; i < 23; i++) {
 		uint8 len = 0;
@@ -349,8 +349,8 @@
 	}
 }
 
-void Screen_LoL::copyGuiShapeToSurface(uint8 *srcBuffer, int dstPageNum) {
-	uint8 *src = srcBuffer;
+void Screen_LoL::copyGuiShapeToSurface(int srcPageNum, int dstPageNum) {
+	uint8 *src = getPagePtr(srcPageNum);
 	uint8 *dst = getPagePtr(dstPageNum) + 0xe7c3;
 
 	for (int i = 0; i < 23; i++) {

Modified: scummvm/trunk/engines/kyra/screen_lol.h
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.h	2009-05-30 15:42:29 UTC (rev 41034)
+++ scummvm/trunk/engines/kyra/screen_lol.h	2009-05-30 15:52:09 UTC (rev 41035)
@@ -56,8 +56,8 @@
 	void backupSceneWindow(int srcPageNum, int dstPageNum);
 	void restoreSceneWindow(int srcPageNum, int dstPageNum);
 	void clearGuiShapeMemory(int pageNum);
-	void copyGuiShapeFromSceneBackupBuffer(int srcPageNum, uint8 *dstBuffer);
-	void copyGuiShapeToSurface(uint8 *srcBuffer, int dstPageNum);
+	void copyGuiShapeFromSceneBackupBuffer(int srcPageNum, int dstPageNum);
+	void copyGuiShapeToSurface(int srcPageNum, int dstPageNum);
 	void smoothScrollZoomStepTop(int srcPageNum, int dstPageNum, int x, int y);
 	void smoothScrollZoomStepBottom(int srcPageNum, int dstPageNum, int x, int y);
 	void smoothScrollHorizontalStep(int pageNum, int x, int u2, int w);

Modified: scummvm/trunk/engines/kyra/script_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_lol.cpp	2009-05-30 15:42:29 UTC (rev 41034)
+++ scummvm/trunk/engines/kyra/script_lol.cpp	2009-05-30 15:52:09 UTC (rev 41035)
@@ -2044,6 +2044,12 @@
 	return gui_enableControls();
 }
 
+int LoLEngine::olol_gasExplosion(EMCState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_gasExplosion(%p) (%d)", (const void *)script, stackPos(0));
+	processGasExplosion(stackPos(0));
+	return 1;
+}
+
 int LoLEngine::olol_characterSays(EMCState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_characterSays(%p)  (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
 	if (stackPos(0) == -1) {
@@ -2599,8 +2605,8 @@
 	// 0xB4
 	Opcode(olol_enableControls);
 	OpcodeUnImpl();
+	Opcode(olol_gasExplosion);
 	OpcodeUnImpl();
-	OpcodeUnImpl();
 
 	// 0xB8
 	OpcodeUnImpl();


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