aboutsummaryrefslogtreecommitdiff
path: root/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2005-12-13 13:27:58 +0000
committerJohannes Schickel2005-12-13 13:27:58 +0000
commit55178803000823e5090aa0316abd92855eafc0f1 (patch)
treeb5da9594904808e647e2707e9ff62676ff4a7e02 /kyra
parent3e3df54a9c6ad237014c10b896ce81913df9314f (diff)
downloadscummvm-rg350-55178803000823e5090aa0316abd92855eafc0f1.tar.gz
scummvm-rg350-55178803000823e5090aa0316abd92855eafc0f1.tar.bz2
scummvm-rg350-55178803000823e5090aa0316abd92855eafc0f1.zip
Fixed a bug with transcendScenes in CD version there the old file
is still loaded then. Also implemented: cmd_changeCharactersXAndY cmd_setCharactersLocation cmd_setCharactersCurrentFrame svn-id: r19790
Diffstat (limited to 'kyra')
-rw-r--r--kyra/kyra.cpp9
-rw-r--r--kyra/script_v1.cpp30
2 files changed, 36 insertions, 3 deletions
diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp
index 36bfd55294..61a393d608 100644
--- a/kyra/kyra.cpp
+++ b/kyra/kyra.cpp
@@ -1327,6 +1327,15 @@ void KyraEngine::enterNewScene(int sceneId, int facing, int unk1, int unk2, int
void KyraEngine::transcendScenes(int roomIndex, int roomName) {
debug(9, "transcendScenes(%d, %d, %d, %d)", roomIndex, roomName);
assert(roomIndex < _roomTableSize);
+ if (_features & GF_TALKIE) {
+ char file[32];
+ assert(roomIndex < _roomTableSize);
+ int tableId = _roomTable[roomIndex].nameIndex;
+ assert(tableId < _roomFilenameTableSize);
+ strcpy(file, _roomFilenameTable[tableId]);
+ strcat(file, ".VRM");
+ _res->unloadPakFile(file);
+ }
_roomTable[roomIndex].nameIndex = roomName;
// _game_unkScreenVar2 = 1;
// _game_unkScreenVar3 = 1;
diff --git a/kyra/script_v1.cpp b/kyra/script_v1.cpp
index 211006eb49..0bae4f959e 100644
--- a/kyra/script_v1.cpp
+++ b/kyra/script_v1.cpp
@@ -948,7 +948,18 @@ int KyraEngine::cmd_internalAnimOff(ScriptState *script) {
}
int KyraEngine::cmd_changeCharactersXAndY(ScriptState *script) {
- warning("STUB: cmd_changeCharactersXAndY");
+ debug(3, "cmd_changeCharactersXAndY(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
+ Character *ch = &_characterList[stackPos(0)];
+ int16 x = stackPos(1);
+ int16 y = stackPos(2);
+ if (x != -1 && y != -1) {
+ x &= 0xFFFC;
+ y &= 0xFFFE;
+ }
+ restoreAllObjectBackgrounds();
+ ch->x1 = ch->x2 = x;
+ ch->y1 = ch->y2 = y;
+ preserveAllBackgrounds();
return 0;
}
@@ -1060,7 +1071,19 @@ int KyraEngine::cmd_unhideMobileCharacter(ScriptState *script) {
}
int KyraEngine::cmd_setCharactersLocation(ScriptState *script) {
- warning("STUB: cmd_setCharactersLocation");
+ debug(3, "cmd_setCharactersLocation(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ Character *ch = &_characterList[stackPos(0)];
+ AnimObject *animObj = &_charactersAnimState[stackPos(0)];
+ int newScene = stackPos(1);
+ if (_currentCharacter->sceneId == ch->sceneId) {
+ if (_currentCharacter->sceneId != newScene)
+ animObj->active = 0;
+ } else if (_currentCharacter->sceneId == newScene) {
+ if (_currentCharacter->sceneId != ch->sceneId)
+ animObj->active = 1;
+ }
+
+ ch->sceneId = stackPos(1);
return 0;
}
@@ -1274,7 +1297,8 @@ int KyraEngine::cmd_drawItemShapeIntoScene(ScriptState *script) {
}
int KyraEngine::cmd_setCharactersCurrentFrame(ScriptState *script) {
- warning("STUB: cmd_setCharactersCurrentFrame");
+ debug(3, "cmd_setCharactersCurrentFrame(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ _characterList[stackPos(0)].currentAnimFrame = stackPos(1);
return 0;
}