MCPcopy Create free account
hub / github.com/JACoders/OpenJK / UI_UpdateScreenshot

Function UI_UpdateScreenshot

code/ui/ui_main.cpp:409–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407vmCvar_t ui_screenshotType;
408
409static void UI_UpdateScreenshot( void )
410{
411 qboolean changed = qfalse;
412 // check some things
413 if ( ui_screenshotType.string[0] && isalpha( ui_screenshotType.string[0] ) )
414 {
415 int ssf = UI_GetScreenshotFormatForString( ui_screenshotType.string );
416 if ( ssf == -1 )
417 {
418 ui.Printf( "UI Screenshot Format Type '%s' unrecognised, defaulting to JPEG\n", ui_screenshotType.string );
419 uiInfo.uiDC.screenshotFormat = SSF_JPEG;
420 changed = qtrue;
421 }
422 else
423 uiInfo.uiDC.screenshotFormat = ssf;
424 }
425 else if ( ui_screenshotType.integer < SSF_JPEG || ui_screenshotType.integer > SSF_PNG )
426 {
427 ui.Printf( "ui_screenshotType %i is out of range, defaulting to 0 (JPEG)\n", ui_screenshotType.integer );
428 uiInfo.uiDC.screenshotFormat = SSF_JPEG;
429 changed = qtrue;
430 }
431 else {
432 uiInfo.uiDC.screenshotFormat = atoi( ui_screenshotType.string );
433 changed = qtrue;
434 }
435
436 if ( changed ) {
437 Cvar_Set( "ui_screenshotType", UI_GetScreenshotFormatString( uiInfo.uiDC.screenshotFormat ) );
438 Cvar_Update( &ui_screenshotType );
439 }
440}
441
442static cvarTable_t cvarTable[] =
443{

Callers

nothing calls this directly

Calls 4

Cvar_SetFunction · 0.50
Cvar_UpdateFunction · 0.50

Tested by

no test coverage detected