Page 1 of 1

UpdateEventArg not setting delta.

Posted: Wed May 21, 2008 02:36
by earthsruler
Hey all its me with another bug.

In Window::update() an UpdateEventArgs is created like this passing the elapsed time into the constructor.

Code: Select all

UpdateEventArgs e(this,elapsed);


However the UpdateEventArgs object does noting with the extra parameter, resulting in the object not having a valid d_timeSinceLastFrame value.

Code: Select all

class CEGUIEXPORT UpdateEventArgs : public WindowEventArgs
{
public:
   UpdateEventArgs(Window* window, float tslf):WindowEventArgs(window) {}

   float d_timeSinceLastFrame; //!< Time since the last frame update
};



ta.

Posted: Wed May 21, 2008 07:25
by scriptkid
Hi,

the unused constructor param seems not okay indeed, but are you sure that the d_timeSinceLastFrame members doesn't get 'poked' from somewhere else? (Since it's public).

Or do you get weird values when handling that specific event? If so, then it's a bug i guess.

Posted: Wed May 21, 2008 07:36
by earthsruler
Yeah not getting poked from anywhere and the typical uninitialised float value is coming through strong. I fixed it in my version of CEGUI :). Works like a glove :)

^
Intentional combining of phrases ;)

Posted: Wed May 21, 2008 07:50
by scriptkid
Intentional combining of phrases ;)


Well, it's efficient to write & read that way :)

So it's just setting that member value? Then i'll fix in in the trunk too.

Thanks!