From: havoc Date: Sun, 7 Dec 2003 10:26:20 +0000 (+0000) Subject: added scr_screenshot_jpeg_quality cvar (and added it to the menu) X-Git-Tag: xonotic-v0.1.0preview~6232 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d873365280b22b93ed9a530c856e32ca37a7acd9;p=xonotic%2Fdarkplaces.git added scr_screenshot_jpeg_quality cvar (and added it to the menu) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3698 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_screen.c b/cl_screen.c index e38bb736..5f13493e 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -17,8 +17,11 @@ cvar_t scr_printspeed = {0, "scr_printspeed","8"}; cvar_t vid_conwidth = {CVAR_SAVE, "vid_conwidth", "640"}; cvar_t vid_conheight = {CVAR_SAVE, "vid_conheight", "480"}; cvar_t scr_screenshot_jpeg = {CVAR_SAVE, "scr_screenshot_jpeg","0"}; +cvar_t scr_screenshot_jpeg_quality = {CVAR_SAVE, "scr_screenshot_jpeg_quality","0.9"}; cvar_t cl_avidemo = {0, "cl_avidemo", "0"}; +int jpeg_supported = false; + qboolean scr_initialized; // ready to draw float scr_con_current; diff --git a/cl_screen.h b/cl_screen.h index 53156a92..c1edc105 100644 --- a/cl_screen.h +++ b/cl_screen.h @@ -66,6 +66,7 @@ void SHOWLMP_clear(void); extern cvar_t vid_conwidth; extern cvar_t vid_conheight; extern cvar_t scr_screenshot_jpeg; +extern cvar_t scr_screenshot_jpeg_quality; void CL_Screen_NewMap(void); void CL_Screen_Init(void); diff --git a/jpeg.c b/jpeg.c index b65e04a4..0d332812 100644 --- a/jpeg.c +++ b/jpeg.c @@ -700,7 +700,7 @@ qboolean JPEG_SaveImage_preflipped (const char *filename, int width, int height, cinfo.in_color_space = JCS_RGB; cinfo.input_components = 3; qjpeg_set_defaults (&cinfo); - qjpeg_set_quality (&cinfo, 90, TRUE); // 90% quality; FIXME: use a cvar + qjpeg_set_quality (&cinfo, scr_screenshot_jpeg_quality.value * 100, TRUE); qjpeg_start_compress (&cinfo, true); // Compress each scanline diff --git a/menu.c b/menu.c index 4ba5a30a..fae2bb18 100644 --- a/menu.c +++ b/menu.c @@ -1112,7 +1112,7 @@ void M_DrawCheckbox (int x, int y, int on) } -#define OPTIONS_ITEMS 33 +#define OPTIONS_ITEMS 34 int options_cursor; @@ -1149,6 +1149,8 @@ void M_Menu_Options_AdjustSliders (int dir) Cvar_SetValueQuick (&scr_viewsize, bound(30, scr_viewsize.value + dir * 10, 120)); else if (options_cursor == optnum++) Cvar_SetValueQuick (&scr_screenshot_jpeg, !scr_screenshot_jpeg.integer); + else if (options_cursor == optnum++) + Cvar_SetValueQuick (&scr_screenshot_jpeg, bound(0, scr_screenshot_jpeg_quality.value + dir * 0.1, 1)); else if (options_cursor == optnum++) Cvar_SetValueQuick (&r_sky, !r_sky.integer); else if (options_cursor == optnum++) @@ -1256,8 +1258,6 @@ void M_Options_Draw (void) p = Draw_CachePic("gfx/p_option.lmp"); M_DrawPic((320-p->width)/2, 4, "gfx/p_option.lmp"); - // LordHavoc: FIXME: overbright needs to be disabled in GAME_GOODVSBAD2 but combine should not be disabled - // LordHavoc: perhaps it's time for Overbright Bits to die, and a r_lightmapintensity option to be added? optnum = 0; optcursor = options_cursor; visible = (vid.conheight - 32) / 8; @@ -1276,6 +1276,7 @@ void M_Options_Draw (void) M_Options_PrintSlider( "Conback Brightness", true, scr_conbrightness.value, 0, 1); M_Options_PrintSlider( " Screen size", true, scr_viewsize.value, 30, 120); M_Options_PrintCheckbox(" JPEG screenshots", jpeg_dll != NULL, scr_screenshot_jpeg.integer); + M_Options_PrintSlider( " JPEG quality", jpeg_dll != NULL, scr_screenshot_jpeg_quality.value, 0, 1); M_Options_PrintCheckbox(" Sky", true, r_sky.integer); M_Options_PrintCheckbox(" Texture Combine", true, gl_combine.integer); M_Options_PrintCheckbox(" Dithering", true, gl_dither.integer); diff --git a/todo b/todo index 6a2641bb..8adf0f8c 100644 --- a/todo +++ b/todo @@ -35,6 +35,8 @@ -n darkplaces: server is starting before the "port" cvar is set by commandline and scripts? (yummyluv) -n darkplaces: typing ip in join game menu should show 'trying' and 'no response' after a while, or 'no network' if networking is not initialized (yummyluv) -n dpmod: make grapple off-hand (joe hill) +4 darkplaces: use larger of model box or collision box for linking into areagrid so that bullet tracing can use the model bounding box instead of the collision one? (Urre) +2 darkplaces: use model box size for SOLID_BSP objects in areagrid linking and such, just for optimal consistency. 0 darkplaces: GAME_FNIGGIUM: console doesn't show unless you manually pull it down 0 darkplaces: add DP_GFX_QUAKE3MODELTAGS, DP_GFX_SKINFILES, and any other new extensions to the wiki d darkplaces: add DP_LITSUPPORT extension and document it