Difference between revisions of "Advanced Engine Features"

Jump to navigation Jump to search
→‎Listing savestates via command line or Launcher: update API description to current code
(→‎Loading/Saving during run time: updated API to match code)
(→‎Listing savestates via command line or Launcher: update API description to current code)
Line 96: Line 96:
'''How to implement it'''<br>
'''How to implement it'''<br>
You have to implement MetaEngine::listSaves(), which takes a parameter indicating the target for which the list of savestates is requested. From this, you can (using the config manager) determine the path to the game data, if necessary, or just directly compute all available savestates. Details necessarily depend on your Engine, but looking at existing implementations should give you a fairly good idea how to tackle this.
You have to implement MetaEngine::listSaves(), which takes a parameter indicating the target for which the list of savestates is requested. From this, you can (using the config manager) determine the path to the game data, if necessary, or just directly compute all available savestates. Details necessarily depend on your Engine, but looking at existing implementations should give you a fairly good idea how to tackle this.
Another requirement is MetaEngine::getMaximumSaveSlot, which returns the maximum save slot number supported by your engine. This is for example used by the GUI to show up empty slots correctly.


It returns a list of SaveStateDescriptor objects, describing each available savestate. As a minimum, it has to contain a human readable description, and a unique save slot number of the savestate (how this is defined is up to your engine -- you need to decide on one numbering scheme you use in all save/load related (Meta)Engine features, though).
It returns a list of SaveStateDescriptor objects, describing each available savestate. As a minimum, it has to contain a human readable description, and a unique save slot number of the savestate (how this is defined is up to your engine -- you need to decide on one numbering scheme you use in all save/load related (Meta)Engine features, though).
Line 103: Line 105:
'''Relevant MetaEngine API'''
'''Relevant MetaEngine API'''
<syntax type="C++"> virtual SaveStateList listSaves(const char *target) const;
<syntax type="C++"> virtual SaveStateList listSaves(const char *target) const;
virtual int getMaximumSaveSlot() const;


kSupportsListSaves feature flag</syntax>
kSupportsListSaves feature flag</syntax>
Line 108: Line 111:
'''Already implemented by:'''
'''Already implemented by:'''
[[AGI]], [[AGOS]], [[Cine]], [[Kyra]], [[Lure]], [[Parallaction]], [[Queen]], [[SAGA]], [[SCUMM]], [[Sky]], [[Sword1]], [[Sword2]], [[Tinsel]], [[Touche]]
[[AGI]], [[AGOS]], [[Cine]], [[Kyra]], [[Lure]], [[Parallaction]], [[Queen]], [[SAGA]], [[SCUMM]], [[Sky]], [[Sword1]], [[Sword2]], [[Tinsel]], [[Touche]]


===Loading savestates via command line or Launcher===
===Loading savestates via command line or Launcher===
561

edits

Navigation menu