diff options
| author | Strangerke | 2014-05-20 22:46:09 +0200 | 
|---|---|---|
| committer | Strangerke | 2014-05-20 22:46:09 +0200 | 
| commit | 39068bb1eded8e4933701534eb19d559d45c63fd (patch) | |
| tree | 347978f99533067ee5b8686ac3865f6dbbd53290 | |
| parent | c494781645bcdadce84052798f6194eaaefc728c (diff) | |
| download | scummvm-rg350-39068bb1eded8e4933701534eb19d559d45c63fd.tar.gz scummvm-rg350-39068bb1eded8e4933701534eb19d559d45c63fd.tar.bz2 scummvm-rg350-39068bb1eded8e4933701534eb19d559d45c63fd.zip | |
MADS: Add synchronize where useful in scene group 6
| -rw-r--r-- | engines/mads/nebular/nebular_scenes6.cpp | 141 | ||||
| -rw-r--r-- | engines/mads/nebular/nebular_scenes6.h | 11 | 
2 files changed, 149 insertions, 3 deletions
| diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index 53e187ab80..6f802b22dc 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -225,6 +225,15 @@ void Scene602::setup() {  	_scene->addActiveVocab(NOUN_LASER_BEAM);  } +void Scene602::synchronize(Common::Serializer &s) { +	Scene6xx::synchronize(s); + +	s.syncAsSint16LE(_lastSpriteIdx); +	s.syncAsSint16LE(_lastSequenceIdx); +	s.syncAsSint16LE(_cycleIndex); +	s.syncAsSint16LE(_safeMode); +} +  void Scene602::enter() {  	_globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('h', -1));  	_globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0)); @@ -538,6 +547,13 @@ void Scene603::setup() {  	_scene->addActiveVocab(NOUN_NOTE);  } +void Scene603::synchronize(Common::Serializer &s) { +	Scene6xx::synchronize(s); + +	s.syncAsSint16LE(_compactCaseHotspotId); +	s.syncAsSint16LE(_noteHotspotId); +} +  void Scene603::enter() {  	if (_game._objects[OBJ_COMPACT_CASE]._roomNumber == _scene->_currentSceneId) {  		_globals._spriteIndexes[4] = _scene->_sprites.addSprites("*RXMRD_3"); @@ -680,6 +696,19 @@ void Scene604::setup() {  	_scene->addActiveVocab(NOUN_TIMEBOMB);  } +void Scene604::synchronize(Common::Serializer &s) { +	Scene6xx::synchronize(s); + +	s.syncAsSint16LE(_timebombHotspotId); +	s.syncAsSint16LE(_bombMode); +	s.syncAsSint16LE(_monsterFrame); + +	s.syncAsUint32LE(_monsterTimer); + +	s.syncAsByte(_monsterActive); +	s.syncAsByte(_animationActiveFl); +} +  void Scene604::enter() {  	_globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('c', 0));  	_globals._spriteIndexes[4] = _scene->_sprites.addSprites("*RXCD_9"); @@ -992,6 +1021,22 @@ void Scene607::setup() {  	_scene->addActiveVocab(VERB_WALKTO);  } +void Scene607::synchronize(Common::Serializer &s) { +	Scene6xx::synchronize(s); + +	s.syncAsUint32LE(_dogTimer); +	s.syncAsUint32LE(_lastFrameTime); + +	s.syncAsByte(_dogLoop); +	s.syncAsByte(_dogEatsRex); +	s.syncAsByte(_dogBarking); +	s.syncAsByte(_shopAvailable); + +	s.syncAsSint16LE(_animationMode); +	s.syncAsSint16LE(_animationActive); +	s.syncAsSint16LE(_counter); +} +  void Scene607::enter() {  	_globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('c', 0));  	_globals._spriteIndexes[3] = _scene->_sprites.addSprites("*RXCD_3"); @@ -1427,6 +1472,40 @@ void Scene608::setup() {  	_scene->addActiveVocab(NOUN_OBNOXIOUS_DOG);  } +void Scene608::synchronize(Common::Serializer &s) { +	Scene6xx::synchronize(s); + +	s.syncAsSint16LE(_carMode); +	s.syncAsSint16LE(_carFrame); +	s.syncAsSint16LE(_carMoveMode); +	s.syncAsSint16LE(_dogDeathMode); +	s.syncAsSint16LE(_carHotspotId); +	s.syncAsSint16LE(_barkCount); +	s.syncAsSint16LE(_polycementHotspotId); +	s.syncAsSint16LE(_animationMode); +	s.syncAsSint16LE(_nextTrigger); +	s.syncAsSint16LE(_throwMode); + +	s.syncAsByte(_resetPositionsFl); +	s.syncAsByte(_dogActiveFl); +	s.syncAsByte(_dogBarkingFl); +	s.syncAsByte(_dogFirstEncounter); +	s.syncAsByte(_rexBeingEaten); +	s.syncAsByte(_dogHitWindow); +	s.syncAsByte(_checkFl); +	s.syncAsByte(_dogSquashFl); +	s.syncAsByte(_dogSafeFl); +	s.syncAsByte(_buttonPressedonTimeFl); +	s.syncAsByte(_dogUnderCar); +	s.syncAsByte(_dogYelping); + +	s.syncAsSint32LE(_dogWindowTimer); +	s.syncAsSint32LE(_dogRunTimer); + +	s.syncAsUint32LE(_dogTimer1); +	s.syncAsUint32LE(_dogTimer2); +} +  void Scene608::resetDogVariables() {  	_globals._sequenceIndexes[5] = _scene->_sequences.startCycle(_globals._spriteIndexes[5], false, 1);  	int idx = _scene->_dynamicHotspots.add(NOUN_OBNOXIOUS_DOG, VERB_WALKTO, _globals._sequenceIndexes[5], Common::Rect(0, 0, 0, 0)); @@ -2383,6 +2462,12 @@ void Scene609::setup() {  	setAAName();  } +void Scene609::synchronize(Common::Serializer &s) { +	Scene6xx::synchronize(s); + +	s.syncAsSint16LE(_videoDoorMode); +} +  void Scene609::enter() {  	_globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', 0));  	_globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0)); @@ -2708,6 +2793,18 @@ void Scene610::setup() {  	_scene->addActiveVocab(VERB_WALKTO);  } +void Scene610::synchronize(Common::Serializer &s) { +	Scene6xx::synchronize(s); + +	s.syncAsSint16LE(_handsetHotspotId); +	s.syncAsSint16LE(_checkVal); + +	s.syncAsByte(_cellCharging); + +	s.syncAsSint32LE(_cellChargingTimer); +	s.syncAsUint32LE(_lastFrameTimer); +} +  void Scene610::enter() {  	_globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('p', -1));  	_globals._spriteIndexes[2] = _scene->_sprites.addSprites("*RXMRC_9"); @@ -2891,6 +2988,39 @@ void Scene611::setup() {  	_scene->addActiveVocab(VERB_WALKTO);  } +void Scene611::synchronize(Common::Serializer &s) { +	Scene6xx::synchronize(s); + +	s.syncAsByte(_seenRatFl); +	s.syncAsByte(_eyesRunningFl); +	s.syncAsByte(_shouldRemoveEyes); +	s.syncAsByte(_ratPresentFl); +	s.syncAsByte(_duringDialogFl); +	s.syncAsByte(_resetBatterieText); +	s.syncAsByte(_hermitTalkingFl); +	s.syncAsByte(_hermitMovingFl); +	s.syncAsByte(_alreadyTalkingFl); +	s.syncAsByte(_giveBatteriesFl); +	s.syncAsByte(_startTradingFl); +	s.syncAsByte(_check1Fl); +	s.syncAsByte(_stickFingerFl); + +	s.syncAsSint16LE(_randVal); +	s.syncAsSint16LE(_ratHotspotId); +	s.syncAsSint16LE(_hermitDialogNode); +	s.syncAsSint16LE(_hermitDisplayedQuestion); +	s.syncAsSint16LE(_nextFrame); +	s.syncAsSint16LE(_hermitMode); + +	s.syncAsUint32LE(_ratTimer); + +	s.syncAsSint16LE(_defaultDialogPos.x); +	s.syncAsSint16LE(_defaultDialogPos.y); + +	_dialog1.synchronize(s); +	_dialog2.synchronize(s); +} +  void Scene611::handleRatMoves() {  	_ratPresentFl = false;  	_scene->_sequences.remove(_globals._sequenceIndexes[1]); @@ -4266,6 +4396,13 @@ void Scene612::setup() {  	_scene->addActiveVocab(VERB_WALKTO);  } +void Scene612::synchronize(Common::Serializer &s) { +	Scene6xx::synchronize(s); + +	s.syncAsSint16LE(_actionMode); +	s.syncAsSint16LE(_cycleIndex); +} +  void Scene612::handleWinchMovement() {  	switch (_game._trigger) {  	case 0: @@ -4281,7 +4418,7 @@ void Scene612::handleWinchMovement() {  	case 1:  		// CHECKME: Is the "else" block useful as action is always equal to 1 at this point?  		// Or is it a missing bit of code we could fix? -		if (action == 1) { +		if (_actionMode == 1) {  			_scene->_sequences.remove(_globals._sequenceIndexes[2]);  			_globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 17, 7, 0, 0);  			_vm->_sound->command(19); @@ -4426,7 +4563,7 @@ void Scene612::actions() {  		}  	} else if (_action.isAction(VERB_UNLOCK, 0xFF, 0x45F)) {  		_cycleIndex = -2; -		action = 1; +		_actionMode = 1;  		handleWinchMovement();  	} else if (_action._lookFlag || _action.isAction(VERB_LOOK, NOUN_EXPRESSWAY))  		_vm->_dialogs->show(61210); diff --git a/engines/mads/nebular/nebular_scenes6.h b/engines/mads/nebular/nebular_scenes6.h index 731b220cd1..680d006f66 100644 --- a/engines/mads/nebular/nebular_scenes6.h +++ b/engines/mads/nebular/nebular_scenes6.h @@ -71,6 +71,7 @@ private:  public:  	Scene602(MADSEngine *vm) : Scene6xx(vm) {} +	void synchronize(Common::Serializer &s);  	virtual void setup();  	virtual void enter(); @@ -84,6 +85,7 @@ private:  public:  	Scene603(MADSEngine *vm) : Scene6xx(vm) {} +	void synchronize(Common::Serializer &s);  	virtual void setup();  	virtual void enter(); @@ -105,6 +107,7 @@ private:  public:  	Scene604(MADSEngine *vm) : Scene6xx(vm) {} +	void synchronize(Common::Serializer &s);  	virtual void setup();  	virtual void enter(); @@ -140,6 +143,7 @@ private:  public:  	Scene607(MADSEngine *vm) : Scene6xx(vm) {} +	void synchronize(Common::Serializer &s);  	virtual void setup();  	virtual void enter(); @@ -187,6 +191,7 @@ private:  public:  	Scene608(MADSEngine *vm) : Scene6xx(vm) {} +	void synchronize(Common::Serializer &s);  	virtual void setup();  	virtual void enter(); @@ -203,6 +208,7 @@ private:  public:  	Scene609(MADSEngine *vm) : Scene6xx(vm) {} +	void synchronize(Common::Serializer &s);  	virtual void setup();  	virtual void enter(); @@ -223,6 +229,7 @@ private:  public:  	Scene610(MADSEngine *vm) : Scene6xx(vm) {} +	void synchronize(Common::Serializer &s);  	virtual void setup();  	virtual void enter(); @@ -274,6 +281,7 @@ private:  public:  	Scene611(MADSEngine *vm) : Scene6xx(vm) {} +	void synchronize(Common::Serializer &s);  	virtual void setup();  	virtual void enter(); @@ -284,13 +292,14 @@ public:  class Scene612: public Scene6xx{  private: -	int action; +	int _actionMode;  	int _cycleIndex;  	void handleWinchMovement();  public:  	Scene612(MADSEngine *vm) : Scene6xx(vm) {} +	void synchronize(Common::Serializer &s);  	virtual void setup();  	virtual void enter(); | 
