diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 902091b7a..9fb536ca3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -876,7 +876,6 @@ set (PCH_SOURCES playsim/p_user.cpp rendering/r_utility.cpp rendering/r_sky.cpp - rendering/r_videoscale.cpp sound/s_advsound.cpp sound/s_reverbedit.cpp sound/s_sndseq.cpp @@ -1147,6 +1146,7 @@ set (PCH_SOURCES common/objects/dobject.cpp common/objects/dobjgc.cpp common/objects/dobjtype.cpp + common/rendering/r_videoscale.cpp common/rendering/gl_load/gl_interface.cpp common/scripting/core/dictionary.cpp common/scripting/core/dynarrays.cpp diff --git a/src/common/engine/i_interface.h b/src/common/engine/i_interface.h index d992203d9..564b7d91c 100644 --- a/src/common/engine/i_interface.h +++ b/src/common/engine/i_interface.h @@ -11,7 +11,7 @@ struct SystemCallbacks bool (*CaptureModeInGame)(); void (*CrashInfo)(char* buffer, size_t bufflen, const char* lfstr); void (*PlayStartupSound)(const char* name); - + bool (*IsSpecialUI)(); }; extern SystemCallbacks *sysCallbacks; diff --git a/src/rendering/i_video.h b/src/common/rendering/i_video.h similarity index 100% rename from src/rendering/i_video.h rename to src/common/rendering/i_video.h diff --git a/src/rendering/r_videoscale.cpp b/src/common/rendering/r_videoscale.cpp similarity index 96% rename from src/rendering/r_videoscale.cpp rename to src/common/rendering/r_videoscale.cpp index a71ee7c3e..b528d992f 100644 --- a/src/rendering/r_videoscale.cpp +++ b/src/common/rendering/r_videoscale.cpp @@ -36,19 +36,15 @@ #include "v_video.h" #include "templates.h" #include "r_videoscale.h" - -#include "c_console.h" -#include "menu/menu.h" +#include "cmdlib.h" +#include "v_draw.h" +#include "i_interface.h" #define NUMSCALEMODES countof(vScaleTable) - -extern bool setsizeneeded, multiplayer, generic_ui; +extern bool setsizeneeded; EXTERN_CVAR(Int, vid_aspect) -EXTERN_CVAR(Bool, log_vgafont) -EXTERN_CVAR(Bool, dlg_vgafont) - CUSTOM_CVAR(Int, vid_scale_customwidth, VID_MIN_WIDTH, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { if (self < VID_MIN_WIDTH) @@ -69,6 +65,9 @@ CUSTOM_CVAR(Float, vid_scale_custompixelaspect, 1.0, CVAR_ARCHIVE | CVAR_GLOBALC self = 1.0; } +static const int VID_MIN_UI_WIDTH = 640; +static const int VID_MIN_UI_HEIGHT = 400; + namespace { uint32_t min_width = VID_MIN_WIDTH; @@ -108,8 +107,7 @@ namespace static bool lastspecialUI = false; bool isInActualMenu = false; - bool specialUI = (generic_ui || !!log_vgafont || !!dlg_vgafont || ConsoleState != c_up || multiplayer || - (menuactive == MENU_On && CurrentMenu && !CurrentMenu->IsKindOf("ConversationMenu"))); + bool specialUI = sysCallbacks && (!sysCallbacks->IsSpecialUI || sysCallbacks->IsSpecialUI()); if (specialUI == lastspecialUI) return; diff --git a/src/rendering/r_videoscale.h b/src/common/rendering/r_videoscale.h similarity index 100% rename from src/rendering/r_videoscale.h rename to src/common/rendering/r_videoscale.h diff --git a/src/d_main.cpp b/src/d_main.cpp index 815a726d0..5d7f8f19e 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -122,6 +122,9 @@ EXTERN_CVAR(Bool, hud_althud) EXTERN_CVAR(Int, vr_mode) EXTERN_CVAR(Bool, cl_customizeinvulmap) +EXTERN_CVAR(Bool, log_vgafont) +EXTERN_CVAR(Bool, dlg_vgafont) + void DrawHUD(); void D_DoAnonStats(); void I_DetectOS(); @@ -2645,6 +2648,13 @@ static void System_PlayStartupSound(const char* sndname) S_Sound(CHAN_BODY, 0, sndname, 1, ATTN_NONE); } +static bool System_IsSpecialUI() +{ + return (generic_ui || !!log_vgafont || !!dlg_vgafont || ConsoleState != c_up || multiplayer || + (menuactive == MENU_On && CurrentMenu && !CurrentMenu->IsKindOf("ConversationMenu"))); + +} + //========================================================================== // // DoomSpecificInfo @@ -2848,6 +2858,8 @@ static int D_DoomMain_Internal (void) System_WantNativeMouse, System_CaptureModeInGame, System_CrashInfo, + System_PlayStartupSound, + System_IsSpecialUI, }; sysCallbacks = &syscb; diff --git a/src/rendering/gl/renderer/gl_postprocess.cpp b/src/rendering/gl/renderer/gl_postprocess.cpp index 8d1cee2c6..274667c32 100644 --- a/src/rendering/gl/renderer/gl_postprocess.cpp +++ b/src/rendering/gl/renderer/gl_postprocess.cpp @@ -20,10 +20,8 @@ */ #include "gl_system.h" -#include "gi.h" #include "m_png.h" #include "r_utility.h" -#include "d_player.h" #include "gl/system/gl_buffers.h" #include "gl/system/gl_framebuffer.h" #include "hwrenderer/utility/hw_cvars.h" diff --git a/src/rendering/polyrenderer/backend/poly_framebuffer.cpp b/src/rendering/polyrenderer/backend/poly_framebuffer.cpp index 6fbdb0fd4..24aea9179 100644 --- a/src/rendering/polyrenderer/backend/poly_framebuffer.cpp +++ b/src/rendering/polyrenderer/backend/poly_framebuffer.cpp @@ -27,8 +27,7 @@ #include "i_time.h" #include "g_game.h" #include "v_text.h" - -#include "rendering/i_video.h" +#include "i_video.h" #include "hwrenderer/utility/hw_clock.h" #include "hwrenderer/utility/hw_vrmodes.h" diff --git a/src/rendering/v_video.h b/src/rendering/v_video.h index d01775676..91934bc6b 100644 --- a/src/rendering/v_video.h +++ b/src/rendering/v_video.h @@ -51,9 +51,6 @@ static const int VID_MIN_WIDTH = 320; static const int VID_MIN_HEIGHT = 200; -static const int VID_MIN_UI_WIDTH = 640; -static const int VID_MIN_UI_HEIGHT = 400; - class player_t; struct sector_t; struct FPortalSceneState;