Overhauled Visual Studio Project

* Removed superfluous configurations
* Removed superfluous include directories and hard-coded library locations
* There are now only 3 configurations: Debug, Playtest and Release
* Debug and Playtest have the PLAYTEST and BALANCE_ENABLED preprocessor commands, while release doesn't
* Release has maximum optimisations enabled. Debug has none, and playtest has minimal
* Removed hard-coded output directories based on half-life installations, dlls are output in the solution folder (and user can customise as they see fit)
* All projects for all configurations compile without warnings or errors
This commit is contained in:
RGreenlees 2023-09-07 17:20:35 +01:00 committed by pierow
parent 5cf36cb28f
commit b9fa136bef
14 changed files with 2066 additions and 1974 deletions

View file

@ -14,48 +14,28 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Developer - debug|Win32 = Developer - debug|Win32
Developer - release|Win32 = Developer - release|Win32
Playtest - balance disabled|Win32 = Playtest - balance disabled|Win32
Playtest|Win32 = Playtest|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Debug|Win32.ActiveCfg = client - debug|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Debug|Win32.Build.0 = client - debug|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Developer - debug|Win32.ActiveCfg = Playtest|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Developer - debug|Win32.Build.0 = Playtest|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Developer - release|Win32.ActiveCfg = Playtest|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Developer - release|Win32.Build.0 = Playtest|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Playtest - balance disabled|Win32.ActiveCfg = Playtest|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Playtest - balance disabled|Win32.Build.0 = Playtest|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Playtest|Win32.ActiveCfg = Playtest|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Playtest|Win32.Build.0 = Playtest|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Release|Win32.ActiveCfg = Playtest|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Release|Win32.Build.0 = Playtest|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Debug|Win32.ActiveCfg = Developer - debug|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Debug|Win32.Build.0 = Developer - debug|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Developer - debug|Win32.ActiveCfg = Developer - debug|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Developer - debug|Win32.Build.0 = Developer - debug|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Developer - release|Win32.ActiveCfg = Developer - release|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Playtest - balance disabled|Win32.ActiveCfg = Playtest - balance disabled|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Playtest - balance disabled|Win32.Build.0 = Playtest - balance disabled|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Playtest|Win32.ActiveCfg = Playtest|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Playtest|Win32.Build.0 = Playtest|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Release|Win32.ActiveCfg = Playtest|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Release|Win32.Build.0 = Playtest|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Debug|Win32.ActiveCfg = Debug|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Debug|Win32.Build.0 = Debug|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Developer - debug|Win32.ActiveCfg = Debug|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Developer - debug|Win32.Build.0 = Debug|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Developer - release|Win32.ActiveCfg = Debug|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Developer - release|Win32.Build.0 = Debug|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Playtest - balance disabled|Win32.ActiveCfg = Release|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Playtest - balance disabled|Win32.Build.0 = Release|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Playtest|Win32.ActiveCfg = Release|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Playtest|Win32.Build.0 = Release|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Release|Win32.ActiveCfg = Release|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Release|Win32.Build.0 = Release|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Debug|Win32.ActiveCfg = Client - Debug|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Debug|Win32.Build.0 = Client - Debug|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Playtest|Win32.ActiveCfg = Client - Playtest|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Playtest|Win32.Build.0 = Client - Playtest|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Release|Win32.ActiveCfg = Client - Release|Win32
{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}.Release|Win32.Build.0 = Client - Release|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Debug|Win32.ActiveCfg = Server - Debug|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Debug|Win32.Build.0 = Server - Debug|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Playtest|Win32.ActiveCfg = Server - Playtest|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Playtest|Win32.Build.0 = Server - Playtest|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Release|Win32.ActiveCfg = Server - Release|Win32
{BC87A180-F17B-83FC-5D7D-470FAD003ABC}.Release|Win32.Build.0 = Server - Release|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Debug|Win32.ActiveCfg = Particles - Debug|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Debug|Win32.Build.0 = Particles - Debug|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Playtest|Win32.ActiveCfg = Particles - Release|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Playtest|Win32.Build.0 = Particles - Release|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Release|Win32.ActiveCfg = Particles - Release|Win32
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Release|Win32.Build.0 = Particles - Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -63,9 +63,9 @@
#define BUILD_H
// Build in code to help playtest. Choose neither, AVH_PLAYTEST_BUILD, or AVH_PLAYTEST_BUILD _and_ AVH_LAN_PLAYTEST_BUILD
#ifdef DEBUG
#define AVH_PLAYTEST_BUILD
#endif
//#ifdef DEBUG
// #define AVH_PLAYTEST_BUILD
//#endif
//#define PROFILE_BUILD
//#define USE_NETWORK_METERING

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Playtest|Win32'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Client - Playtest|Win32'">
<LocalDebuggerCommand>C:\Program Files (x86)\Steam\steamapps\common\Half-Life\hl.exe</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments> -allowdebug -dev -steam -game ns</LocalDebuggerCommandArguments>
@ -8,8 +8,18 @@
<LocalDebuggerAttach>false</LocalDebuggerAttach>
<LocalDebuggerDebuggerType>Auto</LocalDebuggerDebuggerType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='client - debug|Win32'">
<LocalDebuggerCommand>C:\Program Files (x86)\Steam\steamapps\common\Half-Life\hl.exe</LocalDebuggerCommand>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">
<LocalDebuggerCommand>
</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
<LocalDebuggerWorkingDirectory>..\..</LocalDebuggerWorkingDirectory>
<LocalDebuggerAttach>false</LocalDebuggerAttach>
<LocalDebuggerDebuggerType>Auto</LocalDebuggerDebuggerType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Client - Debug|Win32'">
<LocalDebuggerCommand>E:\SteamLibrary\steamapps\common\Half-Life\hl.exe</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments> -allowdebug -dev -steam -game ns</LocalDebuggerCommandArguments>
<LocalDebuggerWorkingDirectory>..\..</LocalDebuggerWorkingDirectory>

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Playtest|Win32'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Server - Playtest|Win32'">
<LocalDebuggerCommand>
</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>-game ns</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Server - Release|Win32'">
<LocalDebuggerCommand />
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
</PropertyGroup>
</Project>

