[Scummvm-cvs-logs] SF.net SVN: scummvm: [31751] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Apr 27 14:39:18 CEST 2008
Revision: 31751
http://scummvm.svn.sourceforge.net/scummvm/?rev=31751&view=rev
Author: lordhoto
Date: 2008-04-27 05:39:16 -0700 (Sun, 27 Apr 2008)
Log Message:
-----------
Implemented KyraEngine_v3::eelScript.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/items_v3.cpp
scummvm/trunk/engines/kyra/kyra_v3.cpp
scummvm/trunk/engines/kyra/kyra_v3.h
scummvm/trunk/engines/kyra/sequences_v3.cpp
Modified: scummvm/trunk/engines/kyra/items_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/items_v3.cpp 2008-04-27 03:19:19 UTC (rev 31750)
+++ scummvm/trunk/engines/kyra/items_v3.cpp 2008-04-27 12:39:16 UTC (rev 31751)
@@ -483,7 +483,7 @@
uint16 item = _itemList[itemSlot].id;
if (_currentChapter == 1 && handItem == 3 && item == 3 && queryGameFlag(0x76)) {
- //eelScript();
+ eelScript();
return true;
} else if ((handItem == 6 || handItem == 7) && item == 2) {
int animObjIndex = -1;
@@ -557,7 +557,7 @@
uint16 item = _mainCharacter.inventory[invSlot];
if (_currentChapter == 1 && handItem == 3 && item == 3 && queryGameFlag(0x76)) {
- //eelScript();
+ eelScript();
return true;
} else if ((handItem == 6 || handItem == 7) && item == 2) {
_screen->hideMouse();
Modified: scummvm/trunk/engines/kyra/kyra_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v3.cpp 2008-04-27 03:19:19 UTC (rev 31750)
+++ scummvm/trunk/engines/kyra/kyra_v3.cpp 2008-04-27 12:39:16 UTC (rev 31751)
@@ -1564,56 +1564,6 @@
#pragma mark -
-void KyraEngine_v3::runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) {
- debugC(9, kDebugLevelMain, "KyraEngine_v3::runTemporaryScript('%s', %d, %d, %d, %d)", filename, allowSkip, resetChar, newShapes, shapeUnload);
- memset(&_temporaryScriptData, 0, sizeof(_temporaryScriptData));
- memset(&_temporaryScriptState, 0, sizeof(_temporaryScriptState));
-
- if (!_scriptInterpreter->loadScript(filename, &_temporaryScriptData, &_opcodesTemporary))
- error("Couldn't load temporary script '%s'", filename);
-
- _scriptInterpreter->initScript(&_temporaryScriptState, &_temporaryScriptData);
- _scriptInterpreter->startScript(&_temporaryScriptState, 0);
-
- _newShapeFlag = -1;
-
- if (_newShapeFiledata && newShapes) {
- resetNewShapes(_newShapeCount, _newShapeFiledata);
- _newShapeFiledata = 0;
- _newShapeCount = 0;
- }
-
- while (_scriptInterpreter->validScript(&_temporaryScriptState))
- _scriptInterpreter->runScript(&_temporaryScriptState);
-
- uint8 *fileData = 0;
-
- if (newShapes)
- _newShapeFiledata = _res->fileData(_newShapeFilename, 0);
-
- fileData = _newShapeFiledata;
-
- if (!fileData) {
- _scriptInterpreter->unloadScript(&_temporaryScriptData);
- return;
- }
-
- if (newShapes)
- _newShapeCount = initNewShapes(fileData);
-
- processNewShapes(allowSkip, resetChar);
-
- if (shapeUnload) {
- resetNewShapes(_newShapeCount, fileData);
- _newShapeCount = 0;
- _newShapeFiledata = 0;
- }
-
- _scriptInterpreter->unloadScript(&_temporaryScriptData);
-}
-
-#pragma mark -
-
bool KyraEngine_v3::updateScore(int scoreId, int strId) {
debugC(9, kDebugLevelMain, "KyraEngine_v3::updateScore(%d, %d)", scoreId, strId);
Modified: scummvm/trunk/engines/kyra/kyra_v3.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v3.h 2008-04-27 03:19:19 UTC (rev 31750)
+++ scummvm/trunk/engines/kyra/kyra_v3.h 2008-04-27 12:39:16 UTC (rev 31751)
@@ -686,6 +686,8 @@
bool updateScore(int scoreId, int strId);
void scoreIncrease(int count, const char *str);
+ void eelScript();
+
// save/load
void saveGame(const char *fileName, const char *saveName);
void loadGame(const char *fileName);
Modified: scummvm/trunk/engines/kyra/sequences_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sequences_v3.cpp 2008-04-27 03:19:19 UTC (rev 31750)
+++ scummvm/trunk/engines/kyra/sequences_v3.cpp 2008-04-27 12:39:16 UTC (rev 31751)
@@ -24,6 +24,7 @@
*/
#include "kyra/kyra_v3.h"
+#include "kyra/resource.h"
namespace Kyra {
@@ -105,8 +106,99 @@
updateSceneAnim(0x0E, -1);
update();
removeSceneAnimObject(0x0E, 1);
- //setNextIdleAnimTimer();
+ setNextIdleAnimTimer();
}
+void KyraEngine_v3::runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v3::runTemporaryScript('%s', %d, %d, %d, %d)", filename, allowSkip, resetChar, newShapes, shapeUnload);
+ memset(&_temporaryScriptData, 0, sizeof(_temporaryScriptData));
+ memset(&_temporaryScriptState, 0, sizeof(_temporaryScriptState));
+
+ if (!_scriptInterpreter->loadScript(filename, &_temporaryScriptData, &_opcodesTemporary))
+ error("Couldn't load temporary script '%s'", filename);
+
+ _scriptInterpreter->initScript(&_temporaryScriptState, &_temporaryScriptData);
+ _scriptInterpreter->startScript(&_temporaryScriptState, 0);
+
+ _newShapeFlag = -1;
+
+ if (_newShapeFiledata && newShapes) {
+ resetNewShapes(_newShapeCount, _newShapeFiledata);
+ _newShapeFiledata = 0;
+ _newShapeCount = 0;
+ }
+
+ while (_scriptInterpreter->validScript(&_temporaryScriptState))
+ _scriptInterpreter->runScript(&_temporaryScriptState);
+
+ uint8 *fileData = 0;
+
+ if (newShapes)
+ _newShapeFiledata = _res->fileData(_newShapeFilename, 0);
+
+ fileData = _newShapeFiledata;
+
+ if (!fileData) {
+ _scriptInterpreter->unloadScript(&_temporaryScriptData);
+ return;
+ }
+
+ if (newShapes)
+ _newShapeCount = initNewShapes(fileData);
+
+ processNewShapes(allowSkip, resetChar);
+
+ if (shapeUnload) {
+ resetNewShapes(_newShapeCount, fileData);
+ _newShapeCount = 0;
+ _newShapeFiledata = 0;
+ }
+
+ _scriptInterpreter->unloadScript(&_temporaryScriptData);
+}
+
+void KyraEngine_v3::eelScript() {
+ debugC(9, kDebugLevelMain, "KyraEngine_v3::eelScript()");
+ if (_chatText)
+ return;
+ _screen->hideMouse();
+
+ if (_inventoryState)
+ hideInventory();
+ removeHandItem();
+
+ objectChat((const char*)getTableEntry(_cCodeFile, 35), 0, 204, 35);
+ objectChat((const char*)getTableEntry(_cCodeFile, 40), 0, 204, 40);
+ playSoundEffect(0x2A, 0xC8);
+
+ setGameFlag(0x171);
+
+ switch (_malcolmShapes-1) {
+ case 0:
+ runTemporaryScript("EELS01.EMC", 0, 0, 1, 1);
+ break;
+
+ case 1:
+ runTemporaryScript("EELS02.EMC", 0, 0, 1, 1);
+ break;
+
+ case 2:
+ runTemporaryScript("EELS03.EMC", 0, 0, 1, 1);
+ break;
+
+ case 3:
+ runTemporaryScript("EELS04.EMC", 0, 0, 1, 1);
+ break;
+
+ default:
+ resetGameFlag(0x171);
+ runTemporaryScript("EELS00.EMC", 0, 0, 1, 1);
+ break;
+ }
+
+ changeChapter(2, 29, 0, 4);
+ _screen->showMouse();
+}
+
} // end of namespace Kyra
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