diff options
| author | Eugene Sandulenko | 2016-04-29 22:22:20 +0200 | 
|---|---|---|
| committer | Eugene Sandulenko | 2016-04-29 22:22:20 +0200 | 
| commit | 73b8dfe5ce54232080ba7e425dc877fd4854e1a0 (patch) | |
| tree | e803bc1bb377f1041a9226630f5eb6a149c51ea4 | |
| parent | 91a91309bf80cefc7730e5bec7f948a111428152 (diff) | |
| download | scummvm-rg350-73b8dfe5ce54232080ba7e425dc877fd4854e1a0.tar.gz scummvm-rg350-73b8dfe5ce54232080ba7e425dc877fd4854e1a0.tar.bz2 scummvm-rg350-73b8dfe5ce54232080ba7e425dc877fd4854e1a0.zip  | |
SCUMM HE: Initial code for Moonbase-specific class
| -rw-r--r-- | engines/scumm/he/intern_he.h | 6 | ||||
| -rw-r--r-- | engines/scumm/he/logic/moonbase_logic.cpp | 14 | ||||
| -rw-r--r-- | engines/scumm/he/moonbase/moonbase.cpp | 40 | ||||
| -rw-r--r-- | engines/scumm/he/moonbase/moonbase.h | 47 | ||||
| -rw-r--r-- | engines/scumm/he/wiz_he.cpp | 8 | ||||
| -rw-r--r-- | engines/scumm/module.mk | 3 | ||||
| -rw-r--r-- | engines/scumm/scumm.cpp | 9 | 
7 files changed, 120 insertions, 7 deletions
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index 370f54c1d8..a8d7e846a2 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -27,6 +27,8 @@  #ifdef ENABLE_HE  #include "scumm/he/floodfill_he.h"  #include "scumm/he/wiz_he.h" + +#include "scumm/he/moonbase/moonbase.h"  #endif  #include "scumm/actor_he.h"	// For AuxBlock & AuxEntry @@ -244,6 +246,10 @@ public:  	void queueAuxEntry(int actorNum, int subIndex);  	void remapHEPalette(const uint8 *src, uint8 *dst); + +public: +	/* Moonbase stuff */ +	Moonbase *_moonbase;  };  class ScummEngine_v72he : public ScummEngine_v71he { diff --git a/engines/scumm/he/logic/moonbase_logic.cpp b/engines/scumm/he/logic/moonbase_logic.cpp index 3fcf30d6b5..22b0b186e6 100644 --- a/engines/scumm/he/logic/moonbase_logic.cpp +++ b/engines/scumm/he/logic/moonbase_logic.cpp @@ -42,9 +42,10 @@ private:  	void op_load_multi_channel_wiz(int op, int numArgs, int32 *args);  	void op_wiz_from_multi_channel_wiz(int op, int numArgs, int32 *args);  	void op_dos_command(int op, int numArgs, int32 *args); -	void op_set_fow_sentinel(int op, int numArgs, int32 *args); +	void op_set_fow_sentinel(int32 *args);  	void op_set_fow_information(int op, int numArgs, int32 *args);  	void op_set_fow_image(int op, int numArgs, int32 *args); +  	void op_ai_test_kludge(int op, int numArgs, int32 *args);  	void op_ai_master_control_program(int op, int numArgs, int32 *args);  	void op_ai_reset(int op, int numArgs, int32 *args); @@ -90,7 +91,7 @@ int32 LogicHEmoonbase::dispatch(int op, int numArgs, int32 *args) {  		op_dos_command(op, numArgs, args);  		break;  	case OP_SET_FOW_SENTINEL: -		op_set_fow_sentinel(op, numArgs, args); +		op_set_fow_sentinel(args);  		break;  	case OP_SET_FOW_INFORMATION:  		op_set_fow_information(op, numArgs, args); @@ -142,9 +143,12 @@ void LogicHEmoonbase::op_dos_command(int op, int numArgs, int32 *args) {  	LogicHE::dispatch(op, numArgs, args);  } -void LogicHEmoonbase::op_set_fow_sentinel(int op, int numArgs, int32 *args) { -	warning("STUB: op_set_fow_sentinel()"); -	LogicHE::dispatch(op, numArgs, args); +void LogicHEmoonbase::op_set_fow_sentinel(int32 *args) { +	debug(2, "op_set_fow_sentinel(%d, %d, %d)", args[0], args[1], args[2]); + +	_vm->_moonbase->_fowSentinelImage = args[0]; +	_vm->_moonbase->_fowSentinelState = args[1]; +	_vm->_moonbase->_fowSentinelConditionBits = args[2];  }  void LogicHEmoonbase::op_set_fow_information(int op, int numArgs, int32 *args) { diff --git a/engines/scumm/he/moonbase/moonbase.cpp b/engines/scumm/he/moonbase/moonbase.cpp new file mode 100644 index 0000000000..1319f5670f --- /dev/null +++ b/engines/scumm/he/moonbase/moonbase.cpp @@ -0,0 +1,40 @@ +/* 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 "scumm/he/intern_he.h" + +namespace Scumm { + +Moonbase::Moonbase() { +	_fowSentinelImage = -1; +	_fowSentinelState = -1; +	_fowSentinelConditionBits = 0; +} + +Moonbase::~Moonbase() { +} + +void Moonbase::renderFOW() { +	warning("STUB: renderFOW()"); +} + +} // End of namespace Scumm diff --git a/engines/scumm/he/moonbase/moonbase.h b/engines/scumm/he/moonbase/moonbase.h new file mode 100644 index 0000000000..0fa6b4298d --- /dev/null +++ b/engines/scumm/he/moonbase/moonbase.h @@ -0,0 +1,47 @@ +/* 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 SCUMM_HE_MOONBASE_H +#define SCUMM_HE_MOONBASE_H + +#ifdef ENABLE_HE + +namespace Scumm { + +class Moonbase { +public: +	Moonbase(); +	~Moonbase(); + +	void renderFOW(); + +public: +	int _fowSentinelImage; +	int _fowSentinelState; +	uint16 _fowSentinelConditionBits; +}; + +#endif + +} // End of namespace Scumm + +#endif diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index 5cd07f286b..3abadc7cdd 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -2116,6 +2116,14 @@ void Wiz::displayWizComplexImage(const WizParameters *params) {  			if (flags & kWIFIsPolygon) {  				drawWizPolygon(params->img.resNum, state, po_x, flags, shadow, dstResNum, palette);  			} else { +				if (_vm->_game.id == GID_MOONBASE) { +					if (params->img.resNum == _vm->_moonbase->_fowSentinelImage && +							state == _vm->_moonbase->_fowSentinelState && +							params->conditionBits == _vm->_moonbase->_fowSentinelConditionBits) +						_vm->_moonbase->renderFOW(); +				} + +  				drawWizImage(params->img.resNum, state, 0, 0, po_x, po_y, params->img.zorder, shadow, zbuffer, r, flags, dstResNum, _vm->getHEPaletteSlot(palette));  			}  		} diff --git a/engines/scumm/module.mk b/engines/scumm/module.mk index c348191e75..5462ad3090 100644 --- a/engines/scumm/module.mk +++ b/engines/scumm/module.mk @@ -138,7 +138,8 @@ MODULE_OBJS += \  	he/logic/funshop.o \  	he/logic/moonbase_logic.o \  	he/logic/puttrace.o \ -	he/logic/soccer.o +	he/logic/soccer.o \ +	he/moonbase/moonbase.o  endif  # This module can be built as a plugin diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index e7118616ba..746e74d33d 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -733,7 +733,7 @@ ScummEngine_v0::ScummEngine_v0(OSystem *syst, const DetectorResult &dr)  	VAR_ACTIVE_VERB = 0xFF;  	if (strcmp(dr.fp.pattern, "maniacdemo.d64") == 0 ) -		_game.features |= GF_DEMO;  +		_game.features |= GF_DEMO;  }  ScummEngine_v6::ScummEngine_v6(OSystem *syst, const DetectorResult &dr) @@ -832,9 +832,16 @@ ScummEngine_v71he::ScummEngine_v71he(OSystem *syst, const DetectorResult &dr)  	_skipProcessActors = 0;  	VAR_WIZ_TCOLOR = 0xFF; + +	/* Moonbase stuff */ +	_moonbase = 0; + +	if (_game.id == GID_MOONBASE) +		_moonbase = new Moonbase();  }  ScummEngine_v71he::~ScummEngine_v71he() { +	delete _moonbase;  	delete _wiz;  }  | 
