mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 07:12:36 +00:00
- slight rearrange of vid_scalemode and menu update
This commit is contained in:
parent
903f448461
commit
4bc923dddf
3 changed files with 28 additions and 10 deletions
|
@ -66,6 +66,7 @@ EXTERN_CVAR (Int, gl_texture_hqresizemode)
|
|||
EXTERN_CVAR (Int, gl_texture_hqresizemult)
|
||||
EXTERN_CVAR (Int, vid_preferbackend)
|
||||
EXTERN_CVAR (Float, vid_scale_custompixelaspect)
|
||||
EXTERN_CVAR (Bool, vid_scale_linear)
|
||||
|
||||
FGameConfigFile::FGameConfigFile ()
|
||||
{
|
||||
|
@ -514,7 +515,7 @@ void FGameConfigFile::DoGlobalSetup ()
|
|||
}
|
||||
if (v.Int == 2) // 320x200
|
||||
{
|
||||
newvalue.Int = 7;
|
||||
newvalue.Int = 6;
|
||||
var->SetGenericRep(newvalue, CVAR_Int);
|
||||
}
|
||||
}
|
||||
|
@ -539,6 +540,25 @@ void FGameConfigFile::DoGlobalSetup ()
|
|||
else
|
||||
vid_scale_custompixelaspect = 1.0;
|
||||
}
|
||||
var = FindCVar("vid_scalemode", NULL);
|
||||
UCVarValue newvalue;
|
||||
if (var != NULL)
|
||||
{
|
||||
UCVarValue v = var->GetGenericRep(CVAR_Int);
|
||||
switch (v.Int)
|
||||
{
|
||||
case 1:
|
||||
newvalue.Int = 0;
|
||||
var->SetGenericRep(newvalue, CVAR_Int);
|
||||
case 3:
|
||||
case 4:
|
||||
vid_scale_linear = true;
|
||||
break;
|
||||
default:
|
||||
vid_scale_linear = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,12 +125,11 @@ namespace
|
|||
v_ScaleTable vScaleTable[NUMSCALEMODES] =
|
||||
{
|
||||
{ true, [](uint32_t Width, uint32_t Height)->uint32_t { return Width; }, [](uint32_t Width, uint32_t Height)->uint32_t { return Height; }, 1.0f, false }, // 0 - Native
|
||||
{ true, [](uint32_t Width, uint32_t Height)->uint32_t { return Width; }, [](uint32_t Width, uint32_t Height)->uint32_t { return Height; }, 1.0f, false }, // 1 - Native (Linear)
|
||||
{ true, [](uint32_t Width, uint32_t Height)->uint32_t { return v_mfillX(Width, Height); }, [](uint32_t Width, uint32_t Height)->uint32_t { return v_mfillY(Width, Height); }, 1.0f, false }, // 6 - Minimum Scale to Fill Entire Screen
|
||||
{ true, [](uint32_t Width, uint32_t Height)->uint32_t { return 640; }, [](uint32_t Width, uint32_t Height)->uint32_t { return 400; }, 1.2f, false }, // 2 - 640x400 (formerly 320x200)
|
||||
{ true, [](uint32_t Width, uint32_t Height)->uint32_t { return 960; }, [](uint32_t Width, uint32_t Height)->uint32_t { return 600; }, 1.2f, false }, // 3 - 960x600 (formerly 640x400)
|
||||
{ true, [](uint32_t Width, uint32_t Height)->uint32_t { return 1280; }, [](uint32_t Width, uint32_t Height)->uint32_t { return 800; }, 1.2f, false }, // 4 - 1280x800
|
||||
{ true, [](uint32_t Width, uint32_t Height)->uint32_t { return vid_scale_customwidth; }, [](uint32_t Width, uint32_t Height)->uint32_t { return vid_scale_customheight; }, 1.0f, true }, // 5 - Custom
|
||||
{ true, [](uint32_t Width, uint32_t Height)->uint32_t { return v_mfillX(Width, Height); }, [](uint32_t Width, uint32_t Height)->uint32_t { return v_mfillY(Width, Height); }, 1.0f, false }, // 6 - Minimum Scale to Fill Entire Screen
|
||||
{ true, [](uint32_t Width, uint32_t Height)->uint32_t { return 320; }, [](uint32_t Width, uint32_t Height)->uint32_t { return 200; }, 1.2f, false }, // 7 - 320x200
|
||||
};
|
||||
bool isOutOfBounds(int x)
|
||||
|
@ -257,7 +256,7 @@ CCMD (vid_setscale)
|
|||
vid_scale_linear = atob(argv[3]);
|
||||
if (argv.argc() > 4)
|
||||
{
|
||||
vid_scale_custompixelaspect = atof(argv[4]);
|
||||
vid_scale_custompixelaspect = (float)atof(argv[4]);
|
||||
}
|
||||
}
|
||||
vid_scalemode = 5;
|
||||
|
@ -284,11 +283,11 @@ CCMD (vid_scaletolowest)
|
|||
vid_scale_customheight = v_mfillY(screen->GetClientWidth(), screen->GetClientHeight());
|
||||
break;
|
||||
case 2: // Method 2: use the actual downscaling mode directly
|
||||
vid_scalemode = 6;
|
||||
vid_scalemode = 1;
|
||||
vid_scalefactor = 1.0;
|
||||
break;
|
||||
default: // Default method: use vid_scalefactor to achieve the result on a default scaling mode
|
||||
vid_scalemode = 1;
|
||||
vid_scalemode = 0;
|
||||
vid_scalefactor = v_MinimumToFill(screen->GetClientWidth(), screen->GetClientHeight());
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -2197,13 +2197,12 @@ OptionValue Ratios
|
|||
OptionValue ScaleModes
|
||||
{
|
||||
0, "$OPTVAL_SCALENEAREST"
|
||||
1, "$OPTVAL_SCALELINEAR"
|
||||
7, "320x200"
|
||||
6, "320x200"
|
||||
2, "640x400"
|
||||
3, "960x600"
|
||||
4, "1280x800"
|
||||
5, "$OPTVAL_CUSTOM"
|
||||
6, "$OPTVAL_LOWEST"
|
||||
1, "$OPTVAL_LOWEST"
|
||||
}
|
||||
OptionValue CropAspect
|
||||
{
|
||||
|
@ -2242,7 +2241,7 @@ OptionMenu VideoModeMenu protected
|
|||
StaticText "$VIDMNU_CUSTOMRES"
|
||||
TextField "$VIDMNU_CUSTOMX", menu_resolution_custom_width
|
||||
TextField "$VIDMNU_CUSTOMY", menu_resolution_custom_height
|
||||
Option "$VIDMNU_USELINEAR", "vid_scale_customlinear", "YesNo"
|
||||
Option "$VIDMNU_USELINEAR", "vid_scale_linear", "YesNo"
|
||||
StaticText ""
|
||||
Command "$VIDMNU_APPLYW", "menu_resolution_commit_changes 0"
|
||||
Command "$VIDMNU_APPLYFS", "menu_resolution_commit_changes 1"
|
||||
|
|
Loading…
Reference in a new issue