Small bugfixes with enterNewScene and cmd_pauseSeconds.

Implemented opcode: cmd_setSceneFile

svn-id: r19829
This commit is contained in:
Johannes Schickel 2005-12-22 19:31:38 +00:00
parent c36104ac0c
commit 22033482b0
3 changed files with 14 additions and 6 deletions

View File

@ -1341,7 +1341,7 @@ 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);
debug(9, "transcendScenes(%d, %d)", roomIndex, roomName);
assert(roomIndex < _roomTableSize);
if (_features & GF_TALKIE) {
char file[32];
@ -1364,6 +1364,12 @@ void KyraEngine::transcendScenes(int roomIndex, int roomName) {
_unkScreenVar3 = 0;
}
void KyraEngine::setSceneFile(int roomIndex, int roomName) {
debug(9, "setSceneFile(%d, %d)", roomIndex, roomName);
assert(roomIndex < _roomTableSize);
_roomTable[roomIndex].nameIndex = roomName;
}
void KyraEngine::moveCharacterToPos(int character, int facing, int xpos, int ypos) {
debug(9, "moveCharacterToPos(%d, %d, %d, %d)", character, facing, xpos, ypos);
Character *ch = &_characterList[character];
@ -1690,8 +1696,8 @@ void KyraEngine::initSceneData(int facing, int unk1, int brandonAlive) {
break;
}
if ((uint8)(_northExitHeight & 0xFF) >= ypos) {
ypos = (_northExitHeight & 0xFF);
if ((uint8)(_northExitHeight & 0xFF) + 2 >= ypos) {
ypos = (_northExitHeight & 0xFF) + 4;
}
if (xpos >= 308) {
xpos = 304;
@ -1743,7 +1749,7 @@ void KyraEngine::initSceneData(int facing, int unk1, int brandonAlive) {
_currentCharacter->x2 = xpos;
_currentCharacter->y1 = ypos;
_currentCharacter->y2 = ypos;
facing = 4;
facing = 2;
xpos2 = 192;
ypos2 = 128;
setFacing = 0;

View File

@ -428,6 +428,7 @@ protected:
void enterNewScene(int sceneId, int facing, int unk1, int unk2, int brandonAlive);
void transcendScenes(int roomIndex, int roomName);
void setSceneFile(int roomIndex, int roomName);
void moveCharacterToPos(int character, int facing, int xpos, int ypos);
void setCharacterPositionWithUpdate(int character);
int setCharacterPosition(int character, int *facingTable);

View File

@ -577,7 +577,7 @@ int KyraEngine::cmd_setBrandonStatusBit(ScriptState *script) {
int KyraEngine::cmd_pauseSeconds(ScriptState *script) {
debug(3, "cmd_pauseSeconds(0x%X) (%d)", script, stackPos(0));
if (stackPos(0) > 0)
delay(stackPos(0)*1000, false);
delay(stackPos(0)*1000, true);
return 0;
}
@ -1393,7 +1393,8 @@ int KyraEngine::cmd_pageFlip(ScriptState *script) {
}
int KyraEngine::cmd_setSceneFile(ScriptState *script) {
warning("STUB: cmd_setSceneFile");
debug(3, "cmd_setSceneFile(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
setSceneFile(stackPos(0), stackPos(1));
return 0;
}