This commit is contained in:
Magnus Norddahl 2017-09-12 02:40:29 +02:00
commit d0fbdd1314
6 changed files with 53 additions and 42 deletions

View file

@ -56,15 +56,15 @@ matrix:
- os: linux
compiler: clang
env:
- CLANG_VERSION=4.0
- CLANG_VERSION=5.0
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=MinSizeRel -DDYN_OPENAL=NO -DDYN_SNDFILE=NO -DDYN_MPG123=NO -DDYN_FLUIDSYNTH=NO"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- llvm-toolchain-trusty-5.0
packages:
- clang-4.0
- clang-5.0
- libstdc++-5-dev
- libsdl2-dev
- libgme-dev

View file

@ -82,12 +82,10 @@ ADD_STAT(shadowmap)
return out;
}
CUSTOM_CVAR(Int, gl_shadowmap_quality, 128, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CUSTOM_CVAR(Int, gl_shadowmap_quality, 512, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
switch (self)
{
case 32:
case 64:
case 128:
case 256:
case 512:

View file

@ -10041,7 +10041,7 @@ scriptwait:
}
else
{
FCanvasTextureInfo::Add (camera, picnum, ACSToDouble(STACK(1)));
FCanvasTextureInfo::Add (camera, picnum, STACK(1));
}
}
sp -= 3;

View file

@ -25,7 +25,7 @@
#include "c_dispatch.h"
#include "c_cvars.h"
#define NUMSCALEMODES 11
#define NUMSCALEMODES 5
namespace
{
@ -41,19 +41,19 @@ namespace
{
// isValid, isLinear, GetScaledWidth(), GetScaledHeight(), isScaled43
{ true, false, [](uint32_t Width)->uint32_t { return Width; }, [](uint32_t Height)->uint32_t { return Height; }, false }, // 0 - Native
{ true, false, [](uint32_t Width)->uint32_t { return 320; }, [](uint32_t Height)->uint32_t { return 200; }, true }, // 1 - 320x200
{ true, true, [](uint32_t Width)->uint32_t { return 640; }, [](uint32_t Height)->uint32_t { return 400; }, true }, // 2 - 640x400
{ true, true, [](uint32_t Width)->uint32_t { return 1280; }, [](uint32_t Height)->uint32_t { return 800; }, true }, // 3 - 1280x800
{ false, false, nullptr, nullptr, false }, // 4
{ false, false, nullptr, nullptr, false }, // 5
{ false, false, nullptr, nullptr, false }, // 6
{ false, false, nullptr, nullptr, false }, // 7
{ true, false, [](uint32_t Width)->uint32_t { return Width / 2; }, [](uint32_t Height)->uint32_t { return Height / 2; }, false }, // 8 - Half-Res
{ true, true, [](uint32_t Width)->uint32_t { return Width * 0.75; }, [](uint32_t Height)->uint32_t { return Height * 0.75; }, false }, // 9 - Res * 0.75
{ true, true, [](uint32_t Width)->uint32_t { return Width * 2; }, [](uint32_t Height)->uint32_t { return Height * 2; }, false }, // 10 - SSAAx2
{ true, true, [](uint32_t Width)->uint32_t { return Width; }, [](uint32_t Height)->uint32_t { return Height; }, false }, // 1 - Native (Linear)
{ true, false, [](uint32_t Width)->uint32_t { return 320; }, [](uint32_t Height)->uint32_t { return 200; }, true }, // 2 - 320x200
{ true, false, [](uint32_t Width)->uint32_t { return 640; }, [](uint32_t Height)->uint32_t { return 400; }, true }, // 3 - 640x400
{ true, true, [](uint32_t Width)->uint32_t { return 1280; }, [](uint32_t Height)->uint32_t { return 800; }, true }, // 4 - 1280x800
};
}
CUSTOM_CVAR(Float, vid_scalefactor, 1.0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
if (self <= 0.0 || self > 2.0)
self = 1.0;
}
CUSTOM_CVAR(Int, vid_scalemode, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
if (self < 0 || self >= NUMSCALEMODES || vScaleTable[self].isValid == false)
@ -64,17 +64,18 @@ CUSTOM_CVAR(Int, vid_scalemode, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
bool ViewportLinearScale()
{
return vScaleTable[vid_scalemode].isLinear;
// vid_scalefactor > 1 == forced linear scale
return (vid_scalefactor > 1.0) ? true : vScaleTable[vid_scalemode].isLinear;
}
int ViewportScaledWidth(int width)
{
return vScaleTable[vid_scalemode].GetScaledWidth(width);
return vScaleTable[vid_scalemode].GetScaledWidth((int)((float)width * vid_scalefactor));
}
int ViewportScaledHeight(int height)
{
return vScaleTable[vid_scalemode].GetScaledHeight(height);
return vScaleTable[vid_scalemode].GetScaledHeight((int)((float)height * vid_scalefactor));
}
bool ViewportIsScaled43()

View file

@ -2193,6 +2193,7 @@ VIDMNU_ASPECTRATIO = "Aspect ratio";
VIDMNU_FORCEASPECT = "Force aspect ratio";
VIDMNU_5X4ASPECTRATIO = "Enable 5:4 aspect ratio";
VIDMNU_SCALEMODE = "Resolution scale";
VIDMNU_SCALEFACTOR = "Scale Factor";
VIDMNU_ENTERTEXT = "Press ENTER to set mode";
VIDMNU_TESTTEXT1 = "T to test mode for 5 seconds";
VIDMNU_TESTTEXT2 = "Please wait 5 seconds...";
@ -2378,6 +2379,8 @@ OPTVAL_VTFZDOOM = "ZDoom (Forced)";
OPTVAL_VTFVANILLA = "Vanilla (Forced)";
OPTVAL_VTAZDOOM = "Auto (ZDoom Preferred)";
OPTVAL_VTAVANILLA = "Auto (Vanilla Preferred)";
OPTVAL_SCALENEAREST = "Scaled (Nearest)";
OPTVAL_SCALELINEAR = "Scaled (Linear)";
// Colors
C_BRICK = "\cabrick";
@ -2692,6 +2695,7 @@ GLLIGHTMNU_CLIPLIGHTS = "Clip lights";
GLLIGHTMNU_LIGHTSPRITES = "Lights affect sprites";
GLLIGHTMNU_LIGHTPARTICLES = "Lights affect particles";
GLLIGHTMNU_LIGHTSHADOWMAP = "Light shadowmaps";
GLLIGHTMNU_LIGHTSHADOWMAPQUALITY = "Shadowmap quality";
// OpenGL Preferences
GLPREFMNU_TITLE = "OPENGL PREFERENCES";

View file

@ -1858,13 +1858,11 @@ OptionValue RatiosTFT
}
OptionValue ScaleModes
{
0, "$OPTVAL_OFF"
1, "320x200"
2, "640x400"
3, "1280x800"
8, "0.5x"
9, "0.75x"
10, "2x SSAA"
0, "$OPTVAL_SCALENEAREST"
1, "$OPTVAL_SCALELINEAR"
2, "320x200"
3, "640x400"
4, "1280x800"
}
OptionMenu VideoModeMenu protected
@ -1880,6 +1878,7 @@ OptionMenu VideoModeMenu protected
Option "$VIDMNU_FORCEASPECT", "vid_aspect", "ForceRatios"
Option "$VIDMNU_5X4ASPECTRATIO", "vid_tft", "YesNo"
Option "$VIDMNU_SCALEMODE", "vid_scalemode", "ScaleModes"
Slider "$VIDMNU_SCALEFACTOR", "vid_scalefactor", 0.25, 2.0, 0.25, 2
StaticText " "
ScreenResolution "res_0"
ScreenResolution "res_1"
@ -2128,6 +2127,14 @@ OptionValue VRMode
7, "$OPTVAL_QUADBUFFERED"
}
OptionValue ShadowMapQuality
{
128, "128"
256, "256"
512, "512"
1024, "1024"
}
OptionMenu "GLTextureGLOptions" protected
{
Title "$GLTEXMNU_TITLE"
@ -2155,6 +2162,7 @@ OptionMenu "GLLightOptions" protected
Option "$GLLIGHTMNU_LIGHTSPRITES", gl_light_sprites, "YesNo"
Option "$GLLIGHTMNU_LIGHTPARTICLES", gl_light_particles, "YesNo"
Option "$GLLIGHTMNU_LIGHTSHADOWMAP", gl_light_shadowmap, "YesNo"
Option "$GLLIGHTMNU_LIGHTSHADOWMAPQUALITY", gl_shadowmap_quality, "ShadowMapQuality"
}
OptionMenu "OpenGLOptions" protected