Difference between revisions of "HOWTO-Engines"
Jump to navigation
Jump to search
(→Manual Steps: mark as obsolete) |
(Removed references to quux and the quoted example. Automated way is to go) |
||
Line 30: | Line 30: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== | == General Conventions == | ||
=== File name conventions === | === File name conventions === | ||
Line 87: | Line 73: | ||
=== Subclassing Engine === | === Subclassing Engine === | ||
The | The generated by the create_engine code gives a simple example of an engine. It contains a few important points: | ||
* It initializes the screen at a given resolution | * It initializes the screen at a given resolution | ||
* It creates a debugger class and registers it with the engine framework. Currently it's only a skeleton defined in | * It creates a debugger class and registers it with the engine framework. Currently, it's only a skeleton defined in <engine>.h. For a full game, you'd implement it in its own debugger.cpp and .h files | ||
* It has a simple event loop | * It has a simple event loop | ||
* It also demonstrates how to read and write savegames | * It also demonstrates how to read and write savegames | ||
Line 132: | Line 118: | ||
uint32 | uint32 | ||
Additionally ScummVM offers way of recording all events and then playing them back on request. That could be used for "demoplay" mode. But to ensure that it will work for your engine, you have to register your RandomSource class instance. | Do not use the following functions: | ||
sprintf -> snprintf | |||
strcpy -> strncpy or Common::strlcpy | |||
Additionally ScummVM offers a way of recording all events and then playing them back on request. That could be used for "demoplay" mode. But to ensure that it will work for your engine, you have to register your RandomSource class instance as demonstrated in the generated <engine>.cpp file. | |||
=== True RGB color support === | === True RGB color support === | ||
If you need to support more than 256 colors in your game engine, please refer to [[API-Truecolor|the truecolor API reference page]] for specifications and initialization protocol. | If you need to support more than 256 colors in your game engine, please refer to [[API-Truecolor|the truecolor API reference page]] for specifications and initialization protocol. | ||