GNAP: Refactor scenes 16, 47, 48, 54 (cutscenes)

This commit is contained in:
Strangerke 2016-04-22 00:26:09 +02:00 committed by Eugene Sandulenko
parent c30810c933
commit 861e5c1067
12 changed files with 414 additions and 138 deletions

View File

@ -2077,11 +2077,9 @@ void GnapEngine::initGlobalSceneVars() {
_toyUfoActionStatus = -1;
_toyUfoX = 0;
_toyUfoY = 50;
}
bool GnapEngine::sceneXX_sub_4466B1() {
if (isKeyStatus1(Common::KEYCODE_ESCAPE)) {
clearKeyStatus1(Common::KEYCODE_ESCAPE);
clearKeyStatus1(Common::KEYCODE_UP);
@ -2098,7 +2096,6 @@ bool GnapEngine::sceneXX_sub_4466B1() {
}
return false;
}
void GnapEngine::sceneXX_playRandomSound(int timerIndex) {
@ -2271,82 +2268,4 @@ void GnapEngine::toyUfoFlyTo(int destX, int destY, int minX, int maxX, int minY,
}
}
// Scene 99
int GnapEngine::cutscene_init() {
return -1;
}
void GnapEngine::cutscene_run() {
int itemIndex = 0;
int soundId = -1;
int volume = 100;
int duration = 0;
bool skip = false;
if (_prevSceneNum == 2) {
soundId = 0x36B;
duration = MAX(1, 300 / getSequenceTotalDuration(_s99_sequenceIdArr[_s99_itemsCount - 1]));//CHECKME
_timers[0] = 0;
}
if (soundId != -1)
playSound(soundId, false);
hideCursor();
_gameSys->drawSpriteToBackground(0, 0, _s99_resourceIdArr[0]);
for (int j = 0; j < _s99_sequenceCountArr[0]; ++j)
_gameSys->insertSequence(_s99_sequenceIdArr[j], j + 2, 0, 0, kSeqNone, 0, 0, 0);
_gameSys->setAnimation(_s99_sequenceIdArr[0], 2, 0);
clearKeyStatus1(Common::KEYCODE_ESCAPE);
clearKeyStatus1(Common::KEYCODE_SPACE);
clearKeyStatus1(29);
_mouseClickState._left = false;
int firstSequenceIndex = 0;
while (!_sceneDone) {
gameUpdateTick();
if (_gameSys->getAnimationStatus(0) == 2 || skip) {
skip = false;
_gameSys->requestClear2(false);
_gameSys->requestClear1();
_gameSys->setAnimation(0, 0, 0);
firstSequenceIndex += _s99_sequenceCountArr[itemIndex++];
if (itemIndex >= _s99_itemsCount) {
_sceneDone = true;
} else {
for (int m = 0; m < _s99_sequenceCountArr[itemIndex]; ++m)
_gameSys->insertSequence(_s99_sequenceIdArr[firstSequenceIndex + m], m + 2, 0, 0, kSeqNone, 0, 0, 0);
_gameSys->drawSpriteToBackground(0, 0, _s99_resourceIdArr[itemIndex]);
_gameSys->setAnimation(_s99_sequenceIdArr[firstSequenceIndex], 2, 0);
}
}
if (isKeyStatus1(Common::KEYCODE_ESCAPE) || isKeyStatus1(Common::KEYCODE_SPACE) || isKeyStatus1(29)) {
clearKeyStatus1(Common::KEYCODE_ESCAPE);
clearKeyStatus1(Common::KEYCODE_SPACE);
clearKeyStatus1(29);
if (_s99_canSkip[itemIndex])
skip = true;
else
_sceneDone = true;
}
if (!_timers[0] && itemIndex == _s99_itemsCount - 1) {
_timers[0] = 2;
volume = MAX(1, volume - duration);
setSoundVolume(soundId, volume);
}
}
if (soundId != -1)
stopSound(soundId);
}
} // End of namespace Gnap

View File

