Open main menu

Difference between revisions of "HOWTO-Engines"

No change in size ,  19:56, 4 August 2016
m
Fix code highlighting
(fix include, thanks _mfk)
m (Fix code highlighting)
Line 115: Line 115:


=== Example: engines/quux/quux.h ===
=== Example: engines/quux/quux.h ===
<syntax type="C++">
<source lang="cpp">
#ifndef QUUX_H
#ifndef QUUX_H
#define QUUX_H
#define QUUX_H
Line 159: Line 159:
   
   
#endif
#endif
</syntax>
</source>


=== Example: engines/quux/quux.cpp ===
=== Example: engines/quux/quux.cpp ===
<syntax type="C++">
<source lang="cpp">
#include "common/scummsys.h"
#include "common/scummsys.h"
   
   
Line 250: Line 250:
   
   
} // End of namespace Quux
} // End of namespace Quux
</syntax>
</source>


=== Example: engines/quux/detection.cpp ===
=== Example: engines/quux/detection.cpp ===
The following example implements a custom MetaEngine instead of using the AdvancedMetaEngine.
The following example implements a custom MetaEngine instead of using the AdvancedMetaEngine.
<syntax type="C++">
<source lang="cpp">
#include "quux/quux.h"
#include "quux/quux.h"
   
   
Line 351: Line 351:
REGISTER_PLUGIN_STATIC(QUUX, PLUGIN_TYPE_ENGINE, QuuxMetaEngine);
REGISTER_PLUGIN_STATIC(QUUX, PLUGIN_TYPE_ENGINE, QuuxMetaEngine);
#endif
#endif
</syntax>
</source>


=== Example: engines/quux/module.mk ===
=== Example: engines/quux/module.mk ===
<syntax type="make">
<source lang="make">
MODULE := engines/quux
MODULE := engines/quux
   
   
Line 371: Line 371:
# Include common rules  
# Include common rules  
include $(srcdir)/rules.mk
include $(srcdir)/rules.mk
</syntax>
</source>


=== Example: engines/quux/configure.engine ===
=== Example: engines/quux/configure.engine ===
<syntax type="bash">
<source lang="bash">
# This file is included from the main "configure" script
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
add_engine quux "Quux" no
add_engine quux "Quux" no
</syntax>
</source>