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

Function DrawAlphaBlendedScreen

Descent3/weapon.cpp:1378–1410  ·  view source on GitHub ↗

Draws an alpha blended polygon over the entire 3d rendering scene The r,g,b floats specify the color

Source from the content-addressed store, hash-verified

1376// Draws an alpha blended polygon over the entire 3d rendering scene
1377// The r,g,b floats specify the color
1378void DrawAlphaBlendedScreen(float r, float g, float b, float alpha) {
1379 g3Point *pntlist[4], points[4];
1380 ddgr_color color;
1381 int i;
1382
1383 color = GR_RGB(r * 255, g * 255, b * 255);
1384
1385 // Set our four corners to cover the screen
1386 points[0].p3_sx = 0;
1387 points[0].p3_sy = 0;
1388 points[1].p3_sx = Game_window_w;
1389 points[1].p3_sy = 0;
1390 points[2].p3_sx = Game_window_w;
1391 points[2].p3_sy = Game_window_h;
1392 points[3].p3_sx = 0;
1393 points[3].p3_sy = Game_window_h;
1394
1395 for (i = 0; i < 4; i++) {
1396 points[i].p3_z = 0;
1397 points[i].p3_flags = PF_PROJECTED;
1398 pntlist[i] = &points[i];
1399 }
1400
1401 rend_SetZBufferState(0);
1402 rend_SetTextureType(TT_FLAT);
1403 rend_SetAlphaType(AT_CONSTANT);
1404 rend_SetAlphaValue(alpha * 255);
1405 rend_SetLighting(LS_NONE);
1406 rend_SetFlatColor(color);
1407
1408 rend_DrawPolygon2D(0, pntlist, 4);
1409 rend_SetZBufferState(1);
1410}
1411
1412// Retreives the weapon in the weapon array based off of an 'index' from 0-19 (non-mapped
1413// primary and secondaries)

Callers 3

DrawAlphaEventFunction · 0.85
DoDamageEffectFunction · 0.85
DoEDrainEffectFunction · 0.85

Calls 8

rend_DrawPolygon2DFunction · 0.85
GR_RGBFunction · 0.50
rend_SetZBufferStateFunction · 0.50
rend_SetTextureTypeFunction · 0.50
rend_SetAlphaTypeFunction · 0.50
rend_SetAlphaValueFunction · 0.50
rend_SetLightingFunction · 0.50
rend_SetFlatColorFunction · 0.50

Tested by

no test coverage detected