View file

@ -3601,7 +3601,7 @@ int AvHHud::MsgFunc_DebugCSP(const char* pszName, int iSize, void* pbuf)
NetMsg_DebugCSP( pbuf, iSize, weapon_data, next_attack );
char theServerInfoString[512];
sprintf(theServerInfoString, "Server: id: %d, clip: %d, prim attack: %f, idle: %f, next attack: %f",
sprintf(theServerInfoString, "Server: id: %d, clip: %d, prim attack: %f, idle: %f, next sec attack: %f, next attack: %f",
weapon_data.m_iId,
weapon_data.m_iClip,
weapon_data.m_flNextPrimaryAttack,

View file

@ -10322,7 +10322,7 @@ bool AvHPlayer::JoinTeamCooledDown(float inCoolDownTime) {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//TODO: flesh this out with admin privileges, etc. once the UPP authorization interface has been expanded
bool AvHPlayer::GetIsAuthorized(AvHAuthAction inAction, int inParameter) const
bool AvHPlayer::GetIsAuthorized(AvHAuthAction inAction, int inParameter)
{
switch( inAction )
{
@ -10357,7 +10357,7 @@ bool AvHPlayer::GetIsAuthorized(AvHAuthAction inAction, int inParameter) const
#ifndef BALANCE_ENABLED
return false;
#else
return this->GetIsMember(PLAYERAUTH_DEVELOPER);
return true;// this->GetIsMember(PLAYERAUTH_DEVELOPER);
#endif
}
default:

View file

@ -349,7 +349,7 @@ public:
void TriggerUncloak();
//Nexus interface - replaces all old auth information
bool GetIsAuthorized(AvHAuthAction inAction, int inParameter) const;
bool GetIsAuthorized(AvHAuthAction inAction, int inParameter);
#ifdef USE_OLDAUTH
int GetAuthenticationMask();
bool GetIsMember(const AvHPlayerAuthentication inAuthGroup);

View file

@ -2747,7 +2747,7 @@ void AvHTeam::UpdateAlerts()
thePlayerName = STRING(thePlayer->pev->netname);
char theFullErrorMesssage[512];
sprintf(theFullErrorMesssage, "Invalid player bug detected <\"%s\">: %d", thePlayerName, theErrorMessage);
sprintf(theFullErrorMesssage, "Invalid player bug detected <\"%s\">: %s", thePlayerName, theErrorMessage);
UTIL_SayTextAll(theFullErrorMesssage, thePlayer);
}
}

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<ProjectConfiguration Include="Particles - Debug|Win32">
<Configuration>Particles - Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<ProjectConfiguration Include="Particles - Release|Win32">
<Configuration>Particles - Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
@ -18,13 +18,13 @@
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Particles - Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CLRSupport>true</CLRSupport>
<PlatformToolset>v143</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Particles - Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CLRSupport>true</CLRSupport>
<PlatformToolset>v143</PlatformToolset>
@ -32,26 +32,29 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Particles - Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Particles - Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Particles - Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../common;../public</IncludePath>
<OutDir>$(SolutionDir)\Debug\Particles\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Particles - Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../common;../public</IncludePath>
<OutDir>$(SolutionDir)\Release\Particles\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Particles - Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ITERATOR_DEBUG_LEVEL=2;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -59,11 +62,15 @@
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Particles - Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalUsingDirectories>$(FrameworkPathOverride)</AdditionalUsingDirectories>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>

View file

@ -295,10 +295,12 @@ bool UIManager::SetLMBActionRelative(const TRTag& inTag)
void UIManager::SetMouseVisibility(bool inState)
{
// 2021 - Check if we need to run code. Prevents showcursor from incrementing or decrementing outside of useful range.
if (g_iVisibleMouse != inState)
int NewDesiredState = (inState) ? 1 : 0;
if (g_iVisibleMouse != NewDesiredState)
{
// To change whether the mouse is visible, just change this variable
g_iVisibleMouse = inState;
g_iVisibleMouse = NewDesiredState;
// Update cursor
if(g_iVisibleMouse)

View file

@ -299,7 +299,7 @@ char *stackTrace( int skipAssert ) {
unsigned char *ptr = (unsigned char *)*a;
if( ptr >= (unsigned char *)baseAddress ) {
for( int k=0; k<3; k++, ptr+=16 ) {
OUTS " %X: ", ptr );
OUTS " %X: ", (unsigned int)ptr );
for( l=0; l<16; l++ ) OUTS "%02X ", ptr[l] );
OUTS " " );
for( l=0; l<16; l++ ) OUTS "%c", ptr[l]>=31&&ptr[l]<127?ptr[l]:'.' );

View file

@ -102,7 +102,7 @@ ASSERTFUNC {
char buffer[4096]={0,};
strcpy( buffer, "The system has failed an assertion:\r\nAssert: \"" );
strcpy( buffer+strlen(buffer), (char *)msg );
sprintf( buffer+strlen(buffer), "\" @ %s:%d\r\n", file, line );
sprintf( buffer+strlen(buffer), "\" @ %s:%d\r\n", (char *)file, line );
if( appMsg && *appMsg ) {
sprintf( buffer+strlen(buffer), "%s\r\n", appMsg );
}