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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Sun Jun 7 15:07:16 CEST 2009


Revision: 41336
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41336&view=rev
Author:   athrxx
Date:     2009-06-07 13:07:16 +0000 (Sun, 07 Jun 2009)

Log Message:
-----------
LOL: implemented two more opcodes for castle cimmeria

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/lol.h
    scummvm/trunk/engines/kyra/script_lol.cpp
    scummvm/trunk/engines/kyra/sequences_lol.cpp
    scummvm/trunk/engines/kyra/sound_lol.cpp

Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h	2009-06-07 13:05:06 UTC (rev 41335)
+++ scummvm/trunk/engines/kyra/lol.h	2009-06-07 13:07:16 UTC (rev 41336)
@@ -714,6 +714,7 @@
 	int olol_getWallFlags(EMCState *script);
 	int olol_changeMonsterStat(EMCState *script);
 	int olol_getMonsterStat(EMCState *script);
+	int olol_releaseMonsterShapes(EMCState *script);
 	int olol_playCharacterScriptChat(EMCState *script);
 	int olol_playEnvironmentalSfx(EMCState *script);
 	int olol_update(EMCState *script);
@@ -724,6 +725,7 @@
 	int olol_countBlockItems(EMCState *script);
 	int olol_characterSkillTest(EMCState *script);
 	int olol_countAllMonsters(EMCState *script);
+	int olol_playEndSequence(EMCState *script);
 	int olol_stopCharacterSpeech(EMCState *script);
 	int olol_setPaletteBrightness(EMCState *script);
 	int olol_calcInflictableDamage(EMCState *script);

Modified: scummvm/trunk/engines/kyra/script_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_lol.cpp	2009-06-07 13:05:06 UTC (rev 41335)
+++ scummvm/trunk/engines/kyra/script_lol.cpp	2009-06-07 13:07:16 UTC (rev 41336)
@@ -1280,6 +1280,13 @@
 	return 0;
 }
 
+int LoLEngine::olol_releaseMonsterShapes(EMCState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_releaseMonsterShapes(%p)", (const void *)script);
+	for (int i = 0; i < 3; i++)
+		releaseMonsterShapes(i);	
+	return 0;
+}
+
 int LoLEngine::olol_playCharacterScriptChat(EMCState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_playCharacterScriptChat(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
 	snd_stopSpeech(1);
@@ -1392,6 +1399,30 @@
 	return res;
 }
 
+int LoLEngine::olol_playEndSequence(EMCState *script){
+	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_playEndSequence(%p)", (const void *)script);
+
+	int c = 0;
+	if (_characters[0].id == -9)
+		c = 1;
+	else if (_characters[0].id == -5)
+		c = 3;	
+	else if (_characters[0].id == -1)
+		c = 2;
+
+	while (snd_updateCharacterSpeech())
+		delay(_tickLength);
+	
+	_eventList.clear();
+	_screen->hideMouse();
+	memset(_screen->getPalette(1), 0, 768);
+	
+	showOutro(c, _monsterDifficulty == 2 ? true : false);
+	quitGame();
+
+	return 0;
+}
+
 int LoLEngine::olol_stopCharacterSpeech(EMCState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_stopCharacterSpeech(%p)", (const void *)script);
 	snd_stopSpeech(1);
@@ -2713,7 +2744,7 @@
 
 	// 0x5C
 	Opcode(olol_getMonsterStat);
-	OpcodeUnImpl();
+	Opcode(olol_releaseMonsterShapes);
 	Opcode(olol_playCharacterScriptChat);
 	Opcode(olol_update);
 
@@ -2731,7 +2762,7 @@
 
 	// 0x68
 	Opcode(olol_countAllMonsters);
-	OpcodeUnImpl();
+	Opcode(olol_playEndSequence);
 	Opcode(olol_stopCharacterSpeech);
 	Opcode(olol_setPaletteBrightness);
 

Modified: scummvm/trunk/engines/kyra/sequences_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sequences_lol.cpp	2009-06-07 13:05:06 UTC (rev 41335)
+++ scummvm/trunk/engines/kyra/sequences_lol.cpp	2009-06-07 13:07:16 UTC (rev 41336)
@@ -799,6 +799,8 @@
 
 	showCredits();
 
+	_eventList.clear();
+
 	switch (character) {
 	case 0:
 		_screen->loadBitmap("KIERAN.CPS", 3, 3, _screen->getPalette(0));
@@ -929,6 +931,7 @@
 	uint8 *animBlock = new uint8[40960];
 	assert(animBlock);
 	memset(animBlock, 0, 40960);
+	int inputFlag = 0;
 
 	do {
 		while (_system->getMillis() < waitTimer && !shouldQuit())
@@ -1133,7 +1136,9 @@
 		}
 
 		_screen->updateScreen();
-	} while (countStrings && !checkInput(0) && !shouldQuit());
+		inputFlag = checkInput(0);
+		removeInputTop();
+	} while (countStrings && !(inputFlag && !(inputFlag & 0x800)) && !shouldQuit());
 	removeInputTop();
 
 	delete[] animBlock;

Modified: scummvm/trunk/engines/kyra/sound_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_lol.cpp	2009-06-07 13:05:06 UTC (rev 41335)
+++ scummvm/trunk/engines/kyra/sound_lol.cpp	2009-06-07 13:07:16 UTC (rev 41336)
@@ -160,7 +160,7 @@
 }
 
 void LoLEngine::snd_playSoundEffect(int track, int volume) {
-	if (track == 1 && (_lastSfxTrack == -1 || _lastSfxTrack == 1))
+	if ((track == 1 && (_lastSfxTrack == -1 || _lastSfxTrack == 1)) || shouldQuit())
 		return;
 
 	_lastSfxTrack = track;
@@ -202,7 +202,7 @@
 }
 
 void LoLEngine::snd_processEnvironmentalSoundEffect(int soundId, int block) {
-	if (!_sound->sfxEnabled())
+	if (!_sound->sfxEnabled() || shouldQuit())
 		return;
 
 	if (_environmentSfx)


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