diff options
author | Strangerke | 2014-04-19 23:26:27 +0200 |
---|---|---|
committer | Strangerke | 2014-04-19 23:27:01 +0200 |
commit | 34d0bc72b571e5e6e0b4b4f3ee1a627cbf470d72 (patch) | |
tree | 83d2204ed47c33fc4dcd5656c92de62f3b0fbbd3 /engines/mads | |
parent | 559efad195b2ec7e77bd9192328d9e48b2a81e29 (diff) | |
download | scummvm-rg350-34d0bc72b571e5e6e0b4b4f3ee1a627cbf470d72.tar.gz scummvm-rg350-34d0bc72b571e5e6e0b4b4f3ee1a627cbf470d72.tar.bz2 scummvm-rg350-34d0bc72b571e5e6e0b4b4f3ee1a627cbf470d72.zip |
MADS: Implement scene 313, come renaming in RGB4 structure, used by AnimPalData
Diffstat (limited to 'engines/mads')
-rw-r--r-- | engines/mads/nebular/nebular_scenes.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes3.cpp | 75 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes3.h | 17 | ||||
-rw-r--r-- | engines/mads/palette.h | 6 | ||||
-rw-r--r-- | engines/mads/scene.cpp | 2 | ||||
-rw-r--r-- | engines/mads/scene_data.cpp | 6 |
6 files changed, 101 insertions, 7 deletions
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index ac2ab85644..1c19d244b9 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -121,6 +121,8 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) { return new Scene310(vm); case 311: return new Scene311(vm); + case 313: + return new Scene313(vm); // Scene group #8 case 804: diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 59167cc088..603f87535c 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -1754,5 +1754,80 @@ void Scene311::actions() { /*------------------------------------------------------------------------*/ +void Scene313::setup() { + setPlayerSpritesPrefix(); + _game._player._spritesPrefix = "RM313A"; + setAAName(); +} + +void Scene313::enter() { + _scene->_userInterface.setup(kInputLimitedSentences); + gender_timer = 0; + gender_threshold = _vm->getRandomNumber(3, 9) * 600; + + if ((_scene->_priorSceneId == 366) || (_scene->_priorSceneId == 316)) { + _game._player._playerPos = Common::Point(30, 80); + _game._player._facing = FACING_NORTH; + } else if ((_scene->_priorSceneId == 311) || (_scene->_priorSceneId == 361) || (_scene->_priorSceneId == 391)) { + _game._player._playerPos = Common::Point(90, 70); + _game._player._facing = FACING_EAST; + } else if (_scene->_priorSceneId == 390) { + _game._player._playerPos = Common::Point(126, 70); + _game._player._facing = FACING_EAST; + } else if ((_scene->_priorSceneId == 389) || (_scene->_priorSceneId == 399)) { + _game._player._playerPos = Common::Point(163, 70); + _game._player._facing = FACING_WEST; + } else if (_scene->_priorSceneId == 388) { + _game._player._playerPos = Common::Point(199, 70); + _game._player._facing = FACING_WEST; + } else if (_scene->_priorSceneId != -2) { + _game._player._playerPos = Common::Point(234, 70); + _game._player._facing = FACING_WEST; + } + + if (_globals[kAfterHavoc]) { + for (uint16 i = 0; i < _scene->_animPalData.size(); i++) { + int palIdx = _scene->_animPalData[i]._firstColorIndex; + int size = _scene->_animPalData[i]._colorCount * 3; + memset(&_vm->_palette->_savedPalette[palIdx], 0, size); + memset(&_vm->_palette->_mainPalette[palIdx], 0, size); + } + } + + sceneEntrySound(); +} + +void Scene313::actions() { + if (_action.isAction(0x2FB, 0x2FC)) + _scene->_nextSceneId = 387; + else if (_action.isAction(0x2FB, 0x2FD)) + _scene->_nextSceneId = 388; + else if (_action.isAction(0x2FB, 0x2FE)) { + if (_globals[kAfterHavoc]) + _scene->_nextSceneId = 399; + else + _scene->_nextSceneId = 389; + } else if (_action.isAction(0x2FB, 0x2FF)) + _scene->_nextSceneId = 390; + else if (_action.isAction(0x2FB, 0x2EF)) { + if (_globals[kSexOfRex] == REX_FEMALE) { + _globals[kSexOfRex] = REX_MALE; + _vm->_dialogs->show(0x7A45); + } + _scene->_nextSceneId = 391; + } else if (_action.isAction(0x2FB, 0x300)) { + if (_globals[kSexOfRex] == REX_FEMALE) { + _globals[kSexOfRex] = REX_MALE; + _vm->_dialogs->show(0x7A45); + } + _scene->_nextSceneId = 366; + } else if (!_action.isAction(0x301, 0x2D4)) + return; + + _action._inProgress = false; +} + +/*------------------------------------------------------------------------*/ + } // End of namespace Nebular } // End of namespace MADS diff --git a/engines/mads/nebular/nebular_scenes3.h b/engines/mads/nebular/nebular_scenes3.h index d4f26f40fa..57b05e8e16 100644 --- a/engines/mads/nebular/nebular_scenes3.h +++ b/engines/mads/nebular/nebular_scenes3.h @@ -217,6 +217,23 @@ public: virtual void actions(); virtual void postActions() {}; }; + +class Scene313: public Scene3xx { +private: + uint32 gender_clock; + uint32 gender_timer; + uint32 gender_threshold; + +public: + Scene313(MADSEngine *vm) : Scene3xx(vm) {} + + virtual void setup(); + virtual void enter(); + virtual void step() {}; + virtual void preActions() {}; + virtual void actions(); + virtual void postActions() {}; +}; } // End of namespace Nebular } // End of namespace MADS diff --git a/engines/mads/palette.h b/engines/mads/palette.h index 728fd0969a..b306c8acb0 100644 --- a/engines/mads/palette.h +++ b/engines/mads/palette.h @@ -46,12 +46,12 @@ enum { }; struct RGB4 { - byte r; + byte _colorCount; byte g; - byte b; + byte _firstColorIndex; byte u; - RGB4() { r = g = b = u = 0; } + RGB4() { _colorCount = g = _firstColorIndex = u = 0; } }; struct RGB6 { diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index 65d1c04c0c..aff4aa36aa 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -254,7 +254,7 @@ void Scene::initPaletteAnimation(Common::Array<RGB4> &animData, bool animFlag) { // Calculate total _animCount = 0; for (uint i = 0; i < _animPalData.size(); ++i) - _animCount += _animPalData[i].r; + _animCount += _animPalData[i]._colorCount; _animVal1 = (_animCount > 16) ? 3 : 0; _cyclingActive = animFlag; diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp index 6eb6be2c1e..d921465c04 100644 --- a/engines/mads/scene_data.cpp +++ b/engines/mads/scene_data.cpp @@ -67,9 +67,9 @@ void ARTHeader::load(Common::SeekableReadStream *f) { palCount = f->readUint16LE(); for (int i = 0; i < palCount; ++i) { RGB4 rgb; - rgb.r = f->readByte(); + rgb._colorCount = f->readByte(); rgb.g = f->readByte(); - rgb.b = f->readByte(); + rgb._firstColorIndex = f->readByte(); rgb.u = f->readByte(); _palAnimData.push_back(rgb); @@ -219,7 +219,7 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName, for (uint i = 0; i < _palAnimData.size(); ++i) { byte g = _palAnimData[i].g; - _palAnimData[i].b = artHeader._palette[g]._palIndex; + _palAnimData[i]._firstColorIndex = artHeader._palette[g]._palIndex; } } } |