Menu-FN: Add r_pixelscale, to be used in combination with r_autoscale

This commit is contained in:
Marco Cawthorne 2021-08-29 21:41:31 +02:00
parent 2377734e60
commit 0bc83d289d
2 changed files with 12 additions and 11 deletions

View File

@ -39,6 +39,7 @@ OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\
* this is due to vid_conautoscale 0 scaling with in floating point... which
* in turns results in skipped rows/columns and shimmering. */
var int autocvar_r_autoscale = TRUE;
var int autocvar_r_pixelscale = FALSE;
void
Menu_AutoScale(void)
{
@ -53,6 +54,11 @@ Menu_AutoScale(void)
} else {
cvar_set("vid_conautoscale", "1");
}
if (autocvar_r_pixelscale) {
float scale = bound(0.0, 480 / psize[1], 1.0);
cvar_set("r_renderscale", sprintf("-%f", scale));
}
}
}

View File

@ -182,8 +182,6 @@ menu_customize_init(void)
string full = search_getfilename(searchy, i);
string filename = substring(search_getfilename(searchy, i), 0, -5);
string extension = substring(full, strlen(full) - 3, 3);
print(full);
print("\n");
/*if (extension == "bmp" || extension == "png" || extension == "jpg")*/ {
g_sprayscount++;
@ -197,8 +195,6 @@ menu_customize_init(void)
string full = search_getfilename(searchy, i);
string filename = substring(full, 0, -5);
string extension = substring(full, strlen(full) - 3, 3);
print(full);
print("\n");
/*if (extension == "bmp" || extension == "png" || extension == "jpg")*/ {
g_sprays[sid] = precache_pic(full);
@ -392,6 +388,12 @@ menu_customize_draw(void)
#ifdef MODEL_PREVIEW
drawfill([g_menuofs[0] + 414,g_menuofs[1] + 370], [64,12], g_vecTopcolor, 0.75f);
drawfill([g_menuofs[0] + 510,g_menuofs[1] + 370], [64,12], g_vecBottomcolor, 0.75f);
/* fake buttons */
WLabel_Static(414, 340, "Previous", 14, 14, [1,1,1],
1.0f, 0, font_arial);
WLabel_StaticR(575, 340, "Next", 14, 14, [1,1,1],
1.0f, 0, font_arial);
#else
drawfill([g_menuofs[0] + 414,g_menuofs[1] + 346], [64,12], g_vecTopcolor, 0.75f);
drawfill([g_menuofs[0] + 510,g_menuofs[1] + 346], [64,12], g_vecBottomcolor, 0.75f);
@ -402,13 +404,6 @@ menu_customize_draw(void)
WLabel_Static(212, 203, m_reslbl[IDS_PROFILE_LOGO], 14, 14, [1,1,1],
1.0f, 0, font_arial);
#ifdef MODEL_PREVIEW
/* fake buttons */
WLabel_Static(414, 340, "Previous", 14, 14, [1,1,1],
1.0f, 0, font_arial);
WLabel_StaticR(575, 340, "Next", 14, 14, [1,1,1],
1.0f, 0, font_arial);
#endif
}
void