diff options
author | Walter van Niftrik | 2016-08-26 13:27:14 +0200 |
---|---|---|
committer | Walter van Niftrik | 2016-08-26 22:00:37 +0200 |
commit | 92cea7ab35978cae759dc5e9714ff5024919e6a1 (patch) | |
tree | 5b4660b63e9549edd4c6765912364efc6362c4a9 /engines/adl | |
parent | 1ca15d76d37a89e7a943ac93daa01f358601cf6e (diff) | |
download | scummvm-rg350-92cea7ab35978cae759dc5e9714ff5024919e6a1.tar.gz scummvm-rg350-92cea7ab35978cae759dc5e9714ff5024919e6a1.tar.bz2 scummvm-rg350-92cea7ab35978cae759dc5e9714ff5024919e6a1.zip |
ADL: Add ADL_v3 class for hires4
Diffstat (limited to 'engines/adl')
-rw-r--r-- | engines/adl/adl_v3.cpp | 58 | ||||
-rw-r--r-- | engines/adl/adl_v3.h | 45 | ||||
-rw-r--r-- | engines/adl/adl_v4.cpp | 2 | ||||
-rw-r--r-- | engines/adl/adl_v4.h | 4 | ||||
-rw-r--r-- | engines/adl/module.mk | 1 |
5 files changed, 107 insertions, 3 deletions
diff --git a/engines/adl/adl_v3.cpp b/engines/adl/adl_v3.cpp new file mode 100644 index 0000000000..2e54195db4 --- /dev/null +++ b/engines/adl/adl_v3.cpp @@ -0,0 +1,58 @@ +/* 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 "adl/adl_v3.h" + +namespace Adl { + +AdlEngine_v3::AdlEngine_v3(OSystem *syst, const AdlGameDescription *gd) : + AdlEngine_v2(syst, gd) { +} + +typedef Common::Functor1Mem<ScriptEnv &, int, AdlEngine_v3> OpcodeV3; + +void AdlEngine_v3::setupOpcodeTables() { + AdlEngine_v2::setupOpcodeTables(); + delete _condOpcodes[0x04]; + _condOpcodes[0x04] = new OpcodeV3(this, &AdlEngine_v3::o3_isNounNotInRoom); +} + +int AdlEngine_v3::o3_isNounNotInRoom(ScriptEnv &e) { + OP_DEBUG_1("\t&& NO_SUCH_ITEMS_IN_ROOM(%s)", itemRoomStr(e.arg(1)).c_str()); + + Common::List<Item>::const_iterator item; + + bool isAnItem = false; + + for (item = _state.items.begin(); item != _state.items.end(); ++item) { + if (item->noun == e.getNoun()) { + isAnItem = true; + + if (item->room == roomArg(e.arg(1))) + return -1; + } + } + + return (isAnItem ? 1 : -1); +} + +} // End of namespace Adl diff --git a/engines/adl/adl_v3.h b/engines/adl/adl_v3.h new file mode 100644 index 0000000000..097fa659ab --- /dev/null +++ b/engines/adl/adl_v3.h @@ -0,0 +1,45 @@ +/* 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 ADL_ADL_V3_H +#define ADL_ADL_V3_H + +#include "adl/adl_v2.h" + +namespace Adl { + +class AdlEngine_v3 : public AdlEngine_v2 { +public: + virtual ~AdlEngine_v3() { } + +protected: + AdlEngine_v3(OSystem *syst, const AdlGameDescription *gd); + + // AdlEngine + virtual void setupOpcodeTables(); + + int o3_isNounNotInRoom(ScriptEnv &e); +}; + +} // End of namespace Adl + +#endif diff --git a/engines/adl/adl_v4.cpp b/engines/adl/adl_v4.cpp index 42f576ef42..598f0f01ee 100644 --- a/engines/adl/adl_v4.cpp +++ b/engines/adl/adl_v4.cpp @@ -30,7 +30,7 @@ namespace Adl { AdlEngine_v4::AdlEngine_v4(OSystem *syst, const AdlGameDescription *gd) : - AdlEngine_v2(syst, gd), + AdlEngine_v3(syst, gd), _curDisk(0) { } diff --git a/engines/adl/adl_v4.h b/engines/adl/adl_v4.h index e5c7ba31ec..3a4836bc14 100644 --- a/engines/adl/adl_v4.h +++ b/engines/adl/adl_v4.h @@ -23,7 +23,7 @@ #ifndef ADL_ADL_V4_H #define ADL_ADL_V4_H -#include "adl/adl_v2.h" +#include "adl/adl_v3.h" namespace Common { class RandomSource; @@ -36,7 +36,7 @@ struct DiskOffset { namespace Adl { -class AdlEngine_v4 : public AdlEngine_v2 { +class AdlEngine_v4 : public AdlEngine_v3 { public: virtual ~AdlEngine_v4() { } diff --git a/engines/adl/module.mk b/engines/adl/module.mk index 98e1de58af..b8f6cb37c0 100644 --- a/engines/adl/module.mk +++ b/engines/adl/module.mk @@ -3,6 +3,7 @@ MODULE := engines/adl MODULE_OBJS := \ adl.o \ adl_v2.o \ + adl_v3.o \ adl_v4.o \ console.o \ detection.o \ |