Open main menu

Difference between revisions of "HOWTO-Engines"

10 bytes added ,  18:19, 1 June 2011
try updating for random source changes (untested)
(fix comments to refer to debug channels, not debug levels)
(try updating for random source changes (untested))
Line 136: Line 136:
   
   
// We need random numbers
// We need random numbers
Common::RandomSource _rnd;
Common::RandomSource *_rnd;
};
};
   
   
Line 185: Line 185:
   
   
// Don't forget to register your random source
// Don't forget to register your random source
g_eventRec.registerRandomSource(_rnd, "quux");
_rnd = new Common::RandomSource("quux");
   
   
debug("QuuxEngine::QuuxEngine");
debug("QuuxEngine::QuuxEngine");
Line 191: Line 191:
   
   
QuuxEngine::~QuuxEngine() {
QuuxEngine::~QuuxEngine() {
debug("QuuxEngine::~QuuxEngine");
// Dispose your resources here
// Dispose your resources here
debug("QuuxEngine::~QuuxEngine");
delete _rnd;
   
   
// Remove all of our debug levels here
// Remove all of our debug levels here
193

edits