OnPreRender should be virtual?
by Mark Harmon · in Torque Game Engine · 01/23/2004 (8:48 pm) · 5 replies
I am trying to debug the Terrain Texture Editor and it looks like onPreRender should be declared virtual in GuiControl child classes. If it isn't then the method never gets called in the child class.
#2
The fix I gave above will make the spin controls update the number of nodes correctly.
Still looking for a way to fix the bug. A work around is to reload your mission after you make terraform changes to the terrain. Even that doesn;t work 100% though.
01/24/2004 (4:02 pm)
The preview window is not being updated properly in the Terrain Texture Editor. It causes the filter to output the wrong image. Try starting with a flat terrain and then add some big mountains. Next use some height filters in the Terrain Texture Editor. Make sure to turn off use distortion. The image in the 2D preview is of the old terrain before modification. The textures are then placed according to that rather than how the terrain actually is.The fix I gave above will make the spin controls update the number of nodes correctly.
Still looking for a way to fix the bug. A work around is to reload your mission after you make terraform changes to the terrain. Even that doesn;t work 100% though.
#3
I've not looked at the classes in question but if I understand your problem correctly, don't forget the old saying, "once virtual, always virtual". What I mean is that you don't have to be explicit about virtual functions in your new class when inheriting from another class although it is a good idea for clarity. As long as they are compatible you're golden.
You do need to call the parent though if that's what you require.
- Melv.
01/25/2004 (3:34 am)
Mark,I've not looked at the classes in question but if I understand your problem correctly, don't forget the old saying, "once virtual, always virtual". What I mean is that you don't have to be explicit about virtual functions in your new class when inheriting from another class although it is a good idea for clarity. As long as they are compatible you're golden.
You do need to call the parent though if that's what you require.
- Melv.
#4
01/25/2004 (11:45 am)
Your right Melv. I was doing some voodoo style programming for a second, thanks for catching me. :)
Associate Kyle Carter