diff --git a/bin/client.dll b/bin/client.dll index ef3ebcee..1b60fad8 100644 Binary files a/bin/client.dll and b/bin/client.dll differ diff --git a/bin/ms.dll b/bin/ms.dll index 898dedcc..5d53a042 100644 Binary files a/bin/ms.dll and b/bin/ms.dll differ diff --git a/cl_dll/cdll_int.cpp b/cl_dll/cdll_int.cpp index 78ad1192..efc4a97c 100644 --- a/cl_dll/cdll_int.cpp +++ b/cl_dll/cdll_int.cpp @@ -23,10 +23,10 @@ #include "netadr.h" #include "vgui_schememanager.h" #include "logfile.h" +#include //#define LOG_ALLEXPORTS //more exports in entity.cpp - #ifdef LOG_ALLEXPORTS #define logfileopt logfile #else @@ -54,9 +54,66 @@ TeamFortressViewport *gViewPort = NULL; extern void InitScreenGlow(void); extern void RenderScreenGlow(void); -void InitInput (void); -void EV_HookEvents( void ); -void IN_Commands( void ); +void InitInput(void); +void EV_HookEvents(void); +void IN_Commands(void); + +static cvar_s *g_pVarBorderless = NULL; +static int g_iBorderlessMode = 0; + +enum BORDERLESS_WINDOW_TYPES +{ + BORDERLESS_SHOWTASKBAR = 1, + BORDERLESS_FULLSCREEN, + BORDERLESS_RESIZABLE, +}; + +static void SetBorderlessWindow() // Bernt; fixing bloom by making fullscreen windowed a thing *shrugs*! +{ + int iCurrentMode = (g_pVarBorderless ? ((int)g_pVarBorderless->value) : 0); + if ((g_iBorderlessMode == iCurrentMode) || (iCurrentMode <= 0)) + return; + + HWND handle = GetActiveWindow(); + if (!handle) + return; + + RECT area; + const int w = GetSystemMetrics(SM_CXSCREEN); + const int h = GetSystemMetrics(SM_CYSCREEN); + SystemParametersInfoA(SPI_GETWORKAREA, 0, &area, 0); + + switch (iCurrentMode) + { + + case BORDERLESS_SHOWTASKBAR: + { + SetWindowLongPtr(handle, GWL_STYLE, WS_VISIBLE | WS_POPUP); + SetWindowPos(handle, HWND_TOP, 0, 0, w, area.bottom, SWP_FRAMECHANGED); + break; + } + + case BORDERLESS_FULLSCREEN: + { + SetWindowLongPtr(handle, GWL_STYLE, WS_VISIBLE | WS_POPUP); + SetWindowPos(handle, HWND_TOP, 0, 0, w, h, SWP_FRAMECHANGED); + break; + } + + case BORDERLESS_RESIZABLE: + { + DWORD new_style = (WS_POPUP | WS_THICKFRAME | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX); + ::SetWindowLongPtrW(handle, GWL_STYLE, static_cast(new_style)); + ::SetWindowPos(handle, nullptr, 0, 0, w, area.bottom, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE); + ::ShowWindow(handle, SW_SHOW); + break; + } + + } + + g_iBorderlessMode = iCurrentMode; +} + /* ========================== Initialize @@ -192,6 +249,7 @@ int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion ) memcpy(&gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t)); EV_HookEvents(); + g_pVarBorderless = CVAR_CREATE("ms_borderless", "0", FCVAR_ARCHIVE); logfile << "[DLLEXPORT Initialize: Complete]" << endl; @@ -221,6 +279,9 @@ int DLLEXPORT HUD_VidInit( void ) dbg( "Call VGui_Startup" ); VGui_Startup(); + dbg("Try Set Borderless"); + SetBorderlessWindow(); + dbg( "Call Glow" ); // IMAGE-SPACE GLOW - Thothie TWHL JUN2010_22 - see comments in tri.cpp InitScreenGlow(); @@ -259,12 +320,15 @@ void DLLEXPORT HUD_Init( void ) dbg( "Call Scheme_Init" ); Scheme_Init(); + logfile << "[HUD_Init: SetBorderlessWindow]" << endl; + dbg("Call SetBorderlessWindow"); + SetBorderlessWindow(); + logfile << "[HUD_Init: Complete]" << endl; enddbg; } - /* ========================== HUD_Redraw @@ -293,7 +357,6 @@ int DLLEXPORT HUD_Redraw( float time, int intermission ) return 1; } - /* ========================== HUD_UpdateClientData @@ -359,9 +422,10 @@ void DLLEXPORT HUD_Frame( double time ) dbg( "Call ServersThink" ); ServersThink( time ); - dbg( "Call ServersThink DONE" ); + SetBorderlessWindow(); + enddbg; } @@ -402,5 +466,4 @@ void DLLEXPORT HUD_DirectorMessage( int iSize, void *pbuf ) enddbg; -} - +} \ No newline at end of file diff --git a/dlls/server.vcxproj b/dlls/server.vcxproj index 9bf39c7f..ec073aed 100644 --- a/dlls/server.vcxproj +++ b/dlls/server.vcxproj @@ -71,7 +71,7 @@ if ERRORLEVEL 1 exit /b 1 /Zm200 /Gw /Zc:inline Disabled ..\common;..\public;..\public\tier0;..\public\tier1;../cl_dlls;../engine;../common;../pm_shared;../game_shared;../MSShared;./Effects;./gamerules;./Global;./Half-life;./Items;./md5;./Monsters;./Player;./Stats;./Syntax;./Weapons;./ - VPC;RAD_TELEMETRY_DISABLED;_HAS_ITERATOR_DEBUGGING=0;WIN32;_WIN32;_DEBUG;DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_ALLOW_RUNTIME_LIBRARY_MISMATCH;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ALLOW_MSC_VER_MISMATCH;%(PreprocessorDefinitions);COMPILER_MSVC32;COMPILER_MSVC32;COMPILER_MSVC;_DLL_EXT=.dll;DLLNAME=ms;BINK_VIDEO;AVI_VIDEO;WMV_VIDEO;;FRAME_POINTER_OMISSION_DISABLED;VALVE_DLL;_EXTERNAL_DLL_EXT=.dll;VPCGAMECAPS=MSC;PROJECTDIR=E:\Cloud\GIT\MasterSwordClassic\dlls;_DLL_EXT=.dll;VPCGAME=msc;SOURCE1=1 + VPC;RAD_TELEMETRY_DISABLED;_HAS_ITERATOR_DEBUGGING=0;WIN32;_WIN32;_DEBUG;DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_ALLOW_RUNTIME_LIBRARY_MISMATCH;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ALLOW_MSC_VER_MISMATCH;%(PreprocessorDefinitions);COMPILER_MSVC32;COMPILER_MSVC32;COMPILER_MSVC;_DLL_EXT=.dll;DLLNAME=ms;BINK_VIDEO;AVI_VIDEO;WMV_VIDEO;;FRAME_POINTER_OMISSION_DISABLED;VALVE_DLL;_EXTERNAL_DLL_EXT=.dll;VPCGAMECAPS=MSC;PROJECTDIR=E:\Cloud\GIT\MasterSwordClassic\dlls;_DLL_EXT=.dll;SOURCE1=1;VPCGAME=msc true false Default @@ -167,7 +167,7 @@ if ERRORLEVEL 1 exit /b 1 true Speed ..\common;..\public;..\public\tier0;../cl_dlls;../engine;../common;../pm_shared;../game_shared;../MSShared;./Effects;./gamerules;./Global;./Half-life;./Items;./md5;./Monsters;./Player;./Stats;./Syntax;./Weapons;./ - VPC;RAD_TELEMETRY_DISABLED;WIN32;_WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_ALLOW_RUNTIME_LIBRARY_MISMATCH;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ALLOW_MSC_VER_MISMATCH;%(PreprocessorDefinitions);COMPILER_MSVC32;COMPILER_MSVC32;COMPILER_MSVC;_DLL_EXT=.dll;DLLNAME=ms;BINK_VIDEO;AVI_VIDEO;WMV_VIDEO;;FRAME_POINTER_OMISSION_DISABLED;VALVE_DLL;_EXTERNAL_DLL_EXT=.dll;VPCGAMECAPS=MSC;PROJECTDIR=E:\Cloud\GIT\MasterSwordClassic\dlls;_DLL_EXT=.dll;VPCGAME=msc;SOURCE1=1 + VPC;RAD_TELEMETRY_DISABLED;WIN32;_WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_ALLOW_RUNTIME_LIBRARY_MISMATCH;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ALLOW_MSC_VER_MISMATCH;%(PreprocessorDefinitions);COMPILER_MSVC32;COMPILER_MSVC32;COMPILER_MSVC;_DLL_EXT=.dll;DLLNAME=ms;BINK_VIDEO;AVI_VIDEO;WMV_VIDEO;;FRAME_POINTER_OMISSION_DISABLED;VALVE_DLL;_EXTERNAL_DLL_EXT=.dll;VPCGAMECAPS=MSC;PROJECTDIR=E:\Cloud\GIT\MasterSwordClassic\dlls;_DLL_EXT=.dll;SOURCE1=1;VPCGAME=msc true false MultiThreaded