2016-03-18 15:40:36 +01:00
|
|
|
/* 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_V2_H
|
|
|
|
#define ADL_ADL_V2_H
|
|
|
|
|
|
|
|
#include "adl/adl.h"
|
|
|
|
|
2016-06-06 20:20:46 +02:00
|
|
|
namespace Common {
|
2016-03-18 23:19:54 +01:00
|
|
|
class RandomSource;
|
|
|
|
}
|
|
|
|
|
2016-03-18 15:40:36 +01:00
|
|
|
namespace Adl {
|
|
|
|
|
|
|
|
class AdlEngine_v2 : public AdlEngine {
|
|
|
|
public:
|
2016-03-18 23:19:54 +01:00
|
|
|
virtual ~AdlEngine_v2();
|
2016-03-18 15:40:36 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
AdlEngine_v2(OSystem *syst, const AdlGameDescription *gd);
|
|
|
|
|
2016-03-20 07:56:53 +01:00
|
|
|
// AdlEngine
|
2016-03-18 15:40:36 +01:00
|
|
|
virtual void setupOpcodeTables();
|
2016-04-10 15:20:17 +02:00
|
|
|
virtual void initState();
|
2016-03-19 14:40:39 +01:00
|
|
|
byte roomArg(byte room) const;
|
2016-03-20 07:56:53 +01:00
|
|
|
void advanceClock();
|
2016-04-10 14:27:51 +02:00
|
|
|
virtual void printString(const Common::String &str);
|
|
|
|
virtual Common::String loadMessage(uint idx) const;
|
2016-04-03 19:26:34 +02:00
|
|
|
void drawItems();
|
|
|
|
void drawItem(Item &item, const Common::Point &pos);
|
2016-04-03 12:30:18 +02:00
|
|
|
void loadRoom(byte roomNr);
|
2016-04-11 21:24:24 +02:00
|
|
|
virtual void showRoom();
|
2016-04-03 19:26:34 +02:00
|
|
|
void takeItem(byte noun);
|
2016-04-03 12:30:18 +02:00
|
|
|
|
2016-04-17 14:07:52 +02:00
|
|
|
virtual DataBlockPtr readDataBlockPtr(Common::ReadStream &f) const;
|
2016-08-27 20:20:29 +02:00
|
|
|
virtual void adjustDataBlockPtr(byte &track, byte §or, byte &offset, byte &size) const { }
|
|
|
|
void loadItems(Common::SeekableReadStream &stream);
|
2016-08-28 01:13:15 +02:00
|
|
|
void loadRooms(Common::SeekableReadStream &stream, byte count);
|
2016-03-20 07:56:53 +01:00
|
|
|
|
|
|
|
void checkTextOverflow(char c);
|
2016-03-18 15:40:36 +01:00
|
|
|
|
2016-03-18 22:52:22 +01:00
|
|
|
int o2_isFirstTime(ScriptEnv &e);
|
2016-03-18 23:19:54 +01:00
|
|
|
int o2_isRandomGT(ScriptEnv &e);
|
2016-03-18 22:52:22 +01:00
|
|
|
int o2_isNounNotInRoom(ScriptEnv &e);
|
2016-03-19 00:13:21 +01:00
|
|
|
int o2_isCarryingSomething(ScriptEnv &e);
|
2016-03-20 07:56:53 +01:00
|
|
|
|
|
|
|
int o2_moveItem(ScriptEnv &e);
|
2016-08-21 12:27:45 +02:00
|
|
|
int o2_setCurPic(ScriptEnv &e);
|
|
|
|
int o2_setPic(ScriptEnv &e);
|
2016-03-19 14:18:01 +01:00
|
|
|
int o2_moveAllItems(ScriptEnv &e);
|
2016-03-20 11:48:07 +01:00
|
|
|
int o2_save(ScriptEnv &e);
|
|
|
|
int o2_restore(ScriptEnv &e);
|
2016-03-19 14:18:01 +01:00
|
|
|
int o2_placeItem(ScriptEnv &e);
|
2016-03-20 07:56:53 +01:00
|
|
|
int o2_tellTime(ScriptEnv &e);
|
2016-03-20 08:29:46 +01:00
|
|
|
int o2_setRoomFromVar(ScriptEnv &e);
|
2016-03-20 08:43:00 +01:00
|
|
|
int o2_initDisk(ScriptEnv &e);
|
2016-03-18 15:40:36 +01:00
|
|
|
|
2016-03-20 07:56:53 +01:00
|
|
|
struct {
|
|
|
|
Common::String time;
|
2016-03-20 11:48:07 +01:00
|
|
|
Common::String saveInsert, saveReplace;
|
|
|
|
Common::String restoreInsert, restoreReplace;
|
2016-03-20 07:56:53 +01:00
|
|
|
} _strings_v2;
|
|
|
|
|
|
|
|
uint _linesPrinted;
|
2016-04-03 12:26:26 +02:00
|
|
|
DiskImage *_disk;
|
2016-04-03 12:30:18 +02:00
|
|
|
Common::Array<DataBlockPtr> _itemPics;
|
2016-04-03 19:26:34 +02:00
|
|
|
bool _itemRemoved;
|
|
|
|
byte _roomOnScreen, _picOnScreen, _itemsOnScreen;
|
2016-03-18 23:19:54 +01:00
|
|
|
|
|
|
|
private:
|
2016-03-20 11:48:07 +01:00
|
|
|
int askForSlot(const Common::String &question);
|
|
|
|
|
2016-03-18 23:19:54 +01:00
|
|
|
Common::RandomSource *_random;
|
2016-03-18 15:40:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Adl
|
|
|
|
|
|
|
|
#endif
|