static XYZ terrainlight;
static float distance;
- if (drawmode == normalmode)
+ if (drawmode == normalmode) {
Game::ReSizeGLScene(90, .1f);
- if (drawmode != normalmode)
+ } else {
glViewport(0, 0, texviewwidth, texviewheight);
+ }
glDepthFunc(GL_LEQUAL);
glDepthMask(1);
glAlphaFunc(GL_GREATER, 0.0001f);
else
blurness -= multiplier * 5;
- if (environment == desertenvironment && detail == 2)
- glTexEnvf( GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, blurness + .4 );
if (environment == desertenvironment) {
+ if (detail == 2) {
+ glTexEnvf( GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, blurness + .4 );
+ }
glRotatef((float)(abs(Random() % 100)) / 1000, 1, 0, 0);
glRotatef((float)(abs(Random() % 100)) / 1000, 0, 1, 0);
}
model[numobjects].CalculateNormals(1);
model[numobjects].ScaleNormals(-1, -1, -1);
- if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
- if (detail == 2)
+ if (detail == 2) {
+ if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 2, .4, 0);
- }
+ }
- if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
- if (detail == 2)
+ if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 1, .4, 0);
+ }
}
if (atype != treeleavestype && atype != bushtype && atype != firetype)
model[numobjects].CalculateNormals(1);
model[numobjects].ScaleNormals(-1, -1, -1);
- if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
- if (detail == 2)
+ if (detail == 2) {
+ if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 2, .4, 0);
- }
+ }
- if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
- if (detail == 2)
+ if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 1, .4, 0);
+ }
}
- if (atype != treeleavestype && atype != bushtype && atype != firetype)
+ if (atype != treeleavestype && atype != bushtype && atype != firetype) {
terrain.AddObject(where + DoRotation(model[numobjects].boundingspherecenter, 0, ayaw, 0), model[numobjects].boundingsphereradius, numobjects);
+ }
numobjects++;
}