- added a compile option to fully disable the software renderer.

This is mainly for new games which have been designed for hardware rendering.
Note that this does not remove the software renderer's code - all it does is to disable the vid_rendermode CVAR by turning it into a static constant with the value 4.
This commit is contained in:
Christoph Oelckers 2022-11-08 11:23:49 +01:00
parent c860e2d732
commit dab61709f8
6 changed files with 25 additions and 2 deletions

View File

@ -27,6 +27,11 @@ if( APPLE )
option( OSX_COCOA_BACKEND "Use native Cocoa backend instead of SDL" ON )
endif()
option( ZDOOM_ENABLE_SWR "Enable software renderer" ON )
if( NOT ZDOOM_ENABLE_SWR )
add_definitions( -DNO_SWRENDERER )
endif()
target_architecture(TARGET_ARCHITECTURE)
message(STATUS "Architecture is ${TARGET_ARCHITECTURE}")

View File

@ -250,6 +250,12 @@ static bool CheckSkipOptionBlock(FScanner &sc)
filter = true;
#endif
}
else if (sc.Compare("SWRender"))
{
#ifndef NO_SWRENDERER
filter = true;
#endif
}
}
while (sc.CheckString(","));
sc.MustGetStringName(")");

View File

@ -231,6 +231,7 @@ CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL | CVAR_VIRTUAL)
// PUBLIC DATA DEFINITIONS -------------------------------------------------
#ifndef NO_SWRENDERER
CUSTOM_CVAR(Int, vid_rendermode, 4, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{
if (self < 0 || self > 4)
@ -251,6 +252,7 @@ CUSTOM_CVAR(Int, vid_rendermode, 4, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOIN
// No further checks needed. All this changes now is which scene drawer the render backend calls.
}
#endif
CUSTOM_CVAR (Int, fraglimit, 0, CVAR_SERVERINFO)
{

View File

@ -149,7 +149,11 @@ public:
};
#ifndef NO_SWRENDERER
EXTERN_CVAR(Int, vid_rendermode)
#else
constexpr int vid_rendermode = 4;
#endif
inline bool V_IsHardwareRenderer()
{

View File

@ -2271,7 +2271,10 @@ OptionMenu VideoModeMenu protected
Option "$VIDMNU_PREFERBACKEND", "vid_preferbackend", "PreferBackend"
StaticText " "
Option "$VIDMNU_RENDERMODE", "vid_rendermode", "RenderMode"
IfOption(SWRender)
{
Option "$VIDMNU_RENDERMODE", "vid_rendermode", "RenderMode"
}
Option "$VIDMNU_FULLSCREEN", "vid_fullscreen", "YesNo"
IfOption(Mac)

View File

@ -47,7 +47,10 @@ OptionMenu VideoOptionsSimple protected
Title "$DSPLYMNU_TITLE"
Option "$VIDMNU_PREFERBACKEND", "vid_preferbackend", "PreferBackend"
Option "$VIDMNU_RENDERMODE", "vid_rendermode", "RenderMode"
IfOption(SWRender)
{
Option "$VIDMNU_RENDERMODE", "vid_rendermode", "RenderMode"
}
Option "$VIDMNU_FULLSCREEN", "vid_fullscreen", "YesNo"
IfOption(Mac)
{