Implemented opcode 129 o3_chapterChange.

svn-id: r31738
This commit is contained in:
Johannes Schickel 2008-04-26 22:22:21 +00:00
parent 6ed2d9c287
commit 71f4dee9ae
3 changed files with 29 additions and 1 deletions

@ -1678,6 +1678,25 @@ void KyraEngine_v3::scoreIncrease(int count, const char *str) {
#pragma mark -
void KyraEngine_v3::changeChapter(int newChapter, int sceneId, int malcolmShapes, int facing) {
debugC(9, kDebugLevelMain, "KyraEngine_v3::changeChapter(%d, %d, %d, %d)", newChapter, sceneId, malcolmShapes, facing);
resetItemList();
_curChapter = newChapter;
runStartupScript(newChapter, 0);
_mainCharacter.dlgIndex = 0;
_malcolmsMood = 1;
memset(_newSceneDlgState, 0, sizeof(_newSceneDlgState));
if (malcolmShapes >= 0)
loadMalcolmShapes(malcolmShapes);
enterNewScene(sceneId, facing, 0, 0, 0);
}
#pragma mark -
Movie *KyraEngine_v3::createWSAMovie() {
WSAMovieV2 *movie = new WSAMovieV2(this, _screen);
assert(movie);

@ -662,7 +662,9 @@ private:
uint8 *_screenBuffer;
uint8 *_paletteOverlay;
bool _useActorBuffer;
int _curChapter;
void changeChapter(int newChapter, int sceneId, int malcolmShapes, int facing);
static const uint8 _chapterLowestScene[];
@ -760,6 +762,7 @@ private:
int o3_setDlgIndex(ScriptState *script);
int o3_getDlgIndex(ScriptState *script);
int o3_defineScene(ScriptState *script);
int o3_changeChapter(ScriptState *script);
int o3_countItemInstances(ScriptState *script);
int o3_dialogStartScript(ScriptState *script);
int o3_dialogEndScript(ScriptState *script);

@ -1041,6 +1041,12 @@ int KyraEngine_v3::o3_defineScene(ScriptState *script) {
return 0;
}
int KyraEngine_v3::o3_changeChapter(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_changeChapter(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
changeChapter(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
return 0;
}
int KyraEngine_v3::o3_countItemInstances(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_countItemInstances(%p) (%d)", (const void *)script, stackPos(0));
int count = 0;
@ -1406,7 +1412,7 @@ void KyraEngine_v3::setupOpcodeTable() {
Opcode(o3_dummy);
// 0x80
Opcode(o3_dummy);
OpcodeUnImpl();
Opcode(o3_changeChapter);
Opcode(o3_dummy);
Opcode(o3_dummy);
// 0x84