aboutsummaryrefslogtreecommitdiff
path: root/engines/neverhood
diff options
context:
space:
mode:
authorjohndoe1232012-11-14 14:34:39 +0000
committerWillem Jan Palenstijn2013-05-08 20:47:38 +0200
commit370f00e808a907f940169ce28e4c391e45b4c2f0 (patch)
tree6b7d6c7bb2e8eabffd5dc6f9ca219111b4b33996 /engines/neverhood
parent325c85fc41dd6a0dbf8050ef3e39fe8c91d8966a (diff)
downloadscummvm-rg350-370f00e808a907f940169ce28e4c391e45b4c2f0.tar.gz
scummvm-rg350-370f00e808a907f940169ce28e4c391e45b4c2f0.tar.bz2
scummvm-rg350-370f00e808a907f940169ce28e4c391e45b4c2f0.zip
NEVERHOOD: New _sceneNum in Module2800
- Very slightly improved the speed in SmackerPlayer::gotoFrame()
Diffstat (limited to 'engines/neverhood')
-rw-r--r--engines/neverhood/gamemodule.cpp4
-rw-r--r--engines/neverhood/module2800.cpp43
-rw-r--r--engines/neverhood/module2800.h5
-rw-r--r--engines/neverhood/smackerplayer.cpp6
4 files changed, 41 insertions, 17 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index 1d01cddd6b..bd671ee3a0 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -373,8 +373,8 @@ void GameModule::startup() {
createModule(2700, -1);
#endif
#if 1
- _vm->gameState().sceneNum = 2;
- createModule(1400, -1);
+ _vm->gameState().sceneNum = 1;
+ createModule(2800, -1);
#endif
#if 0
_vm->gameState().sceneNum = 0;
diff --git a/engines/neverhood/module2800.cpp b/engines/neverhood/module2800.cpp
index c42e0331ac..6500ae0955 100644
--- a/engines/neverhood/module2800.cpp
+++ b/engines/neverhood/module2800.cpp
@@ -59,13 +59,15 @@ Module2800::~Module2800() {
void Module2800::createScene(int sceneNum, int which) {
debug("Module2800::createScene(%d, %d)", sceneNum, which);
- _vm->gameState().sceneNum = sceneNum;
- switch (_vm->gameState().sceneNum) {
+ _sceneNum = sceneNum;
+ switch (_sceneNum) {
case 0:
+ _vm->gameState().sceneNum = 0;
_vm->_soundMan->stopMusic(0xD2FA4D14, 0, 0);
_childObject = new Scene2801(_vm, this, which);
break;
case 1:
+ _vm->gameState().sceneNum = 1;
_vm->_soundMan->stopMusic(0xD2FA4D14, 0, 0);
if (getGlobalVar(V_RADIO_ENABLED))
_childObject = new Scene2802(_vm, this, which);
@@ -73,101 +75,124 @@ void Module2800::createScene(int sceneNum, int which) {
createStaticScene(0x000C6444, 0xC6440008);
break;
case 2:
+ _vm->gameState().sceneNum = 2;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- //setGlobalVar(V_KLAYMAN_SMALL,1);//DEBUG
if (getGlobalVar(V_KLAYMAN_SMALL))
_childObject = new Scene2803Small(_vm, this, which);
else
_childObject = new Scene2803(_vm, this, which);
break;
case 3:
+ _vm->gameState().sceneNum = 3;
_childObject = new Scene2804(_vm, this, which);
break;
case 4:
+ _vm->gameState().sceneNum = 4;
_vm->_soundMan->stopMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2805(_vm, this, which);
break;
case 5:
+ _vm->gameState().sceneNum = 5;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2806(_vm, this, which);
break;
case 6:
+ _vm->gameState().sceneNum = 6;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2807(_vm, this, which);
break;
case 7:
+ _vm->gameState().sceneNum = 7;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2808(_vm, this, 0);
break;
case 8:
+ _vm->gameState().sceneNum = 8;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2809(_vm, this, which);
break;
case 9:
+ _vm->gameState().sceneNum = 9;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2810(_vm, this, which);
break;
case 10:
+ _vm->gameState().sceneNum = 10;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2808(_vm, this, 1);
break;
case 11:
+ _vm->gameState().sceneNum = 11;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2812(_vm, this, which);
break;
case 12:
+ _vm->gameState().sceneNum = 12;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0x0000A245, 0x0A241008);
break;
case 13:
+ _vm->gameState().sceneNum = 13;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0x81C60635, 0x60631814);
break;
case 14:
+ _vm->gameState().sceneNum = 14;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0xCA811204, 0x11200CA0);
break;
case 15:
+ _vm->gameState().sceneNum = 15;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0x2D438A00, 0x38A042DC);
break;
case 16:
+ _vm->gameState().sceneNum = 16;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0x0A806204, 0x062000A0);
break;
case 17:
+ _vm->gameState().sceneNum = 17;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0x010F9284, 0xF9280018);
break;
case 18:
+ _vm->gameState().sceneNum = 18;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0x0100022B, 0x0022F018);
break;
case 19:
+ _vm->gameState().sceneNum = 19;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0x10866205, 0x66201100);
break;
case 20:
+ _vm->gameState().sceneNum = 20;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0x01C58000, 0x58004014);
break;
case 21:
+ _vm->gameState().sceneNum = 21;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2822(_vm, this, which);
break;
case 22:
+ _vm->gameState().sceneNum = 22;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0x9408121E, 0x8121A948);
break;
case 23:
+ _vm->gameState().sceneNum = 23;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0x048C0600, 0xC0604040);
break;
case 24:
+ _vm->gameState().sceneNum = 24;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
createStaticScene(0x04270A94, 0x70A9004A);
break;
case 25:
+ _vm->gameState().sceneNum = 25;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
if (getGlobalVar(V_SHRINK_LIGHTS_ON))
createStaticScene(0x01600204, 0x0020001E);
@@ -175,6 +200,7 @@ void Module2800::createScene(int sceneNum, int which) {
createStaticScene(0x08611204, 0x1120008E);
break;
case 26:
+ _vm->gameState().sceneNum = 26;
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new DiskplayerScene(_vm, this, 4);
break;
@@ -189,7 +215,7 @@ void Module2800::createScene(int sceneNum, int which) {
void Module2800::updateScene() {
if (!updateChild()) {
- switch (_vm->gameState().sceneNum) {
+ switch (_sceneNum) {
case 0:
if (_moduleResult != 2) {
if (_musicResource) {
@@ -359,7 +385,7 @@ void Module2800::updateScene() {
break;
}
} else {
- switch (_vm->gameState().sceneNum) {
+ switch (_sceneNum) {
case 0:
updateMusic(true);
break;
@@ -402,6 +428,9 @@ void Module2800::updateMusic(bool halfVolume) {
Scene2801::Scene2801(NeverhoodEngine *vm, Module *parentModule, int which)
: Scene(vm, parentModule, true) {
+ Sprite *_sprite1;
+ Sprite *_sprite2;
+
_vm->gameModule()->initRadioPuzzle();
SetMessageHandler(&Scene2801::handleMessage);
@@ -586,7 +615,7 @@ void Scene2802::update() {
changeTuneStatus(prevTuneStatus, _currTuneStatus);
//DEBUG>>>
- debug("_currRadioMusicIndex = %d; V_GOOD_RADIO_MUSIC_INDEX = %d", _currRadioMusicIndex, getGlobalVar(V_GOOD_RADIO_MUSIC_INDEX));
+ //debug("_currRadioMusicIndex = %d; V_GOOD_RADIO_MUSIC_INDEX = %d", _currRadioMusicIndex, getGlobalVar(V_GOOD_RADIO_MUSIC_INDEX));
//DEBUG<<<
if (getGlobalVar(V_RADIO_MOVE_DISH_VIDEO) && prevTuneStatus != _currTuneStatus && _currRadioMusicIndex != 0) {
@@ -1990,8 +2019,6 @@ Scene2806::Scene2806(NeverhoodEngine *vm, Module *parentModule, int which)
_clipRects[1].x1 = _sprite4->getDrawRect().x;
_clipRects[1].y1 = _sprite4->getDrawRect().y;
- _fieldEC = true;
-
tempSprite = insertStaticSprite(0xD2012C02, 1100);
_clipRects[2].x1 = tempSprite->getDrawRect().x;
_clipRects[2].y2 = tempSprite->getDrawRect().y2();
diff --git a/engines/neverhood/module2800.h b/engines/neverhood/module2800.h
index bdcb1ee080..1dd7bca402 100644
--- a/engines/neverhood/module2800.h
+++ b/engines/neverhood/module2800.h
@@ -36,7 +36,7 @@ public:
Module2800(NeverhoodEngine *vm, Module *parentModule, int which);
virtual ~Module2800();
protected:
- bool _flag;
+ int _sceneNum;
uint32 _currentMusicFileHash;
MusicResource *_musicResource;
void createScene(int sceneNum, int which);
@@ -49,8 +49,6 @@ public:
Scene2801(NeverhoodEngine *vm, Module *parentModule, int which);
virtual ~Scene2801();
protected:
- Sprite *_sprite1;
- Sprite *_sprite2;
Sprite *_asTape;
uint32 _paletteHash;
uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
@@ -301,7 +299,6 @@ protected:
NPointArray *_pointList;
int _pointIndex;
NRect _clipRects[4];
- bool _fieldEC;
Sprite *_sprite1;
Sprite *_sprite2;
Sprite *_sprite3;
diff --git a/engines/neverhood/smackerplayer.cpp b/engines/neverhood/smackerplayer.cpp
index 04959b42b0..85319dcf26 100644
--- a/engines/neverhood/smackerplayer.cpp
+++ b/engines/neverhood/smackerplayer.cpp
@@ -111,7 +111,7 @@ void SmackerPlayer::close() {
_smackerDecoder->stop();
delete _smackerDecoder;
delete _palette;
- // NOTE: The SmackerDecoder deletes the _stream
+ // NOTE The SmackerDecoder deletes the _stream
delete _smackerSurface;
_smackerDecoder = NULL;
_palette = NULL;
@@ -125,7 +125,7 @@ void SmackerPlayer::gotoFrame(int frameNumber) {
if (frameNumber < _smackerDecoder->getCurFrame())
rewind();
while (_smackerDecoder->getCurFrame() != frameNumber)
- updateFrame();
+ _smackerDecoder->decodeNextFrame();
}
}
@@ -199,7 +199,7 @@ void SmackerPlayer::updateFrame() {
_smackerSurface->getDrawRect().y = _drawY;
_smackerFirst = false;
}
-
+
if (_smackerDecoder->hasDirtyPalette())
updatePalette();