ScummVM API documentation
adl_v2.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef ADL_ADL_V2_H
23#define ADL_ADL_V2_H
24
25#include "adl/adl.h"
26
27namespace Adl {
28
29class AdlEngine_v2 : public AdlEngine {
30public:
31 ~AdlEngine_v2() override;
32
33protected:
34 AdlEngine_v2(OSystem *syst, const AdlGameDescription *gd);
35
36 // AdlEngine
37 void setupOpcodeTables() override;
38 void initState() override;
39 byte roomArg(byte room) const override;
40 void advanceClock() override;
41 void printString(const Common::String &str) override;
42 Common::String loadMessage(uint idx) const override;
43 void drawItems() override;
44 void drawItem(Item &item, const Common::Point &pos) override;
45 void loadRoom(byte roomNr) override;
46 void showRoom() override;
47 void takeItem(byte noun) override;
48
49 // Engine
50 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
51
52 void mapExeStrings(const Common::StringArray &strings);
53 void insertDisk(byte volume);
54 virtual Common::DataBlockPtr readDataBlockPtr(Common::ReadStream &f) const;
55 virtual void adjustDataBlockPtr(byte &track, byte &sector, byte &offset, byte &size) const { }
56 void loadItems(Common::ReadStream &stream);
57 void loadRooms(Common::ReadStream &stream, byte count);
58 void loadMessages(Common::ReadStream &stream, byte count);
59 void loadPictures(Common::ReadStream &stream);
60 void loadItemPictures(Common::ReadStream &stream, byte count);
61 virtual bool isInventoryFull() { return false; }
62 int askForSlot(const Common::String &question);
63
64 void checkTextOverflow(char c);
65 void handleTextOverflow();
66
67 virtual int o_isFirstTime(ScriptEnv &e);
68 virtual int o_isRandomGT(ScriptEnv &e);
69 virtual int o_isNounNotInRoom(ScriptEnv &e);
70 virtual int o_isCarryingSomething(ScriptEnv &e);
71
72 int o_moveItem(ScriptEnv &e) override;
73 int o_setCurPic(ScriptEnv &e) override;
74 int o_setPic(ScriptEnv &e) override;
75 virtual int o_moveAllItems(ScriptEnv &e);
76 int o_save(ScriptEnv &e) override;
77 int o_restore(ScriptEnv &e) override ;
78 int o_placeItem(ScriptEnv &e) override;
79 virtual int o_tellTime(ScriptEnv &e);
80 virtual int o_setRoomFromVar(ScriptEnv &e);
81 virtual int o_initDisk(ScriptEnv &e);
82
83 struct {
84 Common::String time;
85 Common::String saveInsert, saveReplace;
86 Common::String restoreInsert, restoreReplace;
87 } _strings_v2;
88
89 uint _maxLines;
90 Common::DiskImage *_disk;
91 byte _currentVolume;
93 bool _itemRemoved;
94 byte _roomOnScreen, _picOnScreen, _itemsOnScreen;
95 Common::Array<byte> _brokenRooms;
96};
97
98} // End of namespace Adl
99
100#endif
Definition: adl_v2.h:29
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: adl.h:252
Definition: disk_image.h:110
Definition: stream.h:385
Definition: str.h:59
Definition: ustr.h:57
Definition: system.h:166
Definition: detection.h:71
Definition: adl.h:169
Definition: rect.h:144