MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DrawCloudLayer

Function DrawCloudLayer

Descent3/terrainrender.cpp:1276–1304  ·  view source on GitHub ↗

Draws a flat fog layer

Source from the content-addressed store, hash-verified

1274#define CLOUD_LAYER_HEIGHT (TERRAIN_HEIGHT_INCREMENT * 320.0f)
1275// Draws a flat fog layer
1276void DrawCloudLayer() {
1277 vector worldvec[4];
1278 g3Point pnt[4], *pntlist[6];
1279 rend_SetFlatColor(GR_RGB(192, 192, 255));
1280 rend_SetAlphaValue(32);
1281 rend_SetAlphaType(AT_CONSTANT);
1282 rend_SetTextureType(TT_FLAT);
1283 rend_SetLighting(LS_NONE);
1284 worldvec[0].x = -(TERRAIN_SIZE * 100);
1285 worldvec[0].y = CLOUD_LAYER_HEIGHT;
1286 worldvec[0].z = (TERRAIN_SIZE * (100 + TERRAIN_DEPTH));
1287
1288 worldvec[1].x = -(TERRAIN_SIZE * 100);
1289 worldvec[1].y = CLOUD_LAYER_HEIGHT;
1290 worldvec[1].z = -(TERRAIN_SIZE * (100));
1291
1292 worldvec[2].x = (TERRAIN_SIZE * (100 + TERRAIN_WIDTH));
1293 worldvec[2].y = CLOUD_LAYER_HEIGHT;
1294 worldvec[2].z = -(TERRAIN_SIZE * (100));
1295
1296 worldvec[3].x = (TERRAIN_SIZE * (100 + TERRAIN_WIDTH));
1297 worldvec[3].y = CLOUD_LAYER_HEIGHT;
1298 worldvec[3].z = (TERRAIN_SIZE * (100 + TERRAIN_DEPTH));
1299 for (int i = 0; i < 4; i++) {
1300 g3_RotatePoint(&pnt[i], &worldvec[i]);
1301 pntlist[i] = &pnt[i];
1302 }
1303 g3_DrawPoly(4, pntlist, 0);
1304}
1305// left,top,right,bot are optional parameters. Omiting them (or setting them to -1) will
1306// render to the whole screen. Passing valid values will only render tiles visible in the
1307// specified window (though it won't clip those tiles to the window)

Callers

nothing calls this directly

Calls 8

g3_RotatePointFunction · 0.85
g3_DrawPolyFunction · 0.85
rend_SetFlatColorFunction · 0.50
GR_RGBFunction · 0.50
rend_SetAlphaValueFunction · 0.50
rend_SetAlphaTypeFunction · 0.50
rend_SetTextureTypeFunction · 0.50
rend_SetLightingFunction · 0.50

Tested by

no test coverage detected