diff options
| -rw-r--r-- | engines/mads/dragonsphere/dragonsphere_scenes.h | 22 | ||||
| -rw-r--r-- | engines/mads/dragonsphere/dragonsphere_scenes1.cpp | 209 | ||||
| -rw-r--r-- | engines/mads/dragonsphere/dragonsphere_scenes1.h | 59 | ||||
| -rw-r--r-- | engines/mads/dragonsphere/game_dragonsphere.cpp | 2 | ||||
| -rw-r--r-- | engines/mads/dragonsphere/game_dragonsphere.h | 11 | ||||
| -rw-r--r-- | engines/mads/dragonsphere/globals_dragonsphere.cpp | 51 | ||||
| -rw-r--r-- | engines/mads/dragonsphere/globals_dragonsphere.h | 184 | ||||
| -rw-r--r-- | engines/mads/module.mk | 2 | 
8 files changed, 507 insertions, 33 deletions
diff --git a/engines/mads/dragonsphere/dragonsphere_scenes.h b/engines/mads/dragonsphere/dragonsphere_scenes.h index 173cc667ce..2ecf8e9955 100644 --- a/engines/mads/dragonsphere/dragonsphere_scenes.h +++ b/engines/mads/dragonsphere/dragonsphere_scenes.h @@ -29,7 +29,6 @@  #include "mads/dragonsphere/game_dragonsphere.h"  //#include "mads/dragonsphere/globals_dragonsphere.h" -  namespace MADS {  namespace Dragonsphere { @@ -656,27 +655,6 @@ protected:  };  // TODO: Temporary, remove once implemented properly -class Scene1xx : public DragonsphereScene { -protected: -	/** -	 * Plays an appropriate sound when entering a scene -	 */ -	void sceneEntrySound() {} - -	/** -	 *Sets the AA file to use for the scene -	 */ -	void setAAName() {} - -	/** -	 * Updates the prefix used for getting player sprites for the scene -	 */ -	void setPlayerSpritesPrefix() {} -public: -	Scene1xx(MADSEngine *vm) : DragonsphereScene(vm) {} -}; - -// TODO: Temporary, remove once implemented properly  class DummyScene : public DragonsphereScene {  public:  	DummyScene(MADSEngine *vm) : DragonsphereScene(vm) { diff --git a/engines/mads/dragonsphere/dragonsphere_scenes1.cpp b/engines/mads/dragonsphere/dragonsphere_scenes1.cpp new file mode 100644 index 0000000000..6635354991 --- /dev/null +++ b/engines/mads/dragonsphere/dragonsphere_scenes1.cpp @@ -0,0 +1,209 @@ +/* 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. + * + */ + +#include "common/scummsys.h" +#include "mads/mads.h" +#include "mads/conversations.h" +#include "mads/scene.h" +#include "mads/dragonsphere/dragonsphere_scenes.h" +#include "mads/dragonsphere/dragonsphere_scenes1.h" + +namespace MADS { + +namespace Dragonsphere { + +void Scene1xx::setAAName() { +	int interface; + +	switch (_scene->_nextSceneId) { +	case 108: +	case 109: +		interface = 3; +		break; +	case 110: +		interface = 5; +		break; +	case 113: +	case 114: +	case 115: +	case 117: +	case 119: +		interface = 1; +		break; +	case 116: +		interface = 2; +		break; +	case 120: +		interface = 8; +		break; +	default: +		interface = 0; +		break; +	} + +	_game._aaName = Resources::formatAAName(interface); +	_vm->_palette->setEntry(254, 56, 47, 32); + +} + +void Scene1xx::sceneEntrySound() { +	if (!_vm->_musicFlag) +		return; + +	switch (_scene->_nextSceneId) { +	case 104: +		if (_globals[kPlayerPersona] == 1) +			_vm->_sound->command(44); +		else +			_vm->_sound->command(16); +		break; + +	case 106: +		if (_globals[kEndOfGame]) +			_vm->_sound->command(47); +		else +			_vm->_sound->command(16); +		break; + +	case 108: +		if (_game._visitedScenes.exists(109)) +			_vm->_sound->command(32); +		else +			_vm->_sound->command(33); +		break; + +	case 109: +		_vm->_sound->command(32); +		break; + +	case 110: +		_vm->_sound->command(37); +		break; + +	case 111: +		_vm->_sound->command(34); +		break; + +	case 112: +		_vm->_sound->command(38); +		break; + +	case 113: +		_vm->_sound->command(5); +		if (_globals[kPlayerIsSeal]) +			_vm->_sound->command(35); +		else +			_vm->_sound->command(36); +		break; + +	case 114: +		_vm->_sound->command(36); +		break; + +	case 115: +		_vm->_sound->command(39); +		break; + +	case 116: +		_vm->_sound->command(40); +		break; + +	case 117: +		_vm->_sound->command(35); +		break; + +	case 119: +		_vm->_sound->command(41); +		break; + +	case 120: +		_vm->_sound->command(46); +		break; + +	default: +		_vm->_sound->command(16); +		break; +	} +} + +void Scene1xx::setPlayerSpritesPrefix() { +	int darkSceneFl = false; +	int noPlayerFl = false; + +	_vm->_sound->command(5); +	Common::String oldName = _game._player._spritesPrefix; + +	_globals[kPerformDisplacements] = true; + +	switch (_scene->_nextSceneId) { +	case 106: +		if (_scene->_currentSceneId == 120) +			noPlayerFl = true; +		break; + +	case 108: +	case 109: +	case 114: +	case 115: +		darkSceneFl = true; +		break; + +	case 111: +	case 112: +	case 117: +	case 120: +	case 119: +		noPlayerFl = true; +		break; + +	case 113: +		if (!_globals[kPlayerPersona]) +			noPlayerFl = true; +		darkSceneFl = true; +		break; +	} + +	if (noPlayerFl || _globals[kNoLoadWalker]) { +		_game._player._spritesPrefix = ""; +	} else if (!_game._player._forcePrefix) { +		if (!_globals[kPlayerPersona] || _scene->_nextSceneId == 108 || _scene->_nextSceneId == 109) { +			if (_scene->_nextSceneId == 113 || _scene->_nextSceneId == 114 || _scene->_nextSceneId == 115 || _scene->_nextSceneId == 116) +				_game._player._spritesPrefix = "PD"; +			else +				_game._player._spritesPrefix = "KG"; +		} else +			_game._player._spritesPrefix = "PD"; + +		if (darkSceneFl) +			_game._player._spritesPrefix += "D"; +	} + +	if (oldName != _game._player._spritesPrefix) +		_game._player._spritesChanged = true; + +	_game._player._scalingVelocity = true; +} + +/*------------------------------------------------------------------------*/ + +} // End of namespace Dragonsphere +} // End of namespace MADS diff --git a/engines/mads/dragonsphere/dragonsphere_scenes1.h b/engines/mads/dragonsphere/dragonsphere_scenes1.h new file mode 100644 index 0000000000..4194845975 --- /dev/null +++ b/engines/mads/dragonsphere/dragonsphere_scenes1.h @@ -0,0 +1,59 @@ +/* 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 MADS_DRAGON_SCENES1_H +#define MADS_DRAGON_SCENES1_H + +#include "common/scummsys.h" +#include "common/serializer.h" +#include "mads/game.h" +#include "mads/scene.h" +#include "mads/dragonsphere/dragonsphere_scenes.h" + +namespace MADS { + +namespace Dragonsphere { + +class Scene1xx : public DragonsphereScene { +protected: +	/** +	 * Plays an appropriate sound when entering a scene +	 */ +	void sceneEntrySound(); + +	/** +	 *Sets the AA file to use for the scene +	 */ +	void setAAName(); + +	/** +	 * Updates the prefix used for getting player sprites for the scene +	 */ +	void setPlayerSpritesPrefix(); +public: +	Scene1xx(MADSEngine *vm) : DragonsphereScene(vm) {} +}; + +} // End of namespace Dragonsphere +} // End of namespace MADS + +#endif /* MADS_DRAGON_SCENES1_H */ diff --git a/engines/mads/dragonsphere/game_dragonsphere.cpp b/engines/mads/dragonsphere/game_dragonsphere.cpp index b07eab9daa..f528056a54 100644 --- a/engines/mads/dragonsphere/game_dragonsphere.cpp +++ b/engines/mads/dragonsphere/game_dragonsphere.cpp @@ -28,7 +28,7 @@  #include "mads/msurface.h"  #include "mads/dragonsphere/game_dragonsphere.h"  //#include "mads/nebular/dialogs_nebular.h" -//#include "mads/nebular/globals_nebular.h" +#include "mads/dragonsphere/globals_dragonsphere.h"  #include "mads/dragonsphere/dragonsphere_scenes.h"  namespace MADS { diff --git a/engines/mads/dragonsphere/game_dragonsphere.h b/engines/mads/dragonsphere/game_dragonsphere.h index b57f8833c6..290c38d29e 100644 --- a/engines/mads/dragonsphere/game_dragonsphere.h +++ b/engines/mads/dragonsphere/game_dragonsphere.h @@ -26,7 +26,7 @@  #include "common/scummsys.h"  #include "mads/game.h"  #include "mads/globals.h" -//#include "mads/nebular/globals_nebular.h" +#include "mads/dragonsphere/globals_dragonsphere.h"  namespace MADS { @@ -88,15 +88,6 @@ enum InventoryObject {  	OBJ_NEW_BUNDLE = 48  }; -// HACK: A stub for now, remove from here once it's implemented properly -class DragonsphereGlobals : public Globals { -public: -	DragonsphereGlobals() { -		resize(210);	// Rex has 210 globals -	} -	virtual ~DragonsphereGlobals() {} -}; -  class GameDragonsphere : public Game {  	friend class Game;  protected: diff --git a/engines/mads/dragonsphere/globals_dragonsphere.cpp b/engines/mads/dragonsphere/globals_dragonsphere.cpp new file mode 100644 index 0000000000..fa05ed97c2 --- /dev/null +++ b/engines/mads/dragonsphere/globals_dragonsphere.cpp @@ -0,0 +1,51 @@ +/* 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. + * + */ + +#include "common/scummsys.h" +#include "common/config-manager.h" +#include "mads/dragonsphere/globals_dragonsphere.h" + +namespace MADS { + +namespace Dragonsphere { + +DragonsphereGlobals::DragonsphereGlobals() +	: Globals() { +	// Initialize lists +	resize(140); +	_spriteIndexes.resize(30); +	_sequenceIndexes.resize(30); +	_animationIndexes.resize(30); +} + +void DragonsphereGlobals::synchronize(Common::Serializer &s) { +	Globals::synchronize(s); + +	_spriteIndexes.synchronize(s); +	_sequenceIndexes.synchronize(s); +	_animationIndexes.synchronize(s); +} + + +} // End of namespace Dragonsphere + +} // End of namespace MADS diff --git a/engines/mads/dragonsphere/globals_dragonsphere.h b/engines/mads/dragonsphere/globals_dragonsphere.h new file mode 100644 index 0000000000..cc0e42eb43 --- /dev/null +++ b/engines/mads/dragonsphere/globals_dragonsphere.h @@ -0,0 +1,184 @@ +/* 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 MADS_GLOBALS_DRAGONSPHERE_H +#define MADS_GLOBALS_DRAGONSPHERE_H + +#include "common/scummsys.h" +#include "common/array.h" +#include "mads/game.h" +#include "mads/resources.h" + +namespace MADS { + +namespace Dragonsphere { + +enum GlobalId { +	// Global variables + +	kWalkerTiming           = 0, +	kWalkerTiming2			= 1, +	kPlayerPersona = 10, +	kPlayerScore = 11, +	kDragonHighScene = 12, +	kDragonMyScene = 13, +	kNoLoadWalker = 14, +	kPlayerScoreFlags = 15, +	kSorcerorDefeated = 16, +	kPreRoom = 17, +	kPerformDisplacements = 18, + +	kKingStatus = 20, +	kWardStatus = 21, +	kTalkedToSoptus = 22, +	kTalkedToShifter = 23, +	kAmuletStatus = 24, +	kBooksStatus = 25, +	kTapestryStatus = 26, +	kTalkedToMerchant = 27, +	kCanViewCrownHole = 28, +	kTalkedToStatus = 29, + +	kGuardPidStatus = 30, +	kCrawledOutOfBed101 = 31, +	kStatueIsOnStairway114 = 32, +	kDogIsAsleep = 33, +	kCrystalBallDead = 34, +	kThrewBone = 35, +	kWoodenDoorOpen = 36, +	kKingIsInStairwell = 37, +	kLlanieStatus = 38, +	kNoTalkToGuard = 39, + +	kObjectGiven201 = 40, +	kKingGotStabbed = 41, +	kGivenObjectBefore = 42, +	kGuardsAreAsleep = 43, +	kDomeUp = 44, +	kTalkedToWise = 45, +	kDollGiven = 46, +	kResetConv = 47, +	kTalkedToGreta = 48, +	kSlimeHealed = 49, + +	kDanceMusicOn = 50, +	kPlayerIsSeal = 51, +	kVinesHavePlayer = 52, +	kEndOfGame = 53, +	kResetConv2 = 54, +	kInvokedFrom111 = 55, + +	kSaveWinsInDesert = 60, +	kBubblesUpIn301 = 61, +	kBubbleWontAttack = 62, +	kPidLookedAtDoll = 63, + +	kOasis = 80, +	kFireHoles = 81, +	kDesertRoom = 82, +	kFromDirection = 83, +	kDesertCounter = 84, +	kMoveDirection409 = 85, +	kHealVerbsVisible = 86, +	kGrapesHaveGrown = 87, +	kPidTalkShamon = 88, +	kPidJustDied = 89, + +	kGrapesAreDead = 90, +	kRocIsChewingDates = 91, +	kWinsInDesert = 92, +	kWinsTillPrize = 93, +	kPidHasBeenHealedSop = 94, +	kGamePoints = 95, +	kDancePoints = 96, +	kCluePoints = 97, +	kPrizesOwedToPlayer = 98, +	kObjectFlags = 99, + +	kWaterfallDiverted = 100, +	kShakStatus = 101, +	kMaxGridValue = 102, +	kMoveDirection510 = 103, +	kShak506Angry = 104, +	kMonsterIsDead = 105, +	kDoneTalkingLani502 = 106, +	kFoundLani504 = 107, +	kSaidUseSwordShak = 108, +	kGobletFilledSoporific = 109, + +	kBeenIn504AsPid = 110, +	kSeenLaniDeadFirstTime = 111, +	kSaidPoemIn504 = 112, +	kTriedToHealLlanie504 = 113, +	kPutBundleOnLlanie504 = 114, +	kMake504Empty = 115, +	kHasTakenMud = 116, +	kPlatformClicked606 = 117, +	kHadSpiritBundle = 118, + +	kMudIsInEye603 = 120, +	kRopeIsAlive = 121, +	kRatCageIsOpen = 122, +	kFlaskOnPlate = 123, +	kFluidIsDripping = 124, +	kHoleIsIn607 = 125, +	kRopeIsHangingIn607 = 126, +	kObjectIsInFreezer605 = 127, +	kObjectImitated = 128, +	kHasRed = 129, + +	kHasYellow = 130, +	kHasBlue = 131, +	kWizardDead = 132, +	kVineWillGrab = 133, +	kFloorIsCool = 134, +	kRatMelted = 135, +	kDoorIsCool = 136, +	kUsedElevator = 137, +	kBeenOnTopFloor = 138, +	kTorchIsIn609 = 139, + +	kGridPosition = 140 +	}; + +class DragonsphereGlobals : public Globals { +public: +	SynchronizedList _spriteIndexes; +	SynchronizedList _sequenceIndexes; +	SynchronizedList _animationIndexes; +public: +	/** +	 * Constructor +	 */ +	DragonsphereGlobals(); + +	/** +	* Synchronize the globals data +	*/ +	virtual void synchronize(Common::Serializer &s); +}; + +} // End of namespace Dragonsphere + +} // End of namespace MADS + +#endif /* MADS_GLOBALS_DRAGONSPHERE_H */ diff --git a/engines/mads/module.mk b/engines/mads/module.mk index 3bd9ef5f1f..998e09bd08 100644 --- a/engines/mads/module.mk +++ b/engines/mads/module.mk @@ -3,6 +3,8 @@ MODULE := engines/mads  MODULE_OBJS := \  	dragonsphere/game_dragonsphere.o \  	dragonsphere/dragonsphere_scenes.o \ +	dragonsphere/dragonsphere_scenes1.o \ +	dragonsphere/globals_dragonsphere.o \  	phantom/game_phantom.o \  	phantom/globals_phantom.o \  	phantom/phantom_scenes.o \  | 
