MapHud Problem after envTorque
by Gurpreet Nijjar · in RTS Starter Kit · 03/16/2007 (12:28 am) · 1 replies
I need some help here, i applied envTorque to the the RTSStarterkit package and now my mapHud is black!, if i press F10 or F11 and then come back into the game then it is fixed but after i exit and reload it is black again.... Somebody please help, this is probably an easy problem that is overlooked.
Thanks
Thanks
Torque Owner Gurpreet Nijjar
Index: engine/terrain/terrRender.cc
===================================================================
RCS file: /cvs/torque/torque/engine/terrain/terrRender.cc,v
retrieving revision 1.22
diff -u -r1.22 terrRender.cc
--- engine/terrain/terrRender.cc 2003/09/25 01:47:52 1.22
+++ engine/terrain/terrRender.cc 2004/03/24 05:48:51
@@ -5,6 +5,7 @@
#include "terrain/terrData.h"
+#include "game/fx/Celestial.h"
#include "math/mMath.h"
#include "dgl/dgl.h"
#include "console/console.h"
@@ -1907,13 +1908,23 @@
//because it is already in object space (or world or anything, really)
//The first light in the light manager is always the sun.
//This is also how players are lit, so if this is broken, that is broken as well.
-
+
Point3F sTangent,tTangent;
static Vector
- lights.clear();
- gClientSceneGraph->getLightManager()->getLights(lights);
- VectorF sunVector = -lights[0]->mDirection; //first light is always sun
-
+ VectorF sunVector;
+
+ //
+ if(gCelestials != NULL)
+ {
+ lights.clear();
+ gClientSceneGraph->getLightManager()->getLights(lights);
+ sunVector = -lights[0]->mDirection; //first light is always sun
+ }
+ else
+ {
+ sunVector = gCelestials->mSunVector;
+ }
+
//find s and t tangents
F32 pHeight[4];
for (int i = 0; i < 4; i++)
@@ -2337,11 +2348,16 @@
glSetVertexBufferEXT(block->mVertexBuffer);
if (lockArrays)
glLockArraysEXT(0, mXFPointCount);
+ if(gCelestials != NULL) //
+ gCelestials->EnableLighting();
// lock the array
PROFILE_END();
PROFILE_START(TerrainRenderXFRender);
renderXFCache();
PROFILE_END();
+ if(gCelestials != NULL) //
+ gCelestials->DisableLighting();
+
if(!multitextureFog)
{