diff --git a/.gitignore b/.gitignore index 618c836d01..47d756e7f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,40 @@ *.mak *.mak.vpc_crc *.vpc_crc +*.vpc.* *.project *obj_* .waf* .lock-waf* __pycache__ *.pyc +.vs/ +Debug/ +Debug_*/ +Release/ +Release_*/ +*.tlog/ +*.obj +*.pch +*.log +*.idb +*.pdb +*.rc +*.bin +*.vcxproj* +*.sln +*.dll* +*.exp +*.ilk +ValveETWProviderEvents.h +game/client/*/client.lib +game/server/*/server.lib .DS_Store build*/ android/ .cache/ .ccache/ +waf3*/ +.vscode/ +.depproj/ +source-engine.sln \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 8072bb24c8..9dfb40cb16 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,4 +6,4 @@ url = https://github.com/nillerusr/source-physics [submodule "lib"] path = lib - url = https://github.com/nillerusr/source-engine-libs + url = https://github.com/nillerusr/source-engine-libs.git diff --git a/README.md b/README.md index 9b98ac05bc..2126715851 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,19 @@ Welcome to source engine:) Discord: https://discord.gg/hZRB7WMgGw # Current tasks +- [x] Windows build support for waf - [x] NEON support - [x] remove unnecessary dependencies - [x] Arm(android) port - [x] replace current buildsystem with waf - [x] rewrite achivement system( to work without steam ) - [x] 64-bit support +- [x] VTF 7.5 support - [ ] improve performance - [ ] fixing bugs - [ ] dxvk-native support - [ ] Elbrus port - [ ] rewrite serverbrowser to work without steam -- [ ] Windows build support for waf # [How to Build?](https://github.com/nillerusr/source-engine/wiki/How-to-build) diff --git a/appframework/wscript b/appframework/wscript index d5126d96dd..29822a4b18 100755 --- a/appframework/wscript +++ b/appframework/wscript @@ -18,13 +18,24 @@ def build(bld): source = [ 'AppSystemGroup.cpp', '../public/filesystem_init.cpp', -# 'vguimatsysapp.cpp' [$WIN32] -# 'winapp.cpp' [$WIN32] - 'posixapp.cpp',# [$POSIX] - 'sdlmgr.cpp'# [$SDL] # 'glmrendererinfo_osx.mm' [$OSXALL] ] + if bld.env.SDL: + source += [ + 'sdlmgr.cpp' + ] + + if bld.env.DEST_OS == 'win32': + source += [ + 'vguimatsysapp.cpp', + 'winapp.cpp' + ] + else: + source += [ + 'posixapp.cpp',# [$POSIX] + ] + includes = [ '.', '../public', diff --git a/bitmap/bitmap.vpc b/bitmap/bitmap.vpc index 9471c15e5f..2faadbda2b 100644 --- a/bitmap/bitmap.vpc +++ b/bitmap/bitmap.vpc @@ -15,6 +15,8 @@ $Configuration $AdditionalIncludeDirectories "$BASE;$SRCDIR\dx9sdk\include" [$WINDOWS] $AdditionalIncludeDirectories "$BASE;$SRCDIR\x360xdk\include\win32\vs2005" [$WINDOWS] $AdditionalIncludeDirectories "$BASE;$SRCDIR\thirdparty\stb" + + $PreprocessorDefinitions "$BASE;NO_X360_XDK;" [!$X360] } } diff --git a/bitmap/colorconversion.cpp b/bitmap/colorconversion.cpp index 38601ed16c..72325520d6 100644 --- a/bitmap/colorconversion.cpp +++ b/bitmap/colorconversion.cpp @@ -828,7 +828,7 @@ bool ConvertToATIxN( const uint8 *src, ImageFormat srcImageFormat, uint8 *dst, ImageFormat dstImageFormat, int width, int height, int srcStride, int dstStride ) { -#if !defined( _X360 ) && !defined( POSIX ) +#if 0 // from rgb(a) to ATIxN if( srcStride != 0 || dstStride != 0 ) @@ -877,7 +877,7 @@ bool ConvertToDXTLegacy( const uint8 *src, ImageFormat srcImageFormat, uint8 *dst, ImageFormat dstImageFormat, int width, int height, int srcStride, int dstStride ) { -#if !defined( _X360 ) && !defined( POSIX ) +#if 0 // from rgb(a) to dxtN if( srcStride != 0 || dstStride != 0 ) return false; diff --git a/bitmap/wscript b/bitmap/wscript index dae3a16f45..ae3a8e9d20 100755 --- a/bitmap/wscript +++ b/bitmap/wscript @@ -21,7 +21,6 @@ def build(bld): 'float_bm.cpp', 'float_bm2.cpp', 'float_bm3.cpp', - #'float_bm4.cpp', [$WINDOWS] 'float_bm_bilateral_filter.cpp', 'float_cube.cpp', 'imageformat.cpp', @@ -31,6 +30,11 @@ def build(bld): 'tgawriter.cpp', 'bitmap.cpp' ] + + if bld.env.DEST_OS == 'win32': + source += [ + 'float_bm4.cpp' + ] includes = [ '.', @@ -43,6 +47,9 @@ def build(bld): defines = [] libs = [] + + #if bld.env.DEST_OS == 'win32': + # libs += ['NVTC', 'ATI_COMPRESS_MT_VC10'] bld.stlib( source = source, diff --git a/common/ServerBrowser/blacklisted_server_manager.cpp b/common/ServerBrowser/blacklisted_server_manager.cpp index 95fcbfc919..c1b451b299 100644 --- a/common/ServerBrowser/blacklisted_server_manager.cpp +++ b/common/ServerBrowser/blacklisted_server_manager.cpp @@ -53,12 +53,12 @@ int CBlacklistedServerManager::LoadServersFromFile( const char *pszFilename, boo { const char *pszName = pData->GetString( "name" ); - uint32 ulDate = pData->GetInt( "date" ); + uint64 ullDate = pData->GetUint64( "date" ); if ( bResetTimes ) { time_t today; time( &today ); - ulDate = today; + ullDate = (uint64)today; } const char *pszNetAddr = pData->GetString( "addr" ); @@ -68,7 +68,7 @@ int CBlacklistedServerManager::LoadServersFromFile( const char *pszFilename, boo m_Blacklist[iIdx].m_nServerID = m_iNextServerID++; V_strncpy( m_Blacklist[iIdx].m_szServerName, pszName, sizeof( m_Blacklist[iIdx].m_szServerName ) ); - m_Blacklist[iIdx].m_ulTimeBlacklistedAt = ulDate; + m_Blacklist[iIdx].m_ullTimeBlacklistedAt = ullDate; m_Blacklist[iIdx].m_NetAdr.SetFromString( pszNetAddr ); ++count; @@ -92,7 +92,7 @@ void CBlacklistedServerManager::SaveToFile( const char *pszFilename ) { KeyValues *pSubKey = new KeyValues( "server" ); pSubKey->SetString( "name", m_Blacklist[i].m_szServerName ); - pSubKey->SetInt( "date", m_Blacklist[i].m_ulTimeBlacklistedAt ); + pSubKey->SetUint64( "date", m_Blacklist[i].m_ullTimeBlacklistedAt ); pSubKey->SetString( "addr", m_Blacklist[i].m_NetAdr.ToString() ); pKV->AddSubKey( pSubKey ); } @@ -120,7 +120,7 @@ blacklisted_server_t *CBlacklistedServerManager::AddServer( gameserveritem_t &se time_t today; time( &today ); - m_Blacklist[iIdx].m_ulTimeBlacklistedAt = today; + m_Blacklist[iIdx].m_ullTimeBlacklistedAt = (uint64)today; m_Blacklist[iIdx].m_NetAdr = netAdr; m_Blacklist[iIdx].m_nServerID = m_iNextServerID++; @@ -145,7 +145,7 @@ blacklisted_server_t *CBlacklistedServerManager::AddServer( const char *serverNa time_t today; time( &today ); - m_Blacklist[iIdx].m_ulTimeBlacklistedAt = today; + m_Blacklist[iIdx].m_ullTimeBlacklistedAt = (uint64)today; m_Blacklist[iIdx].m_NetAdr = netAdr; m_Blacklist[iIdx].m_nServerID = m_iNextServerID++; @@ -157,7 +157,7 @@ blacklisted_server_t *CBlacklistedServerManager::AddServer( const char *serverNa //----------------------------------------------------------------------------- // Purpose: Add the given server to the blacklist. Return added server. //----------------------------------------------------------------------------- -blacklisted_server_t *CBlacklistedServerManager::AddServer( const char *serverName, const char *netAddressString, uint32 timestamp ) +blacklisted_server_t *CBlacklistedServerManager::AddServer( const char *serverName, const char *netAddressString, uint64 timestamp ) { netadr_t netAdr( netAddressString ); @@ -168,7 +168,7 @@ blacklisted_server_t *CBlacklistedServerManager::AddServer( const char *serverNa int iIdx = m_Blacklist.AddToTail(); V_strncpy( m_Blacklist[iIdx].m_szServerName, serverName, sizeof( m_Blacklist[iIdx].m_szServerName ) ); - m_Blacklist[iIdx].m_ulTimeBlacklistedAt = timestamp; + m_Blacklist[iIdx].m_ullTimeBlacklistedAt = timestamp; m_Blacklist[iIdx].m_NetAdr = netAdr; m_Blacklist[iIdx].m_nServerID = m_iNextServerID++; diff --git a/common/ServerBrowser/blacklisted_server_manager.h b/common/ServerBrowser/blacklisted_server_manager.h index cd8173fdaf..623a4feb49 100644 --- a/common/ServerBrowser/blacklisted_server_manager.h +++ b/common/ServerBrowser/blacklisted_server_manager.h @@ -23,7 +23,7 @@ struct blacklisted_server_t { int m_nServerID; char m_szServerName[64]; - uint32 m_ulTimeBlacklistedAt; + uint64 m_ullTimeBlacklistedAt; netadr_t m_NetAdr; }; @@ -40,7 +40,7 @@ public: blacklisted_server_t *AddServer( gameserveritem_t &server ); blacklisted_server_t *AddServer( const char *serverName, uint32 serverIP, int serverPort ); - blacklisted_server_t *AddServer( const char *serverName, const char *netAddressString, uint32 timestamp ); + blacklisted_server_t *AddServer( const char *serverName, const char *netAddressString, uint64 timestamp ); void RemoveServer( int iServerID ); // remove server with matching 'server id' from list diff --git a/createallprojects b/createallprojects deleted file mode 100755 index 596c2eb8c8..0000000000 --- a/createallprojects +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -pushd `dirname $0` -devtools/bin/vpc /f /hl2 +everything /mksln everything -popd diff --git a/createallprojects.bat b/createallprojects.bat deleted file mode 100644 index b9b78bf1eb..0000000000 --- a/createallprojects.bat +++ /dev/null @@ -1 +0,0 @@ -devtools\bin\vpc.exe /2013 +everything /mksln everything.sln diff --git a/datacache/datacache.vpc b/datacache/datacache.vpc index e8805b46fa..27a64f56a1 100644 --- a/datacache/datacache.vpc +++ b/datacache/datacache.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/datacache/wscript b/datacache/wscript index 3cb9a27761..4eddce12a6 100755 --- a/datacache/wscript +++ b/datacache/wscript @@ -20,7 +20,8 @@ def build(bld): 'mdlcache.cpp', '../public/studio.cpp', '../public/studio_virtualmodel.cpp', - '../common/studiobyteswap.cpp' + '../common/studiobyteswap.cpp', + '../public/tier0/memoverride.cpp' ] includes = [ diff --git a/dedicated/dedicated.vpc b/dedicated/dedicated.vpc index fccc53a785..0f5a47beef 100644 --- a/dedicated/dedicated.vpc +++ b/dedicated/dedicated.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" $include "$SRCDIR\vpc_scripts\source_cryptlib_include.vpc" @@ -142,6 +142,7 @@ $Project "Dedicated" $Lib tier2 $Lib tier3 $Lib vgui_controls [$WIN32] + $Lib vpklib $LibExternal "$SRCDIR/thirdparty/libedit-3.1/src/.libs/libedit" [$LINUXALL] $ImpLibExternal steam_api $ImpLib SDL2 [$SDL] diff --git a/dedicated/wscript b/dedicated/wscript index 131e5ff86a..11e56fd001 100755 --- a/dedicated/wscript +++ b/dedicated/wscript @@ -24,11 +24,8 @@ def build(bld): '../common/SteamAppStartup.cpp', 'sys_common.cpp', 'sys_ded.cpp', - #'sys_windows.cpp', [$WINDOWS] - 'sys_linux.cpp', # [$POSIX] 'console/conproc.cpp', 'console/textconsole.cpp', - 'console/TextConsoleUnix.cpp', # [$POSIX] '../filesystem/filetracker.cpp', '../filesystem/basefilesystem.cpp', '../filesystem/packfile.cpp', @@ -36,9 +33,20 @@ def build(bld): '../filesystem/filesystem_stdio.cpp', '../filesystem/QueuedLoader.cpp', '../public/zip_utils.cpp', - '../filesystem/linux_support.cpp' # [$POSIX] + '../public/tier0/memoverride.cpp' ] + if bld.env.DEST_OS == 'win32': + source += [ + 'sys_windows.cpp' + ] + else: + source += [ + 'sys_linux.cpp', # [$POSIX] + 'console/TextConsoleUnix.cpp', # [$POSIX] + '../filesystem/linux_support.cpp' # [$POSIX] + ] + includes = [ '.', '../public', diff --git a/devtools/bin/vpc.exe b/devtools/bin/vpc.exe index e611043031..407acc2f8a 100755 Binary files a/devtools/bin/vpc.exe and b/devtools/bin/vpc.exe differ diff --git a/dx9sdk/lib/DxErr8.lib b/dx9sdk/lib/DxErr8.lib deleted file mode 100644 index 8789a288b3..0000000000 --- a/dx9sdk/lib/DxErr8.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3e3a0893326c705d44a13d9263681df9b50a3112f37c45488f5e4919f3b3d26e -size 1083572 diff --git a/dx9sdk/lib/DxErr9.lib b/dx9sdk/lib/DxErr9.lib deleted file mode 100644 index c3ebc387ac..0000000000 --- a/dx9sdk/lib/DxErr9.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0dcf72695c4dc029768d2d8fadb5d61d56dcf896bb9683dc936f8a046c608495 -size 3901404 diff --git a/dx9sdk/lib/XInput.lib b/dx9sdk/lib/XInput.lib deleted file mode 100644 index d07060d910..0000000000 --- a/dx9sdk/lib/XInput.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ef5622f062ea151ea49aee29903562b819bd65c90b052877c127ebcd428895dd -size 3436 diff --git a/dx9sdk/lib/amd64/D3DCSX.lib b/dx9sdk/lib/amd64/D3DCSX.lib new file mode 100644 index 0000000000..8e2f059c29 Binary files /dev/null and b/dx9sdk/lib/amd64/D3DCSX.lib differ diff --git a/dx9sdk/lib/amd64/D3DCSXd.lib b/dx9sdk/lib/amd64/D3DCSXd.lib new file mode 100644 index 0000000000..6735a4ddbb Binary files /dev/null and b/dx9sdk/lib/amd64/D3DCSXd.lib differ diff --git a/dx9sdk/lib/amd64/DxErr.lib b/dx9sdk/lib/amd64/DxErr.lib new file mode 100644 index 0000000000..a4fb226998 Binary files /dev/null and b/dx9sdk/lib/amd64/DxErr.lib differ diff --git a/dx9sdk/lib/amd64/X3DAudio.lib b/dx9sdk/lib/amd64/X3DAudio.lib new file mode 100644 index 0000000000..3f730213f3 Binary files /dev/null and b/dx9sdk/lib/amd64/X3DAudio.lib differ diff --git a/dx9sdk/lib/amd64/XAPOFX.lib b/dx9sdk/lib/amd64/XAPOFX.lib new file mode 100644 index 0000000000..02a65259bc Binary files /dev/null and b/dx9sdk/lib/amd64/XAPOFX.lib differ diff --git a/dx9sdk/lib/amd64/XInput.lib b/dx9sdk/lib/amd64/XInput.lib new file mode 100644 index 0000000000..5545d28577 Binary files /dev/null and b/dx9sdk/lib/amd64/XInput.lib differ diff --git a/dx9sdk/lib/amd64/d2d1.lib b/dx9sdk/lib/amd64/d2d1.lib new file mode 100644 index 0000000000..505e6d730d Binary files /dev/null and b/dx9sdk/lib/amd64/d2d1.lib differ diff --git a/dx9sdk/lib/amd64/d3d10.lib b/dx9sdk/lib/amd64/d3d10.lib new file mode 100644 index 0000000000..2b08450b8d Binary files /dev/null and b/dx9sdk/lib/amd64/d3d10.lib differ diff --git a/dx9sdk/lib/amd64/d3d10_1.lib b/dx9sdk/lib/amd64/d3d10_1.lib new file mode 100644 index 0000000000..4b2ef6255d Binary files /dev/null and b/dx9sdk/lib/amd64/d3d10_1.lib differ diff --git a/dx9sdk/lib/amd64/d3d11.lib b/dx9sdk/lib/amd64/d3d11.lib new file mode 100644 index 0000000000..441d85b59c Binary files /dev/null and b/dx9sdk/lib/amd64/d3d11.lib differ diff --git a/dx9sdk/lib/amd64/d3d9.lib b/dx9sdk/lib/amd64/d3d9.lib new file mode 100644 index 0000000000..62b3f75640 Binary files /dev/null and b/dx9sdk/lib/amd64/d3d9.lib differ diff --git a/dx9sdk/lib/amd64/d3dcompiler.lib b/dx9sdk/lib/amd64/d3dcompiler.lib new file mode 100644 index 0000000000..15c8301dad Binary files /dev/null and b/dx9sdk/lib/amd64/d3dcompiler.lib differ diff --git a/dx9sdk/lib/amd64/d3dx10.lib b/dx9sdk/lib/amd64/d3dx10.lib new file mode 100644 index 0000000000..cfd7b9fa6b Binary files /dev/null and b/dx9sdk/lib/amd64/d3dx10.lib differ diff --git a/dx9sdk/lib/amd64/d3dx10d.lib b/dx9sdk/lib/amd64/d3dx10d.lib new file mode 100644 index 0000000000..c4b45a7f44 Binary files /dev/null and b/dx9sdk/lib/amd64/d3dx10d.lib differ diff --git a/dx9sdk/lib/amd64/d3dx11.lib b/dx9sdk/lib/amd64/d3dx11.lib new file mode 100644 index 0000000000..92a666facb Binary files /dev/null and b/dx9sdk/lib/amd64/d3dx11.lib differ diff --git a/dx9sdk/lib/amd64/d3dx11d.lib b/dx9sdk/lib/amd64/d3dx11d.lib new file mode 100644 index 0000000000..2b116fe6aa Binary files /dev/null and b/dx9sdk/lib/amd64/d3dx11d.lib differ diff --git a/dx9sdk/lib/amd64/d3dx9.lib b/dx9sdk/lib/amd64/d3dx9.lib new file mode 100644 index 0000000000..8587d5b07f Binary files /dev/null and b/dx9sdk/lib/amd64/d3dx9.lib differ diff --git a/dx9sdk/lib/amd64/d3dx9d.lib b/dx9sdk/lib/amd64/d3dx9d.lib new file mode 100644 index 0000000000..2f3ebf7732 Binary files /dev/null and b/dx9sdk/lib/amd64/d3dx9d.lib differ diff --git a/dx9sdk/lib/amd64/d3dxof.lib b/dx9sdk/lib/amd64/d3dxof.lib new file mode 100644 index 0000000000..66dbd30377 Binary files /dev/null and b/dx9sdk/lib/amd64/d3dxof.lib differ diff --git a/dx9sdk/lib/amd64/dinput8.lib b/dx9sdk/lib/amd64/dinput8.lib new file mode 100644 index 0000000000..fcd91e1489 Binary files /dev/null and b/dx9sdk/lib/amd64/dinput8.lib differ diff --git a/dx9sdk/lib/amd64/dsound.lib b/dx9sdk/lib/amd64/dsound.lib new file mode 100644 index 0000000000..a85fc8671a Binary files /dev/null and b/dx9sdk/lib/amd64/dsound.lib differ diff --git a/dx9sdk/lib/amd64/dwrite.lib b/dx9sdk/lib/amd64/dwrite.lib new file mode 100644 index 0000000000..15416c63ac Binary files /dev/null and b/dx9sdk/lib/amd64/dwrite.lib differ diff --git a/dx9sdk/lib/amd64/dxgi.lib b/dx9sdk/lib/amd64/dxgi.lib new file mode 100644 index 0000000000..83639be867 Binary files /dev/null and b/dx9sdk/lib/amd64/dxgi.lib differ diff --git a/dx9sdk/lib/amd64/dxguid.lib b/dx9sdk/lib/amd64/dxguid.lib new file mode 100644 index 0000000000..f3994f9c46 Binary files /dev/null and b/dx9sdk/lib/amd64/dxguid.lib differ diff --git a/dx9sdk/lib/amd64/xapobase.lib b/dx9sdk/lib/amd64/xapobase.lib new file mode 100644 index 0000000000..9a1bbcbf14 Binary files /dev/null and b/dx9sdk/lib/amd64/xapobase.lib differ diff --git a/dx9sdk/lib/amd64/xapobased.lib b/dx9sdk/lib/amd64/xapobased.lib new file mode 100644 index 0000000000..63fd4744e0 Binary files /dev/null and b/dx9sdk/lib/amd64/xapobased.lib differ diff --git a/dx9sdk/lib/amstrmid.lib b/dx9sdk/lib/amstrmid.lib deleted file mode 100644 index 1ab9928f66..0000000000 --- a/dx9sdk/lib/amstrmid.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:11049ebe22f538fd6ca0d6231012c01bf7b867ee181c976fdeba2a666926ae24 -size 272820 diff --git a/dx9sdk/lib/d3d8.lib b/dx9sdk/lib/d3d8.lib deleted file mode 100644 index 7d118c637e..0000000000 --- a/dx9sdk/lib/d3d8.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5f410143bdc4fd43a2de62f03837aae135009952c08a1dfef19dcf2d898e75f7 -size 2466 diff --git a/dx9sdk/lib/d3d9.lib b/dx9sdk/lib/d3d9.lib deleted file mode 100644 index 6f0645baa3..0000000000 --- a/dx9sdk/lib/d3d9.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:461a9baf9d7a3e6ce4b04ef7814296c0fcad36ec77deb7566b361cbdabf6e3d7 -size 4988 diff --git a/dx9sdk/lib/d3dx.lib b/dx9sdk/lib/d3dx.lib deleted file mode 100644 index 3f3742d491..0000000000 --- a/dx9sdk/lib/d3dx.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2a7302d67797790fa68dd8c42308621e90971dc71179c702574208b3e56b351f -size 614522 diff --git a/dx9sdk/lib/d3dx8.lib b/dx9sdk/lib/d3dx8.lib deleted file mode 100644 index 82a6c72c17..0000000000 --- a/dx9sdk/lib/d3dx8.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0d5bd10baa80550e2a063e16867723f2fa6a7269a4afef86517a46293958849d -size 2151212 diff --git a/dx9sdk/lib/d3dx8d.lib b/dx9sdk/lib/d3dx8d.lib deleted file mode 100644 index 3d42772a69..0000000000 --- a/dx9sdk/lib/d3dx8d.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2b4f081d23b65686c5d0821eb3fb5f3aaf08972f9539a9ce589499700c227c74 -size 53414 diff --git a/dx9sdk/lib/d3dx8dt.lib b/dx9sdk/lib/d3dx8dt.lib deleted file mode 100644 index 185d2d720e..0000000000 --- a/dx9sdk/lib/d3dx8dt.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:eddac0b46ac664863136e9c3aa85fa5276e029b8972433fdf1cc40dcc3aefe8f -size 2467156 diff --git a/dx9sdk/lib/d3dx9.lib b/dx9sdk/lib/d3dx9.lib deleted file mode 100644 index 7d60606ecb..0000000000 --- a/dx9sdk/lib/d3dx9.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0b1cd009d5e5ed15080c4d7ad0245a273242da07e0747921e80ac3ccf9bc0fc2 -size 87600 diff --git a/dx9sdk/lib/d3dx9d.lib b/dx9sdk/lib/d3dx9d.lib deleted file mode 100644 index f85fd2fc88..0000000000 --- a/dx9sdk/lib/d3dx9d.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f97e80701a1ed7a4d13bc3315a76512ff9abe7dff595d4dd50c323aaf5147185 -size 82790 diff --git a/dx9sdk/lib/d3dx9dt.lib b/dx9sdk/lib/d3dx9dt.lib deleted file mode 100644 index f3d69be97f..0000000000 --- a/dx9sdk/lib/d3dx9dt.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd431d9ec65c3d3fd401b89aba77d83551e06ef80dcb725fdc89b8d78e90cf79 -size 6980296 diff --git a/dx9sdk/lib/d3dxd.lib b/dx9sdk/lib/d3dxd.lib deleted file mode 100644 index 9d856463a6..0000000000 --- a/dx9sdk/lib/d3dxd.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2fa2491ea3fc524799b6a66e23b2f10c5f6ac028f1f53f37d53361978ebc9cce -size 565570 diff --git a/dx9sdk/lib/d3dxof.lib b/dx9sdk/lib/d3dxof.lib deleted file mode 100644 index fd9dbe2d6b..0000000000 --- a/dx9sdk/lib/d3dxof.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6e02101d54f570d2bbb985292f4c6f0db105b067d32e865991a698faa78a34e6 -size 1722 diff --git a/dx9sdk/lib/ddraw.lib b/dx9sdk/lib/ddraw.lib deleted file mode 100644 index 4d1c70bfb7..0000000000 --- a/dx9sdk/lib/ddraw.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6e9e94271645a16f5dee111cf380eaea1dd03bafcfab676d4198cfd7900de036 -size 4540 diff --git a/dx9sdk/lib/dinput.lib b/dx9sdk/lib/dinput.lib deleted file mode 100644 index a075a4fca5..0000000000 --- a/dx9sdk/lib/dinput.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6cefbeaf8688ea42259a055f84feec0410a666be6ddfdcc745c2661edeb123da -size 17790 diff --git a/dx9sdk/lib/dinput8.lib b/dx9sdk/lib/dinput8.lib deleted file mode 100644 index 6e301ed836..0000000000 --- a/dx9sdk/lib/dinput8.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:277158fb325b22fd10680779e73b7dec1b2f577c7129ac25f632168325bd4f5e -size 284368 diff --git a/dx9sdk/lib/dmoguids.lib b/dx9sdk/lib/dmoguids.lib deleted file mode 100644 index 1c325cfc98..0000000000 --- a/dx9sdk/lib/dmoguids.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3fdecc54f091efe3f1888879e0f166c753a86984fb5624f96244f7abb45a3bb7 -size 18408 diff --git a/dx9sdk/lib/dplayx.lib b/dx9sdk/lib/dplayx.lib deleted file mode 100644 index b09dd3e7ca..0000000000 --- a/dx9sdk/lib/dplayx.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0ec0bb6a248ddb690ef60d05a8f04003005a1c231e6e4fa42b1b013cca2900aa -size 3142 diff --git a/dx9sdk/lib/dsetup.lib b/dx9sdk/lib/dsetup.lib deleted file mode 100644 index f8ccbbf95b..0000000000 --- a/dx9sdk/lib/dsetup.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ca00eae1ab791a5fd790d5ff88637e0c1572d9e0c2ce519bebf6152555b9004b -size 5998 diff --git a/dx9sdk/lib/dsound.lib b/dx9sdk/lib/dsound.lib deleted file mode 100644 index f7817aa8b1..0000000000 --- a/dx9sdk/lib/dsound.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:14cfc17975a4fa6e4d556f54e428feddfaf18bed92de0d88ff5cec056b12a232 -size 4038 diff --git a/dx9sdk/lib/dxguid.lib b/dx9sdk/lib/dxguid.lib deleted file mode 100644 index b4b6103326..0000000000 --- a/dx9sdk/lib/dxguid.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2980caa0e1508434f235e508774cd04ba10c7307ac1ac6cd9882c27af3d5a905 -size 896294 diff --git a/dx9sdk/lib/dxtrans.lib b/dx9sdk/lib/dxtrans.lib deleted file mode 100644 index 2d6e927dce..0000000000 --- a/dx9sdk/lib/dxtrans.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:df37172800688fb7e3f5fdfdb74356dd1b3cf96f832f0853216e5cc77d5eefcf -size 3700 diff --git a/dx9sdk/lib/encapi.lib b/dx9sdk/lib/encapi.lib deleted file mode 100644 index 0f00b15bc4..0000000000 --- a/dx9sdk/lib/encapi.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7e413d10865eb1e926025377cd5f32e4ff43edb24a26ebe3a5c91816575a4991 -size 1522 diff --git a/dx9sdk/lib/ksproxy.lib b/dx9sdk/lib/ksproxy.lib deleted file mode 100644 index 9ef13a5d97..0000000000 --- a/dx9sdk/lib/ksproxy.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5ec6a36a095d3407c714c400c7b2af4ef99045e259bfa26159a4c54a3da6f55f -size 3054 diff --git a/dx9sdk/lib/ksuser.lib b/dx9sdk/lib/ksuser.lib deleted file mode 100644 index 3758c5c7d4..0000000000 --- a/dx9sdk/lib/ksuser.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:83637cc3955db5f8603629d2030208f5aeaa0d6d236e31c29d315f64bd25e13a -size 196016 diff --git a/dx9sdk/lib/msdmo.lib b/dx9sdk/lib/msdmo.lib deleted file mode 100644 index dae78e2dbc..0000000000 --- a/dx9sdk/lib/msdmo.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6df9d8ce8bff23e0f9dcf5d53e863742c8d349dcc599962f05d2846689eb9431 -size 4620 diff --git a/dx9sdk/lib/quartz.lib b/dx9sdk/lib/quartz.lib deleted file mode 100644 index f6648444e4..0000000000 --- a/dx9sdk/lib/quartz.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a794047f31bd85d9672ee9abcadc4dc78d7a13a02727ed1e6ae9f7a31b810919 -size 2370 diff --git a/dx9sdk/lib/strmiids.lib b/dx9sdk/lib/strmiids.lib deleted file mode 100644 index 1ab9928f66..0000000000 --- a/dx9sdk/lib/strmiids.lib +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:11049ebe22f538fd6ca0d6231012c01bf7b867ee181c976fdeba2a666926ae24 -size 272820 diff --git a/dx9sdk/lib/x86/DxErr8.lib b/dx9sdk/lib/x86/DxErr8.lib new file mode 100644 index 0000000000..c22ccde6c0 Binary files /dev/null and b/dx9sdk/lib/x86/DxErr8.lib differ diff --git a/dx9sdk/lib/x86/DxErr9.lib b/dx9sdk/lib/x86/DxErr9.lib new file mode 100644 index 0000000000..3f039fa2a9 Binary files /dev/null and b/dx9sdk/lib/x86/DxErr9.lib differ diff --git a/dx9sdk/lib/x86/XInput.lib b/dx9sdk/lib/x86/XInput.lib new file mode 100644 index 0000000000..21b8358ac3 Binary files /dev/null and b/dx9sdk/lib/x86/XInput.lib differ diff --git a/dx9sdk/lib/x86/amstrmid.lib b/dx9sdk/lib/x86/amstrmid.lib new file mode 100644 index 0000000000..8d92123962 Binary files /dev/null and b/dx9sdk/lib/x86/amstrmid.lib differ diff --git a/dx9sdk/lib/x86/d3d8.lib b/dx9sdk/lib/x86/d3d8.lib new file mode 100644 index 0000000000..828ed30d39 Binary files /dev/null and b/dx9sdk/lib/x86/d3d8.lib differ diff --git a/dx9sdk/lib/x86/d3d9.lib b/dx9sdk/lib/x86/d3d9.lib new file mode 100644 index 0000000000..9e08d8637c Binary files /dev/null and b/dx9sdk/lib/x86/d3d9.lib differ diff --git a/dx9sdk/lib/x86/d3dx.lib b/dx9sdk/lib/x86/d3dx.lib new file mode 100644 index 0000000000..e9450b1bc8 Binary files /dev/null and b/dx9sdk/lib/x86/d3dx.lib differ diff --git a/dx9sdk/lib/x86/d3dx8.lib b/dx9sdk/lib/x86/d3dx8.lib new file mode 100644 index 0000000000..8305ff4c21 Binary files /dev/null and b/dx9sdk/lib/x86/d3dx8.lib differ diff --git a/dx9sdk/lib/x86/d3dx8d.lib b/dx9sdk/lib/x86/d3dx8d.lib new file mode 100644 index 0000000000..8be3558778 Binary files /dev/null and b/dx9sdk/lib/x86/d3dx8d.lib differ diff --git a/dx9sdk/lib/x86/d3dx8dt.lib b/dx9sdk/lib/x86/d3dx8dt.lib new file mode 100644 index 0000000000..040d8ca3c0 Binary files /dev/null and b/dx9sdk/lib/x86/d3dx8dt.lib differ diff --git a/dx9sdk/lib/x86/d3dx9.lib b/dx9sdk/lib/x86/d3dx9.lib new file mode 100644 index 0000000000..11853bf0ac Binary files /dev/null and b/dx9sdk/lib/x86/d3dx9.lib differ diff --git a/dx9sdk/lib/x86/d3dx9d.lib b/dx9sdk/lib/x86/d3dx9d.lib new file mode 100644 index 0000000000..e7e722ee80 Binary files /dev/null and b/dx9sdk/lib/x86/d3dx9d.lib differ diff --git a/dx9sdk/lib/x86/d3dx9dt.lib b/dx9sdk/lib/x86/d3dx9dt.lib new file mode 100644 index 0000000000..2802acb29d Binary files /dev/null and b/dx9sdk/lib/x86/d3dx9dt.lib differ diff --git a/dx9sdk/lib/x86/d3dxd.lib b/dx9sdk/lib/x86/d3dxd.lib new file mode 100644 index 0000000000..dbd9a1c0f5 Binary files /dev/null and b/dx9sdk/lib/x86/d3dxd.lib differ diff --git a/dx9sdk/lib/x86/d3dxof.lib b/dx9sdk/lib/x86/d3dxof.lib new file mode 100644 index 0000000000..c7e5178117 Binary files /dev/null and b/dx9sdk/lib/x86/d3dxof.lib differ diff --git a/dx9sdk/lib/x86/ddraw.lib b/dx9sdk/lib/x86/ddraw.lib new file mode 100644 index 0000000000..d7d0583e93 Binary files /dev/null and b/dx9sdk/lib/x86/ddraw.lib differ diff --git a/dx9sdk/lib/x86/dinput.lib b/dx9sdk/lib/x86/dinput.lib new file mode 100644 index 0000000000..3abb454000 Binary files /dev/null and b/dx9sdk/lib/x86/dinput.lib differ diff --git a/dx9sdk/lib/x86/dinput8.lib b/dx9sdk/lib/x86/dinput8.lib new file mode 100644 index 0000000000..c870a09c11 Binary files /dev/null and b/dx9sdk/lib/x86/dinput8.lib differ diff --git a/dx9sdk/lib/x86/dmoguids.lib b/dx9sdk/lib/x86/dmoguids.lib new file mode 100644 index 0000000000..ad5fbfb25e Binary files /dev/null and b/dx9sdk/lib/x86/dmoguids.lib differ diff --git a/dx9sdk/lib/x86/dplayx.lib b/dx9sdk/lib/x86/dplayx.lib new file mode 100644 index 0000000000..d8e429985f Binary files /dev/null and b/dx9sdk/lib/x86/dplayx.lib differ diff --git a/dx9sdk/lib/x86/dsetup.lib b/dx9sdk/lib/x86/dsetup.lib new file mode 100644 index 0000000000..8acfa3ea37 Binary files /dev/null and b/dx9sdk/lib/x86/dsetup.lib differ diff --git a/dx9sdk/lib/x86/dsound.lib b/dx9sdk/lib/x86/dsound.lib new file mode 100644 index 0000000000..c07fe8582f Binary files /dev/null and b/dx9sdk/lib/x86/dsound.lib differ diff --git a/dx9sdk/lib/x86/dxguid.lib b/dx9sdk/lib/x86/dxguid.lib new file mode 100644 index 0000000000..82835ab226 Binary files /dev/null and b/dx9sdk/lib/x86/dxguid.lib differ diff --git a/dx9sdk/lib/x86/dxtrans.lib b/dx9sdk/lib/x86/dxtrans.lib new file mode 100644 index 0000000000..20a499523b Binary files /dev/null and b/dx9sdk/lib/x86/dxtrans.lib differ diff --git a/dx9sdk/lib/x86/encapi.lib b/dx9sdk/lib/x86/encapi.lib new file mode 100644 index 0000000000..0e3d774d10 Binary files /dev/null and b/dx9sdk/lib/x86/encapi.lib differ diff --git a/dx9sdk/lib/x86/ksproxy.lib b/dx9sdk/lib/x86/ksproxy.lib new file mode 100644 index 0000000000..4f3624606b Binary files /dev/null and b/dx9sdk/lib/x86/ksproxy.lib differ diff --git a/dx9sdk/lib/x86/ksuser.lib b/dx9sdk/lib/x86/ksuser.lib new file mode 100644 index 0000000000..7aba7bd709 Binary files /dev/null and b/dx9sdk/lib/x86/ksuser.lib differ diff --git a/dx9sdk/lib/x86/msdmo.lib b/dx9sdk/lib/x86/msdmo.lib new file mode 100644 index 0000000000..290e308f94 Binary files /dev/null and b/dx9sdk/lib/x86/msdmo.lib differ diff --git a/dx9sdk/lib/x86/quartz.lib b/dx9sdk/lib/x86/quartz.lib new file mode 100644 index 0000000000..47fcd1d2dc Binary files /dev/null and b/dx9sdk/lib/x86/quartz.lib differ diff --git a/dx9sdk/lib/x86/strmiids.lib b/dx9sdk/lib/x86/strmiids.lib new file mode 100644 index 0000000000..8d92123962 Binary files /dev/null and b/dx9sdk/lib/x86/strmiids.lib differ diff --git a/engine/LoadScreenUpdate.cpp b/engine/LoadScreenUpdate.cpp index 2ea250638c..9831e15027 100644 --- a/engine/LoadScreenUpdate.cpp +++ b/engine/LoadScreenUpdate.cpp @@ -113,7 +113,7 @@ void EndLoadingUpdates() } } -static int LoadLibraryThreadFunc() +static uintp LoadLibraryThreadFunc(void *pParam) { RefreshScreenIfNecessary(); return 15; diff --git a/engine/audio/private/snd_dev_direct.cpp b/engine/audio/private/snd_dev_direct.cpp index 91499644da..a60e181bfc 100644 --- a/engine/audio/private/snd_dev_direct.cpp +++ b/engine/audio/private/snd_dev_direct.cpp @@ -11,7 +11,7 @@ // Fix for VS 2010 build errors copied from Dota #if !defined( NEW_DXSDK ) && ( _MSC_VER >= 1600 ) #undef KSDATAFORMAT_SUBTYPE_WAVEFORMATEX -#undef KSDATAFORMAT_SUBTYPE_PCM +//#undef KSDATAFORMAT_SUBTYPE_PCM #undef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT #endif #include @@ -46,6 +46,8 @@ typedef enum {SIS_SUCCESS, SIS_FAILURE, SIS_NOTAVAIL} sndinitstat; // hack - need to include latest dsound.h #undef DSSPEAKER_5POINT1 #undef DSSPEAKER_7POINT1 +#undef DSSPEAKER_7POINT1_SURROUND +#undef DSSPEAKER_5POINT1_SURROUND #define DSSPEAKER_5POINT1 6 #define DSSPEAKER_7POINT1 7 #define DSSPEAKER_7POINT1_SURROUND 8 diff --git a/engine/audio/private/voice.cpp b/engine/audio/private/voice.cpp index 1948766bc6..944c02ac4c 100644 --- a/engine/audio/private/voice.cpp +++ b/engine/audio/private/voice.cpp @@ -671,7 +671,7 @@ bool Voice_Init( const char *pCodecName, int nSampleRate ) // // Changing the quality level we use here will require either extending SVC_VoiceInit to pass down which quality is // in use or using a different codec name (vaudio_celtHD!) for backwards compatibility - int quality = bCelt ? 3 : 4; + int quality = ( bCelt || bOpus ) ? 3 : 4; // Get the codec. CreateInterfaceFn createCodecFn = NULL; diff --git a/engine/bugreporter.cpp b/engine/bugreporter.cpp index 093041e2c1..25a5b4f36a 100644 --- a/engine/bugreporter.cpp +++ b/engine/bugreporter.cpp @@ -1847,7 +1847,7 @@ void CBugUIPanel::OnSubmit() extern CGlobalVars g_ServerGlobalVariables; char misc2[ 256 ]; - long mapfiletime = g_pFileSystem->GetFileTime( modelloader->GetName( host_state.worldmodel ), "GAME" ); + time_t mapfiletime = g_pFileSystem->GetFileTime( modelloader->GetName( host_state.worldmodel ), "GAME" ); if ( !isPublic && mapfiletime != 0L ) { char filetimebuf[ 64 ]; diff --git a/engine/engine.vpc b/engine/engine.vpc index 7d6eb1433d..234d3bdf4c 100644 --- a/engine/engine.vpc +++ b/engine/engine.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" $include "$SRCDIR\vpc_scripts\source_replay.vpc" @@ -1120,7 +1120,7 @@ $Project "engine" // http://code.google.com/p/gperftools/wiki/GooglePerformanceTools $File "$SRCDIR/thirdparty/gperftools-2.0/.libs/libprofiler.so" [$GPROFILER] - $Lib "$LIBCOMMON/binkw32" [$WIN32&&!$QUICKTIME_WIN32] + //$Lib "$LIBCOMMON/binkw32" [$WIN32&&!$QUICKTIME_WIN32] $File "$LIBCOMMON\quicktime\QTMLClient" [$WIN32&&$QUICKTIME_WIN32] $ImpLib "SDL2" [$SDL] $File "$SRCDIR\DX9SDK\lib\dsound.lib" [$WIN32] diff --git a/engine/net_ws.cpp b/engine/net_ws.cpp index a06cbb1d22..6a0d0efe52 100644 --- a/engine/net_ws.cpp +++ b/engine/net_ws.cpp @@ -417,7 +417,7 @@ bool NET_StringToAdr ( const char *s, netadr_t *a) CNetChan *NET_FindNetChannel(int socket, netadr_t &adr) { - AUTO_LOCK( s_NetChannels ); + AUTO_LOCK_FM( s_NetChannels ); int numChannels = s_NetChannels.Count(); @@ -798,7 +798,7 @@ INetChannel *NET_CreateNetChannel(int socket, netadr_t *adr, const char * name, // create new channel chan = new CNetChan(); - AUTO_LOCK( s_NetChannels ); + AUTO_LOCK_FM( s_NetChannels ); s_NetChannels.AddToTail( chan ); } @@ -817,7 +817,7 @@ void NET_RemoveNetChannel(INetChannel *netchan, bool bDeleteNetChan) return; } - AUTO_LOCK( s_NetChannels ); + AUTO_LOCK_FM( s_NetChannels ); if ( s_NetChannels.Find( static_cast(netchan) ) == s_NetChannels.InvalidIndex() ) { DevMsg(1, "NET_CloseNetChannel: unknown channel.\n"); @@ -1677,7 +1677,7 @@ netpacket_t *NET_GetPacket (int sock, byte *scratch ) void NET_ProcessPending( void ) { - AUTO_LOCK( s_PendingSockets ); + AUTO_LOCK_FM( s_PendingSockets ); for ( int i=0; iDefWindowProcW( hWnd, uMsg, wParam, lParam ); @@ -575,10 +575,10 @@ void XBX_HandleInvite( DWORD nUserId ) //----------------------------------------------------------------------------- // Main windows procedure //----------------------------------------------------------------------------- -int CGame::WindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +LRESULT CGame::WindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - LONG lRet = 0; + LRESULT lRet = 0; HDC hdc; PAINTSTRUCT ps; @@ -848,7 +848,7 @@ int CGame::WindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) //----------------------------------------------------------------------------- // Creates the game window //----------------------------------------------------------------------------- -static LONG WINAPI HLEngineWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) +static LRESULT WINAPI HLEngineWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { return g_Game.WindowProc( hWnd, uMsg, wParam, lParam ); } @@ -952,7 +952,7 @@ bool CGame::CreateGameWindow( void ) memset( &wc, 0, sizeof( wc ) ); wc.style = CS_OWNDC | CS_DBLCLKS; - wc.lpfnWndProc = CallDefaultWindowProc; + wc.lpfnWndProc = static_cast(CallDefaultWindowProc); wc.hInstance = m_hInstance; wc.lpszClassName = CLASSNAME; diff --git a/engine/voice_codecs/celt/wscript b/engine/voice_codecs/celt/wscript index f67c4afe81..44cfc499dc 100755 --- a/engine/voice_codecs/celt/wscript +++ b/engine/voice_codecs/celt/wscript @@ -19,7 +19,8 @@ def build(bld): source = [ 'voiceencoder_celt.cpp', '../frame_encoder/voice_codec_frame.cpp', - '../../../tier1/interface.cpp' + '../../../tier1/interface.cpp', + '../../../public/tier0/memoverride.cpp' ] includes = [ diff --git a/engine/voice_codecs/minimp3/vaudio_minimp3.vpc b/engine/voice_codecs/minimp3/vaudio_minimp3.vpc index c7f4f42ce7..a153b96894 100644 --- a/engine/voice_codecs/minimp3/vaudio_minimp3.vpc +++ b/engine/voice_codecs/minimp3/vaudio_minimp3.vpc @@ -6,17 +6,17 @@ $Macro SRCDIR "..\..\.." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" $Configuration { - $Compiler - { - $AdditionalIncludeDirectories "$BASE,$SRCDIR\thirdparty\minimp3\,..\..\..\public,..\..\..\public\tier1,..\..,..\..\..\common,..\..\audio\public" - $PreprocessorDefinitions "$BASE;" - } + $Compiler + { + $AdditionalIncludeDirectories "$BASE,$SRCDIR\thirdparty\minimp3\,..\..\..\public,..\..\..\public\tier1,..\..,..\..\..\common,..\..\audio\public" + $DisableSpecificWarnings "$BASE;4706" + } } $Project "vaudio_minimp3" diff --git a/engine/voice_codecs/minimp3/wscript b/engine/voice_codecs/minimp3/wscript index b3f0743cfa..a21693e36d 100755 --- a/engine/voice_codecs/minimp3/wscript +++ b/engine/voice_codecs/minimp3/wscript @@ -17,6 +17,7 @@ def configure(conf): def build(bld): source = [ 'mp3codecs.cpp', + '../../../public/tier0/memoverride.cpp' ] includes = [ diff --git a/engine/voice_codecs/opus/voiceencoder_opus.cpp b/engine/voice_codecs/opus/voiceencoder_opus.cpp index 203539bca4..d6a18fd464 100644 --- a/engine/voice_codecs/opus/voiceencoder_opus.cpp +++ b/engine/voice_codecs/opus/voiceencoder_opus.cpp @@ -97,6 +97,11 @@ bool VoiceEncoder_Opus::Init( int quality, int &rawFrameSize, int &encodedFrameS m_Mode = opus_custom_mode_create( g_OpusOpts[m_iVersion].iSampleRate, g_OpusOpts[m_iVersion].iRawFrameSize, &iError ); + if ( iError != 0 ) { + Msg( "Opus init failed with error %d\n", iError ); + return false; + } + m_EncoderState = opus_custom_encoder_create( m_Mode, CHANNELS, NULL); m_DecoderState = opus_custom_decoder_create( m_Mode, CHANNELS, NULL); diff --git a/engine/voice_codecs/opus/wscript b/engine/voice_codecs/opus/wscript index ce9207d32f..f1e0c3b024 100755 --- a/engine/voice_codecs/opus/wscript +++ b/engine/voice_codecs/opus/wscript @@ -17,7 +17,8 @@ def build(bld): source = [ 'voiceencoder_opus.cpp', '../frame_encoder/voice_codec_frame.cpp', - '../../../tier1/interface.cpp' + '../../../tier1/interface.cpp', + '../../../public/tier0/memoverride.cpp' ] includes = [ diff --git a/engine/voice_codecs/speex/wscript b/engine/voice_codecs/speex/wscript index d1b1f5819e..2871dad236 100755 --- a/engine/voice_codecs/speex/wscript +++ b/engine/voice_codecs/speex/wscript @@ -19,7 +19,8 @@ def build(bld): source = [ 'VoiceEncoder_Speex.cpp', '../frame_encoder/voice_codec_frame.cpp', - '../../../tier1/interface.cpp' + '../../../tier1/interface.cpp', + '../../../public/tier0/memoverride.cpp' ] includes = [ diff --git a/engine/wscript b/engine/wscript index bcb283695a..510ee25397 100755 --- a/engine/wscript +++ b/engine/wscript @@ -172,7 +172,6 @@ def build(bld): 'sys_dll.cpp', 'sys_dll2.cpp', 'sys_engine.cpp', - 'sys_linuxwind.cpp', #[$POSIX] 'testscriptmgr.cpp', 'traceinit.cpp', '../public/vallocator.cpp', @@ -194,21 +193,35 @@ def build(bld): 'EngineSoundServer.cpp', 'audio/private/voice_wavefile.cpp', 'audio/private/vox.cpp', - 'audio/private/snd_posix.cpp', # [$POSIX] - #'audio/private/snd_dev_direct.cpp', [$WINDOWS]/ - #'audio/private/snd_dev_wave.cpp', [$WINDOWS]/ - #'audio/private/voice_mixer_controls.cpp', [$WINDOWS] / - #'audio/private/voice_record_dsound.cpp', [$WINDOWS] / #'audio/private/snd_dev_xaudio.cpp',[$X360] #'audio/private/snd_wave_mixer_xma.cpp', [$X360] - 'audio/private/snd_dev_sdl.cpp', #[$SDL && !$OSXALL] #'audio/private/snd_dev_openal.cpp', # [$OSXALL] #'audio/private/snd_dev_mac_audioqueue.cpp',# [$OSXALL] #'audio/private/voice_record_mac_audioqueue.cpp', #[$OSXALL] ] + if bld.env.SDL: + source += [ + 'audio/private/snd_dev_sdl.cpp', #[$SDL && !$OSXALL] + 'audio/private/voice_record_sdl.cpp' #[$OSXALL||$LINUXALL] + ] + + if bld.env.DEST_OS == 'win32': + source += [ + '../public/tier0/memoverride.cpp', + 'audio/private/snd_dev_direct.cpp', + 'audio/private/snd_dev_wave.cpp', + 'audio/private/voice_mixer_controls.cpp', + 'audio/private/voice_record_dsound.cpp', + ] + else: + source += [ + 'sys_linuxwind.cpp', + 'audio/private/snd_posix.cpp', + ] + if bld.env.DEDICATED: source += ['cl_null.cpp'] else: @@ -296,9 +309,6 @@ def build(bld): 'audio/private/VBRHeader.cpp', #[!$X360] 'audio/private/voice.cpp', #[!$X360] 'audio/private/voice_sound_engine_interface.cpp', #[!$X360] - 'audio/private/voice_mixer_controls_openal.cpp', #[$OSXALL||$LINUXALL] - 'audio/private/voice_record_openal.cpp', #[$OSXALL||$LINUXALL] - 'audio/private/voice_record_sdl.cpp', #[$OSXALL||$LINUXALL] '../public/vgui_controls/vgui_controls.cpp', '../common/vgui/vgui_basebudgetpanel.cpp', '../common/vgui/vgui_budgetbargraphpanel.cpp', @@ -316,6 +326,12 @@ def build(bld): 'vgui_vprofpanel.cpp', 'toolframework.cpp' ] + + if bld.env.DEST_OS != 'win32': + source += [ + 'audio/private/voice_mixer_controls_openal.cpp', #[$OSXALL||$LINUXALL] + 'audio/private/voice_record_openal.cpp' #[$OSXALL||$LINUXALL] + ] includes = [ '.', @@ -334,7 +350,9 @@ def build(bld): if bld.env.DEST_OS == 'android': libs += ['SSL', 'CRYPTO'] # android curl was built with openssl - + elif bld.env.DEST_OS == 'win32': + libs += ['USER32', 'WINMM', 'WININET', 'DSOUND', 'DXGUID', 'GDI32', 'bzip2'] + install_path = bld.env.LIBDIR bld.shlib( diff --git a/external/vpc/tier0/threadtools.cpp b/external/vpc/tier0/threadtools.cpp index 735f233099..5d757c636a 100644 --- a/external/vpc/tier0/threadtools.cpp +++ b/external/vpc/tier0/threadtools.cpp @@ -49,7 +49,7 @@ #endif #ifndef _PS3 -#include +#include #endif #include "tier0/threadtools.h" diff --git a/external/vpc/utils/vpc/main.cpp b/external/vpc/utils/vpc/main.cpp index 0caa9c9365..e237df5029 100644 --- a/external/vpc/utils/vpc/main.cpp +++ b/external/vpc/utils/vpc/main.cpp @@ -75,7 +75,7 @@ CVPC::CVPC() } #ifdef WIN32 - m_eVSVersion = k_EVSVersion_2015; + m_eVSVersion = k_EVSVersion_2019; m_bUseVS2010FileFormat = true; m_bUseUnity = false; #else @@ -175,11 +175,6 @@ void CVPC::Shutdown( bool bHasError ) UnloadPerforceInterface(); } -#if defined( STANDALONE_VPC ) -class CP4; -extern CP4 s_p4; -#endif - //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- bool CVPC::LoadPerforceInterface() @@ -190,11 +185,6 @@ bool CVPC::LoadPerforceInterface() return true; } -#if defined( STANDALONE_VPC ) - p4 = (IP4*)&s_p4; - return (p4 != NULL); -#else - // // Try to load p4lib.dll and the filesystem since the p4lib relies on it // @@ -234,7 +224,6 @@ bool CVPC::LoadPerforceInterface() p4->Connect( Sys_GetFactory( m_pFilesystemModule ) ); return true; -#endif } //----------------------------------------------------------------------------- @@ -635,7 +624,8 @@ void CVPC::SpewUsage( void ) Log_Msg( LOG_VPC, "[/srcctl]: Enable P4SCC source control integration - can also set environment variable VPC_SRCCTL to 1\n" ); #endif Log_Msg( LOG_VPC, "[/mirror]: - Mirror output files to specified path. Used for A:B testing.\n" ); - Log_Msg( LOG_VPC, "[/2015]: Generate projects and solutions for Visual Studio 2015 [default]\n" ); + Log_Msg( LOG_VPC, "[/2019]: Generate projects and solutions for Visual Studio 2019 [default]\n" ); + Log_Msg( LOG_VPC, "[/2015]: Generate projects and solutions for Visual Studio 2015\n" ); Log_Msg( LOG_VPC, "[/2013]: Generate projects and solutions for Visual Studio 2013\n" ); Log_Msg( LOG_VPC, "[/2012]: Generate projects and solutions for Visual Studio 2012\n" ); Log_Msg( LOG_VPC, "[/2010]: Generate projects and solutions for Visual Studio 2010\n" ); @@ -1004,6 +994,11 @@ void CVPC::HandleSingleCommandLineArg( const char *pArg ) m_eVSVersion = k_EVSVersion_2015; m_ExtraOptionsCRCString += pArgName; } + else if ( !V_stricmp( pArgName, "2019" ) ) + { + m_eVSVersion = k_EVSVersion_2019; + m_ExtraOptionsCRCString += pArgName; + } else if ( !V_stricmp( pArgName, "nounity" ) ) { m_bUseUnity = false; @@ -1825,6 +1820,16 @@ void CVPC::SetMacrosAndConditionals() // VS2010 is strictly win32/xbox360 switch ( m_eVSVersion ) { + case k_EVSVersion_2019: + m_ExtraOptionsCRCString += "VS2019"; + SetConditional( "VS2019", true ); + + // temporarily allow VS2013 conditionals also as there are many. Will fix. + SetConditional( "VS2013", true ); + + m_bUseVS2010FileFormat = true; + break; + case k_EVSVersion_2015: m_ExtraOptionsCRCString += "VS2015"; SetConditional( "VS2015", true ); @@ -2362,7 +2367,9 @@ void CVPC::SetupGenerators() { // spew what we are generating const char *pchLogLine = "Generating for Visual Studio 2005.\n"; - if ( m_eVSVersion == k_EVSVersion_2015 ) + if ( m_eVSVersion == k_EVSVersion_2019 ) + pchLogLine = "Generating for Visual Studio 2019.\n"; + else if ( m_eVSVersion == k_EVSVersion_2015 ) pchLogLine = "Generating for Visual Studio 2015.\n"; else if ( m_eVSVersion == k_EVSVersion_2013 ) pchLogLine = "Generating for Visual Studio 2013.\n"; diff --git a/external/vpc/utils/vpc/solutiongenerator_win32.cpp b/external/vpc/utils/vpc/solutiongenerator_win32.cpp index 9314795663..3df227934a 100644 --- a/external/vpc/utils/vpc/solutiongenerator_win32.cpp +++ b/external/vpc/utils/vpc/solutiongenerator_win32.cpp @@ -27,6 +27,12 @@ class CSolutionGenerator_Win32 : public IBaseSolutionGenerator public: void GetVCPROJSolutionGUID( char (&szSolutionGUID)[256] ) { + if ( g_pVPC->Is2019() ) + { + V_strncpy( szSolutionGUID, "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}", ARRAYSIZE(szSolutionGUID) ); + return; + } + HKEY hKey; int firstVer = 8; const int lastVer = 14; // Handle up to VS 14, AKA VS 2015 @@ -114,7 +120,12 @@ public: g_pVPC->VPCError( "Can't open %s for writing.", pSolutionFilename ); - if ( g_pVPC->Is2015() ) + if ( g_pVPC->Is2019() ) + { + fprintf( fp, "\xef\xbb\xbf\nMicrosoft Visual Studio Solution File, Format Version 12.00\n" ); + fprintf( fp, "# Visual Studio Version 16\n" ); + } + else if ( g_pVPC->Is2015() ) { fprintf( fp, "\xef\xbb\xbf\nMicrosoft Visual Studio Solution File, Format Version 12.00\n" ); // still on 12 fprintf( fp, "# Visual Studio 2015\n" ); diff --git a/external/vpc/utils/vpc/vpc.h b/external/vpc/utils/vpc/vpc.h index 4ff493e4b8..d0e7ab989c 100644 --- a/external/vpc/utils/vpc/vpc.h +++ b/external/vpc/utils/vpc/vpc.h @@ -182,6 +182,7 @@ enum EVSVersion k_EVSVersion_2012, k_EVSVersion_2013, k_EVSVersion_2015, + k_EVSVersion_2019, }; class CVPC @@ -218,6 +219,7 @@ public: bool Is2012() { return m_eVSVersion == k_EVSVersion_2012; } // When this returns true so does Is2010() because of the file format similarities bool Is2013() { return m_eVSVersion == k_EVSVersion_2013; } // When this returns true so does Is2010() because of the file format similarities bool Is2015() { return m_eVSVersion == k_EVSVersion_2015; } // When this returns true so does Is2010() because of the file format similarities + bool Is2019() { return m_eVSVersion == k_EVSVersion_2019; } // When this returns true so does Is2010() because of the file format similarities bool BUse2008() { return m_eVSVersion == k_EVSVersion_2008; } bool IsDedicatedBuild() { return m_bDedicatedBuild; } bool IsUnity() { return m_bUseUnity; } diff --git a/external/vpc/utils/vpc/vpc.vcxproj b/external/vpc/utils/vpc/vpc.vcxproj index be37d599ed..c8c8f5ccbc 100644 --- a/external/vpc/utils/vpc/vpc.vcxproj +++ b/external/vpc/utils/vpc/vpc.vcxproj @@ -13,21 +13,21 @@ {36C5F545-588F-4091-B480-89E03EDBDA93} vpc - 8.1 + 10.0.19041.0 Application true - NotSet - v140_xp + MultiByte + v142 Application false true - NotSet - v140_xp + MultiByte + v142 @@ -58,9 +58,8 @@ Console - p4 edit ..\..\..\..\devtools\bin\vpc.exe && copy /y $(TargetPath) ..\..\..\..\devtools\bin\vpc.exe -p4 edit ..\..\..\..\devtools\bin\vpc.pdb && copy /y $(TargetDir)\vpc.pdb ..\..\..\..\devtools\bin\vpc.pdb - + + @@ -83,14 +82,12 @@ p4 edit ..\..\..\..\devtools\bin\vpc.pdb && copy /y $(TargetDir)\vpc.pdb Console - p4 edit ..\..\..\..\devtools\bin\vpc.exe && copy /y $(TargetPath) ..\..\..\..\devtools\bin\vpc.exe -p4 edit ..\..\..\..\devtools\bin\vpc.pdb && copy /y $(TargetDir)\vpc.pdb ..\..\..\..\devtools\bin\vpc.pdb - + + - diff --git a/external/vpc/utils/vpc/vpc.vcxproj.filters b/external/vpc/utils/vpc/vpc.vcxproj.filters index be39a000c0..78aa487069 100644 --- a/external/vpc/utils/vpc/vpc.vcxproj.filters +++ b/external/vpc/utils/vpc/vpc.vcxproj.filters @@ -245,9 +245,6 @@ VPC\Source Files - - Dependencies\Source Files - diff --git a/filesystem/basefilesystem.cpp b/filesystem/basefilesystem.cpp index 8a371b17e1..fe69287073 100644 --- a/filesystem/basefilesystem.cpp +++ b/filesystem/basefilesystem.cpp @@ -42,6 +42,8 @@ #undef GetCurrentDirectory #endif +#include + // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" @@ -2800,7 +2802,7 @@ unsigned int CBaseFileSystem::Size( const char* pFileName, const char *pPathID ) // *pFileName - // Output : long //----------------------------------------------------------------------------- -long CBaseFileSystem::FastFileTime( const CSearchPath *path, const char *pFileName ) +time_t CBaseFileSystem::FastFileTime( const CSearchPath *path, const char *pFileName ) { struct _stat buf; @@ -3323,7 +3325,7 @@ char *CBaseFileSystem::ReadLine( char *pOutput, int maxChars, FileHandle_t file // Input : *pFileName - // Output : long //----------------------------------------------------------------------------- -long CBaseFileSystem::GetFileTime( const char *pFileName, const char *pPathID ) +time_t CBaseFileSystem::GetFileTime( const char *pFileName, const char *pPathID ) { VPROF_BUDGET( "CBaseFileSystem::GetFileTime", VPROF_BUDGETGROUP_OTHER_FILESYSTEM ); @@ -3340,7 +3342,7 @@ long CBaseFileSystem::GetFileTime( const char *pFileName, const char *pPathID ) for ( CSearchPath *pSearchPath = iter.GetFirst(); pSearchPath != NULL; pSearchPath = iter.GetNext() ) { - long ft = FastFileTime( pSearchPath, tempFileName ); + time_t ft = FastFileTime( pSearchPath, tempFileName ); if ( ft != 0L ) { if ( !pSearchPath->GetPackFile() && m_LogFuncs.Count() ) @@ -3363,12 +3365,12 @@ long CBaseFileSystem::GetFileTime( const char *pFileName, const char *pPathID ) return ft; } } - return 0L; + return (time_t)0L; } -long CBaseFileSystem::GetPathTime( const char *pFileName, const char *pPathID ) +time_t CBaseFileSystem::GetPathTime( const char *pFileName, const char *pPathID ) { - VPROF_BUDGET( "CBaseFileSystem::GetFileTime", VPROF_BUDGETGROUP_OTHER_FILESYSTEM ); + VPROF_BUDGET( "CBaseFileSystem::GetPathTime", VPROF_BUDGETGROUP_OTHER_FILESYSTEM ); CSearchPathsIterator iter( this, &pFileName, pPathID ); @@ -3379,10 +3381,10 @@ long CBaseFileSystem::GetPathTime( const char *pFileName, const char *pPathID ) Q_strlower( tempFileName ); #endif - long pathTime = 0L; + time_t pathTime = 0L; for ( CSearchPath *pSearchPath = iter.GetFirst(); pSearchPath != NULL; pSearchPath = iter.GetNext() ) { - long ft = FastFileTime( pSearchPath, tempFileName ); + time_t ft = FastFileTime( pSearchPath, tempFileName ); if ( ft > pathTime ) pathTime = ft; if ( ft != 0L ) @@ -3707,7 +3709,7 @@ void CBaseFileSystem::SetWhitelistSpewFlags( int flags ) // maxCharsIncludingTerminator - // fileTime - //----------------------------------------------------------------------------- -void CBaseFileSystem::FileTimeToString( char *pString, int maxCharsIncludingTerminator, long fileTime ) +void CBaseFileSystem::FileTimeToString( char *pString, int maxCharsIncludingTerminator, time_t fileTime ) { if ( IsX360() ) { diff --git a/filesystem/basefilesystem.h b/filesystem/basefilesystem.h index e413db7dae..c0e16a05b6 100644 --- a/filesystem/basefilesystem.h +++ b/filesystem/basefilesystem.h @@ -67,6 +67,8 @@ #include "vpklib/packedstore.h" #endif +#include + #include "tier0/memdbgon.h" #ifdef _WIN32 @@ -312,10 +314,10 @@ public: virtual void MarkPathIDByRequestOnly( const char *pPathID, bool bRequestOnly ); virtual bool FileExists( const char *pFileName, const char *pPathID = NULL ); - virtual long GetFileTime( const char *pFileName, const char *pPathID = NULL ); + virtual time_t GetFileTime( const char *pFileName, const char *pPathID = NULL ); virtual bool IsFileWritable( char const *pFileName, const char *pPathID = NULL ); virtual bool SetFileWritable( char const *pFileName, bool writable, const char *pPathID = 0 ); - virtual void FileTimeToString( char *pString, int maxChars, long fileTime ); + virtual void FileTimeToString( char *pString, int maxChars, time_t fileTime ); virtual const char *FindFirst( const char *pWildCard, FileFindHandle_t *pHandle ); virtual const char *FindFirstEx( const char *pWildCard, const char *pPathID, FileFindHandle_t *pHandle ); @@ -338,7 +340,7 @@ public: virtual FileNameHandle_t FindFileName( char const *pFileName ); virtual bool String( const FileNameHandle_t& handle, char *buf, int buflen ); virtual int GetPathIndex( const FileNameHandle_t &handle ); - long GetPathTime( const char *pFileName, const char *pPathID ); + time_t GetPathTime( const char *pFileName, const char *pPathID ); virtual void EnableWhitelistFileTracking( bool bEnable, bool bCacheAllVPKHashes, bool bRecalculateAndCheckHashes ); virtual void RegisterFileWhitelist( IPureServerWhitelist *pWhiteList, IFileList **ppFilesToReload ) OVERRIDE; @@ -794,7 +796,7 @@ protected: void HandleOpenRegularFile( CFileOpenInfo &openInfo, bool bIsAbsolutePath ); FileHandle_t FindFileInSearchPath( CFileOpenInfo &openInfo ); - long FastFileTime( const CSearchPath *path, const char *pFileName ); + time_t FastFileTime( const CSearchPath *path, const char *pFileName ); const char *GetWritePath( const char *pFilename, const char *pathID ); diff --git a/filesystem/filesystem_stdio.vpc b/filesystem/filesystem_stdio.vpc index e490aabc92..66ee569e20 100644 --- a/filesystem/filesystem_stdio.vpc +++ b/filesystem/filesystem_stdio.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" $include "$SRCDIR\vpc_scripts\source_cryptlib_include.vpc" diff --git a/filesystem/filesystem_steam.vpc b/filesystem/filesystem_steam.vpc index cc840f1c8d..7f1ecf3f50 100644 --- a/filesystem/filesystem_steam.vpc +++ b/filesystem/filesystem_steam.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/filesystem/wscript b/filesystem/wscript index 9fc2a3d729..52d3a5f99e 100755 --- a/filesystem/wscript +++ b/filesystem/wscript @@ -15,7 +15,7 @@ def configure(conf): conf.define('FILESYSTEM_STDIO_EXPORTS',1) conf.define('DONT_PROTECT_FILEIO_FUNCTIONS',1) # conf.define('PROTECTED_THINGS_ENABLE',1) - conf.define('_USE_32BIT_TIME_T',1) +# conf.define('_USE_32BIT_TIME_T',1) conf.define('SUPPORT_PACKED_STORE',1) def build(bld): @@ -28,10 +28,14 @@ def build(bld): '../public/kevvaluescompiler.cpp', '../public/zip_utils.cpp', 'QueuedLoader.cpp', - 'linux_support.cpp', # [$POSIX] '../public/tier0/memoverride.cpp' ] + if bld.env.DEST_OS != 'win32': + source += [ + 'linux_support.cpp' + ] + includes = [ '.', '../public', @@ -44,6 +48,9 @@ def build(bld): libs = ['tier0','vpklib','tier1','tier2','vstdlib'] + if bld.env.DEST_OS == 'win32': + libs += ['SHELL32'] + install_path = bld.env.LIBDIR bld.shlib( diff --git a/game/client/c_baseentity.cpp b/game/client/c_baseentity.cpp index 96017a82b4..9e65f38843 100644 --- a/game/client/c_baseentity.cpp +++ b/game/client/c_baseentity.cpp @@ -4745,7 +4745,7 @@ C_BaseEntity *C_BaseEntity::Instance( int iEnt ) #ifdef WIN32 #pragma warning( push ) -#include +#include #pragma warning( pop ) #endif diff --git a/game/client/client_base.vpc b/game/client/client_base.vpc index 662c94535b..90e16cb81d 100644 --- a/game/client/client_base.vpc +++ b/game/client/client_base.vpc @@ -16,7 +16,6 @@ $MacroRequired "GAMENAME" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" $include "$SRCDIR\vpc_scripts\protobuf_builder.vpc" $Include "$SRCDIR\vpc_scripts\source_replay.vpc" [$TF] -$Include "$SRCDIR\game\protobuf_include.vpc" $Configuration "Debug" { @@ -498,6 +497,8 @@ $Project $File "$SRCDIR\public\haptics\haptic_msgs.cpp" [!$X360] $File "$SRCDIR\public\haptics\haptic_utils.cpp" [$WIN32&&!$X360] + $File "$SRCDIR\game\client\touch.cpp" + $Folder "Sixense" { $File "sixense\in_sixense.cpp" diff --git a/game/client/client_hl2.vpc b/game/client/client_hl2.vpc index db44981b49..112dec0327 100644 --- a/game/client/client_hl2.vpc +++ b/game/client/client_hl2.vpc @@ -9,7 +9,6 @@ $Macro GAMENAME "hl2" [!$SOURCESDK] $Macro GAMENAME "mod_hl2" [$SOURCESDK] $Include "$SRCDIR\game\client\client_base.vpc" -$Include "$SRCDIR\game\protobuf_include.vpc" $Configuration { diff --git a/game/client/hud_pdump.cpp b/game/client/hud_pdump.cpp index 612a18d7e3..666c88889b 100644 --- a/game/client/hud_pdump.cpp +++ b/game/client/hud_pdump.cpp @@ -22,7 +22,7 @@ static CPDumpPanel *g_pPDumpPanel = NULL; // retaining our own warning setup...ywb #ifdef WIN32 #pragma warning( push ) -#include +#include #pragma warning( pop ) #endif diff --git a/game/client/particlemgr.h b/game/client/particlemgr.h index 3214a55fd8..26393edbb0 100644 --- a/game/client/particlemgr.h +++ b/game/client/particlemgr.h @@ -120,7 +120,7 @@ entities. Each one is useful under different conditions. #include "utllinkedlist.h" #include "utldict.h" #ifdef WIN32 -#include +#include #else #include #endif diff --git a/game/client/physics_main_client.cpp b/game/client/physics_main_client.cpp index b1af5b23a9..9944a73d3f 100644 --- a/game/client/physics_main_client.cpp +++ b/game/client/physics_main_client.cpp @@ -7,7 +7,7 @@ #include "cbase.h" #include "c_baseentity.h" #ifdef WIN32 -#include +#include #endif #include "tier0/vprof.h" diff --git a/game/client/touch.cpp b/game/client/touch.cpp index 64d60411ae..c695b975a1 100644 --- a/game/client/touch.cpp +++ b/game/client/touch.cpp @@ -1,5 +1,5 @@ +#include "cbase.h" #include "convar.h" -#include #include #include "vgui/IInputInternal.h" #include "VGuiMatSurface/IMatSystemSurface.h" @@ -831,7 +831,6 @@ void CTouchControls::WriteConfig() if( f ) { - CTouchButton *button; filesystem->FPrintf( f, "//=======================================================================\n"); filesystem->FPrintf( f, "//\t\t\ttouchscreen config\n" ); filesystem->FPrintf( f, "//=======================================================================\n" ); diff --git a/game/client/wscript b/game/client/wscript index 3732c8b40a..c454d535c3 100755 --- a/game/client/wscript +++ b/game/client/wscript @@ -69,9 +69,11 @@ def build(bld): if bld.env.DEST_OS != 'android': install_path += '/'+bld.env.GAMES+'/bin' - source = [ 'touch.cpp', 'in_touch.cpp' ] + source = [ 'in_touch.cpp' ] + if bld.env.DEST_OS == 'win32': + libs += ['USER32'] - source += game["sources"] + source += game["sources"] + ['../../public/tier0/memoverride.cpp'] includes += game["includes"] defines = game["defines"] diff --git a/game/server/baseentity.cpp b/game/server/baseentity.cpp index f187479c49..7593ce8879 100644 --- a/game/server/baseentity.cpp +++ b/game/server/baseentity.cpp @@ -3365,7 +3365,7 @@ void CBaseEntity::FunctionCheck( void *pFunction, const char *name ) // Note, if you crash here and your class is using multiple inheritance, it is // probably the case that CBaseEntity (or a descendant) is not the first // class in your list of ancestors, which it must be. - if (pFunction && !UTIL_FunctionToName( GetDataDescMap(), (inputfunc_t *)pFunction ) ) + if (pFunction && !UTIL_FunctionToName( GetDataDescMap(), *(inputfunc_t*)pFunction ) ) { Warning( "FUNCTION NOT IN TABLE!: %s:%s (%08lx)\n", STRING(m_iClassname), name, (unsigned long)pFunction ); Assert(0); diff --git a/game/server/baseentity.h b/game/server/baseentity.h index 3b70c7e645..70502fbc15 100644 --- a/game/server/baseentity.h +++ b/game/server/baseentity.h @@ -1108,10 +1108,20 @@ public: ENTITYFUNCPTR TouchSet( ENTITYFUNCPTR func, char *name ) { +#ifdef _DEBUG +#ifdef PLATFORM_64BITS #ifdef GNUC - COMPILE_TIME_ASSERT( sizeof(func) == 8 ); + COMPILE_TIME_ASSERT( sizeof(func) == 16 ); #else - COMPILE_TIME_ASSERT( sizeof(func) == 4 ); + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#endif +#else +#ifdef GNUC + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#else + COMPILE_TIME_ASSERT( sizeof(func) == 4 ); +#endif +#endif #endif m_pfnTouch = func; FunctionCheck( *(reinterpret_cast(&m_pfnTouch)), name ); @@ -1119,10 +1129,20 @@ public: } USEPTR UseSet( USEPTR func, char *name ) { +#ifdef _DEBUG +#ifdef PLATFORM_64BITS #ifdef GNUC - COMPILE_TIME_ASSERT( sizeof(func) == 8 ); + COMPILE_TIME_ASSERT( sizeof(func) == 16 ); #else - COMPILE_TIME_ASSERT( sizeof(func) == 4 ); + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#endif +#else +#ifdef GNUC + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#else + COMPILE_TIME_ASSERT( sizeof(func) == 4 ); +#endif +#endif #endif m_pfnUse = func; FunctionCheck( *(reinterpret_cast(&m_pfnUse)), name ); @@ -1130,10 +1150,20 @@ public: } ENTITYFUNCPTR BlockedSet( ENTITYFUNCPTR func, char *name ) { +#ifdef _DEBUG +#ifdef PLATFORM_64BITS #ifdef GNUC - COMPILE_TIME_ASSERT( sizeof(func) == 8 ); + COMPILE_TIME_ASSERT( sizeof(func) == 16 ); #else - COMPILE_TIME_ASSERT( sizeof(func) == 4 ); + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#endif +#else +#ifdef GNUC + COMPILE_TIME_ASSERT( sizeof(func) == 8 ); +#else + COMPILE_TIME_ASSERT( sizeof(func) == 4 ); +#endif +#endif #endif m_pfnBlocked = func; FunctionCheck( *(reinterpret_cast(&m_pfnBlocked)), name ); diff --git a/game/server/effects.cpp b/game/server/effects.cpp index f9d457c6e7..6142d83c8e 100644 --- a/game/server/effects.cpp +++ b/game/server/effects.cpp @@ -1539,11 +1539,11 @@ public: DECLARE_SERVERCLASS(); private: -#ifdef POSIX +//#ifdef POSIX CEnvWindShared m_EnvWindShared; // FIXME - fails to compile as networked var due to operator= problem -#else - CNetworkVarEmbedded( CEnvWindShared, m_EnvWindShared ); -#endif +//#else +// CNetworkVarEmbedded( CEnvWindShared, m_EnvWindShared ); +//#endif }; LINK_ENTITY_TO_CLASS( env_wind, CEnvWind ); diff --git a/game/server/episodic/ep2_gamestats.cpp b/game/server/episodic/ep2_gamestats.cpp index af6d5e9469..e733863d59 100644 --- a/game/server/episodic/ep2_gamestats.cpp +++ b/game/server/episodic/ep2_gamestats.cpp @@ -419,7 +419,7 @@ void CEP2GameStats::Event_SaveGame( void ) Q_strlower( name ); Q_FixSlashes( name ); - unsigned int uFileTime = filesystem->GetFileTime( name, "GAME" ); + time_t uFileTime = filesystem->GetFileTime( name, "GAME" ); // Latch off previous map->m_SaveGameInfo.Latch( name, uFileTime ); @@ -471,7 +471,7 @@ void CEP2GameStats::Event_LoadGame( void ) if ( pSaveGameInfo->m_nCurrentSaveFileTime == 0 || pSaveGameInfo->m_sCurrentSaveFile != name ) { - unsigned int uFileTime = filesystem->GetFileTime( name, "GAME" ); + time_t uFileTime = filesystem->GetFileTime( name, "GAME" ); // Latch off previous StatsLog( "Relatching save game file due to time or filename change (%s : %u)\n", name, uFileTime ); diff --git a/game/server/episodic/ep2_gamestats.h b/game/server/episodic/ep2_gamestats.h index cc36301cbd..e5a5cf170a 100644 --- a/game/server/episodic/ep2_gamestats.h +++ b/game/server/episodic/ep2_gamestats.h @@ -13,6 +13,8 @@ #include "ep1_gamestats.h" #include "tier1/utlstring.h" +#include + // EP2 Game Stats enum Ep2GameStatsVersions_t { @@ -417,7 +419,7 @@ public: { } - void Latch( char const *pchSaveName, unsigned int uFileTime ) + void Latch( char const *pchSaveName, time_t uFileTime ) { m_pCurrentRecord = &m_Records[ m_Records.AddToTail() ]; m_nCurrentSaveFileTime = uFileTime; @@ -426,7 +428,7 @@ public: CUtlVector< SaveGameInfoRecord2_t > m_Records; SaveGameInfoRecord2_t *m_pCurrentRecord; - unsigned int m_nCurrentSaveFileTime; + time_t m_nCurrentSaveFileTime; CUtlString m_sCurrentSaveFile; }; diff --git a/game/server/h_export.cpp b/game/server/h_export.cpp index fbd7c508b4..ef74c0f73b 100644 --- a/game/server/h_export.cpp +++ b/game/server/h_export.cpp @@ -28,9 +28,9 @@ HMODULE win32DLLHandle; BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) { // ensure data sizes are stable - if ( sizeof(inputfunc_t) != sizeof(int) ) + if ( sizeof(inputfunc_t) != sizeof(uintp) ) { - Assert( sizeof(inputfunc_t) == sizeof(int) ); + Assert( sizeof(inputfunc_t) == sizeof(uintp) ); return FALSE; } diff --git a/game/server/hl2/npc_strider.cpp b/game/server/hl2/npc_strider.cpp index 60d37cdf8b..6dadaff4dd 100644 --- a/game/server/hl2/npc_strider.cpp +++ b/game/server/hl2/npc_strider.cpp @@ -3339,9 +3339,9 @@ bool CNPC_Strider::ShouldExplodeFromDamage( const CTakeDamageInfo &info ) //--------------------------------------------------------- //--------------------------------------------------------- -ConVarRef mat_dxlevel( "mat_dxlevel" ); bool CNPC_Strider::BecomeRagdoll( const CTakeDamageInfo &info, const Vector &forceVector ) { + static ConVarRef mat_dxlevel( "mat_dxlevel" ); // Combine balls make us explode if ( m_bExploding ) { diff --git a/game/server/nav_mesh.h b/game/server/nav_mesh.h index 80920dce60..730182ba90 100644 --- a/game/server/nav_mesh.h +++ b/game/server/nav_mesh.h @@ -73,6 +73,7 @@ public: bool operator()( CBaseCombatCharacter *actor ) { actor->OnNavAreaRemoved( m_deadArea ); + return true; } }; diff --git a/game/server/physics_main.cpp b/game/server/physics_main.cpp index b0b2d867a1..b3472e477a 100644 --- a/game/server/physics_main.cpp +++ b/game/server/physics_main.cpp @@ -8,7 +8,7 @@ #include "cbase.h" #ifdef _WIN32 -#include "typeinfo.h" +#include "typeinfo" // BUGBUG: typeinfo stomps some of the warning settings (in yvals.h) #pragma warning(disable:4244) #elif POSIX diff --git a/game/server/server_base.vpc b/game/server/server_base.vpc index 73e3608f48..6d78d55dc8 100644 --- a/game/server/server_base.vpc +++ b/game/server/server_base.vpc @@ -16,7 +16,6 @@ $MacroRequired "GAMENAME" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" $include "$SRCDIR\vpc_scripts\protobuf_builder.vpc" $Include "$SRCDIR\vpc_scripts\source_replay.vpc" [$TF] -$Include "$SRCDIR\game\protobuf_include.vpc" $Configuration "Debug" { diff --git a/game/server/util.h b/game/server/util.h index a788da6c53..f8b82e0cd5 100644 --- a/game/server/util.h +++ b/game/server/util.h @@ -615,7 +615,7 @@ bool UTIL_IsFacingWithinTolerance( CBaseEntity *pViewer, CBaseEntity *pTarget, f void UTIL_GetDebugColorForRelationship( int nRelationship, int &r, int &g, int &b ); struct datamap_t; -extern const char *UTIL_FunctionToName( datamap_t *pMap, inputfunc_t *function ); +extern const char *UTIL_FunctionToName( datamap_t *pMap, inputfunc_t function ); int UTIL_GetCommandClientIndex( void ); CBasePlayer *UTIL_GetCommandClient( void ); diff --git a/game/server/wscript b/game/server/wscript index 21e4e4ee26..1b6d834d01 100755 --- a/game/server/wscript +++ b/game/server/wscript @@ -56,12 +56,14 @@ def build(bld): defines = [] libs = ['tier0','particles','dmxloader','tier1','tier2','tier3','mathlib','vstdlib','choreoobjects','steam_api'] + if bld.env.DEST_OS == 'win32': + libs += ['USER32'] install_path = bld.env.PREFIX if bld.env.DEST_OS != 'android': install_path += '/'+bld.env.GAMES+'/bin' - source = game["sources"] + source = game["sources"] + ['../../public/tier0/memoverride.cpp'] includes += game["includes"] defines = game["defines"] diff --git a/gameui/BasePanel.cpp b/gameui/BasePanel.cpp index 9f5a88549e..3a00f66632 100644 --- a/gameui/BasePanel.cpp +++ b/gameui/BasePanel.cpp @@ -2312,7 +2312,7 @@ bool CBasePanel::IsPromptableCommand( const char *command ) //------------------------- // Purpose: Job wrapper //------------------------- -static unsigned PanelJobWrapperFn( void *pvContext ) +static uintp PanelJobWrapperFn( void *pvContext ) { CBasePanel::CAsyncJobContext *pAsync = reinterpret_cast< CBasePanel::CAsyncJobContext * >( pvContext ); diff --git a/gameui/BaseSaveGameDialog.cpp b/gameui/BaseSaveGameDialog.cpp index c59d18ce92..cba0f47376 100644 --- a/gameui/BaseSaveGameDialog.cpp +++ b/gameui/BaseSaveGameDialog.cpp @@ -20,6 +20,8 @@ #include "MouseMessageForwardingPanel.h" #include "TGAImagePanel.h" +#include + // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" @@ -364,7 +366,7 @@ bool CBaseSaveGameDialog::ParseSaveData( char const *pszFileName, char const *ps Q_strncpy( save.szElapsedTime, szElapsedTime, sizeof(save.szElapsedTime) ); // Now get file time stamp. - long fileTime = g_pFullFileSystem->GetFileTime(pszFileName); + time_t fileTime = g_pFullFileSystem->GetFileTime(pszFileName); char szFileTime[32]; g_pFullFileSystem->FileTimeToString(szFileTime, sizeof(szFileTime), fileTime); char *newline = strstr(szFileTime, "\n"); diff --git a/gameui/GameUI.vpc b/gameui/GameUI.vpc index cdb83d0e2f..330e1ec751 100644 --- a/gameui/GameUI.vpc +++ b/gameui/GameUI.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" $Include "$SRCDIR\vpc_scripts\source_saxxyawards.vpc" @@ -246,8 +246,8 @@ $Project "GameUI" $Lib vtf $Lib "$LIBCOMMON/libjpeg" [!$DEDICATED] $ImpLib steam_api - $Lib libpng [!$VS2015&&!$DEDICATED] - $Lib $LIBCOMMON/libpng [$VS2015&&!$DEDICATED] + $Lib libpng [!$VS2015 && !$VS2019 && !$DEDICATED] + $Lib $LIBCOMMON/libpng [($VS2015 || $VS2019) && !$DEDICATED] $Lib libz [!$DEDICATED] $ImpLib SDL2 [$SDL] } diff --git a/gameui/SaveGameBrowserDialog.cpp b/gameui/SaveGameBrowserDialog.cpp index ac894ff4f0..8b777375c7 100644 --- a/gameui/SaveGameBrowserDialog.cpp +++ b/gameui/SaveGameBrowserDialog.cpp @@ -22,6 +22,8 @@ #include "GameUI_Interface.h" #include "vstdlib/random.h" +#include + #include "SaveGameBrowserDialog.h" extern const char *COM_GetModDirectory( void ); @@ -1273,7 +1275,7 @@ bool CSaveGameBrowserDialog::ParseSaveData( char const *pszFileName, char const Q_strncpy( save->szElapsedTime, szElapsedTime, sizeof(save->szElapsedTime) ); // Now get file time stamp. - long fileTime = g_pFullFileSystem->GetFileTime(pszFileName); + time_t fileTime = g_pFullFileSystem->GetFileTime(pszFileName); char szFileTime[32]; g_pFullFileSystem->FileTimeToString(szFileTime, sizeof(szFileTime), fileTime); char *newline = strstr(szFileTime, "\n"); diff --git a/gameui/wscript b/gameui/wscript index de768bb62c..5502746dae 100755 --- a/gameui/wscript +++ b/gameui/wscript @@ -22,7 +22,6 @@ def build(bld): 'BasePanel.cpp', 'GameConsole.cpp', 'GameUI_Interface.cpp', - # 'LogoFile.cpp', [!$POSIX] 'ModInfo.cpp', 'MouseMessageForwardingPanel.cpp', '../common/GameUI/ObjectList.cpp', @@ -67,7 +66,6 @@ def build(bld): 'LoadCommentaryDialog.cpp', 'LoadingDialog.cpp', 'BaseSaveGameDialog.cpp', - #'ChangeGameDialog.cpp', [!$POSIX] 'CreateMultiplayerGameBotPage.cpp', 'CreateMultiplayerGameDialog.cpp', 'CreateMultiplayerGameGameplayPage.cpp', @@ -88,7 +86,6 @@ def build(bld): 'OptionsSubAudio.cpp', 'OptionsSubDifficulty.cpp', 'OptionsSubGame.cpp', - #'OptionsSubHaptics.cpp', [$WIN32] [$WIN32] 'OptionsSubKeyboard.cpp', 'OptionsSubMouse.cpp', 'OptionsSubTouch.cpp', @@ -96,8 +93,16 @@ def build(bld): 'OptionsSubPortal.cpp', 'OptionsSubVideo.cpp', 'OptionsSubVoice.cpp', + '../public/tier0/memoverride.cpp', ] + if bld.env.DEST_OS == 'win32': + source += [ + 'LogoFile.cpp', + 'ChangeGameDialog.cpp', + 'OptionsSubHaptics.cpp' + ] + includes = [ '.', '../public', @@ -111,6 +116,9 @@ def build(bld): libs = ['tier0','vgui_controls','tier1','tier2','tier3','vstdlib','vtf','bitmap','mathlib','SDL2','steam_api','matsys_controls','JPEG','PNG','ZLIB'] + if bld.env.DEST_OS == 'win32': + libs += ['USER32', 'GDI32'] + install_path = bld.env.LIBDIR bld.shlib( diff --git a/inputsystem/inputsystem.vpc b/inputsystem/inputsystem.vpc index a217123333..70d0d7dad8 100644 --- a/inputsystem/inputsystem.vpc +++ b/inputsystem/inputsystem.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" @@ -13,7 +13,7 @@ $Configuration { $Compiler { - $AdditionalIncludeDirectories "$BASE;$SRCDIR\thirdparty\SDL2" [!$SDL] // If $SDL, then we already have this from source_video_base.vpc. + $AdditionalIncludeDirectories "$BASE;$SRCDIR\thirdparty\SDL" [!$SDL] // If $SDL, then we already have this from source_video_base.vpc. $PreprocessorDefinitions "$BASE;VERSION_SAFE_STEAM_API_INTERFACES" } $Linker @@ -34,6 +34,7 @@ $Project "inputsystem" $File "key_translation.cpp" $File "key_translation.h" $File "steamcontroller.cpp" + $File "touch_sdl.cpp" } $Folder "Public Headers" diff --git a/inputsystem/wscript b/inputsystem/wscript index cf2e8be518..9089c72a59 100755 --- a/inputsystem/wscript +++ b/inputsystem/wscript @@ -1,8 +1,9 @@ #! /usr/bin/env python # encoding: utf-8 +from gettext import install from waflib import Utils -import os +import os, sys top = '.' PROJECT_NAME = 'inputsystem' @@ -19,11 +20,16 @@ def build(bld): 'inputsystem.cpp', 'joystick_sdl.cpp', 'touch_sdl.cpp', - #'novint.cpp', # [$WIN32] 'key_translation.cpp', - 'steamcontroller.cpp' + 'steamcontroller.cpp', + '../public/tier0/memoverride.cpp' ] + if bld.env.DEST_OS == 'win32': + source += [ + 'novint.cpp' + ] + includes = [ '.', '../common', @@ -35,8 +41,20 @@ def build(bld): libs = ['tier0','tier1','tier2','vstdlib','SDL2','steam_api'] + if bld.env.DEST_OS == 'win32': + libs += ['USER32'] + install_path = bld.env.LIBDIR + # Copy SDL2 dependency + if bld.env.DEST_OS == 'win32': + bld( + rule=(('cp' if 'MSYSTEM' in os.environ or sys.platform != 'win32' else 'copy')+' ${SRC} ${TGT}'), + source='../lib/win32/'+bld.env.DEST_CPU+'/SDL2.dll', + target='SDL2.dll', + install_path=install_path, + ) + bld.shlib( source = source, target = PROJECT_NAME, diff --git a/ivp b/ivp index fb8f2ac922..bb1b1171af 160000 --- a/ivp +++ b/ivp @@ -1 +1 @@ -Subproject commit fb8f2ac922a7f8f758a552ddbe47f1933ffe42b0 +Subproject commit bb1b1171af890f285193db6abc07acb126e6e93f diff --git a/launcher/launcher.cpp b/launcher/launcher.cpp index a814ec4c10..c03c4cf829 100644 --- a/launcher/launcher.cpp +++ b/launcher/launcher.cpp @@ -1190,7 +1190,7 @@ extern void InitGL4ES(); // Output : int APIENTRY //----------------------------------------------------------------------------- #ifdef WIN32 -extern "C" __declspec(DLL_EXPORT) int LauncherMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) +DLL_EXPORT int LauncherMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) #else DLL_EXPORT int LauncherMain( int argc, char **argv ) #endif diff --git a/launcher/launcher.vpc b/launcher/launcher.vpc index daa0a14ab6..f3754b749d 100644 --- a/launcher/launcher.vpc +++ b/launcher/launcher.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/launcher/wscript b/launcher/wscript index 5beb4f915c..06f09b5c6b 100755 --- a/launcher/wscript +++ b/launcher/wscript @@ -19,9 +19,14 @@ def build(bld): '../public/filesystem_init.cpp', 'launcher.cpp', 'reslistgenerator.cpp', - 'android.cpp' + '../public/tier0/memoverride.cpp' ] + if bld.env.DEST_OS == 'android': + source += [ + 'android.cpp' + ] + includes = [ '.', '../public', @@ -33,6 +38,9 @@ def build(bld): defines = [] libs = ['tier0','tier1','tier2','tier3','vstdlib','steam_api','appframework','SDL2','togl'] + + if bld.env.DEST_OS == 'win32': + libs += ['USER32', 'OLE32', 'SHELL32'] install_path = bld.env.LIBDIR diff --git a/launcher_main/launcher_main.rc b/launcher_main/launcher_main.rc index e7bed8555f..f276eb1755 100644 --- a/launcher_main/launcher_main.rc +++ b/launcher_main/launcher_main.rc @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "Windows.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS diff --git a/launcher_main/launcher_main.vpc b/launcher_main/launcher_main.vpc index 72dbce3341..133a3691b7 100644 --- a/launcher_main/launcher_main.vpc +++ b/launcher_main/launcher_main.vpc @@ -62,15 +62,13 @@ $Configuration // Note that the PDB must be checked in with the name it is linked as or else the debugger // will not be able to find it. That's why it is checked in as default.pdb. // override with specific behavior - $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\hl2.exe $SRCDIR" "\n" \ - "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\default.pdb $SRCDIR" "\n" \ - "copy $(TargetPath) $OUTBINDIR\hl2.exe" "\n" \ + $CommandLine "copy $(TargetPath) $OUTBINDIR\hl2.exe" "\n" \ "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \ "copy $(TargetDir)\default.pdb $OUTBINDIR\default.pdb" "\n" \ "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \ "if exist $(TargetDir)$(TargetName).map copy $(TargetDir)$(TargetName).map $OUTBINDIR\hl2.map" "\n" \ - "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\hl2.dat $SRCDIR" "\n" \ - "$OUTBINDIR\bin\newdat $OUTBINDIR\hl2.exe" "\n" \ + //"call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\hl2.dat $SRCDIR" "\n" \ + //"$OUTBINDIR\bin\newdat $OUTBINDIR\hl2.exe" "\n" \ "goto BuildEventOK" "\n" \ ":BuildEventFailed" "\n" \ "echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. ***" "\n" \ diff --git a/lib b/lib index 43a794e257..b3fe8769db 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit 43a794e257cfc96daa29ff4fc814d4a97cf80022 +Subproject commit b3fe8769dbcb1b6cf991b2612c23f55b68c7ac4e diff --git a/materialsystem/cmatqueuedrendercontext.cpp b/materialsystem/cmatqueuedrendercontext.cpp index 157e34df70..96d5bb0fa4 100644 --- a/materialsystem/cmatqueuedrendercontext.cpp +++ b/materialsystem/cmatqueuedrendercontext.cpp @@ -39,7 +39,7 @@ void FastCopy( byte *pDest, const byte *pSrc, size_t nBytes ) int nBytesFull = nBytes - ( nBytes % BYTES_PER_FULL ); for ( byte *pLimit = pDest + nBytesFull; pDest < pLimit; pDest += BYTES_PER_FULL, pSrc += BYTES_PER_FULL ) { - // memcpy( pDest, pSrc, BYTES_PER_FULL); + #ifdef __i386__ __asm { mov esi, pSrc @@ -63,6 +63,9 @@ void FastCopy( byte *pDest, const byte *pSrc, size_t nBytes ) movntps [edi + 96], xmm6 movntps [edi + 112], xmm7 } + #else + memcpy( pDest, pSrc, BYTES_PER_FULL); + #endif } nBytes -= nBytesFull; } diff --git a/materialsystem/mat_stub.h b/materialsystem/mat_stub.h index 300813c7c4..ce4acb0ecf 100644 --- a/materialsystem/mat_stub.h +++ b/materialsystem/mat_stub.h @@ -76,7 +76,7 @@ public: // Texture streaming! virtual ResidencyType_t GetCurrentResidence() const { return RESIDENT_NONE; }; virtual ResidencyType_t GetTargetResidence() const { return RESIDENT_NONE; }; - virtual bool MakeResident( ResidencyType_t newResidence ) {}; + virtual bool MakeResident( ResidencyType_t newResidence ) { return false; }; virtual void UpdateLodBias() {}; // Various texture polling methods diff --git a/materialsystem/materialsystem.vpc b/materialsystem/materialsystem.vpc index 0c81acebea..6af61c8bfb 100644 --- a/materialsystem/materialsystem.vpc +++ b/materialsystem/materialsystem.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/materialsystem/shaderapidx9/shaderapidx10.vpc b/materialsystem/shaderapidx9/shaderapidx10.vpc index f39dd0e1c7..20243b0c25 100644 --- a/materialsystem/shaderapidx9/shaderapidx10.vpc +++ b/materialsystem/shaderapidx9/shaderapidx10.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR "..\.." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/materialsystem/shaderapidx9/shaderapidx8.cpp b/materialsystem/shaderapidx9/shaderapidx8.cpp index 15562e5d4f..93501f65f0 100644 --- a/materialsystem/shaderapidx9/shaderapidx8.cpp +++ b/materialsystem/shaderapidx9/shaderapidx8.cpp @@ -3498,6 +3498,7 @@ void CShaderAPIDx8::ResetRenderState( bool bFullReset ) SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW ); // No shade mode yet + const D3DSHADEMODE D3DSHADE_NONE = (D3DSHADEMODE)0; m_DynamicState.m_ShadeMode = D3DSHADE_NONE; ShadeMode( SHADER_SMOOTH ); diff --git a/materialsystem/shaderapidx9/shaderapidx9.vpc b/materialsystem/shaderapidx9/shaderapidx9.vpc index dbeea1e7e2..167a719cec 100644 --- a/materialsystem/shaderapidx9/shaderapidx9.vpc +++ b/materialsystem/shaderapidx9/shaderapidx9.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR "..\.." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Macro OUTBINNAME "shaderapidx9" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/materialsystem/shaderapidx9/wmi.cpp b/materialsystem/shaderapidx9/wmi.cpp index 1b0644f5b8..2b19de7cb3 100644 --- a/materialsystem/shaderapidx9/wmi.cpp +++ b/materialsystem/shaderapidx9/wmi.cpp @@ -14,7 +14,7 @@ #include #pragma warning( disable : 4127 ) // VS 2010 warning? #pragma warning( disable : 4805 ) // VS 2013 warning: warning C4805: '==' : unsafe mix of type 'INT' and type 'bool' in operation -#include +// #include #pragma warning( default : 4805 ) #pragma warning( default : 4127 ) #include diff --git a/materialsystem/shaderapidx9/wscript b/materialsystem/shaderapidx9/wscript index d1126bb9e5..dba874698d 100755 --- a/materialsystem/shaderapidx9/wscript +++ b/materialsystem/shaderapidx9/wscript @@ -18,9 +18,13 @@ def configure(conf): #'PROTECTED_THINGS_ENABLE', # conflicts with stlport 'strncpy=use_Q_strncpy_instead', '_snprintf=use_Q_snprintf_instead', - 'GL_GLEXT_PROTOTYPES', - 'DX_TO_GL_ABSTRACTION' ]) + + if conf.env.DEST_OS == 'win32' and not conf.env.GL: + conf.env.append_unique('DEFINES',[ + 'USE_ACTUAL_DX', + ]) + def build(bld): source = [ @@ -29,7 +33,6 @@ def build(bld): 'hardwareconfig.cpp', 'meshbase.cpp', 'meshdx8.cpp', - #'recording.cpp', [$WIN32 && !$GL] 'shaderapidx8.cpp', 'shaderdevicebase.cpp', 'shaderapibase.cpp', @@ -40,11 +43,19 @@ def build(bld): 'cvballoctracker.cpp', 'vertexdecl.cpp', 'vertexshaderdx8.cpp', - #'wmi.cpp', [$WIN32 && !$GL] #'textureheap.cpp', [$X360] - 'winutils.cpp'# [!$WIN32] + '../../public/tier0/memoverride.cpp' ] + if bld.env.DEST_OS == 'win32' and not bld.env.GL: + source += [ + 'recording.cpp', + 'wmi.cpp' + ] + + if bld.env.DEST_OS != 'win32': + source += ['winutils.cpp'] + includes = [ '.', '../../public', @@ -60,7 +71,9 @@ def build(bld): if bld.env.DEST_OS == 'android': libs += ['ANDROID_SUPPORT'] - + elif bld.env.DEST_OS == 'win32' and not bld.env.GL: + libs += ['D3D9', 'D3DX9', 'bzip2'] + install_path = bld.env.LIBDIR bld.shlib( diff --git a/materialsystem/shaderapiempty/wscript b/materialsystem/shaderapiempty/wscript index 3dab5e410f..5d92735971 100755 --- a/materialsystem/shaderapiempty/wscript +++ b/materialsystem/shaderapiempty/wscript @@ -19,7 +19,8 @@ def configure(conf): def build(bld): source = [ - 'shaderapiempty.cpp' + 'shaderapiempty.cpp', + '../../public/tier0/memoverride.cpp' ] includes = [ diff --git a/materialsystem/shadersystem.cpp b/materialsystem/shadersystem.cpp index 3a52393edb..b3da33e110 100644 --- a/materialsystem/shadersystem.cpp +++ b/materialsystem/shadersystem.cpp @@ -447,7 +447,8 @@ extern "C" void CShaderSystem::VerifyBaseShaderDLL( CSysModule *pModule ) { -#if defined( _WIN32 ) && !defined( _X360 ) +//#if defined( _WIN32 ) && !defined( _X360 ) +#if 0 const char *pErrorStr = "Corrupt save data settings."; unsigned char *testData1 = new unsigned char[SHADER_DLL_VERIFY_DATA_LEN1]; diff --git a/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20.inc b/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20.inc index 70bff4d124..b150aad02a 100644 --- a/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20.inc +++ b/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20.inc @@ -553,7 +553,7 @@ public: // Asserts to make sure that we aren't using any skipped combinations. // Asserts to make sure that we are setting all of the combination vars. #ifdef _DEBUG - bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE && m_bLIGHTING_PREVIEW && m_bSTATIC_LIGHT_LIGHTMAP; + bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE && m_bLIGHTING_PREVIEW; // && m_bSTATIC_LIGHT_LIGHTMAP Assert( bAllDynamicVarsDefined ); #endif // _DEBUG return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nLIGHTING_PREVIEW ) + 0; diff --git a/materialsystem/stdshaders/stdshader_dbg.vpc b/materialsystem/stdshaders/stdshader_dbg.vpc index 30201811fb..d07acfdf8c 100644 --- a/materialsystem/stdshaders/stdshader_dbg.vpc +++ b/materialsystem/stdshaders/stdshader_dbg.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR "..\.." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" // shader_dll_verify.cpp defines a function called _ftol3. This means that we can't // link with the bug-fixed ftol3.obj. It also means we can't convert float-to-unsigned. diff --git a/materialsystem/stdshaders/stdshader_dx6.vpc b/materialsystem/stdshaders/stdshader_dx6.vpc index daca60d05e..0740e07ed1 100644 --- a/materialsystem/stdshaders/stdshader_dx6.vpc +++ b/materialsystem/stdshaders/stdshader_dx6.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR "..\.." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" // shader_dll_verify.cpp defines a function called _ftol3. This means that we can't // link with the bug-fixed ftol3.obj. It also means we can't convert float-to-unsigned. diff --git a/materialsystem/stdshaders/stdshader_dx7.vpc b/materialsystem/stdshaders/stdshader_dx7.vpc index 12a9a05832..30bb028e0e 100644 --- a/materialsystem/stdshaders/stdshader_dx7.vpc +++ b/materialsystem/stdshaders/stdshader_dx7.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR "..\.." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" // shader_dll_verify.cpp defines a function called _ftol3. This means that we can't // link with the bug-fixed ftol3.obj. It also means we can't convert float-to-unsigned. diff --git a/materialsystem/stdshaders/stdshader_dx8.vpc b/materialsystem/stdshaders/stdshader_dx8.vpc index 9d6eca1d04..2eabff7ac7 100644 --- a/materialsystem/stdshaders/stdshader_dx8.vpc +++ b/materialsystem/stdshaders/stdshader_dx8.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR "..\.." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" // shader_dll_verify.cpp defines a function called _ftol3. This means that we can't // link with the bug-fixed ftol3.obj. It also means we can't convert float-to-unsigned. diff --git a/materialsystem/stdshaders/stdshader_dx9.vpc b/materialsystem/stdshaders/stdshader_dx9.vpc index 575f687a84..46428bde3c 100644 --- a/materialsystem/stdshaders/stdshader_dx9.vpc +++ b/materialsystem/stdshaders/stdshader_dx9.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR "..\.." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" // shader_dll_verify.cpp defines a function called _ftol3. This means that we can't // link with the bug-fixed ftol3.obj. It also means we can't convert float-to-unsigned. diff --git a/materialsystem/stdshaders/wscript b/materialsystem/stdshaders/wscript index 66ec1c0619..c9bc98c45e 100644 --- a/materialsystem/stdshaders/wscript +++ b/materialsystem/stdshaders/wscript @@ -125,7 +125,8 @@ def build(bld): 'worldvertextransition_dx8_helper.cpp', 'writez_dx9.cpp', 'writestencil_dx9.cpp', - 'eyeball.cpp' + 'eyeball.cpp', + '../../public/tier0/memoverride.cpp' # $Folder 'stdshader_dbg Files', [$X360] # { # 'debugdepth.cpp', diff --git a/materialsystem/wscript b/materialsystem/wscript index a99fb8042d..7a758c5905 100755 --- a/materialsystem/wscript +++ b/materialsystem/wscript @@ -44,15 +44,16 @@ def build(bld): 'cmatlightmaps.cpp', 'cmatrendercontext.cpp', 'cmatqueuedrendercontext.cpp', - 'ctexturecompositor.cpp' + 'ctexturecompositor.cpp', + '../public/tier0/memoverride.cpp' ] includes = [ '.', - '../../public', - '../../public/tier0', - '../../public/tier1', - '../../common', + '../public', + '../public/tier0', + '../public/tier1', + '../common', '../' ] + bld.env.INCLUDES_SDL2 diff --git a/mathlib/polyhedron.cpp b/mathlib/polyhedron.cpp index f02bba6f8e..5981ebca4c 100644 --- a/mathlib/polyhedron.cpp +++ b/mathlib/polyhedron.cpp @@ -11,7 +11,9 @@ #include #include #include "tier1/utlvector.h" - +#ifdef COMPILER_MSVC +#include +#endif struct GeneratePolyhedronFromPlanes_Point; @@ -82,7 +84,9 @@ CPolyhedron_AllocByNew *CPolyhedron_AllocByNew::Allocate( unsigned short iVertic (iIndices * sizeof( Polyhedron_IndexedLineReference_t )) + (iPolygons * sizeof( Polyhedron_IndexedPolygon_t ))); +#include "tier0/memdbgoff.h" CPolyhedron_AllocByNew *pAllocated = new ( pMemory ) CPolyhedron_AllocByNew; +#include "tier0/memdbgon.h" pAllocated->iVertexCount = iVertices; pAllocated->iLineCount = iLines; diff --git a/networksystem/networksystem.vpc b/networksystem/networksystem.vpc index b73375b8a1..5146263b36 100644 --- a/networksystem/networksystem.vpc +++ b/networksystem/networksystem.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/particles/wscript b/particles/wscript index 8895f76559..7c3a6087d7 100755 --- a/particles/wscript +++ b/particles/wscript @@ -15,7 +15,6 @@ def configure(conf): return def build(bld): - print(bld) source = [ 'builtin_constraints.cpp', 'builtin_initializers.cpp', diff --git a/public/UtlCachedFileData.h b/public/UtlCachedFileData.h index 0be5049f9b..cb924a3ead 100644 --- a/public/UtlCachedFileData.h +++ b/public/UtlCachedFileData.h @@ -155,7 +155,7 @@ public: void ForceRecheckDiskInfo(); // Iterates all entries and gets filesystem info and optionally causes rebuild on any existing items which are out of date - void CheckDiskInfo( bool force_rebuild, long cacheFileTime = 0L ); + void CheckDiskInfo( bool force_rebuild, time_t cacheFileTime = 0L ); void SaveManifest(); bool ManifestExists(); @@ -229,8 +229,8 @@ private: } FileNameHandle_t handle; - long fileinfo; - long diskfileinfo; + long long fileinfo; + long long diskfileinfo; int dataIndex; }; @@ -636,7 +636,7 @@ bool CUtlCachedFileData::Init() SetDirty( true ); return true; } - long fileTime = g_pFullFileSystem->GetFileTime( m_sRepositoryFileName, "MOD" ); + time_t fileTime = g_pFullFileSystem->GetFileTime( m_sRepositoryFileName, "MOD" ); int size = g_pFullFileSystem->Size( fh ); bool deletefile = false; @@ -908,7 +908,7 @@ public: // Iterates all entries and causes rebuild on any existing items which are out of date template -void CUtlCachedFileData::CheckDiskInfo( bool forcerebuild, long cacheFileTime ) +void CUtlCachedFileData::CheckDiskInfo( bool forcerebuild, time_t cacheFileTime ) { char fn[ 512 ]; int i; @@ -958,7 +958,7 @@ void CUtlCachedFileData::CheckDiskInfo( bool forcerebuild, long cacheFileTime } else { - long pathTime = g_pFullFileSystem->GetPathTime( fn, "GAME" ); + time_t pathTime = g_pFullFileSystem->GetPathTime( fn, "GAME" ); bCheck = (pathTime > cacheFileTime) ? true : false; } diff --git a/public/dispcoll_common.cpp b/public/dispcoll_common.cpp index 673cbb1cf5..307e14086b 100644 --- a/public/dispcoll_common.cpp +++ b/public/dispcoll_common.cpp @@ -429,7 +429,13 @@ void CDispCollTree::AABBTree_CreateLeafs( void ) } } -void __attribute__((no_sanitize("address"))) CDispCollTree::AABBTree_GenerateBoxes_r( int nodeIndex, Vector *pMins, Vector *pMaxs ) +#if COMPILER_CLANG +#define NOASAN __attribute__((no_sanitize("address"))) +#else +#define NOASAN +#endif + +void NOASAN CDispCollTree::AABBTree_GenerateBoxes_r( int nodeIndex, Vector *pMins, Vector *pMaxs ) { // leaf ClearBounds( *pMins, *pMaxs ); @@ -461,6 +467,7 @@ void __attribute__((no_sanitize("address"))) CDispCollTree::AABBTree_GenerateBox } } +#undef NOASAN //----------------------------------------------------------------------------- // Purpose: diff --git a/public/filesystem.h b/public/filesystem.h index 018b7e43c7..2009878ca9 100644 --- a/public/filesystem.h +++ b/public/filesystem.h @@ -21,6 +21,8 @@ #include "tier1/checksum_md5.h" #include "tier1/refcount.h" +#include + #ifdef _WIN32 #pragma once #endif @@ -521,7 +523,7 @@ public: virtual bool IsFileWritable( char const *pFileName, const char *pPathID = 0 ) = 0; virtual bool SetFileWritable( char const *pFileName, bool writable, const char *pPathID = 0 ) = 0; - virtual long GetFileTime( const char *pFileName, const char *pPathID = 0 ) = 0; + virtual time_t GetFileTime( const char *pFileName, const char *pPathID = 0 ) = 0; //-------------------------------------------------------- // Reads/writes files to utlbuffers. Use this for optimal read performance when doing open/read/close @@ -616,7 +618,7 @@ public: // File I/O and info virtual bool IsDirectory( const char *pFileName, const char *pathID = 0 ) = 0; - virtual void FileTimeToString( char* pStrip, int maxCharsIncludingTerminator, long fileTime ) = 0; + virtual void FileTimeToString( char* pStrip, int maxCharsIncludingTerminator, time_t fileTime ) = 0; //-------------------------------------------------------- // Open file operations @@ -844,7 +846,7 @@ public: } virtual int GetPathIndex( const FileNameHandle_t &handle ) = 0; - virtual long GetPathTime( const char *pPath, const char *pPathID ) = 0; + virtual time_t GetPathTime( const char *pPath, const char *pPathID ) = 0; virtual DVDMode_t GetDVDMode() = 0; diff --git a/public/filesystem_passthru.h b/public/filesystem_passthru.h index f4478b8dca..a90a712aa2 100644 --- a/public/filesystem_passthru.h +++ b/public/filesystem_passthru.h @@ -14,6 +14,7 @@ #include "filesystem.h" #include #include +#include #ifdef AsyncRead #undef AsyncRead @@ -52,7 +53,7 @@ public: virtual bool FileExists( const char *pFileName, const char *pPathID ) { return m_pBaseFileSystemPassThru->FileExists( pFileName, pPathID ); } virtual bool IsFileWritable( char const *pFileName, const char *pPathID ) { return m_pBaseFileSystemPassThru->IsFileWritable( pFileName, pPathID ); } virtual bool SetFileWritable( char const *pFileName, bool writable, const char *pPathID ) { return m_pBaseFileSystemPassThru->SetFileWritable( pFileName, writable, pPathID ); } - virtual long GetFileTime( const char *pFileName, const char *pPathID ) { return m_pBaseFileSystemPassThru->GetFileTime( pFileName, pPathID ); } + virtual time_t GetFileTime( const char *pFileName, const char *pPathID ) { return m_pBaseFileSystemPassThru->GetFileTime( pFileName, pPathID ); } virtual bool ReadFile( const char *pFileName, const char *pPath, CUtlBuffer &buf, int nMaxBytes = 0, int nStartingByte = 0, FSAllocFunc_t pfnAlloc = NULL ) { return m_pBaseFileSystemPassThru->ReadFile( pFileName, pPath, buf, nMaxBytes, nStartingByte, pfnAlloc ); } virtual bool WriteFile( const char *pFileName, const char *pPath, CUtlBuffer &buf ) { return m_pBaseFileSystemPassThru->WriteFile( pFileName, pPath, buf ); } virtual bool UnzipFile( const char *pFileName, const char *pPath, const char *pDestination ) { return m_pBaseFileSystemPassThru->UnzipFile( pFileName, pPath, pDestination ); } @@ -100,7 +101,7 @@ public: virtual bool RenameFile( char const *pOldPath, char const *pNewPath, const char *pathID ) { return m_pFileSystemPassThru->RenameFile( pOldPath, pNewPath, pathID ); } virtual void CreateDirHierarchy( const char *path, const char *pathID ) { m_pFileSystemPassThru->CreateDirHierarchy( path, pathID ); } virtual bool IsDirectory( const char *pFileName, const char *pathID ) { return m_pFileSystemPassThru->IsDirectory( pFileName, pathID ); } - virtual void FileTimeToString( char* pStrip, int maxCharsIncludingTerminator, long fileTime ) { m_pFileSystemPassThru->FileTimeToString( pStrip, maxCharsIncludingTerminator, fileTime ); } + virtual void FileTimeToString( char* pStrip, int maxCharsIncludingTerminator, time_t fileTime ) { m_pFileSystemPassThru->FileTimeToString( pStrip, maxCharsIncludingTerminator, fileTime ); } virtual void SetBufferSize( FileHandle_t file, unsigned nBytes ) { m_pFileSystemPassThru->SetBufferSize( file, nBytes ); } virtual bool IsOk( FileHandle_t file ) { return m_pFileSystemPassThru->IsOk( file ); } virtual bool EndOfFile( FileHandle_t file ) { return m_pFileSystemPassThru->EndOfFile( file ); } @@ -211,7 +212,7 @@ public: virtual bool ReadToBuffer( FileHandle_t hFile, CUtlBuffer &buf, int nMaxBytes = 0, FSAllocFunc_t pfnAlloc = NULL ) { return m_pFileSystemPassThru->ReadToBuffer( hFile, buf, nMaxBytes, pfnAlloc ); } virtual bool FullPathToRelativePathEx( const char *pFullPath, const char *pPathId, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars ) { return m_pFileSystemPassThru->FullPathToRelativePathEx( pFullPath, pPathId, pDest, maxLenInChars ); } virtual int GetPathIndex( const FileNameHandle_t &handle ) { return m_pFileSystemPassThru->GetPathIndex( handle ); } - virtual long GetPathTime( const char *pPath, const char *pPathID ) { return m_pFileSystemPassThru->GetPathTime( pPath, pPathID ); } + virtual time_t GetPathTime( const char *pPath, const char *pPathID ) { return m_pFileSystemPassThru->GetPathTime( pPath, pPathID ); } virtual DVDMode_t GetDVDMode() { return m_pFileSystemPassThru->GetDVDMode(); } diff --git a/public/materialsystem/imesh.h b/public/materialsystem/imesh.h index 2839340462..fde8d5ec39 100644 --- a/public/materialsystem/imesh.h +++ b/public/materialsystem/imesh.h @@ -1149,14 +1149,14 @@ inline void CVertexBuilder::FastAdvanceNVertices( int n ) -#ifndef COMPILER_MSVC64 +// #ifndef COMPILER_MSVC64 // Implement for 64-bit Windows if needed. //----------------------------------------------------------------------------- // Fast Vertex! No need to call advance vertex, and no random access allowed //----------------------------------------------------------------------------- inline void CVertexBuilder::FastVertex( const ModelVertexDX7_t &vertex ) { -#if defined(__arm__) || defined(__aarch64__) +#if defined(__arm__) || defined(__aarch64__) || defined(PLATFORM_WINDOWS_PC64) FastVertexSSE( vertex ); #else Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed @@ -1224,7 +1224,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX7_t &vertex ) Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed Assert( m_nCurrentVertex < m_nMaxVertexCount ); -#if defined( _WIN32 ) && !defined( _X360 ) +#if defined( _WIN32 ) && !defined( _X360 ) && !defined( PLATFORM_64BITS ) const void *pRead = &vertex; void *pCurrPos = m_pCurrPosition; __asm @@ -1240,7 +1240,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX7_t &vertex ) movntps [edi + 16], xmm1 movntps [edi + 32], xmm2 } -#elif defined(GNUC) +#elif defined(GNUC) || defined(PLATFORM_WINDOWS_PC64) const char *pRead = (char *)&vertex; char *pCurrPos = (char *)m_pCurrPosition; __m128 m1 = _mm_load_ps( (float *)pRead ); @@ -1271,7 +1271,7 @@ inline void CVertexBuilder::Fast4VerticesSSE( Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed Assert( m_nCurrentVertex < m_nMaxVertexCount-3 ); -#if defined( _WIN32 ) && !defined( _X360 ) +#if defined( _WIN32 ) && !defined( _X360 ) && !defined( PLATFORM_64BITS ) void *pCurrPos = m_pCurrPosition; __asm { @@ -1313,6 +1313,38 @@ inline void CVertexBuilder::Fast4VerticesSSE( movntps [edi + 80+96], xmm5 } +#elif defined(__arm__) || defined(PLATFORM_WINDOWS_PC64) + const void *pReadA = &vtx_a; + const void *pReadB = &vtx_b; + const void *pReadC = &vtx_c; + const void *pReadD = &vtx_d; + + void *pCurrPos = m_pCurrPosition; + + __m128 m1 = _mm_load_ps( (float *)pReadA ); + __m128 m2 = _mm_load_ps( (float *)((intp)pReadA + 16) ); + __m128 m3 = _mm_load_ps( (float *)((intp)pReadA + 32) ); + __m128 m4 = _mm_load_ps( (float *)pReadB ); + __m128 m5 = _mm_load_ps( (float *)((intp)pReadB + 16) ); + __m128 m6 = _mm_load_ps( (float *)((intp)pReadB + 32) ); + _mm_stream_ps( (float *)pCurrPos, m1 ); + _mm_stream_ps( (float *)((intp)pCurrPos + 16), m2 ); + _mm_stream_ps( (float *)((intp)pCurrPos + 32), m3 ); + _mm_stream_ps( (float *)((intp)pCurrPos + 48), m4 ); + _mm_stream_ps( (float *)((intp)pCurrPos + 64), m5 ); + _mm_stream_ps( (float *)((intp)pCurrPos + 80), m6 ); + m1 = _mm_load_ps( (float *)pReadC ); + m2 = _mm_load_ps( (float *)((intp)pReadC + 16) ); + m3 = _mm_load_ps( (float *)((intp)pReadC + 32) ); + m4 = _mm_load_ps( (float *)pReadD ); + m5 = _mm_load_ps( (float *)((intp)pReadD + 16) ); + m6 = _mm_load_ps( (float *)((intp)pReadD + 32) ); + _mm_stream_ps( (float *)((intp)pCurrPos + 0+96), m1 ); + _mm_stream_ps( (float *)((intp)pCurrPos + 16+96), m2 ); + _mm_stream_ps( (float *)((intp)pCurrPos + 32+96), m3 ); + _mm_stream_ps( (float *)((intp)pCurrPos + 48+96), m4 ); + _mm_stream_ps( (float *)((intp)pCurrPos + 64+96), m5 ); + _mm_stream_ps( (float *)((intp)pCurrPos + 80+96), m6 ); #else Error( "Implement CMeshBuilder::Fast4VerticesSSE\n"); #endif @@ -1326,7 +1358,7 @@ inline void CVertexBuilder::Fast4VerticesSSE( inline void CVertexBuilder::FastVertex( const ModelVertexDX8_t &vertex ) { -#if defined(__arm__) || defined(__aarch64__) +#if defined(__arm__) || defined(__aarch64__) || defined(PLATFORM_WINDOWS_PC64) FastVertexSSE( vertex ); #else Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed @@ -1402,7 +1434,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex ) Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed Assert( m_nCurrentVertex < m_nMaxVertexCount ); -#if defined( _WIN32 ) && !defined( _X360 ) +#if defined( _WIN32 ) && !defined( _X360 ) && !defined( PLATFORM_64BITS ) const void *pRead = &vertex; void *pCurrPos = m_pCurrPosition; __asm @@ -1420,7 +1452,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex ) movntps [edi + 32], xmm2 movntps [edi + 48], xmm3 } -#elif defined(GNUC) +#elif defined(GNUC) || defined(PLATFORM_WINDOWS_PC64) const void *pRead = &vertex; void *pCurrPos = m_pCurrPosition; @@ -1455,7 +1487,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex ) m_bWrittenUserData = false; #endif } -#endif // COMPILER_MSVC64 +// #endif // COMPILER_MSVC64 //----------------------------------------------------------------------------- diff --git a/public/tier0/dbg.h b/public/tier0/dbg.h index 9f2c734bbf..80587c0402 100644 --- a/public/tier0/dbg.h +++ b/public/tier0/dbg.h @@ -358,6 +358,18 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent(); #define VerifyEquals( _exp, _expectedValue ) AssertEquals( _exp, _expectedValue ) #define DbgVerify( _exp ) Assert( _exp ) +#ifdef _DEBUG +#define DbgAssert( _exp ) Assert( _exp ) +#else +#define DbgAssert( _exp ) ((void)0) +#endif + +#ifdef _DEBUG +#define DbgAssert( _exp ) Assert( _exp ) +#else +#define DbgAssert( _exp ) ((void)0) +#endif + #define AssertMsg1( _exp, _msg, a1 ) AssertMsg( _exp, _msg, a1 ) #define AssertMsg2( _exp, _msg, a1, a2 ) AssertMsg( _exp, _msg, a1, a2 ) #define AssertMsg3( _exp, _msg, a1, a2, a3 ) AssertMsg( _exp, _msg, a1, a2, a3 ) @@ -383,6 +395,7 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent(); #define VerifyMsg3( _exp, _msg, a1, a2, a3 ) (_exp) #define VerifyEquals( _exp, _expectedValue ) (_exp) #define DbgVerify( _exp ) (_exp) +#define DbgAssert( _exp ) ((void)0) #define AssertMsg1( _exp, _msg, a1 ) ((void)0) #define AssertMsg2( _exp, _msg, a1, a2 ) ((void)0) @@ -397,6 +410,9 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent(); #endif // DBGFLAG_ASSERT +// Source2 compatibility macro +#define AssertDbg( X ) DbgAssert( X ) + // The Always version of the assert macros are defined even when DBGFLAG_ASSERT is not, // so they will be available even in release. #define AssertAlways( _exp ) _AssertMsg( _exp, _T("Assertion Failed: ") _T(#_exp), ((void)0), false ) diff --git a/public/tier0/etwprof.h b/public/tier0/etwprof.h index c1d4282204..dc9d1c39e7 100644 --- a/public/tier0/etwprof.h +++ b/public/tier0/etwprof.h @@ -27,7 +27,7 @@ #ifdef IS_WINDOWS_PC // ETW support should be compiled in for all Windows PC platforms. It isn't // supported on Windows XP but that is determined at run-time. -#define ETW_MARKS_ENABLED +//#define ETW_MARKS_ENABLED #endif #ifdef ETW_MARKS_ENABLED diff --git a/public/tier0/memalloc.h b/public/tier0/memalloc.h index 3a64fc320c..60fab0d1fe 100644 --- a/public/tier0/memalloc.h +++ b/public/tier0/memalloc.h @@ -28,7 +28,9 @@ #endif // Undefine this if using a compiler lacking threadsafe RTTI (like vc6) +#ifndef COMPILER_MSVC #define MEM_DEBUG_CLASSNAME 1 +#endif #include #if defined( OSX ) @@ -383,7 +385,7 @@ public: #pragma warning(disable:4290) #pragma warning(push) - #include + #include // MEM_DEBUG_CLASSNAME is opt-in. // Note: typeid().name() is not threadsafe, so if the project needs to access it in multiple threads diff --git a/public/tier0/memoverride.cpp b/public/tier0/memoverride.cpp index 57d3f4cbda..0fcfb6bc23 100644 --- a/public/tier0/memoverride.cpp +++ b/public/tier0/memoverride.cpp @@ -145,6 +145,11 @@ inline void *ReallocUnattributed( void *pMem, size_t nSize ) #define FREE_CALL #endif +// check for noexcept in crt +#ifndef _CRT_NOEXCEPT +#define _CRT_NOEXCEPT +#endif + extern "C" { @@ -203,12 +208,12 @@ ALLOC_CALL void *_realloc_base( void *pMem, size_t nSize ) return ReallocUnattributed( pMem, nSize ); } -ALLOC_CALL void *_recalloc_base( void *pMem, size_t nSize ) +ALLOC_CALL void *_recalloc_base( void *pMem, size_t nCount, size_t nSize ) { - void *pMemOut = ReallocUnattributed( pMem, nSize ); + void *pMemOut = ReallocUnattributed( pMem, nCount * nSize ); if ( !pMem ) { - memset( pMemOut, 0, nSize ); + memset( pMemOut, 0, nCount * nSize); } return pMemOut; } @@ -242,7 +247,7 @@ void * __cdecl _realloc_crt(void *ptr, size_t size) void * __cdecl _recalloc_crt(void *ptr, size_t count, size_t size) { - return _recalloc_base( ptr, size * count ); + return _recalloc_base( ptr, size, count ); } ALLOC_CALL void * __cdecl _recalloc ( void * memblock, size_t count, size_t size ) @@ -255,7 +260,7 @@ ALLOC_CALL void * __cdecl _recalloc ( void * memblock, size_t count, size_t size return pMem; } -size_t _msize_base( void *pMem ) +size_t _msize_base( void *pMem ) _CRT_NOEXCEPT { return g_pMemAlloc->GetSize(pMem); } diff --git a/public/tier0/threadtools.h b/public/tier0/threadtools.h index 7714fe4f87..b99755fafa 100644 --- a/public/tier0/threadtools.h +++ b/public/tier0/threadtools.h @@ -216,7 +216,7 @@ inline bool ThreadInMainThread() #endif // NOTE: ThreadedLoadLibraryFunc_t needs to return the sleep time in milliseconds or TT_INFINITE -typedef int (*ThreadedLoadLibraryFunc_t)(); +typedef uintp (*ThreadedLoadLibraryFunc_t)(void *pParam); PLATFORM_INTERFACE void SetThreadedLoadLibraryFunc( ThreadedLoadLibraryFunc_t func ); PLATFORM_INTERFACE ThreadedLoadLibraryFunc_t GetThreadedLoadLibraryFunc(); @@ -1602,8 +1602,11 @@ public: } }; +#ifdef _WIN32 PLATFORM_INTERFACE int ThreadWaitForObjects( int nEvents, const HANDLE *pHandles, bool bWaitAll = true, unsigned timeout = TT_INFINITE ); inline int ThreadWaitForEvents( int nEvents, const CThreadEvent *pEvents, bool bWaitAll = true, unsigned timeout = TT_INFINITE ) { return ThreadWaitForObjects( nEvents, (const HANDLE *)pEvents, bWaitAll, timeout ); } +inline int ThreadWaitForObject(HANDLE handle, bool bWaitAll = true, unsigned timeout = TT_INFINITE) { return ThreadWaitForObjects(1, &handle, bWaitAll, timeout); } +#endif //----------------------------------------------------------------------------- // diff --git a/public/tier0/threadtools.inl b/public/tier0/threadtools.inl index 694c653eb2..1935b213b7 100644 --- a/public/tier0/threadtools.inl +++ b/public/tier0/threadtools.inl @@ -532,11 +532,11 @@ unsigned long STDCALL CThread::ThreadProc(LPVOID pv) INLINE_ON_PS3 void* CThread::ThreadProc(LPVOID pv) #endif { -#if defined( POSIX ) || defined( _PS3 ) +// #if defined( POSIX ) || defined( _PS3 ) ThreadInit_t *pInit = reinterpret_cast(pv); -#else - std::auto_ptr pInit((ThreadInit_t *)pv); -#endif +// #else +// std::auto_ptr pInit((ThreadInit_t *)pv); +// #endif #ifdef _X360 // Make sure all threads are consistent w.r.t floating-point math diff --git a/public/tier1/reliabletimer.h b/public/tier1/reliabletimer.h index c830fbe343..1d067fc02e 100644 --- a/public/tier1/reliabletimer.h +++ b/public/tier1/reliabletimer.h @@ -13,7 +13,7 @@ #include "tier1/tier1.h" #include "tier1/strtools.h" -#define DbgAssert Assert +// #define DbgAssert Assert #define kMILLION (1000000) #define kTHOUSAND (1000) diff --git a/replay/replay.vpc b/replay/replay.vpc index 70b80e391b..326f043f48 100644 --- a/replay/replay.vpc +++ b/replay/replay.vpc @@ -9,7 +9,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" // NOTE: We don't want to include source_replay.vpc here. The only purpose // REPLAY_ENABLED // serves in this project is for includes like netmessages.h @@ -201,12 +201,12 @@ $Project "replay" $Libexternal $LIBCOMMON/libcrypto [$OSXALL] $Libexternal "$SRCDIR\lib\common\$(CRYPTOPPDIR)\libcrypto" [$LINUXALL] - $Libexternal libpng [!$VS2015] - $Libexternal $LIBCOMMON/libpng [$VS2015] + $Libexternal libpng [!$VS2015 && !$VS2019] + $Libexternal $LIBCOMMON/libpng [$VS2015 || $VS2019] $ImpLib "$LIBCOMMON\curl" [$OSXALL] - $Lib "$LIBCOMMON\libcurl" [$WIN32&&!$VS2015] + $Lib "$LIBCOMMON\libcurl" [$WIN32&&!$VS2015&&!$VS2019] $Lib "libz" [$WIN32] $Libexternal libz [$LINUXALL] diff --git a/scenefilecache/scenefilecache.vpc b/scenefilecache/scenefilecache.vpc index ee6460de4f..d3972951b2 100644 --- a/scenefilecache/scenefilecache.vpc +++ b/scenefilecache/scenefilecache.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/scenefilecache/wscript b/scenefilecache/wscript index 828c06d9e3..f1bd3fc97e 100755 --- a/scenefilecache/wscript +++ b/scenefilecache/wscript @@ -17,7 +17,8 @@ def configure(conf): def build(bld): source = [ - 'SceneFileCache.cpp' + 'SceneFileCache.cpp', + '../public/tier0/memoverride.cpp' ] includes = [ diff --git a/scripts/waifulib/compiler_optimizations.py b/scripts/waifulib/compiler_optimizations.py index ec203e07ac..8064dd98ed 100644 --- a/scripts/waifulib/compiler_optimizations.py +++ b/scripts/waifulib/compiler_optimizations.py @@ -47,41 +47,41 @@ LINKFLAGS = { CFLAGS = { 'common': { # disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP - 'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS', '/Zc:threadSafeInit-', '/MT'], + 'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS', '/Zc:threadSafeInit-'], 'clang': ['-g0', '-fno-strict-aliasing', '-gdwarf-2', '-fvisibility=hidden'], 'gcc': ['-g0', '-fno-strict-aliasing', '-fvisibility=hidden'], 'owcc': ['-fno-short-enum', '-ffloat-store', '-g0'] }, 'fast': { - 'msvc': ['/O2', '/Oy'], + 'msvc': ['/O2', '/Oy', '/MT'], 'gcc': ['-Ofast'], 'clang': ['-Ofast'], 'default': ['-O3'] }, 'fastnative': { - 'msvc': ['/O2', '/Oy'], + 'msvc': ['/O2', '/Oy', '/MT'], 'gcc': ['-Ofast', '-march=native', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'], 'clang': ['-Ofast', '-march=native'], 'default': ['-O3'] }, 'release': { - 'msvc': ['/O2'], + 'msvc': ['/O2', '/MT'], 'owcc': ['-O3', '-fomit-leaf-frame-pointer', '-fomit-frame-pointer', '-finline-functions', '-finline-limit=512'], 'default': ['-O2', '-funsafe-math-optimizations', '-ftree-vectorize'] }, 'debug': { - 'msvc': ['/Od'], + 'msvc': ['/Od', '/MTd'], 'owcc': ['-g', '-O0', '-fno-omit-frame-pointer', '-funwind-tables', '-fno-omit-leaf-frame-pointer'], 'default': ['-g', '-O0'] #, '-ftree-vectorize', '-ffast-math', '-fno-tree-partial-pre'] }, 'sanitize': { - 'msvc': ['/Od', '/RTC1'], + 'msvc': ['/Od', '/RTC1', '/MT'], 'gcc': ['-Og', '-fsanitize=undefined', '-fsanitize=address'], 'clang': ['-O0', '-fsanitize=undefined', '-fsanitize=address'], 'default': ['-O0'] }, 'nooptimize': { - 'msvc': ['/Od'], + 'msvc': ['/Od', '/MT'], 'default': ['-O0'] } } diff --git a/scripts/waifulib/masm.py b/scripts/waifulib/masm.py new file mode 100644 index 0000000000..02ae054e7c --- /dev/null +++ b/scripts/waifulib/masm.py @@ -0,0 +1,22 @@ +# encoding: utf-8 +# masm.py -- Microsoft Macro Assembler file support + +from waflib import Errors, Logs, Task +from waflib.TaskGen import extension + +class masm(Task.Task): + """ + Compiles assembler files with masm + """ + color = 'BLUE' + run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${ASMDEFINES_ST:DEFINES} ${AS_TGT_F}${TGT} ${AS_SRC_F}${SRC}' + +@extension('.masm') +def create_masm_task(self, node): + return self.create_compiled_task('masm', node) + +def configure(conf): + conf.env.AS = conf.env.CC[0].replace('CL.exe', 'ml64.exe') + conf.env.ASFLAGS = ['/nologo', '/c'] + conf.env.AS_SRC_F = [''] + conf.env.AS_TGT_F = ['/Fo'] \ No newline at end of file diff --git a/scripts/waifulib/msvc_pdb_ext.py b/scripts/waifulib/msvc_pdb_ext.py new file mode 100644 index 0000000000..348c90dcd4 --- /dev/null +++ b/scripts/waifulib/msvc_pdb_ext.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# encoding: utf-8 +# Rafaƫl Kooi 2019 + +from waflib import TaskGen + +banned_extensions_list = ["rc", "asm", "masm"] + +@TaskGen.feature('c', 'cxx', 'fc') +@TaskGen.after_method('propagate_uselib_vars') +def add_pdb_per_object(self): + """For msvc/fortran, specify a unique compile pdb per object, to work + around LNK4099. Flags are updated with a unique /Fd flag based on the + task output name. This is separate from the link pdb. + """ + if not hasattr(self, 'compiled_tasks'): + return + + link_task = getattr(self, 'link_task', None) + + for task in self.compiled_tasks: + if task.inputs and (task.inputs[0].name.lower().split(".")[-1] in banned_extensions_list): + continue + + add_pdb = False + for flagname in ('CFLAGS', 'CXXFLAGS', 'FCFLAGS'): + # several languages may be used at once + for flag in task.env[flagname]: + if flag[1:].lower() == 'zi': + add_pdb = True + break + + if add_pdb: + node = task.outputs[0].change_ext('.pdb') + pdb_flag = '/Fd:' + node.abspath() + + for flagname in ('CFLAGS', 'CXXFLAGS', 'FCFLAGS'): + buf = [pdb_flag] + for flag in task.env[flagname]: + if flag[1:3] == 'Fd' or flag[1:].lower() == 'fs' or flag[1:].lower() == 'mp': + continue + buf.append(flag) + task.env[flagname] = buf + + if link_task and not node in link_task.dep_nodes: + link_task.dep_nodes.append(node) + if not node in task.outputs: + task.outputs.append(node) diff --git a/scripts/waifulib/sdl2.py b/scripts/waifulib/sdl2.py index abb4427570..4155f2b2df 100644 --- a/scripts/waifulib/sdl2.py +++ b/scripts/waifulib/sdl2.py @@ -42,7 +42,7 @@ def sdl2_configure_path(conf, path): ] libpath = 'lib' if conf.env.COMPILER_CC == 'msvc': - if conf.env.DEST_CPU == 'x86_64': + if conf.env.DEST_CPU in ['x86_64', 'amd64']: libpath = 'lib/x64' else: libpath = 'lib/' + conf.env.DEST_CPU diff --git a/serverbrowser/BlacklistedServers.cpp b/serverbrowser/BlacklistedServers.cpp index c310f39127..21357418a9 100644 --- a/serverbrowser/BlacklistedServers.cpp +++ b/serverbrowser/BlacklistedServers.cpp @@ -67,9 +67,9 @@ int __cdecl BlacklistedAtCompare(ListPanel *pPanel, const ListPanelItem &p1, con if ( !pSvr1 && !pSvr2 ) return 0; - if ( pSvr1->m_ulTimeBlacklistedAt > pSvr2->m_ulTimeBlacklistedAt ) + if ( pSvr1->m_ullTimeBlacklistedAt > pSvr2->m_ullTimeBlacklistedAt ) return -1; - if ( pSvr1->m_ulTimeBlacklistedAt < pSvr2->m_ulTimeBlacklistedAt ) + if ( pSvr1->m_ullTimeBlacklistedAt < pSvr2->m_ullTimeBlacklistedAt ) return 1; return 0; @@ -148,19 +148,19 @@ bool CBlacklistedServers::AddServersFromFile( const char *pszFilename, bool bRes { const char *pszName = pData->GetString( "name" ); - uint32 ulDate = pData->GetInt( "date" ); + uint64 ullDate = pData->GetUint64( "date" ); if ( bResetTimes ) { time_t today; time( &today ); - ulDate = today; + ullDate = (uint64)today; } const char *pszNetAddr = pData->GetString( "addr" ); if ( pszNetAddr && pszNetAddr[0] && pszName && pszName[0] ) { - blacklisted_server_t *blackServer = m_blackList.AddServer( pszName, pszNetAddr, ulDate ); + blacklisted_server_t *blackServer = m_blackList.AddServer( pszName, pszNetAddr, ullDate ); UpdateBlacklistUI( blackServer ); } @@ -256,7 +256,7 @@ void CBlacklistedServers::UpdateBlacklistUI( blacklisted_server_t *blackServer ) // construct a time string for blacklisted time struct tm *now; - now = localtime( (time_t*)&blackServer->m_ulTimeBlacklistedAt ); + now = localtime( (time_t*)&blackServer->m_ullTimeBlacklistedAt ); if ( now ) { char buf[64]; diff --git a/serverbrowser/BlacklistedServers.h b/serverbrowser/BlacklistedServers.h index ce8b9b50ef..1772be2e28 100644 --- a/serverbrowser/BlacklistedServers.h +++ b/serverbrowser/BlacklistedServers.h @@ -12,6 +12,7 @@ #endif #include "ServerBrowser/blacklisted_server_manager.h" +#include //----------------------------------------------------------------------------- // Purpose: Blacklisted servers list @@ -61,7 +62,7 @@ private: vgui::DHANDLE< vgui::FileOpenDialog > m_hImportDialog; CBlacklistedServerManager m_blackList; - long m_blackListTimestamp; + time_t m_blackListTimestamp; }; diff --git a/serverbrowser/ServerBrowser.vpc b/serverbrowser/ServerBrowser.vpc index 548a3b7fe0..6bfedde491 100644 --- a/serverbrowser/ServerBrowser.vpc +++ b/serverbrowser/ServerBrowser.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/serverbrowser/wscript b/serverbrowser/wscript index 1dc3cb8f87..755ae062e2 100755 --- a/serverbrowser/wscript +++ b/serverbrowser/wscript @@ -16,7 +16,7 @@ def configure(conf): conf.define('VERSION_SAFE_STEAM_API_INTERFACES',1) conf.define('SERVERBROWSER_EXPORTS',1) conf.define('GAME_SRC',1) - conf.define('_USE_32BIT_TIME_T',1) +# conf.define('_USE_32BIT_TIME_T',1) def build(bld): source = [ @@ -40,7 +40,8 @@ def build(bld): 'VACBannedConnRefusedDialog.cpp', 'QuickListPanel.cpp', '../public/vgui_controls/vgui_controls.cpp', - '../common/ServerBrowser/blacklisted_server_manager.cpp' + '../common/ServerBrowser/blacklisted_server_manager.cpp', + '../public/tier0/memoverride.cpp' ] includes = [ diff --git a/soundemittersystem/soundemittersystem.vpc b/soundemittersystem/soundemittersystem.vpc index f8ca82fe99..62ad4ae677 100644 --- a/soundemittersystem/soundemittersystem.vpc +++ b/soundemittersystem/soundemittersystem.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/soundemittersystem/soundemittersystembase.cpp b/soundemittersystem/soundemittersystembase.cpp index 41d01e3894..ae7eb5efd2 100644 --- a/soundemittersystem/soundemittersystembase.cpp +++ b/soundemittersystem/soundemittersystembase.cpp @@ -18,6 +18,8 @@ #include "SoundEmitterSystem/isoundemittersystembase.h" #include "ifilelist.h" +#include + // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" @@ -167,7 +169,7 @@ static void AccumulateFileNameAndTimestampIntoChecksum( CRC32_t *crc, char const return; } - long ft = filesystem->GetFileTime( filename, "GAME" ); + time_t ft = filesystem->GetFileTime( filename, "GAME" ); CRC32_ProcessBuffer( crc, &ft, sizeof( ft ) ); CRC32_ProcessBuffer( crc, filename, Q_strlen( filename ) ); } diff --git a/soundemittersystem/wscript b/soundemittersystem/wscript index 3da4b83ad5..03f796f577 100755 --- a/soundemittersystem/wscript +++ b/soundemittersystem/wscript @@ -21,7 +21,8 @@ def build(bld): source = [ '../game/shared/interval.cpp', 'soundemittersystembase.cpp', - '../public/SoundParametersInternal.cpp' + '../public/SoundParametersInternal.cpp', + '../public/tier0/memoverride.cpp' ] includes = [ diff --git a/soundsystem/soundsystem.cpp b/soundsystem/soundsystem.cpp index d48893a6c2..e69ae50423 100644 --- a/soundsystem/soundsystem.cpp +++ b/soundsystem/soundsystem.cpp @@ -17,6 +17,7 @@ #include "snd_dev_wave.h" #include "tier2/tier2.h" +#include //----------------------------------------------------------------------------- // External interfaces @@ -65,7 +66,7 @@ private: { char filename[ 512 ]; CAudioSource *source; - long filetime; + time_t filetime; }; IAudioDevice *m_pAudioDevice; @@ -168,7 +169,7 @@ CAudioSource *CSoundSystem::FindOrAddSound( const char *filename ) Assert( s ); if ( !stricmp( s->filename, filename ) ) { - long filetime = g_pFullFileSystem->GetFileTime( filename ); + time_t filetime = g_pFullFileSystem->GetFileTime( filename ); if ( filetime != s->filetime ) { Msg( "Reloading sound %s\n", filename ); diff --git a/soundsystem/soundsystem.vpc b/soundsystem/soundsystem.vpc index 2653ca5a67..d502d87aa9 100644 --- a/soundsystem/soundsystem.vpc +++ b/soundsystem/soundsystem.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/studiorender/r_studiodraw.cpp b/studiorender/r_studiodraw.cpp index 19748fd805..da6905fd0e 100644 --- a/studiorender/r_studiodraw.cpp +++ b/studiorender/r_studiodraw.cpp @@ -657,7 +657,7 @@ static matrix3x4_t *ComputeSkinMatrix( mstudioboneweight_t &boneweights, matrix3 static matrix3x4_t *ComputeSkinMatrixSSE( mstudioboneweight_t &boneweights, matrix3x4_t *pPoseToWorld, matrix3x4_t &result ) { // NOTE: pPoseToWorld, being cache aligned, doesn't need explicit initialization -#if defined( _WIN32 ) && !defined( _X360 ) +#if defined( _WIN32 ) && !defined( _X360 ) && !defined( PLATFORM_64BITS ) switch( boneweights.numbones ) { default: @@ -866,8 +866,8 @@ static matrix3x4_t *ComputeSkinMatrixSSE( mstudioboneweight_t &boneweights, matr return &result; #endif } -#elif POSIX -#warning "ComputeSkinMatrixSSE C implementation only" +#elif POSIX || PLATFORM_WINDOWS_PC64 +// #warning "ComputeSkinMatrixSSE C implementation only" return ComputeSkinMatrix( boneweights, pPoseToWorld, result ); #elif defined( _X360 ) return ComputeSkinMatrix( boneweights, pPoseToWorld, result ); diff --git a/studiorender/studiorender.vpc b/studiorender/studiorender.vpc index 4876d438c6..84fc6076cf 100644 --- a/studiorender/studiorender.vpc +++ b/studiorender/studiorender.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/studiorender/wscript b/studiorender/wscript index 2e6d7b5cfa..bf0b9fe36d 100755 --- a/studiorender/wscript +++ b/studiorender/wscript @@ -29,7 +29,8 @@ def build(bld): 'r_studioflex.cpp', 'r_studiogettriangles.cpp', 'r_studiolight.cpp', - 'r_studiostats.cpp' + 'r_studiostats.cpp', + '../public/tier0/memoverride.cpp' ] includes = [ diff --git a/thirdparty b/thirdparty index c397ca0520..92bf82cc3a 160000 --- a/thirdparty +++ b/thirdparty @@ -1 +1 @@ -Subproject commit c397ca0520de10f8bf9c85fadc9fcc3055c60b0f +Subproject commit 92bf82cc3adf1bde633dfc75f272f1da942a7ea3 diff --git a/tier0/assert_dialog.rc b/tier0/assert_dialog.rc index 19b79829e4..35efc38329 100644 --- a/tier0/assert_dialog.rc +++ b/tier0/assert_dialog.rc @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "Windows.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -121,4 +121,6 @@ END // ETW event manifest data from ValveETWProviders.man // +#if 0 #include "ValveETWProviderEvents.rc" +#endif \ No newline at end of file diff --git a/tier0/dbg.cpp b/tier0/dbg.cpp index b7a3938355..83205eefd1 100644 --- a/tier0/dbg.cpp +++ b/tier0/dbg.cpp @@ -14,6 +14,7 @@ #define WIN_32_LEAN_AND_MEAN #include // Currently needed for IsBadReadPtr and IsBadWritePtr #pragma comment(lib,"user32.lib") // For MessageBox +#include #endif #include @@ -379,7 +380,7 @@ static SpewRetval_t _SpewMessage( SpewType_t spewType, const char *pGroupName, i /* direct it to the appropriate target(s) */ SpewRetval_t ret; - assert( g_pSpewInfo == NULL ); + assert( g_pSpewInfo == (void*)NULL ); SpewInfo_t spewInfo = { pColor, diff --git a/tier0/memdbg.cpp b/tier0/memdbg.cpp index e5304869f1..3461c6e8ef 100644 --- a/tier0/memdbg.cpp +++ b/tier0/memdbg.cpp @@ -887,7 +887,7 @@ void *CDbgMemAlloc::Expand_NoLongerSupported( void *pMem, size_t nSize ) //----------------------------------------------------------------------------- void CDbgMemAlloc::PushAllocDbgInfo( const char *pFileName, int nLine ) { - if ( g_DbgInfoStack == NULL ) + if ( g_DbgInfoStack == (int)NULL ) { g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH ); g_nDbgInfoStackDepth = -1; @@ -901,7 +901,7 @@ void CDbgMemAlloc::PushAllocDbgInfo( const char *pFileName, int nLine ) void CDbgMemAlloc::PopAllocDbgInfo() { - if ( g_DbgInfoStack == NULL ) + if ( g_DbgInfoStack == (int)NULL ) { g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH ); g_nDbgInfoStackDepth = -1; @@ -922,7 +922,7 @@ uint32 CDbgMemAlloc::GetDebugInfoSize() void CDbgMemAlloc::SaveDebugInfo( void *pvDebugInfo ) { - if ( g_DbgInfoStack == NULL ) + if ( g_DbgInfoStack == (int)NULL ) { g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH ); g_nDbgInfoStackDepth = -1; @@ -935,7 +935,7 @@ void CDbgMemAlloc::SaveDebugInfo( void *pvDebugInfo ) void CDbgMemAlloc::RestoreDebugInfo( const void *pvDebugInfo ) { - if ( g_DbgInfoStack == NULL ) + if ( g_DbgInfoStack == (int)NULL ) { g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH ); g_nDbgInfoStackDepth = -1; @@ -976,7 +976,7 @@ void CDbgMemAlloc::GetActualDbgInfo( const char *&pFileName, int &nLine ) return; #endif - if ( g_DbgInfoStack == NULL ) + if ( g_DbgInfoStack == (int)NULL ) { g_DbgInfoStack = (DbgInfoStack_t *)DebugAlloc( sizeof(DbgInfoStack_t) * DBG_INFO_STACK_DEPTH ); g_nDbgInfoStackDepth = -1; diff --git a/tier0/memstd.cpp b/tier0/memstd.cpp index 36d9fb1314..76d1fc8723 100644 --- a/tier0/memstd.cpp +++ b/tier0/memstd.cpp @@ -313,8 +313,8 @@ public: virtual void InitDebugInfo( void *pvDebugInfo, const char *pchRootFileName, int nLine ) {} virtual void GetActualDbgInfo( const char *&pFileName, int &nLine ) {} - virtual void RegisterAllocation( const char *pFileName, int nLine, int nLogicalSize, int nActualSize, unsigned nTime ) {} - virtual void RegisterDeallocation( const char *pFileName, int nLine, int nLogicalSize, int nActualSize, unsigned nTime ) {} + virtual void RegisterAllocation( const char *pFileName, int nLine, size_t nLogicalSize, size_t nActualSize, unsigned nTime ) {} + virtual void RegisterDeallocation( const char *pFileName, int nLine, size_t nLogicalSize, size_t nActualSize, unsigned nTime ) {} virtual int GetVersion() { return MEMALLOC_VERSION; } @@ -666,7 +666,7 @@ int CSmallBlockPool::CountFreeBlocks() // Size of committed memory managed by this heap: int CSmallBlockPool::GetCommittedSize() { - unsigned totalSize = (unsigned)m_pCommitLimit - (unsigned)m_pBase; + unsigned totalSize = (uintp)m_pCommitLimit - (uintp)m_pBase; Assert( 0 != m_nBlockSize ); return totalSize; diff --git a/tier0/threadtools.cpp b/tier0/threadtools.cpp index 01217e4927..ff4ab5a8a4 100644 --- a/tier0/threadtools.cpp +++ b/tier0/threadtools.cpp @@ -14,10 +14,9 @@ #ifdef _WIN32 #include - #ifdef _WIN32 - #include - #pragma comment(lib, "winmm.lib") - #endif + #include + #pragma comment(lib, "winmm.lib") + #include "tier0/vcrmode.h" #elif POSIX #include #include @@ -775,7 +774,18 @@ void ThreadSetDebugName( ThreadHandle_t hThread, const char *pszName ) #endif } +//----------------------------------------------------------------------------- +#ifdef _WIN32 +ASSERT_INVARIANT( TW_FAILED == WAIT_FAILED ); +ASSERT_INVARIANT( TW_TIMEOUT == WAIT_TIMEOUT ); +ASSERT_INVARIANT( WAIT_OBJECT_0 == 0 ); + +int ThreadWaitForObjects( int nEvents, const HANDLE *pHandles, bool bWaitAll, unsigned timeout ) +{ + return VCRHook_WaitForMultipleObjects( nEvents, pHandles, bWaitAll, timeout ); +} +#endif //----------------------------------------------------------------------------- // Used to thread LoadLibrary on the 360 diff --git a/tier0/tier0.vpc b/tier0/tier0.vpc index 0d7b1f5e24..f924bcddd5 100644 --- a/tier0/tier0.vpc +++ b/tier0/tier0.vpc @@ -7,7 +7,7 @@ $MacroRequired "PLATSUBDIR" $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" @@ -55,8 +55,8 @@ $Configuration $PreLinkEvent [$WINDOWS] { - $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $LIBPUBLIC\$(TargetName).lib $SRCDIR" "\n" \ - "$BASE" + //$CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $LIBPUBLIC\$(TargetName).lib $SRCDIR" "\n" \ + // "$BASE" } $PreLinkEvent [$X360] diff --git a/tier0/wscript b/tier0/wscript index 0e9faed4d6..1f0a9f347e 100755 --- a/tier0/wscript +++ b/tier0/wscript @@ -18,15 +18,12 @@ def configure(conf): def build(bld): source = [ 'assert_dialog.cpp', - #'assert_dialog.rc', [$WINDOWS] 'commandline.cpp', 'cpu.cpp', 'cpumonitoring.cpp', - 'cpu_posix.cpp', #[$POSIX] 'cpu_usage.cpp', 'dbg.cpp', 'dynfunction.cpp', - #'etwprof.cpp', [$WINDOWS] 'fasttimer.cpp', # 'InterlockedCompareExchange128.masm', [$WIN64] 'mem.cpp', @@ -36,11 +33,7 @@ def build(bld): 'memvalidate.cpp', 'minidump.cpp', 'pch_tier0.cpp', - #'platform.cpp', [$WINDOWS||$X360] - 'platform_posix.cpp', # [$POSIX] #'pmc360.cpp', [$X360] - #'pme.cpp', [$WINDOWS] - 'pme_posix.cpp', # [$POSIX] 'PMELib.cpp', #[$WINDOWS||$POSIX] 'progressbar.cpp', 'security.cpp', @@ -50,12 +43,30 @@ def build(bld): 'threadtools.cpp', 'tier0_strtools.cpp', 'tslist.cpp', - #'vcrmode.cpp', #[$WINDOWS] - 'vcrmode_posix.cpp', #[$POSIX] 'vprof.cpp', - # 'win32consoleio.cpp', [$WINDOWS] #'../tier1/pathmatch.cpp' # [$LINUXALL] ] + + if bld.env.DEST_OS == 'win32': + source += [ + 'assert_dialog.rc', + #'etwprof.cpp', [$WINDOWS] + 'platform.cpp', + 'pme.cpp', + 'vcrmode.cpp', + 'win32consoleio.cpp' + ] + if bld.env.DEST_CPU == 'amd64': + source += [ + 'InterlockedCompareExchange128.masm' + ] + else: + source += [ + 'cpu_posix.cpp', + 'platform_posix.cpp', + 'pme_posix.cpp', + 'vcrmode_posix.cpp' + ] includes = [ '.', @@ -65,7 +76,10 @@ def build(bld): defines = [] - libs = ['DL', 'M', 'LOG'] + if bld.env.DEST_OS == 'win32': + libs = ['ADVAPI32', 'WS2_32'] + else: + libs = ['DL', 'M', 'LOG'] install_path = bld.env.LIBDIR diff --git a/tier1/bitbuf.cpp b/tier1/bitbuf.cpp index 274f8e3260..26d4d5759e 100644 --- a/tier1/bitbuf.cpp +++ b/tier1/bitbuf.cpp @@ -43,14 +43,14 @@ inline unsigned int CountTrailingZeros( unsigned int elem ) inline unsigned int CountLeadingZeros(unsigned int x) { uint32 firstBit; - if ( _BitScanReverse(&firstBit,x) ) + if ( _BitScanReverse((unsigned long*)&firstBit,x) ) return 31 - firstBit; return 32; } inline unsigned int CountTrailingZeros(unsigned int elem) { uint32 out; - if ( _BitScanForward(&out, elem) ) + if ( _BitScanForward((unsigned long*)&out, elem) ) return out; return 32; } diff --git a/tier1/interface.cpp b/tier1/interface.cpp index 82c8d9cd10..a4507fd476 100644 --- a/tier1/interface.cpp +++ b/tier1/interface.cpp @@ -182,7 +182,7 @@ static HMODULE InternalLoadLibrary( const char *pName, Sys_Flags flags ) return LoadLibraryEx( pName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ); #endif } -unsigned ThreadedLoadLibraryFunc( void *pParam ) +uintp ThreadedLoadLibraryFunc( void *pParam ) { ThreadedLoadLibaryContext_t *pContext = (ThreadedLoadLibaryContext_t*)pParam; pContext->m_hLibrary = InternalLoadLibrary( pContext->m_pLibraryName, SYS_NOFLAGS ); @@ -229,7 +229,7 @@ HMODULE Sys_LoadLibrary( const char *pLibraryName, Sys_Flags flags ) context.m_pLibraryName = str; context.m_hLibrary = 0; - ThreadHandle_t h = CreateSimpleThread( ThreadedLoadLibraryFunc, &context ); + ThreadHandle_t h = CreateSimpleThread( (ThreadFunc_t)ThreadedLoadLibraryFunc, &context ); #ifdef _X360 ThreadSetAffinity( h, XBOX_PROCESSOR_3 ); @@ -238,7 +238,7 @@ HMODULE Sys_LoadLibrary( const char *pLibraryName, Sys_Flags flags ) unsigned int nTimeout = 0; while( ThreadWaitForObject( h, true, nTimeout ) == TW_TIMEOUT ) { - nTimeout = threadFunc(); + nTimeout = threadFunc(0); } ReleaseThreadHandle( h ); @@ -278,7 +278,9 @@ CSysModule *Sys_LoadModule( const char *pModuleName, Sys_Flags flags /* = SYS_NO // file in the depot (MFP) or a filesystem GetLocalCopy() call must be made // prior to the call to this routine. char szCwd[1024]; +#ifdef POSIX char szModuleName[1024]; +#endif HMODULE hDLL = NULL; if ( !Q_IsAbsolutePath( pModuleName ) ) @@ -300,8 +302,6 @@ CSysModule *Sys_LoadModule( const char *pModuleName, Sys_Flags flags /* = SYS_NO } char szAbsoluteModuleName[1024]; - size_t cCwd = strlen( szCwd ); - bool bUseLibPrefix = false; #ifdef ANDROID diff --git a/tier1/processor_detect.cpp b/tier1/processor_detect.cpp index 0aabeb7a17..54542d0223 100644 --- a/tier1/processor_detect.cpp +++ b/tier1/processor_detect.cpp @@ -13,6 +13,13 @@ bool CheckSSETechnology(void) { return false; } bool CheckSSE2Technology(void) { return false; } bool Check3DNowTechnology(void) { return false; } +#elif defined( _WIN32 ) && defined( PLATFORM_64BITS ) + +bool CheckMMXTechnology(void) { return true; } +bool CheckSSETechnology(void) { return true; } +bool CheckSSE2Technology(void) { return true; } +bool Check3DNowTechnology(void) { return false; } + #elif defined( _WIN32 ) && !defined( _X360 ) #pragma optimize( "", off ) diff --git a/tier1/strtools_unicode.cpp b/tier1/strtools_unicode.cpp index 77685ec307..cb74856647 100644 --- a/tier1/strtools_unicode.cpp +++ b/tier1/strtools_unicode.cpp @@ -11,7 +11,7 @@ #include "tier1/strtools.h" // This code was copied from steam -#define DbgAssert Assert +// #define DbgAssert Assert //----------------------------------------------------------------------------- // Purpose: determine if a uchar32 represents a valid Unicode code point diff --git a/tier1/wscript b/tier1/wscript index 903fb5da17..66c29ae484 100755 --- a/tier1/wscript +++ b/tier1/wscript @@ -15,7 +15,6 @@ def configure(conf): conf.env.append_unique('DEFINES', ['TIER1_STATIC_LIB=1']) def build(bld): - print(bld) source = [ '../utils/lzma/C/LzmaDec.c', 'bitbuf.cpp', @@ -40,10 +39,6 @@ def build(bld): 'memstack.cpp', 'NetAdr.cpp', 'newbitbuf.cpp', -# 'pathmatch.cpp', # [$LINUXALL] - # 'processor_detect.cpp', # [$WINDOWS||$X360] - 'processor_detect_linux.cpp', # [$POSIX] - 'qsort_s.cpp', # [$LINUXALL||$PS3] 'rangecheckedvar.cpp', 'reliabletimer.cpp', 'snappy-sinksource.cpp', @@ -64,6 +59,17 @@ def build(bld): 'utlsymbol.cpp' ] + if bld.env.DEST_OS == 'win32': + source += [ + 'processor_detect.cpp', + ] + else: + source += [ + #'pathmatch.cpp', + 'processor_detect_linux.cpp', + 'qsort_s.cpp', + ] + includes = [ '.', '../', @@ -76,7 +82,9 @@ def build(bld): defines = [] libs = [] - + if bld.env.DEST_OS == 'win32': + libs += ['RPCRT4'] + bld.stlib( source = source, target = PROJECT_NAME, diff --git a/togl/togl.vpc b/togl/togl.vpc index dadbcd7292..9be21dd7db 100644 --- a/togl/togl.vpc +++ b/togl/togl.vpc @@ -6,7 +6,7 @@ $Macro SRCDIR ".." [$WIN32] $Macro SRCDIR ".." [!$WIN32] -$Macro OUTBINDIR $LIBPUBLIC +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Macro OUTBINNAME "togl" $Macro TOGL_SRCDIR "$SRCDIR/togl/linuxwin" $Macro TOGL_INCDIR "$SRCDIR/public/togl/linuxwin" diff --git a/togles/togl.vpc b/togles/togl.vpc index dadbcd7292..9be21dd7db 100644 --- a/togles/togl.vpc +++ b/togles/togl.vpc @@ -6,7 +6,7 @@ $Macro SRCDIR ".." [$WIN32] $Macro SRCDIR ".." [!$WIN32] -$Macro OUTBINDIR $LIBPUBLIC +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Macro OUTBINNAME "togl" $Macro TOGL_SRCDIR "$SRCDIR/togl/linuxwin" $Macro TOGL_INCDIR "$SRCDIR/public/togl/linuxwin" diff --git a/unicode/unicode.vpc b/unicode/unicode.vpc index 5b0f3e207a..9c90cf0fbe 100644 --- a/unicode/unicode.vpc +++ b/unicode/unicode.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/unicode/wscript b/unicode/wscript new file mode 100644 index 0000000000..bcc4122c5f --- /dev/null +++ b/unicode/wscript @@ -0,0 +1,51 @@ +#! /usr/bin/env python +# encoding: utf-8 + +from waflib import Utils +import os + +top = '.' +PROJECT_NAME = 'unicode' + +def options(opt): + # stub + return + +def configure(conf): + conf.define('UNICODE_EXPORTS', 1) + +def build(bld): + if bld.env.DEST_OS != 'win32': + return + + source = [ + 'unicode.cpp', + '../public/tier0/memoverride.cpp' + ] + + includes = [ + '.', + '../public', + '../public/tier0', + '../public/tier1' + ] + + defines = [] + + libs = ['tier0','tier1','tier2','vstdlib','mathlib', 'USER32'] + + install_path = bld.env.LIBDIR + + bld.shlib( + source = source, + target = PROJECT_NAME, + name = PROJECT_NAME, + features = 'c cxx', + includes = includes, + defines = defines, + use = libs, + install_path = install_path, + subsystem = bld.env.MSVC_SUBSYSTEM, + idx = bld.get_taskgen_count() + ) + diff --git a/utils/bsppack/bsppack.vpc b/utils/bsppack/bsppack.vpc index ca35d9cec0..602757e847 100644 --- a/utils/bsppack/bsppack.vpc +++ b/utils/bsppack/bsppack.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR "..\.." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/utils/bzip2/wscript b/utils/bzip2/wscript index 92b9c0a8ce..70f1190942 100755 --- a/utils/bzip2/wscript +++ b/utils/bzip2/wscript @@ -12,8 +12,8 @@ def options(opt): return def configure(conf): - conf.env.append_unique('CFLAGS',['-std=gnu11']) - + if conf.env.DEST_OS != 'win32': + conf.env.append_unique('CFLAGS',['-std=gnu11']) def build(bld): source = [ @@ -39,8 +39,6 @@ def build(bld): libs = [] - install_path = bld.env.PREFIX - bld.stlib( source = source, target = PROJECT_NAME, @@ -49,7 +47,6 @@ def build(bld): includes = includes, defines = defines, use = libs, - install_path = install_path, subsystem = bld.env.MSVC_SUBSYSTEM, idx = bld.get_taskgen_count() ) diff --git a/vgui2/src/Surface.cpp b/vgui2/src/Surface.cpp index 51ad51861f..81dc950308 100644 --- a/vgui2/src/Surface.cpp +++ b/vgui2/src/Surface.cpp @@ -2493,7 +2493,7 @@ void CWin32Surface::CreatePopup(VPANEL panel, bool minimised, bool showTaskbarIc plat->textureDC = NULL; ::SetBkMode(plat->hdc, TRANSPARENT); - ::SetWindowLong(plat->hwnd, GWL_USERDATA, (LONG)g_pIVgui->PanelToHandle(panel)); + ::SetWindowLongPtr(plat->hwnd, GWLP_USERDATA, (LONG_PTR)g_pIVgui->PanelToHandle(panel)); ::SetTextAlign(plat->hdc, TA_LEFT | TA_TOP | TA_UPDATECP); if (!((VPanel *)panel)->IsVisible() || panel == _embeddedPanel) @@ -2514,7 +2514,7 @@ void CWin32Surface::CreatePopup(VPANEL panel, bool minimised, bool showTaskbarIc else { // somehow getting added twice, fundamental problem - _asm int 3; + Assert(0); } // hack, force a windows sound to be played @@ -2571,7 +2571,7 @@ void CWin32Surface::ReleasePanel(VPANEL panel) SetPanelVisible(panel, false); // free all the windows/bitmap/DC handles we are using - ::SetWindowLong(plat->hwnd, GWL_USERDATA, (LONG)-1); + ::SetWindowLongPtr(plat->hwnd, GWLP_USERDATA, (LONG_PTR)-1); ::SetWindowPos(plat->hwnd, HWND_BOTTOM, 0, 0, 1, 1, SWP_NOREDRAW|SWP_HIDEWINDOW); // free the window context @@ -3721,7 +3721,7 @@ static LRESULT CALLBACK staticProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lpara if (staticSurfaceAvailable) { - panel = g_pIVgui->HandleToPanel(::GetWindowLong(hwnd, GWL_USERDATA)); + panel = g_pIVgui->HandleToPanel((LONG)::GetWindowLongPtr(hwnd, GWLP_USERDATA)); if (panel) { diff --git a/vgui2/src/vgui_dll.vpc b/vgui2/src/vgui_dll.vpc index 2de1268b2b..e92dea6d9d 100644 --- a/vgui2/src/vgui_dll.vpc +++ b/vgui2/src/vgui_dll.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR "..\.." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Macro OUTBINNAME "vgui2" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/vgui2/src/wscript b/vgui2/src/wscript index f4e5547cd8..0d7f67a766 100644 --- a/vgui2/src/wscript +++ b/vgui2/src/wscript @@ -28,18 +28,26 @@ def build(bld): 'MemoryBitmap.cpp', 'MessageListener.cpp', 'Scheme.cpp', - #'Surface.cpp', [$WIN32] - #'System.cpp', [$WINDOWS||$X360] - 'system_posix.cpp',# [$POSIX] '../../public/UnicodeFileHelpers.cpp', 'vgui.cpp', 'vgui_internal.cpp', 'vgui_key_translation.cpp', 'VPanel.cpp', 'VPanelWrapper.cpp', - 'keyrepeat.cpp' + 'keyrepeat.cpp', + '../../public/tier0/memoverride.cpp' ] + if bld.env.DEST_OS == 'win32': + source += [ + 'Surface.cpp', + 'System.cpp' + ] + else: + source += [ + 'system_posix.cpp' + ] + includes = [ '.', '../../public', @@ -52,6 +60,9 @@ def build(bld): libs = ['tier0','tier1','tier2','tier3','vstdlib','SDL2'] + if bld.env.DEST_OS == 'win32': + libs += ['USER32', 'IMM32', 'GDI32', 'SHELL32', 'OLE32', 'SHLWAPI', 'vgui_surfacelib', 'WINMM'] + install_path = bld.env.LIBDIR bld.shlib( diff --git a/vgui2/vgui_controls/FileOpenDialog.cpp b/vgui2/vgui_controls/FileOpenDialog.cpp index ebe5eb0c3e..d4a098fcb1 100644 --- a/vgui2/vgui_controls/FileOpenDialog.cpp +++ b/vgui2/vgui_controls/FileOpenDialog.cpp @@ -53,6 +53,8 @@ #undef GetCurrentDirectory #endif +#include + // memdbgon must be the last include file in a .cpp file!!! #include @@ -1238,7 +1240,7 @@ void FileOpenDialog::PopulateFileList() kv->SetString( "attributes", g_pFullFileSystem->IsFileWritable( pFullPath )? "" : "R" ); - long fileModified = g_pFullFileSystem->GetFileTime( pFullPath ); + time_t fileModified = g_pFullFileSystem->GetFileTime( pFullPath ); g_pFullFileSystem->FileTimeToString( pszFileModified, sizeof( pszFileModified ), fileModified ); kv->SetString( "modified", pszFileModified ); @@ -1277,7 +1279,7 @@ void FileOpenDialog::PopulateFileList() kv->SetString( "attributes", g_pFullFileSystem->IsFileWritable( pFullPath )? "" : "R" ); - long fileModified = g_pFullFileSystem->GetFileTime( pFullPath ); + time_t fileModified = g_pFullFileSystem->GetFileTime( pFullPath ); g_pFullFileSystem->FileTimeToString( pszFileModified, sizeof( pszFileModified ), fileModified ); kv->SetString( "modified", pszFileModified ); diff --git a/vgui2/vgui_controls/wscript b/vgui2/vgui_controls/wscript index 4962d3648b..68644dc067 100644 --- a/vgui2/vgui_controls/wscript +++ b/vgui2/vgui_controls/wscript @@ -106,6 +106,9 @@ def build(bld): libs = [] + if bld.env.DEST_OS == 'win32': + libs += ['SHELL32'] + bld.stlib( source = source, target = PROJECT_NAME, diff --git a/vgui2/vgui_surfacelib/wscript b/vgui2/vgui_surfacelib/wscript index 0de65a46ba..d93032bf9c 100644 --- a/vgui2/vgui_surfacelib/wscript +++ b/vgui2/vgui_surfacelib/wscript @@ -20,11 +20,18 @@ def build(bld): 'FontAmalgam.cpp', 'FontManager.cpp', 'FontEffects.cpp', - #'Win32Font.cpp', [$WIN32 && !$X360] #'Win32Font_x360.cpp', [$X360] #'osxfont.cpp', [$OSXALL] - 'linuxfont.cpp' # [$LINUXALL] ] + + if bld.env.DEST_OS == 'win32': + source += [ + 'Win32Font.cpp' + ] + else: + source += [ + 'linuxfont.cpp' + ] includes = [ '.', diff --git a/vguimatsurface/asanstubs.cpp b/vguimatsurface/asanstubs.cpp index 3705250729..63f7dc4fdf 100644 --- a/vguimatsurface/asanstubs.cpp +++ b/vguimatsurface/asanstubs.cpp @@ -70,10 +70,12 @@ void VPanel::SetEnabled(bool state) bool VPanel::IsVisible() { + return false; } bool VPanel::IsEnabled() { + return false; } void VPanel::GetAbsPos(int &x, int &y) @@ -110,8 +112,10 @@ VPanel *VPanel::GetChild(int index) return NULL; } +CUtlVector< VPanel *> panels; CUtlVector< VPanel *> &VPanel::GetChildren() { + return panels; // return NULL; } @@ -153,6 +157,7 @@ void VPanel::SetPlat(SurfacePlat *Plat) bool VPanel::IsPopup() { + return false; } void VPanel::SetPopup(bool state) diff --git a/vguimatsurface/vguimatsurface.vpc b/vguimatsurface/vguimatsurface.vpc index 9e05948854..2743739fce 100644 --- a/vguimatsurface/vguimatsurface.vpc +++ b/vguimatsurface/vguimatsurface.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/vguimatsurface/wscript b/vguimatsurface/wscript index 7359a3ab37..a76de0b29b 100644 --- a/vguimatsurface/wscript +++ b/vguimatsurface/wscript @@ -27,12 +27,17 @@ def build(bld): 'Input.cpp', 'MatSystemSurface.cpp', 'asanstubs.cpp', - #'memorybitmap.cpp', [$WIN32] 'TextureDictionary.cpp', '../vgui2/src/vgui_key_translation.cpp', - '../public/vgui_controls/vgui_controls.cpp' + '../public/vgui_controls/vgui_controls.cpp', + '../public/tier0/memoverride.cpp' ] + if bld.env.DEST_OS == 'win32': + source += [ + 'memorybitmap.cpp' + ] + includes = [ '.', '../public', @@ -47,6 +52,8 @@ def build(bld): if bld.env.DEST_OS == 'android': libs += ['EXPAT'] + elif bld.env.DEST_OS == 'win32': + libs += ['USER32', 'GDI32'] install_path = bld.env.LIBDIR diff --git a/video/video_quicktime.vpc b/video/video_quicktime.vpc index 80f4cdb412..c9f6cd9b4d 100644 --- a/video/video_quicktime.vpc +++ b/video/video_quicktime.vpc @@ -9,7 +9,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/video/video_services.vpc b/video/video_services.vpc index b9ccbcb8fc..fcc0eade5f 100644 --- a/video/video_services.vpc +++ b/video/video_services.vpc @@ -11,7 +11,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/video/video_webm.vpc b/video/video_webm.vpc index b1f326a8df..379dd97f07 100644 --- a/video/video_webm.vpc +++ b/video/video_webm.vpc @@ -8,7 +8,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/video/wscript b/video/wscript index 30d7a5605c..e6b1beea2a 100755 --- a/video/wscript +++ b/video/wscript @@ -16,7 +16,8 @@ def configure(conf): def build(bld): source = [ - 'videoservices.cpp' + 'videoservices.cpp', + '../public/tier0/memoverride.cpp' ] includes = [ @@ -31,6 +32,9 @@ def build(bld): libs = ['tier0','tier1','tier2','tier3','vstdlib'] + if bld.env.DEST_OS == 'win32': + libs += ['USER32'] + install_path = bld.env.LIBDIR bld.shlib( diff --git a/vpc_scripts/fbx.vpc b/vpc_scripts/fbx.vpc new file mode 100644 index 0000000000..88bd9eaa6c --- /dev/null +++ b/vpc_scripts/fbx.vpc @@ -0,0 +1,38 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ========== +// +// In addition to fbx_base.vpc which defines the version, include path and +// defines for compiling code that utilizes Autodesk FBX SDK, add the lib +// for linking. +// +//============================================================================= + +$MacroRequired SRCDIR + +$Include "$SRCDIR\vpc_scripts\fbx_base.vpc" + +$Macro VSDIR "vs2010" [$VS2010] +$Macro VSDIR "vs2012" [$VS2012] +$Macro VSDIR "vs2012" [$VS2013] // !!NOTE!! INTENTIONALLY use the 2012 version to avoid a bug caused by the VS2013 compiler. +$Macro VSDIR "vs2012" [$VS2015] // !!NOTE!! INTENTIONALLY use the 2012 version to avoid a bug caused by the VS2013 compiler. + +// Use the shared version of FBX lib to allow mixing DEBUG & RELEASE builds +$Macro FBXLIB_RELEASE "$FBXDIR\lib\$VSDIR\x86\release\libfbxsdk.lib" [$WIN32] +$Macro FBXLIB_RELEASE "$FBXDIR\lib\$VSDIR\x64\release\libfbxsdk.lib" [$WIN64] +$Macro FBXLIB_DEBUG "$FBXDIR\lib\$VSDIR\x86\release\libfbxsdk.lib" [$WIN32] +$Macro FBXLIB_DEBUG "$FBXDIR\lib\$VSDIR\x64\release\libfbxsdk.lib" [$WIN64] + +$Configuration "Release" +{ + $Linker + { + $AdditionalDependencies "$BASE wininet.lib $FBXLIB_RELEASE" [$WIN32 || $WIN64] + } +} + +$Configuration "Debug" +{ + $Linker + { + $AdditionalDependencies "$BASE wininet.lib $FBXLIB_DEBUG" [$WIN32 || $WIN64] + } +} diff --git a/vpc_scripts/fbx_base.vpc b/vpc_scripts/fbx_base.vpc new file mode 100644 index 0000000000..9f0f9b3e66 --- /dev/null +++ b/vpc_scripts/fbx_base.vpc @@ -0,0 +1,22 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ========== +// +// FBX Version, include path and defines for compiling code that utilizes +// Autodesk FBX SDK +// +//============================================================================= + +$MacroRequired SRCDIR + +$Macro FBXVER "2015.1" + +$Macro FBXDIR "$SRCDIR\thirdparty\fbx\FbxSdk\$FBXVER" + +$Configuration +{ + $Compiler + { + $AdditionalIncludeDirectories "$BASE;$FBXDIR\include" + $PreprocessorDefinitions "$BASE;FBXSDK_NEW_API" + $PreprocessorDefinitions "$BASE;FBXSDK_SHARED" [$VS2012 || $VS2013 || $VS2015] + } +} diff --git a/vpc_scripts/groups.vgc b/vpc_scripts/groups.vgc index 35c6323ce1..e816e3179a 100644 --- a/vpc_scripts/groups.vgc +++ b/vpc_scripts/groups.vgc @@ -125,9 +125,10 @@ $Group "console" $Group "game" { + "vaudio_minimp3" "appframework" "bitmap" - "bsppack" +// "bsppack" "bzip2" "choreoobjects" "client" @@ -135,16 +136,16 @@ $Group "game" "datamodel" "dedicated" "dedicated_main" - "dmserializers" +// "dmserializers" "dmxloader" "engine" - "fbxutils" +// "fbxutils" "filesystem_stdio" "gameui" // "gc" - "gcsdk" +// "gcsdk" // "gcsdk_gc" - "haptics" +// "haptics" "havana_constraints" "hk_base" "hk_math" @@ -158,17 +159,18 @@ $Group "game" "materialsystem" "mathlib" "matsys_controls" - "movieobjects" +// "movieobjects" "particles" - "raytrace" +// "raytrace" "replay" "replay_common" "scenefilecache" "server" + "serverbrowser" "shaderapidx9" "shaderlib" - "simdtest" - "socketlib" +// "simdtest" +// "socketlib" "soundemittersystem" "sourcevr" "stdshader_dbg" @@ -187,11 +189,13 @@ $Group "game" "vgui_surfacelib" "vguimatsurface" "vphysics" + "video_services" "vpklib" "vstdlib" "vtf" "coroutine_osx" - "zlib" + "unicode" +// "zlib" } $Group "everything" diff --git a/vpc_scripts/source_dll_win32_base.vpc b/vpc_scripts/source_dll_win32_base.vpc index 8dbfca73bf..841f6dbe40 100644 --- a/vpc_scripts/source_dll_win32_base.vpc +++ b/vpc_scripts/source_dll_win32_base.vpc @@ -12,9 +12,9 @@ $MacroRequired "OUTBINDIR" $Macro OUTBINDIR "$OUTBINDIR$PLATSUBDIR" $Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR" -$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" [!$VS2015] -$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR\2015\release" [$VS2015&&!$WIN32] -$Macro LIBCOMMON "$SRCDIR\lib\common\win32\2015\release" [$VS2015&&$WIN32] +$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" [!$VS2015 && !$VS2019] +$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR\2015\release" [($VS2015 || $VS2019) && !$WIN32] +$Macro LIBCOMMON "$SRCDIR\lib\common\win32\2015\release" [($VS2015 || $VS2019) && $WIN32] $Include "$SRCDIR\vpc_scripts\loadaddress.vpc" $Include "$SRCDIR\vpc_scripts\source_dll_win32_debug.vpc" @@ -66,11 +66,11 @@ $Configuration $PostBuildEvent [!$ANALYZE] { $CommandLine "if not exist $QUOTE$OUTBINDIR$QUOTE mkdir $QUOTE$OUTBINDIR$QUOTE" "\n" - $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE $SRCDIR" "\n" [!$SOURCESDK] +// $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE $SRCDIR" "\n" [!$SOURCESDK] $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$(TargetFileName)$QUOTE $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE" "\n" \ "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \ "if exist $QUOTE$(TargetDir)$(TargetName).map$QUOTE copy $QUOTE$(TargetDir)$(TargetName).map$QUOTE $OUTBINDIR\$(TargetName).map" "\n" - $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $QUOTE$OUTBINDIR\$(TargetName).pdb$QUOTE $SRCDIR" "\n" [!$SOURCESDK] +// $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $QUOTE$OUTBINDIR\$(TargetName).pdb$QUOTE $SRCDIR" "\n" [!$SOURCESDK] $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$(TargetName).pdb$QUOTE $OUTBINDIR\$(TargetName).pdb" "\n" \ "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \ "goto BuildEventOK" "\n" \ @@ -110,7 +110,8 @@ $Project $CustomBuildStep { // General - $CommandLine "$QUOTE$(VCInstallDir)bin\ml.exe$QUOTE /safeseh /c /Cp /Zi /Fo$QUOTE$(IntDir)\$(InputName).obj$QUOTE $QUOTE$(InputPath)$QUOTE" + $CommandLine "$QUOTE$(VCInstallDir)bin\ml.exe$QUOTE /safeseh /c /Cp /Zi /Fo$QUOTE$(IntDir)\$(InputName).obj$QUOTE $QUOTE$(InputPath)$QUOTE" [!$VS2019] + $CommandLine "$QUOTE$(VC_ExecutablePath_x86_x86)\ml.exe$QUOTE /safeseh /c /Cp /Zi /Fo$QUOTE$(IntDir)\$(InputName).obj$QUOTE $QUOTE$(InputPath)$QUOTE" [$VS2019] $Description "Compiling pointeroverride.asm" $Outputs "$(IntDir)\$(InputName).obj" } diff --git a/vpc_scripts/source_exe_win_win32_base.vpc b/vpc_scripts/source_exe_win_win32_base.vpc index a2704b197a..60ad198ea3 100644 --- a/vpc_scripts/source_exe_win_win32_base.vpc +++ b/vpc_scripts/source_exe_win_win32_base.vpc @@ -12,9 +12,9 @@ $MacroRequired "OUTBINDIR" $Macro OUTBINDIR "$OUTBINDIR$PLATSUBDIR" $Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR" -$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" [!$VS2015] -$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR\2015\release" [$VS2015&&!$WIN32] -$Macro LIBCOMMON "$SRCDIR\lib\common\win32\2015\release" [$VS2015&&$WIN32] +$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" [!$VS2015 && !$VS2019] +$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR\2015\release" [($VS2015 || $VS2019) && !$WIN32] +$Macro LIBCOMMON "$SRCDIR\lib\common\win32\2015\release" [($VS2015 || $VS2019) && $WIN32] $Include "$SRCDIR\vpc_scripts\loadaddress.vpc" $Include "$SRCDIR\vpc_scripts\source_exe_win_win32_debug.vpc" @@ -68,11 +68,11 @@ $Configuration $PostBuildEvent [!$ANALYZE] { - $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetFileName) $SRCDIR" "\n" [!$SOURCESDK] +// $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetFileName) $SRCDIR" "\n" [!$SOURCESDK] $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$QUOTE$(TargetFileName) $OUTBINDIR\$(TargetFileName) >nul" "\n" \ "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \ "if exist $QUOTE$(TargetDir)$QUOTE$(TargetName).map copy $QUOTE$(TargetDir)$QUOTE$(TargetName).map $OUTBINDIR\$(TargetName).map >nul" "\n" - $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetName).pdb $SRCDIR" "\n" [!$SOURCESDK] +// $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetName).pdb $SRCDIR" "\n" [!$SOURCESDK] $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$QUOTE$(TargetName).pdb $OUTBINDIR\$(TargetName).pdb >nul" "\n" \ "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \ "goto BuildEventOK" "\n" \ @@ -111,7 +111,8 @@ $Project $CustomBuildStep { // General - $CommandLine "$QUOTE$(VCInstallDir)bin\ml.exe$QUOTE /c /Cp /Zi /Fo$QUOTE$(IntDir)\$(InputName).obj$QUOTE $QUOTE$(InputPath)$QUOTE" + $CommandLine "$QUOTE$(VCInstallDir)bin\ml.exe$QUOTE /safeseh /c /Cp /Zi /Fo$QUOTE$(IntDir)\$(InputName).obj$QUOTE $QUOTE$(InputPath)$QUOTE" [!$VS2019] + $CommandLine "$QUOTE$(VC_ExecutablePath_x86_x86)\ml.exe$QUOTE /safeseh /c /Cp /Zi /Fo$QUOTE$(IntDir)\$(InputName).obj$QUOTE $QUOTE$(InputPath)$QUOTE" [$VS2019] $Description "Compiling pointeroverride.asm" $Outputs "$(IntDir)\$(InputName).obj" } diff --git a/vpc_scripts/source_lib_win32_base.vpc b/vpc_scripts/source_lib_win32_base.vpc index 1bc4f7fe14..b5006a6425 100644 --- a/vpc_scripts/source_lib_win32_base.vpc +++ b/vpc_scripts/source_lib_win32_base.vpc @@ -11,9 +11,9 @@ $MacroRequired "OUTLIBNAME" "$PROJECTNAME" $MacroRequired "OUTLIBDIR" $Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR" -$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" [!$VS2015] -$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR\2015\release" [$VS2015&&!$WIN32] -$Macro LIBCOMMON "$SRCDIR\lib\common\win32\2015\release" [$VS2015&&$WIN32] +$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" [!$VS2015 && !$VS2019] +$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR\2015\release" [($VS2015 || $VS2019) && !$WIN32] +$Macro LIBCOMMON "$SRCDIR\lib\common\win32\2015\release" [($VS2015 || $VS2019) && $WIN32] $Include "$SRCDIR\vpc_scripts\source_lib_win32_debug.vpc" $Include "$SRCDIR\vpc_scripts\source_lib_win32_release.vpc" @@ -58,7 +58,7 @@ $Configuration $PreLinkEvent [!$ANALYZE && !$SOURCESDK] { - $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTLIBDIR\$(TargetName).lib $SRCDIR" +// $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTLIBDIR\$(TargetName).lib $SRCDIR" } $Librarian diff --git a/vpc_scripts/source_video_base.vpc b/vpc_scripts/source_video_base.vpc index 5e4ec453e1..6cc206745b 100644 --- a/vpc_scripts/source_video_base.vpc +++ b/vpc_scripts/source_video_base.vpc @@ -45,6 +45,6 @@ $Configuration $PreprocessorDefinitions "$BASE;GL_GLEXT_PROTOTYPES;DX_TO_GL_ABSTRACTION" [$GL] $PreprocessorDefinitions "$BASE;USE_SDL" [$SDL] - $AdditionalIncludeDirectories "$BASE;$SRCDIR\thirdparty\SDL2" [$SDL || $DEDICATED] + $AdditionalIncludeDirectories "$BASE;$SRCDIR\thirdparty\SDL" [$SDL || $DEDICATED] } } diff --git a/vpc_scripts/source_win32_base.vpc b/vpc_scripts/source_win32_base.vpc index 454cde3ff8..d08fca76bb 100644 --- a/vpc_scripts/source_win32_base.vpc +++ b/vpc_scripts/source_win32_base.vpc @@ -18,6 +18,7 @@ $Configuration $PlatformToolset "v120" [$VS2013 && $ANALYZE] // VS 2013 for /analyze $PlatformToolset "v140_xp" [$VS2015 && !$ANALYZE] // VS 2015 for /analyze $PlatformToolset "v140" [$VS2015 && $ANALYZE] // VS 2015 for /analyze + $PlatformToolset "v142" [$VS2019] // VS 2019 } $General @@ -48,7 +49,7 @@ $Configuration // window since F8 stops on both warnings and errors. The only way to // keep the warning count down is to have warnings-as-errors. // We will not be warning free on 64-bit for a while... - $TreatWarningsAsErrors "Yes (/WX)" [!$ANALYZE && !$WIN64] + //$TreatWarningsAsErrors "Yes (/WX)" [!$ANALYZE && !$WIN64] // Defines to differentiate 32 from 64 bit builds $PreprocessorDefinitions "$BASE;PLATFORM_64BITS;WIN64;_WIN64;COMPILER_MSVC64" [$WIN64] diff --git a/vphysics/main.cpp b/vphysics/main.cpp index 03bdeb63b5..6210c028c7 100644 --- a/vphysics/main.cpp +++ b/vphysics/main.cpp @@ -223,20 +223,20 @@ void CPhysicsInterface::DestroyAllCollisionSets() // In release build, each of these libraries must contain a symbol that indicates it is also a release build // You MUST disable this in order to run a release vphysics.dll with a debug library. // This should not usually be necessary -#if !defined(_DEBUG) && defined(_WIN32) -extern int ivp_physics_lib_is_a_release_build; -extern int ivp_compactbuilder_lib_is_a_release_build; -extern int hk_base_lib_is_a_release_build; -extern int hk_math_lib_is_a_release_build; -extern int havana_constraints_lib_is_a_release_build; +// #if !defined(_DEBUG) && defined(_WIN32) +// extern int ivp_physics_lib_is_a_release_build; +// extern int ivp_compactbuilder_lib_is_a_release_build; +// extern int hk_base_lib_is_a_release_build; +// extern int hk_math_lib_is_a_release_build; +// extern int havana_constraints_lib_is_a_release_build; -void DebugTestFunction() -{ - ivp_physics_lib_is_a_release_build = 0; - ivp_compactbuilder_lib_is_a_release_build = 0; - hk_base_lib_is_a_release_build = 0; - hk_math_lib_is_a_release_build = 0; - havana_constraints_lib_is_a_release_build = 0; -} -#endif +// void DebugTestFunction() +// { +// ivp_physics_lib_is_a_release_build = 0; +// ivp_compactbuilder_lib_is_a_release_build = 0; +// hk_base_lib_is_a_release_build = 0; +// hk_math_lib_is_a_release_build = 0; +// havana_constraints_lib_is_a_release_build = 0; +// } +// #endif diff --git a/vphysics/vphysics.vpc b/vphysics/vphysics.vpc index 698c41a75d..0c00da4e39 100644 --- a/vphysics/vphysics.vpc +++ b/vphysics/vphysics.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" diff --git a/vphysics/wscript b/vphysics/wscript index fb6d4fa2cf..c10384c699 100755 --- a/vphysics/wscript +++ b/vphysics/wscript @@ -39,8 +39,8 @@ def build(bld): 'physics_virtualmesh.cpp', 'trace.cpp', 'vcollide_parse.cpp', - 'vphysics_saverestore.cpp' - + 'vphysics_saverestore.cpp', + '../public/tier0/memoverride.cpp' ] includes = [ diff --git a/vpklib/packedstore.cpp b/vpklib/packedstore.cpp index a6671ed2e9..1c12347683 100644 --- a/vpklib/packedstore.cpp +++ b/vpklib/packedstore.cpp @@ -634,11 +634,10 @@ void CPackedStore::Write( void ) // Do we plan on signing this thing and writing a signature? m_Signature.Purge(); - uint32 nExpectedSignatureSize = 0; if ( m_SignaturePrivateKey.Count() > 0 && m_SignaturePublicKey.Count() > 0 ) { #ifdef VPK_ENABLE_SIGNING - nExpectedSignatureSize = k_cubRSASignature; + uint32 nExpectedSignatureSize = k_cubRSASignature; headerOut.m_nSignatureSize = sizeof(uint32) + m_SignaturePublicKey.Count() + sizeof(uint32) + nExpectedSignatureSize; #else Error( "VPK signing not implemented" ); diff --git a/vstdlib/vstdlib.vpc b/vstdlib/vstdlib.vpc index 6de75ca817..b2d0cd662b 100644 --- a/vstdlib/vstdlib.vpc +++ b/vstdlib/vstdlib.vpc @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- $Macro SRCDIR ".." -$Macro OUTBINDIR "$LIBPUBLIC" +$Macro OUTBINDIR "$SRCDIR\..\game\bin" $include "$SRCDIR\vpc_scripts\source_dll_base.vpc" @@ -56,8 +56,8 @@ $Configuration $PreLinkEvent [$WINDOWS] { - $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $LIBPUBLIC\$(TargetName).lib $SRCDIR" "\n" \ - "$BASE" + //$CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $LIBPUBLIC\$(TargetName).lib $SRCDIR" "\n" \ + // "$BASE" } $PreLinkEvent [$X360] diff --git a/vstdlib/wscript b/vstdlib/wscript index 3e2547affd..57a6363384 100755 --- a/vstdlib/wscript +++ b/vstdlib/wscript @@ -22,11 +22,20 @@ def build(bld): 'jobthread.cpp', 'KeyValuesSystem.cpp', 'osversion.cpp', - #'processutils.cpp' # [$WINDOWS] 'random.cpp', 'vcover.cpp', '../public/tier0/memoverride.cpp' ] + + if bld.env.DEST_OS == 'win32': + source += [ + 'processutils.cpp' + ] + if bld.env.DEST_CPU == 'amd64': + source += [ + 'coroutine_win64.masm', + 'GetStackPtr64.masm' + ] includes = [ '.', diff --git a/vtf/wscript b/vtf/wscript index 3698d0c475..ed49385b67 100755 --- a/vtf/wscript +++ b/vtf/wscript @@ -17,11 +17,15 @@ def configure(conf): def build(bld): source = [ 'convert_x360.cpp', - #$File "s3tc_decode.cpp" # [$WINDOWS] 'vtf.cpp' #$File "vtf_x360.cpp"# [$X360] ] + if bld.env.DEST_OS == 'win32': + source += [ + 's3tc_decode.cpp' + ] + includes = [ '.', '../public', diff --git a/wscript b/wscript index 5cb8f253b3..a2f8a1b2bf 100644 --- a/wscript +++ b/wscript @@ -74,7 +74,8 @@ projects={ 'vphysics', 'vpklib', 'vstdlib', - 'vtf' + 'vtf', + 'unicode' ], 'dedicated': [ 'appframework', @@ -137,6 +138,7 @@ def define_platform(conf): conf.env.DEDICATED = conf.options.DEDICATED conf.env.TOGLES = conf.options.TOGLES conf.env.GL = conf.options.GL + conf.env.OPUS = conf.options.OPUS if conf.options.DEDICATED: conf.options.SDL = False @@ -153,8 +155,8 @@ def define_platform(conf): if conf.options.TOGLES: conf.env.append_unique('DEFINES', ['TOGLES']) - if conf.options.SDL: + conf.env.SDL = 1 conf.define('USE_SDL', 1) if conf.options.ALLOW64: @@ -169,8 +171,7 @@ def define_platform(conf): 'NO_HOOK_MALLOC', '_DLL_EXT=.so' ]) - - if conf.env.DEST_OS == 'android': + elif conf.env.DEST_OS == 'android': conf.env.append_unique('DEFINES', [ 'ANDROID=1', '_ANDROID=1', 'LINUX=1', '_LINUX=1', @@ -179,6 +180,18 @@ def define_platform(conf): 'NO_HOOK_MALLOC', '_DLL_EXT=.so' ]) + elif conf.env.DEST_OS == 'win32': + conf.env.append_unique('DEFINES', [ + 'WIN32=1', '_WIN32=1', + '_WINDOWS', + '_DLL_EXT=.dll', + '_CRT_SECURE_NO_DEPRECATE', + '_CRT_NONSTDC_NO_DEPRECATE', + '_ALLOW_RUNTIME_LIBRARY_MISMATCH', + '_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH', + '_ALLOW_MSC_VER_MISMATCH', + 'NO_X360_XDK' + ]) if conf.options.DEBUG_ENGINE: conf.env.append_unique('DEFINES', [ @@ -201,10 +214,10 @@ def options(opt): grp.add_option('-D', '--debug-engine', action = 'store_true', dest = 'DEBUG_ENGINE', default = False, help = 'build with -DDEBUG [default: %default]') - grp.add_option('--use-sdl', action = 'store', dest = 'SDL', type = 'int', default = True, + grp.add_option('--use-sdl', action = 'store', dest = 'SDL', type = 'int', default = sys.platform != 'win32', help = 'build engine with SDL [default: %default]') - grp.add_option('--use-togl', action = 'store', dest = 'GL', type = 'int', default = True, + grp.add_option('--use-togl', action = 'store', dest = 'GL', type = 'int', default = sys.platform != 'win32', help = 'build engine with ToGL [default: %default]') grp.add_option('--build-games', action = 'store', dest = 'GAMES', type = 'string', default = 'hl2', @@ -221,7 +234,7 @@ def options(opt): # TODO(nillerusr): add wscript for opus building grp.add_option('--enable-opus', action = 'store_true', dest = 'OPUS', default = False, - help = 'build engine with ToGLES [default: %default]') + help = 'build engine with Opus voice codec [default: %default]') opt.load('compiler_optimizations subproject') @@ -231,17 +244,20 @@ def options(opt): opt.load('reconfigure') def configure(conf): - conf.load('fwgslib reconfigure') + conf.load('fwgslib reconfigure compiler_optimizations') # Force XP compability, all build targets should add # subsystem=bld.env.MSVC_SUBSYSTEM # TODO: wrapper around bld.stlib, bld.shlib and so on? conf.env.MSVC_SUBSYSTEM = 'WINDOWS,5.01' conf.env.MSVC_TARGETS = ['x86'] # explicitly request x86 target for MSVC + if conf.options.ALLOW64: + conf.env.MSVC_TARGETS = ['x64'] if sys.platform == 'win32': - conf.load('msvc msvc_pdb msdev msvs') + conf.load('msvc_pdb_ext msdev msvs') conf.load('subproject xcompile compiler_c compiler_cxx gitversion clang_compilation_database strip_on_install waf_unit_test enforce_pic') - + if conf.env.DEST_OS == 'win32' and conf.env.DEST_CPU == 'amd64': + conf.load('masm') define_platform(conf) if conf.env.TOGLES: @@ -249,10 +265,13 @@ def configure(conf): elif conf.env.GL: projects['game'] += ['togl'] + if conf.env.DEST_OS == 'win32': + projects['game'] += ['utils/bzip2'] + projects['dedicated'] += ['utils/bzip2'] if conf.options.OPUS or conf.env.DEST_OS == 'android': projects['game'] += ['engine/voice_codecs/opus'] - if conf.env.DEST_OS in ['win32', 'linux', 'darwin'] and conf.env.DEST_CPU == 'x86_64': + if conf.env.DEST_OS in ['win32', 'linux', 'darwin'] and conf.env.DEST_CPU in ['x86_64', 'amd64']: conf.env.BIT32_MANDATORY = not conf.options.ALLOW64 if conf.env.BIT32_MANDATORY: Logs.info('WARNING: will build engine for 32-bit target') @@ -286,7 +305,9 @@ def configure(conf): cflags, linkflags = conf.get_optimization_flags() - flags = ['-pipe', '-fPIC'] + flags = [] + if conf.env.DEST_OS != 'win32': + flags += ['-pipe', '-fPIC'] if conf.env.COMPILER_CC != 'msvc': flags += ['-pthread'] @@ -303,7 +324,7 @@ def configure(conf): ] flags += ['-fvisibility=default'] - else: + elif conf.env.COMPILER_CC != 'msvc': flags += ['-march=native'] if conf.env.DEST_CPU in ['x86', 'x86_64']: @@ -311,14 +332,63 @@ def configure(conf): elif conf.env.DEST_CPU in ['arm', 'aarch64']: flags += ['-fsigned-char'] - cflags += flags - linkflags += flags + if conf.env.DEST_OS != 'win32': + cflags += flags + linkflags += flags + else: + cflags += [ + '/I'+os.path.abspath('.')+'/thirdparty/SDL', + '/arch:SSE' if conf.env.DEST_CPU == 'x86' else '/arch:AVX', + '/GF', + '/Gy', + '/fp:fast', + '/Zc:forScope', + '/Zc:wchar_t', + '/GR', + '/TP' + ] + + if conf.options.BUILD_TYPE == 'debug': + linkflags += [ + '/INCREMENTAL:NO', + '/NODEFAULTLIB:libc', + '/NODEFAULTLIB:libcd', + '/NODEFAULTLIB:libcmt', + '/FORCE' + ] + else: + linkflags += [ + '/INCREMENTAL', + '/NODEFAULTLIB:libc', + '/NODEFAULTLIB:libcd', + '/NODEFAULTLIB:libcmtd' + ] + linkflags += [ + '/LIBPATH:'+os.path.abspath('.')+'/lib/win32/'+conf.env.DEST_CPU+'/', + '/LIBPATH:'+os.path.abspath('.')+'/dx9sdk/lib/'+conf.env.DEST_CPU+'/' + ] + # And here C++ flags starts to be treated separately - cxxflags = list(cflags) + ['-std=c++11','-fpermissive'] + cxxflags = list(cflags) + if conf.env.DEST_OS != 'win32': + cxxflags += ['-std=c++11','-fpermissive'] if conf.env.COMPILER_CC == 'gcc': +# wrapfunctions = ['freopen','creat','access','__xstat','stat','lstat','fopen64','open64', +# 'opendir','__lxstat','chmod','chown','lchown','symlink','link','__lxstat64','mknod', +# 'utimes','unlink','rename','utime','__xstat64','mount','mkdir','rmdir','scandir','realpath','mkfifo'] + +# for func in wrapfunctions: +# linkflags += ['-Wl,--wrap='+func] conf.define('COMPILER_GCC', 1) + elif conf.env.COMPILER_CC == 'msvc': + conf.define('COMPILER_MSVC', 1) + conf.define('MSVC', 1) + if conf.env.DEST_CPU == 'x86': + conf.define('COMPILER_MSVC32', 1) + elif conf.env.DEST_CPU in ['x86_64', 'amd64']: + conf.define('COMPILER_MSVC64', 1) if conf.env.COMPILER_CC != 'msvc': conf.check_cc(cflags=cflags, linkflags=linkflags, msg='Checking for required C flags') @@ -337,21 +407,22 @@ def configure(conf): conf.env.append_unique('INCLUDES', [os.path.abspath('common/')]) if conf.env.DEST_OS != 'android': - if conf.options.SDL: - conf.check_cfg(package='sdl2', uselib_store='SDL2', args=['--cflags', '--libs']) - if conf.options.DEDICATED: - conf.check_cfg(package='libedit', uselib_store='EDIT', args=['--cflags', '--libs']) - else: - conf.check_pkg('freetype2', 'FT2', FT2_CHECK) - conf.check_pkg('fontconfig', 'FC', FC_CHECK) - conf.check_cfg(package='openal', uselib_store='OPENAL', args=['--cflags', '--libs']) - conf.check_cfg(package='libjpeg', uselib_store='JPEG', args=['--cflags', '--libs']) - conf.check_cfg(package='libpng', uselib_store='PNG', args=['--cflags', '--libs']) - conf.check_cfg(package='libcurl', uselib_store='CURL', args=['--cflags', '--libs']) - conf.check_cfg(package='zlib', uselib_store='ZLIB', args=['--cflags', '--libs']) + if conf.env.DEST_OS != 'win32': + if conf.options.SDL: + conf.check_cfg(package='sdl2', uselib_store='SDL2', args=['--cflags', '--libs']) + if conf.options.DEDICATED: + conf.check_cfg(package='libedit', uselib_store='EDIT', args=['--cflags', '--libs']) + else: + conf.check_pkg('freetype2', 'FT2', FT2_CHECK) + conf.check_pkg('fontconfig', 'FC', FC_CHECK) + conf.check_cfg(package='openal', uselib_store='OPENAL', args=['--cflags', '--libs']) + conf.check_cfg(package='libjpeg', uselib_store='JPEG', args=['--cflags', '--libs']) + conf.check_cfg(package='libpng', uselib_store='PNG', args=['--cflags', '--libs']) + conf.check_cfg(package='libcurl', uselib_store='CURL', args=['--cflags', '--libs']) + conf.check_cfg(package='zlib', uselib_store='ZLIB', args=['--cflags', '--libs']) - if conf.options.OPUS: - conf.check_cfg(package='opus', uselib_store='OPUS', args=['--cflags', '--libs']) + if conf.options.OPUS: + conf.check_cfg(package='opus', uselib_store='OPUS', args=['--cflags', '--libs']) else: conf.check(lib='SDL2', uselib_store='SDL2') conf.check(lib='freetype2', uselib_store='FT2') @@ -377,24 +448,41 @@ def configure(conf): # Don't check them more than once, to save time # Usually, they are always available # but we need them in uselib - a = map(lambda x: { - # 'features': 'c', - # 'message': '...' + x, - 'lib': x, - # 'uselib_store': x.upper(), - # 'global_define': False, - }, [ + a = [ 'user32', 'shell32', 'gdi32', 'advapi32', 'dbghelp', 'psapi', - 'ws2_32' - ]) + 'ws2_32', + 'rpcrt4', + 'winmm', + 'wininet', + 'ole32', + 'shlwapi', + 'imm32' + ] - for i in a: - conf.check_cc(**i) + if conf.env.COMPILER_CC == 'msvc': + for i in a: + conf.check_lib_msvc(i) + else: + for i in a: + conf.check_cc(lib = i) + + conf.check(lib='libz', uselib_store='ZLIB') + # conf.check(lib='nvtc', uselib_store='NVTC') + # conf.check(lib='ati_compress_mt_vc10', uselib_store='ATI_COMPRESS_MT_VC10') + conf.check(lib='SDL2', uselib_store='SDL2') + conf.check(lib='libjpeg', uselib_store='JPEG') + conf.check(lib='libpng', uselib_store='PNG') + conf.check(lib='d3dx9', uselib_store='D3DX9') + conf.check(lib='d3d9', uselib_store='D3D9') + conf.check(lib='dsound', uselib_store='DSOUND') + conf.check(lib='dxguid', uselib_store='DXGUID') + if conf.options.OPUS: + conf.check(lib='opus', uselib_store='OPUS') # conf.multicheck(*a, run_all_tests = True, mandatory = True) @@ -417,6 +505,13 @@ def configure(conf): def build(bld): os.environ["CCACHE_DIR"] = os.path.abspath('.ccache/'+bld.env.COMPILER_CC+'/'+bld.env.DEST_OS+'/'+bld.env.DEST_CPU) + if bld.env.DEST_OS == 'win32': + projects['game'] += ['utils/bzip2'] + projects['dedicated'] += ['utils/bzip2'] + + if bld.env.OPUS or bld.env.DEST_OS == 'android': + projects['game'] += ['engine/voice_codecs/opus'] + if bld.env.DEDICATED: bld.add_subproject(projects['dedicated']) else: