ScummVM
detection.cpp
Go to the documentation of this file.
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 #include "glk/glk.h"
24 #include "glk/detection.h"
25 #include "glk/quetzal.h"
26 
27 #ifdef ENABLE_GLK_ADRIFT
28 #include "glk/adrift/detection.h"
29 #include "glk/adrift/adrift.h"
30 #endif
31 
32 #ifdef ENABLE_GLK_ADVSYS
33 #include "glk/advsys/detection.h"
34 #include "glk/advsys/advsys.h"
35 #endif
36 
37 #ifdef ENABLE_GLK_ALAN2
38 #include "glk/alan2/detection.h"
39 #include "glk/alan2/alan2.h"
40 #endif
41 
42 #ifdef ENABLE_GLK_ALAN3
43 #include "glk/alan3/detection.h"
44 #include "glk/alan3/alan3.h"
45 #endif
46 
47 #ifdef ENABLE_GLK_ARCHETYPE
50 #endif
51 
52 #ifdef ENABLE_GLK_FROTZ
53 #include "glk/frotz/detection.h"
54 #include "glk/frotz/frotz.h"
55 #endif
56 
57 #ifdef ENABLE_GLK_GLULXE
58 #include "glk/glulxe/detection.h"
59 #include "glk/glulxe/glulxe.h"
60 #endif
61 
62 #ifdef ENABLE_GLK_HUGO
63 #include "glk/hugo/detection.h"
64 #include "glk/hugo/hugo.h"
65 #endif
66 
67 #ifdef ENABLE_GLK_JACL
68 #include "glk/jacl/detection.h"
69 #include "glk/jacl/jacl.h"
70 #endif
71 
72 #ifdef ENABLE_GLK_LEVEL9
73 #include "glk/level9/detection.h"
74 #include "glk/level9/level9.h"
75 #endif
76 
77 #ifdef ENABLE_GLK_MAGNETIC
78 #include "glk/magnetic/detection.h"
79 #include "glk/magnetic/magnetic.h"
80 #endif
81 
82 #ifdef ENABLE_GLK_QUEST
83 #include "glk/quest/detection.h"
84 #include "glk/quest/quest.h"
85 #endif
86 
87 #ifdef ENABLE_GLK_SCOTT
88 #include "glk/scott/detection.h"
89 #include "glk/scott/scott.h"
90 #endif
91 
92 #ifdef ENABLE_GLK_TADS
93 #include "glk/tads/detection.h"
94 #include "glk/tads/tads2/tads2.h"
95 #include "glk/tads/tads3/tads3.h"
96 #endif
97 
98 #include "base/plugins.h"
99 #include "common/md5.h"
100 #include "common/memstream.h"
101 #include "common/savefile.h"
102 #include "common/str-array.h"
103 #include "common/system.h"
104 #include "graphics/colormasks.h"
105 #include "graphics/surface.h"
106 #include "common/config-manager.h"
107 #include "common/file.h"
108 
109 namespace Glk {
110 
111 GlkDetectedGame::GlkDetectedGame(const char *id, const char *desc, const Common::String &filename) :
112  DetectedGame("glk", id, desc, Common::EN_ANY, Common::kPlatformUnknown) {
114  addExtraEntry("filename", filename);
115 }
116 
117 GlkDetectedGame::GlkDetectedGame(const char *id, const char *desc, const Common::String &filename,
118  Common::Language lang) : DetectedGame("glk", id, desc, lang, Common::kPlatformUnknown) {
120  addExtraEntry("filename", filename);
121 }
122 
123 GlkDetectedGame::GlkDetectedGame(const char *id, const char *desc, const char *xtra,
125  DetectedGame("glk", id, desc, lang, Common::kPlatformUnknown, xtra) {
127  addExtraEntry("filename", filename);
128 }
129 
130 GlkDetectedGame::GlkDetectedGame(const char *id, const char *desc, const Common::String &filename,
131  const Common::String &md5, size_t filesize) :
132  DetectedGame("glk", id, desc, Common::UNK_LANG, Common::kPlatformUnknown) {
134  addExtraEntry("filename", filename);
135 
136  canBeAdded = true;
137  hasUnknownFiles = true;
138 
139  FileProperties fp;
140  fp.md5 = md5;
141  fp.size = filesize;
142  matchedFiles[filename] = fp;
143 }
144 
145 } // End of namespace Glk
146 
148  return
149  (f == kSupportsListSaves) ||
150  (f == kSupportsLoadingDuringStartup) ||
151  (f == kSupportsDeleteSave) ||
152  (f == kSavesSupportMetaInfo) ||
153  (f == kSavesSupportCreationDate) ||
154  (f == kSavesSupportPlayTime) ||
155  (f == kSimpleSavesNames);
156 }
157 
159  return
160  (f == kSupportsRTL) ||
161  (f == kSupportsLoadingDuringRuntime) ||
162  (f == kSupportsSavingDuringRuntime);
163 }
164 
165 template<class META, class ENG>Engine *create(OSystem *syst, Glk::GlkGameDescription &gameDesc) {
166  Glk::GameDescriptor gd = META::findGame(gameDesc._gameId.c_str());
167  if (gd._description) {
168  gameDesc._options = gd._options;
169  return new ENG(syst, gameDesc);
170  } else {
171  return nullptr;
172  }
173 }
174 
177  assert(engine);
178 
179  // Populate the game description
180  Glk::GlkGameDescription gameDesc;
181  gameDesc._gameId = ConfMan.get("gameid");
182  gameDesc._filename = ConfMan.get("filename");
183 
184  gameDesc._language = Common::UNK_LANG;
186  if (ConfMan.hasKey("language"))
187  gameDesc._language = Common::parseLanguage(ConfMan.get("language"));
188  if (ConfMan.hasKey("platform"))
189  gameDesc._platform = Common::parsePlatform(ConfMan.get("platform"));
190 
191  // If the game description has no filename, the engine has been launched directly from
192  // the command line. Do a scan for supported games for that Id in the game folder
193  if (gameDesc._filename.empty()) {
194  gameDesc._filename = findFileByGameId(gameDesc._gameId);
195  if (gameDesc._filename.empty())
197  }
198 
199  // Get the MD5
200  Common::File f;
201  if (!f.open(Common::FSNode(ConfMan.get("path")).getChild(gameDesc._filename)))
203 
204  gameDesc._md5 = Common::computeStreamMD5AsString(f, 5000);
205  f.close();
206 
207  // Create the correct engine
208  *engine = nullptr;
209 #ifdef ENABLE_GLK_ADRIFT
210  if ((*engine = create<Glk::Adrift::AdriftMetaEngine, Glk::Adrift::Adrift>(syst, gameDesc)) != nullptr) {}
211  else
212 #endif
213 #ifdef ENABLE_GLK_ADVSYS
214  if ((*engine = create<Glk::AdvSys::AdvSysMetaEngine, Glk::AdvSys::AdvSys>(syst, gameDesc)) != nullptr) {}
215  else
216 #endif
217 #ifdef ENABLE_GLK_ALAN2
218  if ((*engine = create<Glk::Alan2::Alan2MetaEngine, Glk::Alan2::Alan2>(syst, gameDesc)) != nullptr) {}
219  else
220 #endif
221 #ifdef ENABLE_GLK_ALAN3
222  if ((*engine = create<Glk::Alan3::Alan3MetaEngine, Glk::Alan3::Alan3>(syst, gameDesc)) != nullptr) {}
223  else
224 #endif
225 #ifdef ENABLE_GLK_ARCHETYPE
226  if ((*engine = create<Glk::Archetype::ArchetypeMetaEngine, Glk::Archetype::Archetype>(syst, gameDesc)) != nullptr) {}
227  else
228 #endif
229 #ifdef ENABLE_GLK_FROTZ
230  if ((*engine = create<Glk::Frotz::FrotzMetaEngine, Glk::Frotz::Frotz>(syst, gameDesc)) != nullptr) {}
231  else
232 #endif
233 #ifdef ENABLE_GLK_GLULXE
234  if ((*engine = create<Glk::Glulxe::GlulxeMetaEngine, Glk::Glulxe::Glulxe>(syst, gameDesc)) != nullptr) {}
235  else
236 #endif
237 #ifdef ENABLE_GLK_HUGO
238  if ((*engine = create<Glk::Hugo::HugoMetaEngine, Glk::Hugo::Hugo>(syst, gameDesc)) != nullptr) {}
239  else
240 #endif
241 #ifdef ENABLE_GLK_JACL
242  if ((*engine = create<Glk::JACL::JACLMetaEngine, Glk::JACL::JACL>(syst, gameDesc)) != nullptr) {}
243  else
244 #endif
245 #ifdef ENABLE_GLK_LEVEL9
246  if ((*engine = create<Glk::Level9::Level9MetaEngine, Glk::Level9::Level9>(syst, gameDesc)) != nullptr) {}
247  else
248 #endif
249 #ifdef ENABLE_GLK_MAGNETIC
250  if ((*engine = create<Glk::Magnetic::MagneticMetaEngine, Glk::Magnetic::Magnetic>(syst, gameDesc)) != nullptr) {}
251  else
252 #endif
253 #ifdef ENABLE_GLK_QUEST
254  if ((*engine = create<Glk::Quest::QuestMetaEngine, Glk::Quest::Quest>(syst, gameDesc)) != nullptr) {}
255  else
256 #endif
257 #ifdef ENABLE_GLK_SCOTT
258  if ((*engine = create<Glk::Scott::ScottMetaEngine, Glk::Scott::Scott>(syst, gameDesc)) != nullptr) {}
259  else
260 #endif
261 #ifdef ENABLE_GLK_TADS
262  if ((td = Glk::TADS::TADSMetaEngine::findGame(gameDesc._gameId.c_str()))._description) {
264  *engine = new Glk::TADS::TADS3::TADS3(syst, gameDesc);
265  else
266  *engine = new Glk::TADS::TADS2::TADS2(syst, gameDesc);
267  } else
268 #endif
269  {
271  }
272 
273  return Common::kNoError;
274 }
275 
277  // Get the list of files in the folder and return detection against them
278  Common::FSNode folder = Common::FSNode(ConfMan.get("path"));
279  Common::FSList fslist;
281 
282  // Iterate over the files
283  for (Common::FSList::iterator i = fslist.begin(); i != fslist.end(); ++i) {
284  // Run a detection on each file in the folder individually
285  Common::FSList singleList;
286  singleList.push_back(*i);
287  DetectedGames games = detectGames(singleList);
288 
289  // If a detection was found with the correct game Id, we have a winner
290  if (!games.empty() && games.front().gameId == gameId)
291  return (*i).getName();
292  }
293 
294  // No match found
295  return Common::String();
296 }
297 
300 #ifdef ENABLE_GLK_ADRIFT
302 #endif
303 #ifdef ENABLE_GLK_ADVSYS
305 #endif
306 #ifdef ENABLE_GLK_ALAN2
308 #endif
309 #ifdef ENABLE_GLK_ALAN3
311 #endif
312 #ifdef ENABLE_GLK_ARCHETYPE
314 #endif
315 #ifdef ENABLE_GLK_FROTZ
317 #endif
318 #ifdef ENABLE_GLK_GLULXE
320 #endif
321 #ifdef ENABLE_GLK_HUGO
323 #endif
324 #ifdef ENABLE_GLK_JACL
326 #endif
327 #ifdef ENABLE_GLK_LEVEL9
329 #endif
330 #ifdef ENABLE_GLK_MAGNETIC
332 #endif
333 #ifdef ENABLE_GLK_QUEST
335 #endif
336 #ifdef ENABLE_GLK_SCOTT
338 #endif
339 #ifdef ENABLE_GLK_TADS
341 #endif
342 
343  return list;
344 }
345 
346 #define FIND_GAME(SUBENGINE) \
347  Glk::GameDescriptor gd##SUBENGINE = Glk::SUBENGINE::SUBENGINE##MetaEngine::findGame(gameId); \
348  if (gd##SUBENGINE._description) return gd##SUBENGINE
349 
351 #ifdef ENABLE_GLK_ADRIFT
352  FIND_GAME(Adrift);
353 #endif
354 #ifdef ENABLE_GLK_ADVSYS
355  FIND_GAME(AdvSys);
356 #endif
357 #ifdef ENABLE_GLK_ALAN2
358  FIND_GAME(Alan2);
359 #endif
360 #ifdef ENABLE_GLK_ALAN3
361  FIND_GAME(Alan3);
362 #endif
363 #ifdef ENABLE_GLK_ARCHETYPE
364  FIND_GAME(Archetype);
365 #endif
366 #ifdef ENABLE_GLK_FROTZ
367  FIND_GAME(Frotz);
368 #endif
369 #ifdef ENABLE_GLK_GLULXE
370  FIND_GAME(Glulxe);
371 #endif
372 #ifdef ENABLE_GLK_HUGO
373  FIND_GAME(Hugo);
374 #endif
375 #ifdef ENABLE_GLK_JACL
376  FIND_GAME(JACL);
377 #endif
378 #ifdef ENABLE_GLK_LEVEL9
379  FIND_GAME(Level9);
380 #endif
381 #ifdef ENABLE_GLK_MAGNETIC
382  FIND_GAME(Magnetic);
383 #endif
384 #ifdef ENABLE_GLK_QUEST
385  FIND_GAME(Quest);
386 #endif
387 #ifdef ENABLE_GLK_SCOTT
388  FIND_GAME(Scott);
389 #endif
390 #ifdef ENABLE_GLK_TADS
391  FIND_GAME(TADS);
392 #endif
393 
394  return PlainGameDescriptor();
395 }
396 
397 #undef FIND_GAME
398 
400  // This is as good a place as any to detect multiple sub-engines using the same Ids
401  detectClashes();
402 
403  DetectedGames detectedGames;
404 #ifdef ENABLE_GLK_ADRIFT
405  Glk::Adrift::AdriftMetaEngine::detectGames(fslist, detectedGames);
406 #endif
407 #ifdef ENABLE_GLK_ADVSYS
408  Glk::AdvSys::AdvSysMetaEngine::detectGames(fslist, detectedGames);
409 #endif
410 #ifdef ENABLE_GLK_ALAN2
411  Glk::Alan2::Alan2MetaEngine::detectGames(fslist, detectedGames);
412 #endif
413 #ifdef ENABLE_GLK_ALAN3
414  Glk::Alan3::Alan3MetaEngine::detectGames(fslist, detectedGames);
415 #endif
416 #ifdef ENABLE_GLK_ARCHETYPE
418 #endif
419 #ifdef ENABLE_GLK_FROTZ
420  Glk::Frotz::FrotzMetaEngine::detectGames(fslist, detectedGames);
421 #endif
422 #ifdef ENABLE_GLK_GLULXE
423  Glk::Glulxe::GlulxeMetaEngine::detectGames(fslist, detectedGames);
424 #endif
425 #ifdef ENABLE_GLK_HUGO
426  Glk::Hugo::HugoMetaEngine::detectGames(fslist, detectedGames);
427 #endif
428 #ifdef ENABLE_GLK_JACL
429  Glk::JACL::JACLMetaEngine::detectGames(fslist, detectedGames);
430 #endif
431 #ifdef ENABLE_GLK_LEVEL9
432  Glk::Level9::Level9MetaEngine::detectGames(fslist, detectedGames);
433 #endif
434 #ifdef ENABLE_GLK_MAGNETIC
435  Glk::Magnetic::MagneticMetaEngine::detectGames(fslist, detectedGames);
436 #endif
437 #ifdef ENABLE_GLK_QUEST
438  Glk::Quest::QuestMetaEngine::detectGames(fslist, detectedGames);
439 #endif
440 #ifdef ENABLE_GLK_SCOTT
441  Glk::Scott::ScottMetaEngine::detectGames(fslist, detectedGames);
442 #endif
443 #ifdef ENABLE_GLK_TADS
444  Glk::TADS::TADSMetaEngine::detectGames(fslist, detectedGames);
445 #endif
446 
447  return detectedGames;
448 }
449 
451  Common::StringMap map;
452 #ifdef ENABLE_GLK_ADRIFT
454 #endif
455 #ifdef ENABLE_GLK_ADVSYS
457 #endif
458 #ifdef ENABLE_GLK_ALAN2
460 #endif
461 #ifdef ENABLE_GLK_ALAN3
463 #endif
464 #ifdef ENABLE_GLK_ARCHETYPE
466 #endif
467 #ifdef ENABLE_GLK_FROTZ
469 #endif
470 #ifdef ENABLE_GLK_GLULXE
472 #endif
473 #ifdef ENABLE_GLK_HUGO
475 #endif
476 #ifdef ENABLE_GLK_JACL
478 #endif
479 #ifdef ENABLE_GLK_LEVEL9
481 #endif
482 #ifdef ENABLE_GLK_MAGNETIC
484 #endif
485 #ifdef ENABLE_GLK_QUEST
487 #endif
488 #ifdef ENABLE_GLK_SCOTT
490 #endif
491 #ifdef ENABLE_GLK_TADS
493 #endif
494 }
495 
496 SaveStateList GlkMetaEngine::listSaves(const char *target) const {
498  Common::StringArray filenames;
499  Common::String saveDesc;
500  Common::String pattern = Common::String::format("%s.0##", target);
501 
502  filenames = saveFileMan->listSavefiles(pattern);
503 
504  SaveStateList saveList;
505  for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
506  const char *ext = strrchr(file->c_str(), '.');
507  int slot = ext ? atoi(ext + 1) : -1;
508 
509  if (slot >= 0 && slot <= MAX_SAVES) {
511 
512  if (in) {
513  Common::String saveName;
515  saveList.push_back(SaveStateDescriptor(slot, saveName));
516 
517  delete in;
518  }
519  }
520  }
521 
522  // Sort saves based on slot number.
523  Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator());
524  return saveList;
525 }
526 
528  return MAX_SAVES;
529 }
530 
531 void GlkMetaEngine::removeSaveState(const char *target, int slot) const {
532  Common::String filename = Common::String::format("%s.%03d", target, slot);
534 }
535 
536 SaveStateDescriptor GlkMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
537  Common::String filename = Common::String::format("%s.%03d", target, slot);
540  bool result = false;
541 
542  if (in) {
543  result = Glk::QuetzalReader::getSavegameMetaInfo(in, ssd);
544  ssd.setSaveSlot(slot);
545  delete in;
546  }
547 
548  if (result)
549  return ssd;
550 
551  return SaveStateDescriptor();
552 }
553 
554 #if PLUGIN_ENABLED_DYNAMIC(GLK)
556 #else
558 #endif
virtual void close()
Close the file, if open.
Definition: file.cpp:102
ScummVM Meta Engine interface.
Definition: detection.h:34
virtual bool removeSavefile(const String &name)=0
Removes the given savefile from the system.
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:33
FilePropertiesMap matchedFiles
An optional list of the files that were used to match the game with the engine&#39;s detection tables...
Definition: game.h:139
Details about a given game.
Definition: game.h:111
Common::String _md5
Definition: glk.h:64
Abool in(Aword obj, Aword cnt)
Definition: exe.cpp:705
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:49
Common::Language _language
Definition: glk.h:61
Simple string class for ScummVM.
Definition: str.h:49
GlkDetectedGame(const char *id, const char *desc, const Common::String &filename)
Definition: detection.cpp:111
Engine initialization: No game data was found in the specified location.
Definition: error.h:46
virtual DetectedGames detectGames(const Common::FSList &fslist) const override
Runs the engine&#39;s game detector on the given list of files, and returns a (possibly empty) list of ga...
Definition: detection.cpp:399
Internal interface to the QuickTime audio decoder.
void list(Aword cnt)
Definition: exe.cpp:885
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:58
void addExtraEntry(const Common::String &key, const Common::String &value)
Allows adding of extra entries to be saved as part of the detection entry in the configuration file...
Definition: game.h:174
virtual bool open(const String &filename)
Try to open the file with the given filename, by searching SearchMan.
Definition: file.cpp:41
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:34
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:48
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const
Returns meta infos from the specified save state.
Definition: detection.cpp:536
#define assert(s)
Definition: portdefs.h:77
Common::String md5
Definition: game.h:94
Engine * create(OSystem *syst, Glk::GlkGameDescription &gameDesc)
Definition: detection.cpp:165
virtual int getMaximumSaveSlot() const
Return the maximum save slot that the engine supports.
Definition: detection.cpp:527
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const override
Tries to instantiate an engine instance based on the settings of the currently active ConfMan target...
Definition: detection.cpp:175
void push_back(const T &element)
Appends element to the end of the array.
Definition: array.h:104
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:48
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:47
void sort(T first, T last, StrictWeakOrdering comp)
Simple sort function, modeled after std::sort.
Definition: algorithm.h:218
char * strrchr(const char *s, int c)
Common::String findFileByGameId(const Common::String &gameId) const
Definition: detection.cpp:276
List of multiple file system nodes.
Definition: fs.h:46
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:34
FILE * file
static const BdfFontData desc
TADS 2 game interpreter.
Definition: tads2.h:35
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:86
EngineFeature
A feature in this context means an ability of the engine which can be either available or not...
Definition: engine.h:107
bool hasUnknownFiles
A game was detected, but some files were not recognized.
Definition: game.h:134
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:33
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:47
#define f(col, lum)
Definition: engine.h:57
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:33
OSystem * g_system
The global OSystem instance.
Definition: system.cpp:40
Platform parsePlatform(const String &str)
Convert a string containing a platform name into a Platform enum value.
Definition: platform.cpp:63
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:84
A record describing the properties of a file.
Definition: game.h:92
String computeStreamMD5AsString(ReadStream &stream, uint32 length)
Compute the MD5 checksum of the content of the given ReadStream.
Definition: md5.cpp:283
TODO: vital to document this core class properly!!! For both users and implementors.
Definition: file.h:39
static bool getSavegameDescription(Common::SeekableReadStream *rs, Common::String &saveName)
Loads a Quetzal save and extracts it&#39;s description from an ANNO chunk.
Definition: quetzal.cpp:129
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:86
iterator end()
Definition: array.h:256
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:49
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:84
bool getChildren(FSList &fslist, ListMode mode=kListDirectoriesOnly, bool hidden=true) const
Return a list of all child nodes of this directory node.
Definition: fs.cpp:72
void detectClashes() const
Calls each sub-engine in turn to ensure no game Id accidentally shares the same Id.
Definition: detection.cpp:450
Object describing a save state.
Definition: savestate.h:45
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:33
TADS 3 game interpreter.
Definition: tads3.h:35
static void detectGames(const Common::FSList &fslist, Common::List< DetectorResult > &results, const char *gameid)
Definition: detection.cpp:575
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:34
virtual PlainGameList getSupportedGames() const override
Returns a list of games supported by this engine.
Definition: detection.cpp:298
REGISTER_PLUGIN_STATIC(ACCESS, PLUGIN_TYPE_ENGINE, AccessMetaEngine)
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:48
const char * c_str() const
Definition: str.h:208
int32 size
Definition: game.h:93
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:94
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:91
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:94
static PlainGameDescriptor empty()
Definition: detection.h:97
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:35
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:48
virtual bool hasFeature(MetaEngineFeature f) const override
Determine whether the engine supports the specified MetaEngine feature.
Definition: detection.cpp:147
static bool getSavegameMetaInfo(Common::SeekableReadStream *rs, SaveStateDescriptor &ssd)
Loads a Quetzal save and extract&#39;s it&#39;s description and meta info.
Definition: quetzal.cpp:148
Contains the necessary data structures andfunctions for adding to andreferring to the ID table(a very...
Definition: adrift.cpp:28
bool empty() const
Definition: str.h:211
Common::String gameId
Definition: game.h:148
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:685
Common::String filename
Definition: action.cpp:479
static GameDescriptor findGame(const char *gameId)
Returns a game description for the given game Id, if it&#39;s supported.
Definition: detection.cpp:41
No error occurred.
Definition: error.h:45
T & front()
Returns a reference to the first element of the array.
Definition: array.h:138
Language
List of game language.
Definition: language.h:35
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:33
virtual void removeSaveState(const char *target, int slot) const
Remove the specified save state.
Definition: detection.cpp:531
An Error instance pairs an error code with string description providing more details about the error...
Definition: error.h:77
#define GUIO3(a, b, c)
Definition: gui_options.h:87
Holds the name of a recognised game.
Definition: detection.h:87
Comparator object to compare SaveStateDescriptor&#39;s based on slot.
Definition: savestate.h:248
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:34
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:137
virtual PlainGameDescriptor findGame(const char *gameId) const override
Query the engine for a PlainGameDescriptor for the specified gameid, if any.
Definition: detection.cpp:350
#define GUIO_NOMUSIC
Definition: gui_options.h:28
#define GUIO_NOSPEECH
Definition: gui_options.h:30
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:764
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:33
virtual Common::SaveFileManager * getSavefileManager()
Return the SaveFileManager, used to store and load savestates and other modifiable persistent game da...
Definition: system.cpp:213
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:122
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:84
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:61
Interface for ScummVM backends.
Definition: system.h:113
A simple structure used to map gameids (like "monkey", "sword1", ...) to nice human readable and desc...
Definition: game.h:39
const char * _description
Definition: detection.h:89
virtual InSaveFile * openForLoading(const String &name)=0
Open the file with the specified name in the given directory for loading.
void setSaveSlot(int slot)
Definition: savestate.h:53
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:89
Common::String _gameId
Definition: glk.h:60
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:48
#define ConfMan
Shortcut for accessing the configuration manager.
Common::String _filename
Definition: glk.h:63
Language parseLanguage(const String &str)
Convert a string containing a language name into a Language enum value.
Definition: language.cpp:64
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:711
#define FIND_GAME(SUBENGINE)
Definition: detection.cpp:346
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:47
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:33
FSNode, short for "File System Node", provides an abstraction for file paths, allowing for portable f...
Definition: fs.h:58
MetaEngineFeature
A feature in this context means an ability of the engine which can be either available or not...
Definition: metaengine.h:226
iterator begin()
Definition: array.h:252
The SaveFileManager is serving as a factory for InSaveFile and OutSaveFile objects.
Definition: savefile.h:82
bool canBeAdded
This detection entry contains enough data to add the game to the configuration manager and launch it...
Definition: game.h:146
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:96
bool empty() const
Definition: array.h:232
#define REGISTER_PLUGIN_DYNAMIC(ID, TYPE, PLUGINCLASS)
REGISTER_PLUGIN_DYNAMIC is a convenience macro which is used to declare the plugin interface for dyna...
Definition: plugins.h:122
#define GUIO_NOSUBTITLES
Definition: gui_options.h:27
static String format(const char *fmt,...) GCC_PRINTF(1
Print formatted data into a String object.
Definition: str.cpp:634
This is the namespace of the Hugo engine.
Definition: console.cpp:30
virtual StringArray listSavefiles(const String &pattern)=0
List available savegames matching a given pattern.
static void detectClashes(Common::StringMap &map)
Check for game Id clashes with other sub-engines.
Definition: detection.cpp:94
Interface for a seekable & readable data stream.
Definition: stream.h:561
virtual SaveStateList listSaves(const char *target) const
Return a list of all save states associated with the given target.
Definition: detection.cpp:496
#define GLK
Definition: sysdep.h:45
static void getSupportedGames(PlainGameList &games)
Get a list of supported games.
Definition: detection.cpp:33
virtual bool hasFeature(EngineFeature f) const override
Returns true whether a given feature is supported by the engine.
Definition: detection.cpp:158
Common::Platform _platform
Definition: glk.h:62
static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList)
Detect supported games.
Definition: detection.cpp:47
void setGUIOptions(const Common::String &options)
Definition: game.cpp:104