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

Function rend_SetPreferredState

renderer/HardwareBaseGPU.cpp:372–399  ·  view source on GitHub ↗

Sets some global preferences for the renderer

Source from the content-addressed store, hash-verified

370
371// Sets some global preferences for the renderer
372int rend_SetPreferredState(renderer_preferred_state *pref_state) {
373 int retval = 1;
374 renderer_preferred_state old_state = gpu_preferred_state;
375
376 gpu_preferred_state = *pref_state;
377 if (gpu_state.initted) {
378 int reinit = 0;
379 mprintf(0, "Inside pref state!\n");
380
381 // Change gamma if needed
382 if (pref_state->width != gpu_state.screen_width || pref_state->height != gpu_state.screen_height ||
383 old_state.bit_depth != pref_state->bit_depth) {
384 reinit = 1;
385 }
386
387 if (reinit) {
388 retval = rend_ReInit();
389 } else {
390 if (old_state.gamma != pref_state->gamma) {
391 rend_SetGammaValue(pref_state->gamma);
392 }
393 }
394 } else {
395 gpu_preferred_state = *pref_state;
396 }
397
398 return retval;
399}
400
401// Draws a simple bitmap at the specified x,y location
402void rend_DrawSimpleBitmap(int bm_handle, int x, int y) {

Callers 4

TelComShowFunction · 0.50
SetScreenModeFunction · 0.50
config_gammaFunction · 0.50
finishMethod · 0.50

Calls 2

rend_ReInitFunction · 0.85
rend_SetGammaValueFunction · 0.70

Tested by

no test coverage detected