From 73b8dfe5ce54232080ba7e425dc877fd4854e1a0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 29 Apr 2016 22:22:20 +0200 Subject: SCUMM HE: Initial code for Moonbase-specific class --- engines/scumm/he/intern_he.h | 6 ++++ engines/scumm/he/logic/moonbase_logic.cpp | 14 +++++---- engines/scumm/he/moonbase/moonbase.cpp | 40 ++++++++++++++++++++++++++ engines/scumm/he/moonbase/moonbase.h | 47 +++++++++++++++++++++++++++++++ engines/scumm/he/wiz_he.cpp | 8 ++++++ 5 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 engines/scumm/he/moonbase/moonbase.cpp create mode 100644 engines/scumm/he/moonbase/moonbase.h (limited to 'engines/scumm/he') 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)); } } -- cgit v1.2.3