Game Development Community

Core/ITickable class missing init of critical member

by Matthew Jessick · in Torque Game Engine · 05/16/2007 (3:57 pm) · 1 replies

ITickable::ITickable()
: mProcessTick(true)
{
getProcessList().push_back( this );
}


Adding the init of mProcessTick solves my problem in TGE 1.5.1 of a large fraction of my gui controls derived from ITickable not receiving processTick calls in a release build (they did receive the calls in a debug build).

GameBase.cc initializes this parameter in its constructor, so GameBase derived objects work reliably out of the box.

Newly derived objects however, would see random behavior in a release build unless the base class mProcessTick member is specifically initialized.

The init could be to false, or subclasses could continue to be forced to remember to set this base class member. e.g.: guiTickCtrl doing so might have solved my problem. My suggestion, however, is that the ITickable base class should initialize its mProcessTick member either true or false to result in repeatable behavior between release and debug builds whether future programmers remember to init this base class parameter in their subclasses or not.

#1
05/16/2007 (4:33 pm)
Good catch, this should have been included in the latest Torque release as I remember Matt talking about this a month or so ago.