@ -603,9 +603,6 @@ public:
void sceneXX_playRandomSound(int timerIndex);
void playSequences(int fullScreenSpriteId, int sequenceId1, int sequenceId2, int sequenceId3);
// Scene 16
void scene16_initCutscene();
// Scene 17
bool _s17_canTryGetWrench;
int _s17_wrenchCtr, _s17_platPhoneCtr, _s17_platTryGetWrenchCtr;
@ -836,18 +833,6 @@ public:
void scene46_run();
void scene46_updateAnimations();
// Scene 47
void scene47_initCutscene1();
void scene47_initCutscene2();
void scene47_initCutscene3();
void scene47_initCutscene4();
void scene47_initCutscene5();
void scene47_initCutscene6();
void scene47_initCutscene7();
// Scene 48
void scene48_initCutscene();
// Scene 49
int _s49_scoreBarPos, _s49_scoreLevel;
bool _s49_scoreBarFlash;
@ -1026,15 +1011,6 @@ public:
// Scene 54
void scene54_initCutscene1();
void scene54_initCutscene2();
// Scene 99
int _s99_itemsCount;
int _s99_resourceIdArr[16];
int _s99_sequenceCountArr[16];
int _s99_sequenceIdArr[50];
bool _s99_canSkip[16];
int cutscene_init();
void cutscene_run();
};
} // End of namespace Gnap

View File

