UpdateEventArg not setting delta.

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

earthsruler
Quite a regular
Quite a regular
Posts: 74
Joined: Mon Apr 28, 2008 23:21
Location: Australia

UpdateEventArg not setting delta.

Postby earthsruler » Wed May 21, 2008 02:36

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.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Wed May 21, 2008 07:25

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.
Check out my released snake game using Cegui!

earthsruler
Quite a regular
Quite a regular
Posts: 74
Joined: Mon Apr 28, 2008 23:21
Location: Australia

Postby earthsruler » Wed May 21, 2008 07:36

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 ;)

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Wed May 21, 2008 07:50

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!
Check out my released snake game using Cegui!


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: MSN [Bot] and 2 guests