| 407 | vmCvar_t ui_screenshotType; |
| 408 | |
| 409 | static 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 | |
| 442 | static cvarTable_t cvarTable[] = |
| 443 | { |
nothing calls this directly
no test coverage detected