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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef MOHAWK_MOHAWK_H
24 #define MOHAWK_MOHAWK_H
25 
26 #include "common/scummsys.h"
27 #include "common/array.h"
28 
29 #include "engines/engine.h"
30 
31 class OSystem;
32 
33 namespace Common {
34 class SeekableReadStream;
35 }
36 
37 /**
38  * This is the namespace of the Mohawk engine.
39  *
40  * Status of this engine: ???
41  *
42  * Games using this engine:
43  * - Myst
44  * - Riven: The Sequel to Myst
45  */
46 namespace Mohawk {
47 
48 enum MohawkGameType {
49 	GType_MYST,
50 	GType_MAKINGOF,
51 	GType_RIVEN,
52 	GType_CSTIME,
53 	GType_LIVINGBOOKSV1,
54 	GType_LIVINGBOOKSV2,
55 	GType_LIVINGBOOKSV3,
56 	GType_LIVINGBOOKSV4,
57 	GType_LIVINGBOOKSV5
58 };
59 
60 enum MohawkGameFeatures {
61 	GF_ME             = (1 << 0), // Myst Masterpiece Edition
62 	GF_25TH           = (1 << 1), // Myst and Riven 25th Anniversary
63 	GF_DVD            = (1 << 2),
64 	GF_DEMO           = (1 << 3),
65 	GF_LB_10          = (1 << 4), // very early Living Books 1.0 games
66 	GF_LANGUAGE_FILES = (1 << 5)  // Myst and Riven versions using language override files
67 };
68 
69 struct MohawkGameDescription;
70 class Sound;
71 class PauseDialog;
72 class Archive;
73 class CursorManager;
74 
75 class MohawkEngine : public ::Engine {
76 protected:
77 	Common::Error run() override;
78 
79 public:
80 	MohawkEngine(OSystem *syst, const MohawkGameDescription *gamedesc);
81 	~MohawkEngine() override;
82 
83 	// Detection related functions
84 	const MohawkGameDescription *_gameDescription;
85 	const char *getGameId() const;
86 	uint32 getFeatures() const;
87 	const char *getAppName() const;
88 	Common::Platform getPlatform() const;
89 	uint8 getGameType() const;
90 	Common::Language getLanguage() const;
91 	Common::String getDatafileLanguageName(const char *prefix) const;
92 
93 	bool hasFeature(EngineFeature f) const override;
94 
95 	CursorManager *_cursor;
96 
97 	virtual Common::SeekableReadStream *getResource(uint32 tag, uint16 id);
98 	bool hasResource(uint32 tag, uint16 id);
99 	bool hasResource(uint32 tag, const Common::String &resName);
100 	uint32 getResourceOffset(uint32 tag, uint16 id);
101 	uint16 findResourceID(uint32 type, const Common::String &resName);
102 	Common::String getResourceName(uint32 tag, uint16 id);
103 
104 	void pauseGame();
105 
106 private:
107 	PauseDialog *_pauseDialog;
108 
109 protected:
110 	// An array holding the main Mohawk archives require by the games
111 	Common::Array<Archive *> _mhk;
112 };
113 
114 } // End of namespace Mohawk
115 
116 #endif
117