@ -23,10 +23,13 @@
#include "gnap/gnap.h"
#include "gnap/gamesys.h"
#include "gnap/resource.h"
#include "gnap/scenes/scene16.h"
namespace Gnap {
void GnapEngine::scene16_initCutscene() {
Scene16::Scene16(GnapEngine *vm) : CutScene(vm) {}
int Scene16::init() {
_s99_sequenceIdArr[0] = 0x1F2;
_s99_sequenceIdArr[1] = 0x201;
_s99_sequenceIdArr[2] = 0x1FC;
@ -77,6 +80,8 @@ void GnapEngine::scene16_initCutscene() {
_s99_sequenceCountArr[11] = 1;
_s99_sequenceCountArr[12] = 1;
_s99_itemsCount = 13;
return -1;
}
} // End of namespace Gnap

View File

@ -0,0 +1,42 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef GNAP_SCENE16_H
#define GNAP_SCENE16_H
#include "gnap/debugger.h"
#include "gnap/scenes/scenecore.h"
namespace Gnap {
class GnapEngine;
class Scene16: public CutScene {
public:
Scene16(GnapEngine *vm);
~Scene16() {}
virtual int init();
};
} // End of namespace Gnap
#endif // GNAP_SCENE16_H

View File

@ -23,10 +23,13 @@
#include "gnap/gnap.h"
#include "gnap/gamesys.h"
#include "gnap/resource.h"
#include "gnap/scenes/scene47.h"
namespace Gnap {
void GnapEngine::scene47_initCutscene1() {
Scene471::Scene471(GnapEngine *vm) : CutScene(vm) {}
int Scene471::init() {
_s99_sequenceIdArr[0] = 0x301;
_s99_sequenceIdArr[1] = 0x305;
_s99_sequenceIdArr[2] = 0x302;
@ -48,9 +51,13 @@ void GnapEngine::scene47_initCutscene1() {
_s99_canSkip[3] = false;
_s99_canSkip[4] = false;
_s99_itemsCount = 5;
return -1;
}
void GnapEngine::scene47_initCutscene2() {
Scene472::Scene472(GnapEngine *vm) : CutScene(vm) {}
int Scene472::init() {
_s99_sequenceIdArr[0] = 0x306;
_s99_sequenceIdArr[1] = 0x309;
_s99_sequenceIdArr[2] = 0x307;
@ -69,9 +76,13 @@ void GnapEngine::scene47_initCutscene2() {
_s99_canSkip[2] = false;
_s99_canSkip[3] = false;
_s99_itemsCount = 4;
return -1;
}
void GnapEngine::scene47_initCutscene3() {
Scene473::Scene473(GnapEngine *vm) : CutScene(vm) {}
int Scene473::init() {
_s99_sequenceIdArr[0] = 0x320;
_s99_sequenceIdArr[1] = 0x321;
_s99_resourceIdArr[0] = 0x142;
@ -81,9 +92,13 @@ void GnapEngine::scene47_initCutscene3() {
_s99_canSkip[0] = false;
_s99_canSkip[1] = false;
_s99_itemsCount = 2;
return -1;
}
void GnapEngine::scene47_initCutscene4() {
Scene474::Scene474(GnapEngine *vm) : CutScene(vm) {}
int Scene474::init() {
_s99_sequenceIdArr[0] = 0x30C;
_s99_sequenceIdArr[1] = 0x30D;
_s99_sequenceIdArr[2] = 0x30B;
@ -97,9 +112,13 @@ void GnapEngine::scene47_initCutscene4() {
_s99_canSkip[1] = false;
_s99_canSkip[2] = false;
_s99_itemsCount = 3;
return -1;
}
void GnapEngine::scene47_initCutscene5() {
Scene475::Scene475(GnapEngine *vm) : CutScene(vm) {}
int Scene475::init() {
_s99_sequenceIdArr[0] = 0x30E;
_s99_sequenceIdArr[1] = 0x30F;
_s99_sequenceIdArr[2] = 0x310;
@ -111,18 +130,26 @@ void GnapEngine::scene47_initCutscene5() {
_s99_canSkip[0] = false;
_s99_canSkip[1] = false;
_s99_itemsCount = 2;
return -1;
}
void GnapEngine::scene47_initCutscene6() {
Scene476::Scene476(GnapEngine *vm) : CutScene(vm) {}
int Scene476::init() {
_s99_sequenceIdArr[0] = 0x31E;
_s99_sequenceIdArr[1] = 0x31F;
_s99_resourceIdArr[0] = 0x2FA;
_s99_sequenceCountArr[0] = 2;
_s99_canSkip[0] = false;
_s99_itemsCount = 1;
return -1;
}
void GnapEngine::scene47_initCutscene7() {
Scene477::Scene477(GnapEngine *vm) : CutScene(vm) {}
int Scene477::init() {
int v0, v4, v2, v3;
_s99_sequenceIdArr[0] = 0x316;
@ -130,11 +157,11 @@ void GnapEngine::scene47_initCutscene7() {
_s99_sequenceIdArr[2] = 0x314;
_s99_sequenceIdArr[3] = 0x31B;
int v1 = 4;
if (!isFlag(kGFTwigTaken)) {
if (!_vm->isFlag(kGFTwigTaken)) {
_s99_sequenceIdArr[4] = 0x31C;
v1 = 5;
}
if (!isFlag(kGFPlatypusTalkingToAssistant))
if (!_vm->isFlag(kGFPlatypusTalkingToAssistant))
_s99_sequenceIdArr[v1++] = 0x31D;
v4 = v1;
_s99_sequenceIdArr[v1] = 0x319;
@ -144,9 +171,9 @@ void GnapEngine::scene47_initCutscene7() {
_s99_sequenceIdArr[v0++] = 0x312;
_s99_sequenceIdArr[v0] = 0x31A;
v2 = v0 + 1;
if (!isFlag(kGFTwigTaken))
if (!_vm->isFlag(kGFTwigTaken))
_s99_sequenceIdArr[v2++] = 0x31C;
if (!isFlag(kGFPlatypusTalkingToAssistant))
if (!_vm->isFlag(kGFPlatypusTalkingToAssistant))
_s99_sequenceIdArr[v2++] = 0x31D;
_s99_sequenceIdArr[v2] = 0x313;
_s99_sequenceIdArr[v2 + 1] = 0x315;
@ -166,6 +193,8 @@ void GnapEngine::scene47_initCutscene7() {
_s99_canSkip[3] = false;
_s99_canSkip[4] = false;
_s99_itemsCount = 5;
return -1;
}
} // End of namespace Gnap

View File

@ -0,0 +1,89 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef GNAP_SCENE47_H
#define GNAP_SCENE47_H
#include "gnap/debugger.h"
#include "gnap/scenes/scenecore.h"
namespace Gnap {
class GnapEngine;
class Scene471: public CutScene {
public:
Scene471(GnapEngine *vm);
~Scene471() {}
virtual int init();
};
class Scene472: public CutScene {
public:
Scene472(GnapEngine *vm);
~Scene472() {}
virtual int init();
};
class Scene473: public CutScene {
public:
Scene473(GnapEngine *vm);
~Scene473() {}
virtual int init();
};
class Scene474: public CutScene {
public:
Scene474(GnapEngine *vm);
~Scene474() {}
virtual int init();
};
class Scene475: public CutScene {
public:
Scene475(GnapEngine *vm);
~Scene475() {}
virtual int init();
};
class Scene476: public CutScene {
public:
Scene476(GnapEngine *vm);
~Scene476() {}
virtual int init();
};
class Scene477: public CutScene {
public:
Scene477(GnapEngine *vm);
~Scene477() {}
virtual int init();
};
} // End of namespace Gnap
#endif // GNAP_SCENE47_H

View File

@ -23,10 +23,13 @@
#include "gnap/gnap.h"
#include "gnap/gamesys.h"
#include "gnap/resource.h"
#include "gnap/scenes/scene48.h"
namespace Gnap {
void GnapEngine::scene48_initCutscene() {
Scene48::Scene48(GnapEngine *vm) : CutScene(vm) {}
int Scene48::init() {
_s99_sequenceIdArr[0] = 390;
_s99_sequenceIdArr[1] = 391;
_s99_sequenceIdArr[2] = 392;
@ -80,6 +83,8 @@ void GnapEngine::scene48_initCutscene() {
_s99_canSkip[11] = false;
_s99_canSkip[12] = false;
_s99_itemsCount = 13;
return -1;
}
} // End of namespace Gnap

View File

@ -0,0 +1,42 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef GNAP_SCENE48_H
#define GNAP_SCENE48_H
#include "gnap/debugger.h"
#include "gnap/scenes/scenecore.h"
namespace Gnap {
class GnapEngine;
class Scene48: public CutScene {
public:
Scene48(GnapEngine *vm);
~Scene48() {}
virtual int init();
};
} // End of namespace Gnap
#endif // GNAP_SCENE48_H

View File

@ -23,10 +23,13 @@
#include "gnap/gnap.h"
#include "gnap/gamesys.h"
#include "gnap/resource.h"
#include "gnap/scenes/scene54.h"
namespace Gnap {
void GnapEngine::scene54_initCutscene1() {
Scene541::Scene541(GnapEngine *vm) : CutScene(vm) {}
int Scene541::init() {
_s99_sequenceIdArr[0] = 0x1BE;
_s99_sequenceIdArr[1] = 0x1BF;
_s99_sequenceIdArr[2] = 0x1BA;
@ -36,7 +39,7 @@ void GnapEngine::scene54_initCutscene1() {
_s99_resourceIdArr[0] = 0x3C;
_s99_resourceIdArr[1] = 0x43;
_s99_resourceIdArr[2] = 0x44;
if (isFlag(kGFPictureTaken))
if (_vm->isFlag(kGFPictureTaken))
_s99_resourceIdArr[3] = 0x47;
else
_s99_resourceIdArr[3] = 0x46;
@ -52,9 +55,13 @@ void GnapEngine::scene54_initCutscene1() {
_s99_canSkip[3] = false;
_s99_canSkip[4] = false;
_s99_itemsCount = 5;
return -1;
}
void GnapEngine::scene54_initCutscene2() {
Scene542::Scene542(GnapEngine *vm) : CutScene(vm) {}
int Scene542::init() {
_s99_sequenceIdArr[0] = 0x1C9;
_s99_sequenceIdArr[1] = 0x1C7;
_s99_sequenceIdArr[2] = 0x1CC;
@ -122,6 +129,8 @@ void GnapEngine::scene54_initCutscene2() {
_s99_canSkip[14] = true;
_s99_canSkip[15] = false;
_s99_itemsCount = 16;
return -1;
}
} // End of namespace Gnap

View File

@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef GNAP_SCENE54_H
#define GNAP_SCENE54_H
#include "gnap/debugger.h"
#include "gnap/scenes/scenecore.h"
namespace Gnap {
class GnapEngine;
class Scene541: public CutScene {
public:
Scene541(GnapEngine *vm);
~Scene541() {}
virtual int init();
};
class Scene542: public CutScene {
public:
Scene542(GnapEngine *vm);
~Scene542() {}
virtual int init();
};
} // End of namespace Gnap
#endif // GNAP_SCENE54_H

View File

@ -41,6 +41,10 @@
#include "gnap/scenes/scene13.h"
#include "gnap/scenes/scene14.h"
#include "gnap/scenes/scene15.h"
#include "gnap/scenes/scene16.h"
#include "gnap/scenes/scene47.h"
#include "gnap/scenes/scene48.h"
#include "gnap/scenes/scene54.h"
namespace Gnap {
@ -160,7 +164,7 @@ int GnapEngine::initSceneLogic() {
case 47:
case 48:
case 54:
backgroundId = cutscene_init();
backgroundId = -1;
_gameSys->setScaleValues(0, 500, 1, 1000);
break;
case 17:
@ -478,10 +482,12 @@ void GnapEngine::runSceneLogic() {
_newSceneNum = 12;
break;
case 16:
scene16_initCutscene();
_scene = new Scene16(this);
_scene->init();
_newSceneNum = 17;
_newCursorValue = 3;
cutscene_run();
_scene->run();
delete _scene;
break;
case 17:
scene17_run();
@ -639,39 +645,49 @@ void GnapEngine::runSceneLogic() {
break;
case 47:
if (_prevSceneNum == 49) {
scene47_initCutscene1();
_scene = new Scene471(this);
_scene->init();
_newSceneNum = 7;
_newCursorValue = 2;
} else if (_prevSceneNum == 13) {
scene47_initCutscene2();
_scene = new Scene472(this);
_scene->init();
_newSceneNum = 11;
} else if (!isFlag(kGFPlatyPussDisguised) && _prevSceneNum == 2) {//CHECKME
if (isFlag(kGFUnk25)) {
scene47_initCutscene3();
_scene = new Scene473(this);
_scene->init();
_newSceneNum = 2;
} else {
scene47_initCutscene4();
_scene = new Scene474(this);
_scene->init();
_newSceneNum = 49;
}
} else if (_prevSceneNum == 21) {
scene47_initCutscene5();
_scene = new Scene475(this);
_scene->init();
_newSceneNum = 21;
setFlag(kGFTwigTaken);
setFlag(kGFKeysTaken);
} else if (_prevSceneNum == 30) {
scene47_initCutscene6();
_scene = new Scene476(this);
_scene->init();
_newSceneNum = 26;
} else if (isFlag(kGFPlatyPussDisguised) && _cursorValue == 1) {
scene47_initCutscene7();
_scene = new Scene477(this);
_scene->init();
_newSceneNum = 4;
}
cutscene_run();
_scene->run();
delete _scene;
break;
case 48:
scene48_initCutscene();
_scene = new Scene48(this);
_scene->init();
_newSceneNum = 33;
_newCursorValue = 4;
cutscene_run();
_scene->run();
delete _scene;
break;
case 49:
scene49_run();
@ -696,16 +712,91 @@ void GnapEngine::runSceneLogic() {
break;
case 54:
if (_prevSceneNum == 45) {
scene54_initCutscene1();
_scene = new Scene541(this);
_scene->init();
_newSceneNum = 43;
cutscene_run();
_scene->run();
delete _scene;
} else {
scene54_initCutscene2();
cutscene_run();
_scene = new Scene542(this);
_scene->init();
_scene->run();
delete _scene;
_gameDone = true;
}
break;
}
}
void CutScene::run() {
int itemIndex = 0;
int soundId = -1;
int volume = 100;
int duration = 0;
bool skip = false;
if (_vm->_prevSceneNum == 2) {
soundId = 0x36B;
duration = MAX(1, 300 / _vm->getSequenceTotalDuration(_s99_sequenceIdArr[_s99_itemsCount - 1]));//CHECKME
_vm->_timers[0] = 0;
}
if (soundId != -1)
_vm->playSound(soundId, false);
_vm->hideCursor();
_vm->_gameSys->drawSpriteToBackground(0, 0, _s99_resourceIdArr[0]);
for (int j = 0; j < _s99_sequenceCountArr[0]; ++j)
_vm->_gameSys->insertSequence(_s99_sequenceIdArr[j], j + 2, 0, 0, kSeqNone, 0, 0, 0);
_vm->_gameSys->setAnimation(_s99_sequenceIdArr[0], 2, 0);
_vm->clearKeyStatus1(Common::KEYCODE_ESCAPE);
_vm->clearKeyStatus1(Common::KEYCODE_SPACE);
_vm->clearKeyStatus1(29);
_vm->_mouseClickState._left = false;
int firstSequenceIndex = 0;
while (!_vm->_sceneDone) {
_vm->gameUpdateTick();
if (_vm->_gameSys->getAnimationStatus(0) == 2 || skip) {
skip = false;
_vm->_gameSys->requestClear2(false);
_vm->_gameSys->requestClear1();
_vm->_gameSys->setAnimation(0, 0, 0);
firstSequenceIndex += _s99_sequenceCountArr[itemIndex++];
if (itemIndex >= _s99_itemsCount) {
_vm->_sceneDone = true;
} else {
for (int m = 0; m < _s99_sequenceCountArr[itemIndex]; ++m)
_vm->_gameSys->insertSequence(_s99_sequenceIdArr[firstSequenceIndex + m], m + 2, 0, 0, kSeqNone, 0, 0, 0);
_vm->_gameSys->drawSpriteToBackground(0, 0, _s99_resourceIdArr[itemIndex]);
_vm->_gameSys->setAnimation(_s99_sequenceIdArr[firstSequenceIndex], 2, 0);
}
}
if (_vm->isKeyStatus1(Common::KEYCODE_ESCAPE) || _vm->isKeyStatus1(Common::KEYCODE_SPACE) || _vm->isKeyStatus1(29)) {
_vm->clearKeyStatus1(Common::KEYCODE_ESCAPE);
_vm->clearKeyStatus1(Common::KEYCODE_SPACE);
_vm->clearKeyStatus1(29);
if (_s99_canSkip[itemIndex])
skip = true;
else
_vm->_sceneDone = true;
}
if (!_vm->_timers[0] && itemIndex == _s99_itemsCount - 1) {
_vm->_timers[0] = 2;
volume = MAX(1, volume - duration);
_vm->setSoundVolume(soundId, volume);
}
}
if (soundId != -1)
_vm->stopSound(soundId);
}
} // End of namespace Gnap

View File

@ -44,6 +44,26 @@ protected:
GnapEngine *_vm;
};
class CutScene : public Scene {
public:
CutScene(GnapEngine *vm) : Scene(vm) {};
~CutScene() {};
virtual int init() = 0;
void updateHotspots() {}
void run();
void updateAnimations() {}
void updateAnimationsCb() {}
protected:
GnapEngine *_vm;
int _s99_itemsCount;
int _s99_resourceIdArr[16];
int _s99_sequenceCountArr[16];
int _s99_sequenceIdArr[50];
bool _s99_canSkip[16];
};
} // End of namespace Gnap
#endif // GNAP_SCENECORE_H