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