diff options
| -rw-r--r-- | backends/fs/amigaos4/amigaos4-fs.cpp | 13 | ||||
| -rw-r--r-- | backends/fs/amigaos4/amigaos4-fs.h | 6 | ||||
| -rw-r--r-- | engines/avalanche/avalanche.cpp | 66 | ||||
| -rw-r--r-- | engines/avalanche/avalanche.h | 38 | ||||
| -rw-r--r-- | engines/avalanche/avalot.cpp | 14 | ||||
| -rw-r--r-- | engines/avalanche/avalot.h | 14 | ||||
| -rw-r--r-- | engines/avalanche/dialogs.cpp | 8 | ||||
| -rw-r--r-- | engines/avalanche/dialogs.h | 3 | ||||
| -rw-r--r-- | engines/avalanche/graphics.h | 1 | ||||
| -rw-r--r-- | engines/fullpipe/constants.h | 15 | ||||
| -rw-r--r-- | engines/fullpipe/modal.h | 12 | ||||
| -rw-r--r-- | engines/fullpipe/module.mk | 1 | ||||
| -rw-r--r-- | engines/fullpipe/scenes.cpp | 34 | ||||
| -rw-r--r-- | engines/fullpipe/scenes.h | 33 | ||||
| -rw-r--r-- | engines/fullpipe/scenes/scene38.cpp | 114 | ||||
| -rw-r--r-- | engines/fullpipe/scenes/sceneFinal.cpp | 174 | ||||
| -rw-r--r-- | engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp | 4 | ||||
| -rw-r--r-- | engines/wintermute/video/video_theora_player.cpp | 4 | 
18 files changed, 322 insertions, 232 deletions
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp index 6d713f10be..bd8bf1978a 100644 --- a/backends/fs/amigaos4/amigaos4-fs.cpp +++ b/backends/fs/amigaos4/amigaos4-fs.cpp @@ -81,6 +81,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {  	_sDisplayName = ::lastPathComponent(_sPath);  	_pFileLock = 0;  	_bIsDirectory = false; +	_bIsValid = false;  	// Check whether the node exists and if it is a directory  	struct ExamineData * pExd = IDOS->ExamineObjectTags(EX_StringNameInput,_sPath.c_str(),TAG_END); @@ -305,12 +306,6 @@ bool AmigaOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b  AbstractFSNode *AmigaOSFilesystemNode::getParent() const {  	ENTER(); -	if (!_bIsDirectory) { -		debug(6, "Not a directory"); -		LEAVE(); -		return 0; -	} -  	if (_pFileLock == 0) {  		debug(6, "Root node");  		LEAVE(); @@ -332,6 +327,9 @@ AbstractFSNode *AmigaOSFilesystemNode::getParent() const {  }  bool AmigaOSFilesystemNode::isReadable() const { +	if (!_bIsValid) +		return false; +  	// Regular RWED protection flags are low-active or inverted, thus the negation.  	// moreover pseudo root filesystem (null _pFileLock) is readable whatever the  	// protection says @@ -341,6 +339,9 @@ bool AmigaOSFilesystemNode::isReadable() const {  }  bool AmigaOSFilesystemNode::isWritable() const { +	if (!_bIsValid) +		return false; +  	// Regular RWED protection flags are low-active or inverted, thus the negation.  	// moreover pseudo root filesystem (null _pFileLock) is never writable whatever  	// the protection says (because of the pseudo nature) diff --git a/backends/fs/amigaos4/amigaos4-fs.h b/backends/fs/amigaos4/amigaos4-fs.h index c5ca61476f..7ce9981479 100644 --- a/backends/fs/amigaos4/amigaos4-fs.h +++ b/backends/fs/amigaos4/amigaos4-fs.h @@ -43,7 +43,13 @@   */  class AmigaOSFilesystemNode : public AbstractFSNode {  protected: +	/** +	 * The main file lock. +	 * If this is NULL but _bIsValid is true, then this Node references +	 * the virtual filesystem root. +	 */  	BPTR _pFileLock; +  	Common::String _sDisplayName;  	Common::String _sPath;  	bool _bIsDirectory; diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index dbe434cde3..a7e7be0ad3 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -532,75 +532,9 @@ Common::Error AvalancheEngine::run() {  	do {  		runAvalot(); - -#if 0 -		switch (_storage._operation) { -		case kRunShootemup: -			run("seu.avx", kJsb, kBflight, kNormal); -			break; -		case kRunDosshell: -			dosShell(); -			break; -		case kRunGhostroom: -			run("g-room.avx", kJsb, kNoBflight, kNormal); -			break; -		case kRunGolden: -			run("golden.avx", kJsb, kBflight, kMusical); -			break; -		} -#endif -  	} while (!_letMeOut && !shouldQuit());  	return Common::kNoError;  } -#if 0 -void AvalancheEngine::run(Common::String what, bool withJsb, bool withBflight, Elm how) { -	// Probably there'll be no need of this function, as all *.AVX-es will become classes. -	warning("STUB: run(%s)", what.c_str()); -} - -Common::String AvalancheEngine::elmToStr(Elm how) { -	switch (how) { -	case kNormal: -	case kMusical: -		return Common::String("jsb"); -	case kRegi: -		return Common::String("REGI"); -	case kElmpoyten: -		return Common::String("ELMPOYTEN"); -	// Useless, but silent a warning -	default: -		return Common::String(""); -	} -} - -// Same as keypressed1(). -void AvalancheEngine::flushBuffer() { -	warning("STUB: flushBuffer()"); -} - -void AvalancheEngine::dosShell() { -	warning("STUB: dosShell()"); -} - -// Needed in dos_shell(). TODO: Remove later. -Common::String AvalancheEngine::commandCom() { -	warning("STUB: commandCom()"); -	return ("STUB: commandCom()"); -} - -// Needed for run_avalot()'s errors. TODO: Remove later. -void AvalancheEngine::explain(byte error) { -	warning("STUB: explain()"); -} - -// Needed later. -void AvalancheEngine::quit() { -	cursorOn(); -} - -#endif -  } // End of namespace Avalanche diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index ef2338e629..fe13fa8d9e 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -128,43 +128,6 @@ private:  	AvalancheConsole *_console;  	Common::Platform _platform; -#if 0 -	struct { -		byte _operation; -		uint16 _skellern; -		byte _contents[1000]; -	} _storage; - -	static const int16 kRunShootemup = 1, kRunDosshell = 2, kRunGhostroom = 3, kRunGolden = 4; -	static const int16 kReset = 0; - -	static const bool kJsb = true, kNoJsb = false, kBflight = true, kNoBflight = false; - -	// From bootstrp: -	enum Elm {kNormal, kMusical, kElmpoyten, kRegi}; - -	Common::String _argsWithNoFilename; -	byte _originalMode; -	byte *_old1c; -	Common::String _segofs; -	int32 _soundcard, _speed, _baseaddr, _irq, _dma; -	bool _zoomy; - -	void run(Common::String what, bool withJsb, bool withBflight, Elm how); -	void bFlightOn(); -	void bFlightOff(); -	Common::String elmToStr(Elm how); -	bool keyPressed(); -	void flushBuffer(); -	void dosShell(); -	void bFlight(); -	Common::String commandCom(); -	void explain(byte error); -	void cursorOff(); -	void cursorOn(); -	void quit(); -#endif -  public:  	// For Thinkabout:  	static const bool kThing = true; @@ -173,7 +136,6 @@ public:  	static const char kSpludwicksOrder[3];  	static const uint16 kNotes[12]; -	static const TuneType kTune;  	bool _holdLeftMouse; diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 04fd2a8d98..6648e8d961 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -76,11 +76,6 @@ namespace Avalanche {  const char AvalancheEngine::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroom};  const uint16 AvalancheEngine::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587}; -const TuneType AvalancheEngine::kTune = { -	kPitchHigher, kPitchHigher, kPitchLower, kPitchSame, kPitchHigher, kPitchHigher, kPitchLower, kPitchHigher, kPitchHigher, kPitchHigher, -	kPitchLower, kPitchHigher, kPitchHigher, kPitchSame, kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchHigher, -	kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchSame, kPitchLower, kPitchHigher, kPitchSame, kPitchLower, kPitchHigher -};  Room AvalancheEngine::_whereIs[29] = {  	// The Lads @@ -257,13 +252,6 @@ void AvalancheEngine::init() {  			_also[i][j] = nullptr;  	} -#if 0 -	if (_vm->_enhanced->atbios) -		atkey = "f1"; -	else -		atkey = "alt-"; -#endif -  	_letMeOut = false;  	_currentMouse = 177;  	_dropsOk = true; @@ -1287,7 +1275,7 @@ void AvalancheEngine::minorRedraw() {  }  void AvalancheEngine::majorRedraw() { -	warning("STUB: major_redraw()"); +	_graphics->refreshScreen();  }  uint16 AvalancheEngine::bearing(byte whichPed) { diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h index e5b8f3d490..9afb4a7b63 100644 --- a/engines/avalanche/avalot.h +++ b/engines/avalanche/avalot.h @@ -38,9 +38,6 @@ class AvalancheEngine;  static const byte kObjectNum = 18; // always preface with a #  static const int16 kCarryLimit = 12;  // carry limit -static const int16 kNumlockCode = 32;  // Code for Num Lock -static const int16 kMouseSize = 134; -  struct PedType {  	int16 _x, _y;  	Direction _direction; @@ -59,8 +56,6 @@ struct LineType : public FieldType {  	Color _color;  }; -typedef int8 TuneType[31]; -  struct QuasipedType {  	byte   _whichPed;  	Color  _textColor; @@ -69,15 +64,6 @@ struct QuasipedType {  	People _who;  }; -#if 0 -struct Sundry { // Things which must be saved over a backtobootstrap, outside DNA. -	Common::String _qEnidFilename; -	bool _qSoundFx; -	byte _qThinks; -	bool _qThinkThing; -}; -#endif -  } // End of namespace Avalanche  #endif // AVALANCHE_AVALOT_H diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index c68ad4b002..2174df3580 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -34,6 +34,12 @@  namespace Avalanche { +const Dialogs::TuneType Dialogs::kTune = { +	kPitchHigher, kPitchHigher, kPitchLower, kPitchSame, kPitchHigher, kPitchHigher, kPitchLower, kPitchHigher, kPitchHigher, kPitchHigher, +	kPitchLower, kPitchHigher, kPitchHigher, kPitchSame, kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchHigher, +	kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchSame, kPitchLower, kPitchHigher, kPitchSame, kPitchLower, kPitchHigher +}; +  // A quasiped defines how people who aren't sprites talk. For example, quasiped  // "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.  const QuasipedType Dialogs::kQuasipeds[16] = { @@ -270,7 +276,7 @@ bool Dialogs::theyMatch(TuneType &played) {  	byte mistakes = 0;  	for (unsigned int i = 0; i < sizeof(played); i++) { -		if (played[i] != _vm->kTune[i]) +		if (played[i] != kTune[i])  			mistakes++;  	} diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h index 43e6a4fec6..defd152db5 100644 --- a/engines/avalanche/dialogs.h +++ b/engines/avalanche/dialogs.h @@ -70,6 +70,9 @@ private:  		kFontStyleItalic  	}; +	typedef int8 TuneType[31]; + +	static const TuneType kTune;  	static const int16 kHalfIconWidth = 19;  	static const QuasipedType kQuasipeds[16]; diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index ea3b621d69..636ae6fdf9 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -123,6 +123,7 @@ public:  	void removeBackup();  private: +	static const int16 kMouseSize = 134;  	static const uint16 kBackgroundWidth = kScreenWidth;  	static const byte kEgaPaletteIndex[16];  	static const byte kBackgroundHeight = 8 * 12080 / kScreenWidth; // With 640 width it's 151. diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 9e79b1c732..e25a6f464a 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -1350,6 +1350,21 @@ namespace Fullpipe {  #define QU_SC38_ENTERLIFT 2836  #define QU_SC38_EXITLIFT 2837 +// Final scene +#define ANI_FIN_COIN 5014 +#define MSG_FIN_ENDFINAL 5109 +#define MSG_FIN_GOTO2 5024 +#define MSG_FIN_GOTO3 5071 +#define MSG_FIN_GOTO4 5075 +#define MSG_FIN_STARTFINAL 5025 +#define MSG_FN4_STARTMUSIC 5356 +#define QU_FIN1_FALLCOIN 5018 +#define QU_FIN1_TAKECOIN 5023 +#define QU_FN2_DOFINAL 5066 +#define QU_FN3_DOFINAL 5072 +#define QU_FN4_DOFINAL 5108 +#define ST_FCN_NORM 5017 +  // Debug scene  #define MSG_RESTARTGAME 4767  #define PIC_SCD_1 727 diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h index af52e1b6a9..65210aaab3 100644 --- a/engines/fullpipe/modal.h +++ b/engines/fullpipe/modal.h @@ -106,6 +106,18 @@ class ModalMap : public BaseModalObject {  	PictureObject *getScenePicture();  }; +class ModalFinal : public BaseModalObject { + public: +	ModalFinal() {} +	virtual ~ModalFinal() {} + +	virtual bool pollEvent() { return true; } +	virtual bool handleMessage(ExCommand *message) { return false; } +	virtual bool init(int counterdiff) { return true; } +	virtual void update() {} +	virtual void saveload() {} +}; +  } // End of namespace Fullpipe  #endif /* FULLPIPE_MODAL_H */ diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk index d9cecf058a..f6a94de421 100644 --- a/engines/fullpipe/module.mk +++ b/engines/fullpipe/module.mk @@ -59,6 +59,7 @@ MODULE_OBJS = \  	scenes/scene36.o \  	scenes/scene37.o \  	scenes/scene38.o \ +	scenes/sceneFinal.o \  	scenes/sceneDbg.o  # This module can be built as a plugin diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 1e4a5633ea..71c8b1efb5 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -365,10 +365,6 @@ Vars::Vars() {  	scene37_soundFlipper = 0;  	scene37_dudeX = 0; -	scene38_var01 = 0; -	scene38_var02 = 0; -	scene38_var03 = 0; -	scene38_var04 = 0;  	scene38_boss = 0;  	scene38_tally = 0;  	scene38_shorty = 0; @@ -376,15 +372,19 @@ Vars::Vars() {  	scene38_dominos = 0;  	scene38_domino1 = 0;  	scene38_bottle = 0; -	scene38_var05 = 0; -	scene38_var06 = 0; -	scene38_var07 = 0; -	scene38_var08 = 0; -	scene38_var09 = 0; -	scene38_var10 = 0; -	scene38_var11 = 0; -	scene38_var12 = 0; -	scene38_var13 = 0; +	scene38_bossCounter = 0; +	scene38_lastBossAnim = 0; +	scene38_bossAnimCounter = 0; +	scene38_tallyCounter = 0; +	scene38_lastTallyAnim = 0; +	scene38_tallyAnimCounter = 0; +	scene38_shortyCounter = 0; +	scene38_lastShortyAnim = 0; +	scene38_shortyAnimCounter = 0; + +	sceneFinal_var01 = 0; +	sceneFinal_var02 = 0; +	sceneFinal_var03 = 0;  	selector = 0;  } @@ -975,7 +975,6 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {  		_updateCursorCallback = scene37_updateCursor;  		break; -#if 0  	case SC_38:  		sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_38");  		scene->preloadMovements(sceneVar); @@ -990,14 +989,13 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {  	case SC_FINAL1:  		sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_FINAL1");  		scene->preloadMovements(sceneVar); -		sceneFinal1_initScene(); +		sceneFinal_initScene();  		_behaviorManager->initBehavior(scene, sceneVar);  		scene->initObjectCursors("SC_FINAL1");  		setSceneMusicParameters(sceneVar); -		addMessageHandler(sceneHandlerFinal1, 2); -		_updateCursorCallback = sceneFinal1_updateCursor; +		addMessageHandler(sceneHandlerFinal, 2); +		_updateCursorCallback = sceneFinal_updateCursor;  		break; -#endif  	case SC_DBGMENU:  		sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_DBGMENU"); diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index b35d0eb87f..5f77f74706 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -173,6 +173,13 @@ void scene37_initScene(Scene *sc);  int sceneHandler37(ExCommand *ex);  int scene37_updateCursor(); +void scene38_initScene(Scene *sc); +int sceneHandler38(ExCommand *ex); + +int sceneFinal_updateCursor(); +void sceneFinal_initScene(); +int sceneHandlerFinal(ExCommand *cmd); +  void sceneDbgMenu_initScene(Scene *sc);  int sceneHandlerDbgMenu(ExCommand *cmd); @@ -516,10 +523,6 @@ public:  	int scene37_soundFlipper;  	int scene37_dudeX; -	int scene38_var01; -	int scene38_var02; -	int scene38_var03; -	int scene38_var04;  	StaticANIObject *scene38_boss;  	StaticANIObject *scene38_tally;  	StaticANIObject *scene38_shorty; @@ -527,15 +530,19 @@ public:  	StaticANIObject *scene38_dominos;  	StaticANIObject *scene38_domino1;  	StaticANIObject *scene38_bottle; -	int scene38_var05; -	int scene38_var06; -	int scene38_var07; -	int scene38_var08; -	int scene38_var09; -	int scene38_var10; -	int scene38_var11; -	int scene38_var12; -	int scene38_var13; +	int scene38_bossCounter; +	int scene38_lastBossAnim; +	int scene38_bossAnimCounter; +	int scene38_tallyCounter; +	int scene38_lastTallyAnim; +	int scene38_tallyAnimCounter; +	int scene38_shortyCounter; +	int scene38_lastShortyAnim; +	int scene38_shortyAnimCounter; + +	int sceneFinal_var01; +	int sceneFinal_var02; +	int sceneFinal_var03;  	PictureObject *selector;  }; diff --git a/engines/fullpipe/scenes/scene38.cpp b/engines/fullpipe/scenes/scene38.cpp index e6f9f6fa8c..198a88f25d 100644 --- a/engines/fullpipe/scenes/scene38.cpp +++ b/engines/fullpipe/scenes/scene38.cpp @@ -52,10 +52,6 @@ void scene38_setBottleState(Scene *sc) {  }  void scene38_initScene(Scene *sc) { -	g_vars->scene38_var01 = 200; -	g_vars->scene38_var02 = 200; -	g_vars->scene38_var03 = 300; -	g_vars->scene38_var04 = 300;  	g_vars->scene38_boss = sc->getStaticANIObject1ById(ANI_GLAVAR, -1);  	g_vars->scene38_tally = sc->getStaticANIObject1ById(ANI_DYLDA, -1);  	g_vars->scene38_shorty = sc->getStaticANIObject1ById(ANI_MALYSH, -1); @@ -63,15 +59,15 @@ void scene38_initScene(Scene *sc) {  	g_vars->scene38_dominos = sc->getStaticANIObject1ById(ANI_DOMINOS, 0);  	g_vars->scene38_domino1 = sc->getStaticANIObject1ById(ANI_DOMINO38, 1);  	g_vars->scene38_bottle = sc->getStaticANIObject1ById(ANI_BOTTLE38, 0); -	g_vars->scene38_var05 = 0; -	g_vars->scene38_var06 = 0; -	g_vars->scene38_var07 = 0; -	g_vars->scene38_var08 = 15; -	g_vars->scene38_var09 = 0; -	g_vars->scene38_var10 = 0; -	g_vars->scene38_var11 = 30; -	g_vars->scene38_var12 = 0; -	g_vars->scene38_var13 = 0; +	g_vars->scene38_bossCounter = 0; +	g_vars->scene38_lastBossAnim = 0; +	g_vars->scene38_bossAnimCounter = 0; +	g_vars->scene38_tallyCounter = 15; +	g_vars->scene38_lastTallyAnim = 0; +	g_vars->scene38_tallyAnimCounter = 0; +	g_vars->scene38_shortyCounter = 30; +	g_vars->scene38_lastShortyAnim = 0; +	g_vars->scene38_shortyAnimCounter = 0;  	scene38_setBottleState(sc); @@ -94,7 +90,7 @@ void sceneHandler38_tryTakeBottle() {  	g_vars->scene38_boss->changeStatics2(ST_GLV_NOHAMMER);  	g_vars->scene38_boss->startAnim(MV_GLV_LOOKMAN, 0, -1); -	g_vars->scene38_var05 = 0; +	g_vars->scene38_bossCounter = 0;  }  void sceneHandler38_postHammerKick() { @@ -104,10 +100,10 @@ void sceneHandler38_postHammerKick() {  void sceneHandler38_propose() {  	if (!g_vars->scene38_tally->_movement) {  		if (g_vars->scene38_tally->_flags & 4) { -			if (!(g_vars->scene38_tally->_flags & 2) && g_vars->scene38_var08 > 0 +			if (!(g_vars->scene38_tally->_flags & 2) && g_vars->scene38_tallyCounter > 0  				&& g_fp->_rnd->getRandomNumber(32767) < 32767) {  				chainQueue(QU_DLD_DENY, 0); -				g_vars->scene38_var08 = 0; +				g_vars->scene38_tallyCounter = 0;  			}  		}  	} @@ -115,16 +111,16 @@ void sceneHandler38_propose() {  void sceneHandler38_point() {  	if ((!g_vars->scene38_boss->_movement && ((g_vars->scene38_boss->_flags & 4) || !(g_vars->scene38_boss->_flags & 2))) -		&& g_vars->scene38_var05 > 0 +		&& g_vars->scene38_bossCounter > 0  		&& g_fp->_rnd->getRandomNumber(32767) < 32767) {  		if (g_vars->scene38_boss->_statics->_staticsId == ST_GLV_HAMMER) {  			chainQueue(QU_GLV_TOSMALL, 0); -			g_vars->scene38_var05 = 0; +			g_vars->scene38_bossCounter = 0;  		} else {  			if (g_vars->scene38_boss->_statics->_staticsId == ST_GLV_NOHAMMER)  				chainQueue(QU_GLV_TOSMALL_NOHMR, 0); -			g_vars->scene38_var05 = 0; +			g_vars->scene38_bossCounter = 0;  		}  	}  } @@ -132,11 +128,11 @@ void sceneHandler38_point() {  void sceneHandler38_hammerKick() {  	if (!g_vars->scene38_shorty->_movement) {  		if (g_vars->scene38_shorty->_flags & 4) { -			if (!(g_vars->scene38_shorty->_flags & 2) && g_vars->scene38_var11 > 1 +			if (!(g_vars->scene38_shorty->_flags & 2) && g_vars->scene38_shortyCounter > 1  				&& g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_LEFT2  				&& g_fp->_rnd->getRandomNumber(32767) < 3276) {  				chainQueue(QU_MLS_TURNR, 0); -				g_vars->scene38_var11 = 0; +				g_vars->scene38_shortyCounter = 0;  			}  		}  	} @@ -152,11 +148,11 @@ void sceneHandler38_hammerKick() {  void sceneHandler38_drink() {  	if (!g_vars->scene38_shorty->_movement) {  		if (g_vars->scene38_shorty->_flags & 4) { -			if (!(g_vars->scene38_shorty->_flags & 2) && g_vars->scene38_var11 > 0 +			if (!(g_vars->scene38_shorty->_flags & 2) && g_vars->scene38_shortyCounter > 0  				&& g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_LEFT2  				&& g_fp->_rnd->getRandomNumber(32767) < 3276) {  				chainQueue(QU_MLS_TURNR, 0); -				g_vars->scene38_var11 = 0; +				g_vars->scene38_shortyCounter = 0;  			}  		}  	} @@ -166,30 +162,30 @@ void sceneHandler38_animateAlcoholics() {  	MessageQueue *mq;  	if (g_vars->scene38_boss->_movement || !(g_vars->scene38_boss->_flags & 4) || (g_vars->scene38_boss->_flags & 2)) { -		g_vars->scene38_var05 = 0; +		g_vars->scene38_bossCounter = 0;  	} else { -		g_vars->scene38_var05++; +		g_vars->scene38_bossCounter++;  	} -	if (g_vars->scene38_var05 >= 50) { +	if (g_vars->scene38_bossCounter >= 50) {  		int bossSt = g_vars->scene38_boss->_statics->_staticsId;  		if (bossSt == ST_GLV_SLEEP2) { -			g_vars->scene38_var05 = 0; +			g_vars->scene38_bossCounter = 0;  		} else if ((g_vars->scene38_domino0->_flags & 4) && g_vars->scene38_domino0->_statics->_staticsId == ST_DMN38_6) {  			if (bossSt == ST_GLV_HAMMER) {  				chainQueue(QU_GLV_TAKEDOMINO, 1); -				g_vars->scene38_var05 = 0; +				g_vars->scene38_bossCounter = 0;  			}  			if (bossSt == ST_GLV_NOHAMMER) {  				chainQueue(QU_GLV_TAKEDOMINO_NOHMR, 1); -				g_vars->scene38_var05 = 0; +				g_vars->scene38_bossCounter = 0;  			}  		} else {  			if ((g_vars->scene38_bottle->_flags & 4) && g_vars->scene38_bottle->_statics->_staticsId == ST_BTL38_FULL && bossSt == ST_GLV_NOHAMMER) {  				chainQueue(QU_GLV_DRINKBOTTLE, 1); -				g_vars->scene38_var05 = 0; +				g_vars->scene38_bossCounter = 0;  			} else {  				int bossAnim = 0; @@ -211,14 +207,14 @@ void sceneHandler38_animateAlcoholics() {  					bossAnim = QU_GLV_HMRKICK;  				} -				if (g_vars->scene38_var06 == bossAnim) { -					g_vars->scene38_var07++; +				if (g_vars->scene38_lastBossAnim == bossAnim) { +					g_vars->scene38_bossAnimCounter++; -					if (g_vars->scene38_var07 > 2) +					if (g_vars->scene38_bossAnimCounter > 2)  						bossAnim = 0;  				} else { -					g_vars->scene38_var06 = bossAnim; -					g_vars->scene38_var07 = 1; +					g_vars->scene38_lastBossAnim = bossAnim; +					g_vars->scene38_bossAnimCounter = 1;  				}  				if (bossAnim > 0) { @@ -226,19 +222,19 @@ void sceneHandler38_animateAlcoholics() {  					mq->chain(0); -					g_vars->scene38_var05 = 0; +					g_vars->scene38_bossCounter = 0;  				}  			}  		}  	}  	if (g_vars->scene38_tally->_movement || !(g_vars->scene38_tally->_flags & 4) || (g_vars->scene38_tally->_flags & 2)) { -		g_vars->scene38_var08 = 0; +		g_vars->scene38_tallyCounter = 0;  	} else { -		g_vars->scene38_var08++; +		g_vars->scene38_tallyCounter++;  	} -	if (g_vars->scene38_var08 >= 50) { +	if (g_vars->scene38_tallyCounter >= 50) {  		int tallyAnim = 0;  		if (g_fp->_rnd->getRandomNumber(32767) >= 1310) { @@ -260,38 +256,38 @@ void sceneHandler38_animateAlcoholics() {  			}  		} -		if (g_vars->scene38_var09 == tallyAnim) { -			g_vars->scene38_var10++; +		if (g_vars->scene38_lastTallyAnim == tallyAnim) { +			g_vars->scene38_tallyAnimCounter++; -			if (g_vars->scene38_var10++ > 2) +			if (g_vars->scene38_tallyAnimCounter++ > 2)  				tallyAnim = 0;  		} else { -			g_vars->scene38_var09 = tallyAnim; -			g_vars->scene38_var10 = 1; +			g_vars->scene38_lastTallyAnim = tallyAnim; +			g_vars->scene38_tallyAnimCounter = 1;  		}  		if (tallyAnim > 0) {  			mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(tallyAnim), 0, 0);  			mq->chain(0); -			g_vars->scene38_var08 = 0; +			g_vars->scene38_tallyCounter = 0;  		}  	}  	if (g_vars->scene38_shorty->_movement || !(g_vars->scene38_shorty->_flags & 4) || (g_vars->scene38_shorty->_flags & 2)) { -		g_vars->scene38_var11 = 0; +		g_vars->scene38_shortyCounter = 0;  		return;  	} -	g_vars->scene38_var11++; +	g_vars->scene38_shortyCounter++; -	if (g_vars->scene38_var11 < 50) +	if (g_vars->scene38_shortyCounter < 50)  		return;  	int shortyAnim = 0;  	if (g_fp->_rnd->getRandomNumber(32767) >= 1310) {  		if (g_fp->_rnd->getRandomNumber(32767) >= 1310 || g_vars->scene38_shorty->_statics->_staticsId != ST_MLS_LEFT2) { -			if (g_vars->scene38_boss->_statics->_staticsId != ST_GLV_SLEEP2 && g_vars->scene38_var05 > 30 && g_fp->_rnd->getRandomNumber(32767) < 0x3FFF && g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_LEFT2) +			if (g_vars->scene38_boss->_statics->_staticsId != ST_GLV_SLEEP2 && g_vars->scene38_bossCounter > 30 && g_fp->_rnd->getRandomNumber(32767) < 0x3FFF && g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_LEFT2)  				shortyAnim = QU_MLS_HAND;  		} else {  			shortyAnim = QU_MLS_BLINK; @@ -304,13 +300,13 @@ void sceneHandler38_animateAlcoholics() {  		}  	} -	if (g_vars->scene38_var12 == shortyAnim) { -		g_vars->scene38_var13++; -		if (g_vars->scene38_var13 > 2) +	if (g_vars->scene38_lastShortyAnim == shortyAnim) { +		g_vars->scene38_shortyAnimCounter++; +		if (g_vars->scene38_shortyAnimCounter > 2)  			return;  	} else { -		g_vars->scene38_var12 = shortyAnim; -		g_vars->scene38_var13 = 1; +		g_vars->scene38_lastShortyAnim = shortyAnim; +		g_vars->scene38_shortyAnimCounter = 1;  	}  	if (shortyAnim > 0) { @@ -318,7 +314,7 @@ void sceneHandler38_animateAlcoholics() {  		mq->chain(0); -		g_vars->scene38_var11 = 0; +		g_vars->scene38_shortyCounter = 0;  	}  } @@ -391,11 +387,11 @@ int sceneHandler38(ExCommand *cmd) {  		if (g_fp->_aniMan2) {  			int x = g_fp->_aniMan2->_ox; -			if (x < g_fp->_sceneRect.left + g_vars->scene38_var01) -				g_fp->_currentScene->_x = x - g_vars->scene38_var03 - g_fp->_sceneRect.left; +			if (x < g_fp->_sceneRect.left + 200) +				g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left; -			if (x > g_fp->_sceneRect.right - g_vars->scene38_var01) -				g_fp->_currentScene->_x = x + g_vars->scene38_var03 - g_fp->_sceneRect.right; +			if (x > g_fp->_sceneRect.right - 200) +				g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;  		}  		sceneHandler38_animateAlcoholics(); diff --git a/engines/fullpipe/scenes/sceneFinal.cpp b/engines/fullpipe/scenes/sceneFinal.cpp new file mode 100644 index 0000000000..e483e8bab7 --- /dev/null +++ b/engines/fullpipe/scenes/sceneFinal.cpp @@ -0,0 +1,174 @@ +/* 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 "fullpipe/fullpipe.h" + +#include "fullpipe/objectnames.h" +#include "fullpipe/constants.h" + +#include "fullpipe/gameloader.h" +#include "fullpipe/motion.h" +#include "fullpipe/scenes.h" +#include "fullpipe/statics.h" + +#include "fullpipe/interaction.h" +#include "fullpipe/behavior.h" + +#include "fullpipe/modal.h" + + +namespace Fullpipe { + +void sceneFinal_initScene() { +	g_fp->_gameLoader->loadScene(SC_FINAL2); +	g_fp->accessScene(SC_FINAL2)->setPictureObjectsFlag4(); +	g_fp->_gameLoader->loadScene(SC_FINAL3); +	g_fp->accessScene(SC_FINAL3)->setPictureObjectsFlag4(); +	g_fp->_gameLoader->loadScene(SC_FINAL4); +	g_fp->accessScene(SC_FINAL4)->setPictureObjectsFlag4(); + +	getGameLoaderInventory()->setIsLocked(0); +	getGameLoaderInventory()->slideIn(); + +	g_fp->_updateFlag = 0; +	g_fp->_flgCanOpenMap = 0; + +	g_vars->sceneFinal_var01 = 0; +	g_vars->sceneFinal_var02 = 0; +	g_vars->sceneFinal_var03 = 0; +} + +int sceneFinal_updateCursor() { +	if (g_vars->sceneFinal_var01) +		g_fp->_cursorId = 0; +	else +		g_fp->updateCursorCommon(); + +	return g_fp->_cursorId; +} + +void sceneHandlerFinal_endFinal() { +	g_vars->sceneFinal_var01 = 0; +} + +void sceneHandlerFinal_startMusic(const char *track) { +	warning("STUB: sceneHandlerFinal_startMusic()"); +} + +void sceneHandlerFinal_goto4() { +	g_fp->_currentScene = g_fp->accessScene(SC_FINAL4); + +	g_fp->_gameLoader->loadScene(SC_FINAL4); + +	chainQueue(QU_FN4_DOFINAL, 1); +} + +void sceneHandlerFinal_goto3() { +	g_fp->_currentScene = g_fp->accessScene(SC_FINAL3); + +	chainQueue(QU_FN3_DOFINAL, 1); +} + +void sceneHandlerFinal_goto2() { +	g_fp->_currentScene = g_fp->accessScene(SC_FINAL2); + +	chainQueue(QU_FN2_DOFINAL, 1); +} + +void sceneHandlerFinal_startFinal() { +	g_vars->sceneFinal_var01 = 1; + +	getCurrSceneSc2MotionController()->clearEnabled(); +	getGameLoaderInteractionController()->disableFlag24(); + +	g_fp->_aniMan2 = 0; + +	g_fp->_aniMan->_flags &= 0xFFFB; + +	chainQueue(QU_FIN1_TAKECOIN, 1); + +	g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_FINAL1"), "MUSIC2", 1); + +	g_fp->_modalObject = new ModalFinal; +} + +void sceneHandlerFinal_fallCoin() { +	StaticANIObject *coin = g_fp->_currentScene->getStaticANIObject1ById(ANI_FIN_COIN, -1); + +	if (!coin->_movement) { +		if (!coin->_statics || coin->_statics->_staticsId != ST_FCN_NORM) +			chainQueue(QU_FIN1_FALLCOIN, 1); +	} +} + +int sceneHandlerFinal(ExCommand *cmd) { +	if (cmd->_messageKind != 17) +		return 0; + +	switch (cmd->_messageNum) { +	case MSG_FIN_ENDFINAL: +		sceneHandlerFinal_endFinal(); +		break; + +	case MSG_FN4_STARTMUSIC: +		sceneHandlerFinal_startMusic("track16.ogg"); +		break; + +	case MSG_FIN_GOTO4: +		sceneHandlerFinal_goto4(); + +		g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_FINAL1"), "MUSIC3", 1); +		break; + +	case MSG_FIN_GOTO3: +		sceneHandlerFinal_goto3(); +		break; + +	case MSG_FIN_GOTO2: +		sceneHandlerFinal_goto2(); +		break; + +	case MSG_FIN_STARTFINAL: +		sceneHandlerFinal_startFinal(); +		break; + +	case 33: +		if (g_fp->_aniMan2) { +			g_vars->sceneFinal_var03 = g_fp->_aniMan2->_ox; + +			if (g_vars->sceneFinal_var03 < 450 && g_vars->sceneFinal_var02 >= 450 ) +				sceneHandlerFinal_fallCoin(); + +			g_vars->sceneFinal_var02 = g_vars->sceneFinal_var03; +		} + +		g_fp->_behaviorManager->updateBehaviors(); + +		g_fp->startSceneTrack(); + +		break; +	} + +	return 0; +} + +} // End of namespace Fullpipe diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp index 73797f20f3..c33e8ba54b 100644 --- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp @@ -448,8 +448,8 @@ bool BaseSurfaceOSystem::drawSprite(int x, int y, Rect32 *rect, Rect32 *newRect,  bool BaseSurfaceOSystem::putSurface(const Graphics::Surface &surface, bool hasAlpha) {  	_loaded = true;  	if (surface.format == _surface->format && surface.w == _surface->w && surface.h == _surface->h) { -		const byte *src = (const byte*) surface.getBasePtr(0, 0); -		byte *dst = (byte*) _surface->getBasePtr(0, 0); +		const byte *src = (const byte *)surface.getBasePtr(0, 0); +		byte *dst = (byte *)_surface->getBasePtr(0, 0);  		memcpy(dst, src, surface.pitch * surface.h);  	} else {  		_surface->free(); diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index aedc9bf025..299b64f915 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -306,8 +306,8 @@ bool VideoTheoraPlayer::update() {  				const Graphics::Surface *decodedFrame = _theoraDecoder->decodeNextFrame();  				if (decodedFrame) {  					if (decodedFrame->format == _surface.format && decodedFrame->w == _surface.w && decodedFrame->h == _surface.h) { -						const byte *src = (const byte*) decodedFrame->getBasePtr(0, 0); -						byte *dst = (byte*) _surface.getBasePtr(0, 0); +						const byte *src = (const byte *)decodedFrame->getBasePtr(0, 0); +						byte *dst = (byte *)_surface.getBasePtr(0, 0);  						memcpy(dst, src, _surface.pitch * _surface.h);  					} else {  						_surface.free();  | 
