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

Function gamma_callback

Descent3/config.cpp:486–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484
485
486static void gamma_callback(newuiTiledWindow *wnd, void *data) {
487 int bm_handle = *((int *)data);
488
489 g3Point pnts[4], *pntlist[4];
490 rend_SetColorModel(CM_RGB);
491 rend_SetAlphaType(AT_ALWAYS);
492 rend_SetTextureType(TT_LINEAR);
493 rend_SetLighting(LS_NONE);
494 rend_SetOverlayType(OT_NONE);
495 rend_SetWrapType(WT_WRAP);
496 rend_SetZBufferState(0);
497
498 // First draw checkboard
499 int startx = GAMMA_SLICE_X;
500
501 for (int i = 0; i < 4; i++) {
502 pntlist[i] = &pnts[i];
503 pnts[i].p3_z = 0;
504 pnts[i].p3_r = 1;
505 pnts[i].p3_g = 1;
506 pnts[i].p3_b = 1;
507 pnts[i].p3_flags = PF_PROJECTED;
508 }
509
510 pnts[0].p3_sx = startx;
511 pnts[0].p3_sy = GAMMA_SLICE_Y;
512 pnts[0].p3_u = 0;
513 pnts[0].p3_v = 0;
514
515 pnts[1].p3_sx = startx + GAMMA_SLICE_WIDTH;
516 pnts[1].p3_sy = GAMMA_SLICE_Y;
517 pnts[1].p3_u = 2;
518 pnts[1].p3_v = 0;
519
520 pnts[2].p3_sx = startx + GAMMA_SLICE_WIDTH;
521 pnts[2].p3_sy = GAMMA_SLICE_Y + GAMMA_SLICE_HEIGHT;
522 pnts[2].p3_u = 2;
523 pnts[2].p3_v = 1;
524
525 pnts[3].p3_sx = startx;
526 pnts[3].p3_sy = GAMMA_SLICE_Y + GAMMA_SLICE_HEIGHT;
527 pnts[3].p3_u = 0;
528 pnts[3].p3_v = 1;
529
530 rend_DrawPolygon2D(bm_handle, pntlist, 4);
531
532 // Now draw grey in the center
533 int int_val = 8;
534 rend_SetFlatColor(GR_RGB(int_val, int_val, int_val));
535 rend_SetTextureType(TT_FLAT);
536
537 pnts[0].p3_sx += 64;
538 pnts[0].p3_sy += 32;
539
540 pnts[1].p3_sx -= 64;
541 pnts[1].p3_sy += 32;
542
543 pnts[2].p3_sx -= 64;

Callers

nothing calls this directly

Calls 10

rend_DrawPolygon2DFunction · 0.85
rend_SetColorModelFunction · 0.50
rend_SetAlphaTypeFunction · 0.50
rend_SetTextureTypeFunction · 0.50
rend_SetLightingFunction · 0.50
rend_SetOverlayTypeFunction · 0.50
rend_SetWrapTypeFunction · 0.50
rend_SetZBufferStateFunction · 0.50
rend_SetFlatColorFunction · 0.50
GR_RGBFunction · 0.50

Tested by

no test coverage detected