OpenTTD
|
The base factory, keeping track of all blitters. More...
#include <factory.hpp>
Public Member Functions | |
const char * | GetName () const |
Get the long, human readable, name for the Blitter-class. | |
const char * | GetDescription () const |
Get a nice description of the blitter-class. | |
virtual Blitter * | CreateInstance ()=0 |
Create an instance of this Blitter-class. |
Static Public Member Functions | |
static Blitter * | SelectBlitter (const char *name) |
Find the requested blitter and return his class. | |
static BlitterFactory * | GetBlitterFactory (const char *name) |
Get the blitter factory with the given name. | |
static Blitter * | GetCurrentBlitter () |
Get the current active blitter (always set by calling SelectBlitter). | |
static char * | GetBlittersInfo (char *p, const char *last) |
Fill a buffer with information about the blitters. |
Protected Member Functions | |
BlitterFactory (const char *name, const char *description, bool usable=true) | |
Construct the blitter, and register it. |
Private Types | |
typedef std::map< const char *, BlitterFactory *, StringCompare > | Blitters |
Map of blitter factories. |
Static Private Member Functions | |
static Blitters & | GetBlitters () |
Get the map with currently known blitters. | |
static Blitter ** | GetActiveBlitter () |
Get the currently active blitter. |
Private Attributes | |
const char * | name |
The name of the blitter factory. | |
const char * | description |
The description of the blitter. |
The base factory, keeping track of all blitters.
Definition at line 28 of file factory.hpp.
|
inlineprotected |
Construct the blitter, and register it.
name | The name of the blitter. |
description | A longer description for the blitter. |
usable | Whether the blitter is usable (on the current computer). For example for disabling SSE blitters when the CPU can't handle them. |
Definition at line 65 of file factory.hpp.
References DEBUG, and GetBlitters().
|
inlinestaticprivate |
Get the currently active blitter.
Definition at line 49 of file factory.hpp.
Referenced by GetCurrentBlitter(), and SelectBlitter().
|
inlinestatic |
Get the blitter factory with the given name.
name | the blitter factory to select. |
Definition at line 114 of file factory.hpp.
References GetBlitters(), name, and StrEmpty().
Referenced by SelectBlitter(), and SwitchNewGRFBlitter().
|
inlinestaticprivate |
Get the map with currently known blitters.
Definition at line 39 of file factory.hpp.
Referenced by BlitterFactory(), GetBlitterFactory(), and GetBlittersInfo().
|
inlinestatic |
Fill a buffer with information about the blitters.
p | The buffer to fill. |
last | The last element of the buffer. |
Definition at line 158 of file factory.hpp.
References GetBlitters(), GetDescription(), name, and seprintf().
Referenced by ShowHelp().
|
inlinestatic |
Find the requested blitter and return his class.
name | the blitter to select. |
Definition at line 96 of file factory.hpp.
References CreateInstance(), DEBUG, GetActiveBlitter(), GetBlitterFactory(), Blitter::GetName(), and StrEmpty().
Referenced by openttd_main(), VideoDriver_Null::Start(), and SwitchNewGRFBlitter().