Game Development Community

Water/whiteout colouring the GUI bug fix

by Cisor · in Torque Game Engine · 03/09/2004 (8:51 am) · 6 replies

EDIT: To clarify the bug:

When you go underwater the gui controls get coloured blue by the water effects. The code below changes the order of the rendering so that the controls are rendered after the water and whiteout effects.

Although this is a really trivial change, there doesn't seem to be a snipit or resource covering how to fix this bug, so I decided to post it here under the bugs.

Firstly, in GuiTSCtrl::onRender, find:
renderChildControls(offset, updateRect);
and comment it out.
// renderChildControls(offset, updateRect); removed to prevent gui colouring - MJC

Then in GameTSCtrl.cc, in GameTSCtrl::onRender, find:
if(GameProcessCameraQuery(&camq))  
      GameRenderFilters(camq);
and insert the following immediately after it:
if(!skipRender) // added by MJC to not render controls coloured by effects
	  Parent::renderChildControls(offset, updateRect);

Then in EditTSCtrl.cc, in EditTSCtrl::onRender, find:
Parent::onRender(offset, updateRect);
and insert the following immediately after it:
Parent::renderChildControls(offset, updateRect); // MJC - render children separately

And that's all there is to it.

#1
03/09/2004 (9:04 am)
Can you clarify what this bug is?
#2
03/09/2004 (9:08 am)
Sure, John, when you go underwater, your gui gets coloured blue by the water effect. The same thing happens with the whiteout/flash effect.

PS: I've edited the post above to explain the problem.
#3
05/02/2005 (3:29 pm)
Has this fix been implemented into the v1.3 or HEAD?
#4
05/02/2005 (8:55 pm)
Very nice. Thanks. Assimilated.
#5
05/02/2005 (11:07 pm)
Not sure it's really a bug, so not sure it'll go into 1.4 (upcoming Torque release)... Have noted it, though.
#6
07/12/2005 (1:49 pm)
I've added a field, applyFilterToChildren, on TS Ctrls, which controls this. Fixed bug #53. Note it requires a little bit of logic from all children to make sure that the child controls are rendered properly in all cases.