diff --git a/.gitignore b/.gitignore index a96f2908..47d756e7 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,6 @@ android/ .cache/ .ccache/ waf3*/ -.vscode/ \ No newline at end of file +.vscode/ +.depproj/ +source-engine.sln \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 8072bb24..9dfb40cb 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/bitmap/colorconversion.cpp b/bitmap/colorconversion.cpp index 38601ed1..72325520 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 8c32f45a..ae3a8e9d 100755 --- a/bitmap/wscript +++ b/bitmap/wscript @@ -48,8 +48,8 @@ def build(bld): libs = [] - if bld.env.DEST_OS == 'win32': - libs += ['NVTC', 'ATI_COMPRESS_MT_VC10'] + #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 95fcbfc9..c1b451b2 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 cd8173fd..623a4feb 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/datacache/wscript b/datacache/wscript index 3cb9a277..4eddce12 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/wscript b/dedicated/wscript index 5fed8f10..11e56fd0 100755 --- a/dedicated/wscript +++ b/dedicated/wscript @@ -33,9 +33,10 @@ def build(bld): '../filesystem/filesystem_stdio.cpp', '../filesystem/QueuedLoader.cpp', '../public/zip_utils.cpp', + '../public/tier0/memoverride.cpp' ] - if bld.env.DEST_OS == 'win32' + if bld.env.DEST_OS == 'win32': source += [ 'sys_windows.cpp' ] diff --git a/dx9sdk/lib/amd64/D3DCSX.lib b/dx9sdk/lib/amd64/D3DCSX.lib new file mode 100644 index 00000000..8e2f059c 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 00000000..6735a4dd 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 00000000..a4fb2269 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 00000000..3f730213 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 00000000..02a65259 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 00000000..5545d285 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 00000000..505e6d73 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 00000000..2b08450b 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 00000000..4b2ef625 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 00000000..441d85b5 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 00000000..62b3f756 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 00000000..15c8301d 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 00000000..cfd7b9fa 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 00000000..c4b45a7f 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 00000000..92a666fa 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 00000000..2b116fe6 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 00000000..8587d5b0 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 00000000..2f3ebf77 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 00000000..66dbd303 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 00000000..fcd91e14 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 00000000..a85fc867 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 00000000..15416c63 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 00000000..83639be8 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 00000000..f3994f9c 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 00000000..9a1bbcbf 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 00000000..63fd4744 Binary files /dev/null and b/dx9sdk/lib/amd64/xapobased.lib differ diff --git a/dx9sdk/lib/DxErr8.lib b/dx9sdk/lib/x86/DxErr8.lib similarity index 100% rename from dx9sdk/lib/DxErr8.lib rename to dx9sdk/lib/x86/DxErr8.lib diff --git a/dx9sdk/lib/DxErr9.lib b/dx9sdk/lib/x86/DxErr9.lib similarity index 100% rename from dx9sdk/lib/DxErr9.lib rename to dx9sdk/lib/x86/DxErr9.lib diff --git a/dx9sdk/lib/XInput.lib b/dx9sdk/lib/x86/XInput.lib similarity index 100% rename from dx9sdk/lib/XInput.lib rename to dx9sdk/lib/x86/XInput.lib diff --git a/dx9sdk/lib/amstrmid.lib b/dx9sdk/lib/x86/amstrmid.lib similarity index 100% rename from dx9sdk/lib/amstrmid.lib rename to dx9sdk/lib/x86/amstrmid.lib diff --git a/dx9sdk/lib/d3d8.lib b/dx9sdk/lib/x86/d3d8.lib similarity index 100% rename from dx9sdk/lib/d3d8.lib rename to dx9sdk/lib/x86/d3d8.lib diff --git a/dx9sdk/lib/d3d9.lib b/dx9sdk/lib/x86/d3d9.lib similarity index 100% rename from dx9sdk/lib/d3d9.lib rename to dx9sdk/lib/x86/d3d9.lib diff --git a/dx9sdk/lib/d3dx.lib b/dx9sdk/lib/x86/d3dx.lib similarity index 100% rename from dx9sdk/lib/d3dx.lib rename to dx9sdk/lib/x86/d3dx.lib diff --git a/dx9sdk/lib/d3dx8.lib b/dx9sdk/lib/x86/d3dx8.lib similarity index 100% rename from dx9sdk/lib/d3dx8.lib rename to dx9sdk/lib/x86/d3dx8.lib diff --git a/dx9sdk/lib/d3dx8d.lib b/dx9sdk/lib/x86/d3dx8d.lib similarity index 100% rename from dx9sdk/lib/d3dx8d.lib rename to dx9sdk/lib/x86/d3dx8d.lib diff --git a/dx9sdk/lib/d3dx8dt.lib b/dx9sdk/lib/x86/d3dx8dt.lib similarity index 100% rename from dx9sdk/lib/d3dx8dt.lib rename to dx9sdk/lib/x86/d3dx8dt.lib diff --git a/dx9sdk/lib/d3dx9.lib b/dx9sdk/lib/x86/d3dx9.lib similarity index 100% rename from dx9sdk/lib/d3dx9.lib rename to dx9sdk/lib/x86/d3dx9.lib diff --git a/dx9sdk/lib/d3dx9d.lib b/dx9sdk/lib/x86/d3dx9d.lib similarity index 100% rename from dx9sdk/lib/d3dx9d.lib rename to dx9sdk/lib/x86/d3dx9d.lib diff --git a/dx9sdk/lib/d3dx9dt.lib b/dx9sdk/lib/x86/d3dx9dt.lib similarity index 100% rename from dx9sdk/lib/d3dx9dt.lib rename to dx9sdk/lib/x86/d3dx9dt.lib diff --git a/dx9sdk/lib/d3dxd.lib b/dx9sdk/lib/x86/d3dxd.lib similarity index 100% rename from dx9sdk/lib/d3dxd.lib rename to dx9sdk/lib/x86/d3dxd.lib diff --git a/dx9sdk/lib/d3dxof.lib b/dx9sdk/lib/x86/d3dxof.lib similarity index 100% rename from dx9sdk/lib/d3dxof.lib rename to dx9sdk/lib/x86/d3dxof.lib diff --git a/dx9sdk/lib/ddraw.lib b/dx9sdk/lib/x86/ddraw.lib similarity index 100% rename from dx9sdk/lib/ddraw.lib rename to dx9sdk/lib/x86/ddraw.lib diff --git a/dx9sdk/lib/dinput.lib b/dx9sdk/lib/x86/dinput.lib similarity index 100% rename from dx9sdk/lib/dinput.lib rename to dx9sdk/lib/x86/dinput.lib diff --git a/dx9sdk/lib/dinput8.lib b/dx9sdk/lib/x86/dinput8.lib similarity index 100% rename from dx9sdk/lib/dinput8.lib rename to dx9sdk/lib/x86/dinput8.lib diff --git a/dx9sdk/lib/dmoguids.lib b/dx9sdk/lib/x86/dmoguids.lib similarity index 100% rename from dx9sdk/lib/dmoguids.lib rename to dx9sdk/lib/x86/dmoguids.lib diff --git a/dx9sdk/lib/dplayx.lib b/dx9sdk/lib/x86/dplayx.lib similarity index 100% rename from dx9sdk/lib/dplayx.lib rename to dx9sdk/lib/x86/dplayx.lib diff --git a/dx9sdk/lib/dsetup.lib b/dx9sdk/lib/x86/dsetup.lib similarity index 100% rename from dx9sdk/lib/dsetup.lib rename to dx9sdk/lib/x86/dsetup.lib diff --git a/dx9sdk/lib/dsound.lib b/dx9sdk/lib/x86/dsound.lib similarity index 100% rename from dx9sdk/lib/dsound.lib rename to dx9sdk/lib/x86/dsound.lib diff --git a/dx9sdk/lib/dxguid.lib b/dx9sdk/lib/x86/dxguid.lib similarity index 100% rename from dx9sdk/lib/dxguid.lib rename to dx9sdk/lib/x86/dxguid.lib diff --git a/dx9sdk/lib/dxtrans.lib b/dx9sdk/lib/x86/dxtrans.lib similarity index 100% rename from dx9sdk/lib/dxtrans.lib rename to dx9sdk/lib/x86/dxtrans.lib diff --git a/dx9sdk/lib/encapi.lib b/dx9sdk/lib/x86/encapi.lib similarity index 100% rename from dx9sdk/lib/encapi.lib rename to dx9sdk/lib/x86/encapi.lib diff --git a/dx9sdk/lib/ksproxy.lib b/dx9sdk/lib/x86/ksproxy.lib similarity index 100% rename from dx9sdk/lib/ksproxy.lib rename to dx9sdk/lib/x86/ksproxy.lib diff --git a/dx9sdk/lib/ksuser.lib b/dx9sdk/lib/x86/ksuser.lib similarity index 100% rename from dx9sdk/lib/ksuser.lib rename to dx9sdk/lib/x86/ksuser.lib diff --git a/dx9sdk/lib/msdmo.lib b/dx9sdk/lib/x86/msdmo.lib similarity index 100% rename from dx9sdk/lib/msdmo.lib rename to dx9sdk/lib/x86/msdmo.lib diff --git a/dx9sdk/lib/quartz.lib b/dx9sdk/lib/x86/quartz.lib similarity index 100% rename from dx9sdk/lib/quartz.lib rename to dx9sdk/lib/x86/quartz.lib diff --git a/dx9sdk/lib/strmiids.lib b/dx9sdk/lib/x86/strmiids.lib similarity index 100% rename from dx9sdk/lib/strmiids.lib rename to dx9sdk/lib/x86/strmiids.lib diff --git a/engine/LoadScreenUpdate.cpp b/engine/LoadScreenUpdate.cpp index 2ea25063..9831e150 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/bugreporter.cpp b/engine/bugreporter.cpp index 093041e2..25a5b4f3 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/sv_main.cpp b/engine/sv_main.cpp index 1628c881..5bc95139 100644 --- a/engine/sv_main.cpp +++ b/engine/sv_main.cpp @@ -209,10 +209,11 @@ static ConVar sv_consistency( "sv_consistency", "1", FCVAR_REPLICATED, "Legacy v /// XXX(JohnS): When steam voice gets ugpraded to Opus we will probably default back to steam. At that time we should /// note that Steam voice is the highest quality codec below. -static ConVar sv_voicecodec( "sv_voicecodec", "vaudio_celt", 0, +static ConVar sv_voicecodec( "sv_voicecodec", "vaudio_opus", 0, "Specifies which voice codec to use. Valid options are:\n" "vaudio_speex - Legacy Speex codec (lowest quality)\n" "vaudio_celt - Newer CELT codec\n" + "vaudio_opus - Latest Opus codec (highest quality, comes by default)\n" "steam - Use Steam voice API" ); diff --git a/engine/sys_dll2.cpp b/engine/sys_dll2.cpp index 6bcc2af8..087d398e 100644 --- a/engine/sys_dll2.cpp +++ b/engine/sys_dll2.cpp @@ -1176,7 +1176,7 @@ InitReturnVal_t CEngineAPI::Init() m_bRunningSimulation = false; // Initialize the FPU control word -#if defined(WIN32) && !defined( SWDS ) && !defined( _X360 ) && !defined (__arm__) +#if defined(WIN32) && !defined( SWDS ) && !defined( _X360 ) && !defined (__arm__) && !defined(PLATFORM_WINDOWS_PC64) _asm { fninit diff --git a/engine/sys_mainwind.cpp b/engine/sys_mainwind.cpp index 21cb9487..c3bb3acf 100644 --- a/engine/sys_mainwind.cpp +++ b/engine/sys_mainwind.cpp @@ -161,7 +161,7 @@ public: void SetMainWindow( SDL_Window* window ); #else #ifdef WIN32 - int WindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); + LRESULT WindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); #endif void SetMainWindow( HWND window ); #endif @@ -514,7 +514,7 @@ void VCR_HandlePlaybackMessages( // FIXME: It would be nice to remove the need for this, which we can do // if we can make unicode work when running inside hammer. //----------------------------------------------------------------------------- -static LONG WINAPI CallDefaultWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) +static LRESULT WINAPI CallDefaultWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { if ( unicode ) return unicode->DefWindowProcW( 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 f67c4afe..44cfc499 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/wscript b/engine/voice_codecs/minimp3/wscript index b3f0743c..a21693e3 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/wscript b/engine/voice_codecs/opus/wscript index ce9207d3..f1e0c3b0 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 d1b1f581..2871dad2 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/filesystem/basefilesystem.cpp b/filesystem/basefilesystem.cpp index 8a371b17..fe692870 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 e413db7d..c0e16a05 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/wscript b/filesystem/wscript index 6f8d9c50..52d3a5f9 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): diff --git a/game/client/wscript b/game/client/wscript index dd9e53f7..c454d535 100755 --- a/game/client/wscript +++ b/game/client/wscript @@ -69,12 +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': - source += [ '../../public/tier0/memoverride.cpp' ] 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 f187479c..7593ce88 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 3b70c7e6..eeb69209 100644 --- a/game/server/baseentity.h +++ b/game/server/baseentity.h @@ -1108,7 +1108,7 @@ public: ENTITYFUNCPTR TouchSet( ENTITYFUNCPTR func, char *name ) { -#ifdef GNUC +#ifdef PLATFORM_64BITS COMPILE_TIME_ASSERT( sizeof(func) == 8 ); #else COMPILE_TIME_ASSERT( sizeof(func) == 4 ); @@ -1119,7 +1119,7 @@ public: } USEPTR UseSet( USEPTR func, char *name ) { -#ifdef GNUC +#ifdef PLATFORM_64BITS COMPILE_TIME_ASSERT( sizeof(func) == 8 ); #else COMPILE_TIME_ASSERT( sizeof(func) == 4 ); @@ -1130,7 +1130,7 @@ public: } ENTITYFUNCPTR BlockedSet( ENTITYFUNCPTR func, char *name ) { -#ifdef GNUC +#ifdef PLATFORM_64BITS COMPILE_TIME_ASSERT( sizeof(func) == 8 ); #else COMPILE_TIME_ASSERT( sizeof(func) == 4 ); diff --git a/game/server/episodic/ep2_gamestats.cpp b/game/server/episodic/ep2_gamestats.cpp index af6d5e94..e733863d 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 cc36301c..e5a5cf17 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 fbd7c508..ef74c0f7 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 60d37cdf..6dadaff4 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/util.h b/game/server/util.h index a788da6c..f8b82e0c 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 ec36c948..1b6d834d 100755 --- a/game/server/wscript +++ b/game/server/wscript @@ -63,13 +63,10 @@ def build(bld): 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"] - if bld.env.DEST_OS == 'win32': - source += ['../../public/tier0/memoverride.cpp'] - defines.remove('PROTECTED_THINGS_ENABLE') bld.shlib( diff --git a/gameui/BasePanel.cpp b/gameui/BasePanel.cpp index 9f5a8854..3a00f666 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 c59d18ce..cba0f473 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/SaveGameBrowserDialog.cpp b/gameui/SaveGameBrowserDialog.cpp index ac894ff4..8b777375 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 ae6b83de..5502746d 100755 --- a/gameui/wscript +++ b/gameui/wscript @@ -93,11 +93,11 @@ def build(bld): 'OptionsSubPortal.cpp', 'OptionsSubVideo.cpp', 'OptionsSubVoice.cpp', + '../public/tier0/memoverride.cpp', ] if bld.env.DEST_OS == 'win32': source += [ - '../public/tier0/memoverride.cpp', 'LogoFile.cpp', 'ChangeGameDialog.cpp', 'OptionsSubHaptics.cpp' diff --git a/inputsystem/wscript b/inputsystem/wscript index 814fe7e2..c62fac18 100755 --- a/inputsystem/wscript +++ b/inputsystem/wscript @@ -1,6 +1,7 @@ #! /usr/bin/env python # encoding: utf-8 +from gettext import install from waflib import Utils import os @@ -20,7 +21,8 @@ def build(bld): 'joystick_sdl.cpp', 'touch_sdl.cpp', 'key_translation.cpp', - 'steamcontroller.cpp' + 'steamcontroller.cpp', + '../public/tier0/memoverride.cpp' ] if bld.env.DEST_OS == 'win32': @@ -44,6 +46,15 @@ def build(bld): install_path = bld.env.LIBDIR + # Copy SDL2 dependency + if bld.env.DEST_OS == 'win32': + bld( + rule='cp ${SRC} ${TGT}', + source='../lib/win32/public/'+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 bb1b1171..fb8f2ac9 160000 --- a/ivp +++ b/ivp @@ -1 +1 @@ -Subproject commit bb1b1171af890f285193db6abc07acb126e6e93f +Subproject commit fb8f2ac922a7f8f758a552ddbe47f1933ffe42b0 diff --git a/launcher/wscript b/launcher/wscript index ab9e1a3f..06f09b5c 100755 --- a/launcher/wscript +++ b/launcher/wscript @@ -19,6 +19,7 @@ def build(bld): '../public/filesystem_init.cpp', 'launcher.cpp', 'reslistgenerator.cpp', + '../public/tier0/memoverride.cpp' ] if bld.env.DEST_OS == 'android': diff --git a/lib b/lib new file mode 160000 index 00000000..86166922 --- /dev/null +++ b/lib @@ -0,0 +1 @@ +Subproject commit 8616692265f85926d6901600716e08c69f60d820 diff --git a/lib/common/win32/2015/release/binkw32.lib b/lib/common/win32/2015/release/binkw32.lib deleted file mode 100644 index c198757d..00000000 Binary files a/lib/common/win32/2015/release/binkw32.lib and /dev/null differ diff --git a/lib/common/win32/2015/release/d3dx9.lib b/lib/common/win32/2015/release/d3dx9.lib deleted file mode 100644 index c4d864bf..00000000 Binary files a/lib/common/win32/2015/release/d3dx9.lib and /dev/null differ diff --git a/lib/common/win32/2015/release/libjpeg.lib b/lib/common/win32/2015/release/libjpeg.lib deleted file mode 100644 index baa7d61b..00000000 Binary files a/lib/common/win32/2015/release/libjpeg.lib and /dev/null differ diff --git a/lib/common/win32/2015/release/libpng.lib b/lib/common/win32/2015/release/libpng.lib deleted file mode 100644 index 95be4942..00000000 Binary files a/lib/common/win32/2015/release/libpng.lib and /dev/null differ diff --git a/lib/public/SDL2.lib b/lib/public/SDL2.lib deleted file mode 100644 index 6b3bcebd..00000000 Binary files a/lib/public/SDL2.lib and /dev/null differ diff --git a/lib/public/ati_compress_mt_vc10.lib b/lib/public/ati_compress_mt_vc10.lib deleted file mode 100644 index 5e208cde..00000000 Binary files a/lib/public/ati_compress_mt_vc10.lib and /dev/null differ diff --git a/lib/public/ftol3.obj b/lib/public/ftol3.obj deleted file mode 100644 index dc9d9edb..00000000 Binary files a/lib/public/ftol3.obj and /dev/null differ diff --git a/lib/public/libz.lib b/lib/public/libz.lib deleted file mode 100644 index 805057c5..00000000 Binary files a/lib/public/libz.lib and /dev/null differ diff --git a/lib/public/nvtc.lib b/lib/public/nvtc.lib deleted file mode 100644 index 64356287..00000000 Binary files a/lib/public/nvtc.lib and /dev/null differ diff --git a/lib/public/openvr_api.lib b/lib/public/openvr_api.lib deleted file mode 100644 index a2dfe540..00000000 Binary files a/lib/public/openvr_api.lib and /dev/null differ diff --git a/lib/public/socketlib.lib b/lib/public/socketlib.lib deleted file mode 100644 index 002776c2..00000000 Binary files a/lib/public/socketlib.lib and /dev/null differ diff --git a/lib/public/steam_api.lib b/lib/public/steam_api.lib deleted file mode 100644 index 19566c19..00000000 Binary files a/lib/public/steam_api.lib and /dev/null differ diff --git a/materialsystem/cmatqueuedrendercontext.cpp b/materialsystem/cmatqueuedrendercontext.cpp index 157e34df..519e1f70 100644 --- a/materialsystem/cmatqueuedrendercontext.cpp +++ b/materialsystem/cmatqueuedrendercontext.cpp @@ -39,7 +39,9 @@ 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 PLATFORM_64BITS + memcpy( pDest, pSrc, BYTES_PER_FULL); + #else __asm { mov esi, pSrc @@ -63,6 +65,7 @@ void FastCopy( byte *pDest, const byte *pSrc, size_t nBytes ) movntps [edi + 96], xmm6 movntps [edi + 112], xmm7 } + #endif } nBytes -= nBytesFull; } diff --git a/materialsystem/shaderapidx9/wscript b/materialsystem/shaderapidx9/wscript index 6165d515..dba87469 100755 --- a/materialsystem/shaderapidx9/wscript +++ b/materialsystem/shaderapidx9/wscript @@ -44,6 +44,7 @@ def build(bld): 'vertexdecl.cpp', 'vertexshaderdx8.cpp', #'textureheap.cpp', [$X360] + '../../public/tier0/memoverride.cpp' ] if bld.env.DEST_OS == 'win32' and not bld.env.GL: @@ -54,8 +55,6 @@ def build(bld): if bld.env.DEST_OS != 'win32': source += ['winutils.cpp'] - else: - source += ['../../public/tier0/memoverride.cpp'] includes = [ '.', diff --git a/materialsystem/shaderapiempty/wscript b/materialsystem/shaderapiempty/wscript index 3dab5e41..5d927359 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/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20.inc b/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20.inc index 70bff4d1..b150aad0 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/wscript b/materialsystem/stdshaders/wscript index 66ec1c06..c9bc98c4 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 763870c1..7a758c59 100755 --- a/materialsystem/wscript +++ b/materialsystem/wscript @@ -44,18 +44,16 @@ def build(bld): 'cmatlightmaps.cpp', 'cmatrendercontext.cpp', 'cmatqueuedrendercontext.cpp', - 'ctexturecompositor.cpp' + 'ctexturecompositor.cpp', + '../public/tier0/memoverride.cpp' ] - if bld.env.DEST_OS == 'win32': - source += ['../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 f02bba6f..19dfd102 100644 --- a/mathlib/polyhedron.cpp +++ b/mathlib/polyhedron.cpp @@ -82,7 +82,7 @@ CPolyhedron_AllocByNew *CPolyhedron_AllocByNew::Allocate( unsigned short iVertic (iIndices * sizeof( Polyhedron_IndexedLineReference_t )) + (iPolygons * sizeof( Polyhedron_IndexedPolygon_t ))); - CPolyhedron_AllocByNew *pAllocated = new ( pMemory ) CPolyhedron_AllocByNew; + CPolyhedron_AllocByNew *pAllocated = (CPolyhedron_AllocByNew*)pMemory; pAllocated->iVertexCount = iVertices; pAllocated->iLineCount = iLines; diff --git a/particles/wscript b/particles/wscript index 8895f765..7c3a6087 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 0be5049f..cb924a3e 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/filesystem.h b/public/filesystem.h index 018b7e43..2009878c 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 f4478b8d..a90a712a 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 28393404..fde8d5ec 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 9f2c734b..80587c04 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/memalloc.h b/public/tier0/memalloc.h index 4ca4b04c..60fab0d1 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 ) diff --git a/public/tier0/threadtools.h b/public/tier0/threadtools.h index f9b1f63f..b99755fa 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(); diff --git a/public/tier1/reliabletimer.h b/public/tier1/reliabletimer.h index c830fbe3..1d067fc0 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/scenefilecache/wscript b/scenefilecache/wscript index 828c06d9..f1bd3fc9 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/masm.py b/scripts/waifulib/masm.py new file mode 100644 index 00000000..02ae054e --- /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 00000000..348c90dc --- /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 abb44275..4155f2b2 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 c310f391..21357418 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 ce8b9b50..1772be2e 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/wscript b/serverbrowser/wscript index 646b059c..755ae062 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,14 +40,10 @@ 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' ] - if bld.env.DEST_OS == 'win32': - source += [ - '../public/tier0/memoverride.cpp' - ] - includes = [ '.', '../public', diff --git a/soundemittersystem/soundemittersystembase.cpp b/soundemittersystem/soundemittersystembase.cpp index 41d01e38..ae7eb5ef 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 b1a2ec07..03f796f5 100755 --- a/soundemittersystem/wscript +++ b/soundemittersystem/wscript @@ -21,12 +21,10 @@ def build(bld): source = [ '../game/shared/interval.cpp', 'soundemittersystembase.cpp', - '../public/SoundParametersInternal.cpp' + '../public/SoundParametersInternal.cpp', + '../public/tier0/memoverride.cpp' ] - if bld.env.DEST_OS == 'win32': - source += ['../public/tier0/memoverride.cpp'] - includes = [ '.', '../public', diff --git a/soundsystem/soundsystem.cpp b/soundsystem/soundsystem.cpp index d48893a6..e69ae504 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/studiorender/r_studiodraw.cpp b/studiorender/r_studiodraw.cpp index 19748fd8..da6905fd 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/wscript b/studiorender/wscript index 2e6d7b5c..bf0b9fe3 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/tier0/memstd.cpp b/tier0/memstd.cpp index 595f6351..76d1fc87 100644 --- a/tier0/memstd.cpp +++ b/tier0/memstd.cpp @@ -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/wscript b/tier0/wscript index d97b94b8..1f0a9f34 100755 --- a/tier0/wscript +++ b/tier0/wscript @@ -56,6 +56,10 @@ def build(bld): 'vcrmode.cpp', 'win32consoleio.cpp' ] + if bld.env.DEST_CPU == 'amd64': + source += [ + 'InterlockedCompareExchange128.masm' + ] else: source += [ 'cpu_posix.cpp', diff --git a/tier1/interface.cpp b/tier1/interface.cpp index c16945c7..a4507fd4 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 ); diff --git a/tier1/processor_detect.cpp b/tier1/processor_detect.cpp index 0aabeb7a..54542d02 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 77685ec3..cb748566 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 4af8229a..66c29ae4 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', diff --git a/unicode/wscript b/unicode/wscript new file mode 100644 index 00000000..bcc4122c --- /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/vgui2/src/Surface.cpp b/vgui2/src/Surface.cpp index 51ad5186..81dc9503 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/wscript b/vgui2/src/wscript index ad76f5a2..0d7f67a7 100644 --- a/vgui2/src/wscript +++ b/vgui2/src/wscript @@ -34,14 +34,14 @@ def build(bld): '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', - '../../public/tier0/memoverride.cpp' + 'System.cpp' ] else: source += [ diff --git a/vgui2/vgui_controls/FileOpenDialog.cpp b/vgui2/vgui_controls/FileOpenDialog.cpp index ebe5eb0c..d4a098fc 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/vguimatsurface/wscript b/vguimatsurface/wscript index db0f3d05..a76de0b2 100644 --- a/vguimatsurface/wscript +++ b/vguimatsurface/wscript @@ -29,12 +29,12 @@ def build(bld): 'asanstubs.cpp', '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 += [ - '../public/tier0/memoverride.cpp', 'memorybitmap.cpp' ] diff --git a/video/wscript b/video/wscript index b30df1ad..e6b1beea 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 = [ diff --git a/vphysics/physics_collide.cpp b/vphysics/physics_collide.cpp index 1c2609f6..3770d91b 100644 --- a/vphysics/physics_collide.cpp +++ b/vphysics/physics_collide.cpp @@ -1637,8 +1637,8 @@ void CPhysicsCollision::VCollideLoad( vcollide_t *pOutput, int solidCount, const for ( int i = 0; i < solidCount; i++ ) { - int size; - memcpy( &size, pBuffer + position, sizeof(int) ); + int size = *(int*)(pBuffer + position); + // memcpy( &size, pBuffer + position, sizeof(int) ); position += sizeof(int); char *tmpbuf = new char[size]; diff --git a/vphysics/wscript b/vphysics/wscript index fb6d4fa2..c10384c6 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/vstdlib/wscript b/vstdlib/wscript index 0ed048e8..57a63633 100755 --- a/vstdlib/wscript +++ b/vstdlib/wscript @@ -31,6 +31,11 @@ def build(bld): source += [ 'processutils.cpp' ] + if bld.env.DEST_CPU == 'amd64': + source += [ + 'coroutine_win64.masm', + 'GetStackPtr64.masm' + ] includes = [ '.', diff --git a/wscript b/wscript index 526935a7..40d865c6 100644 --- a/wscript +++ b/wscript @@ -74,7 +74,8 @@ projects={ 'vphysics', 'vpklib', 'vstdlib', - 'vtf' + 'vtf', + 'unicode' ], 'dedicated': [ 'appframework', @@ -248,10 +249,13 @@ def configure(conf): # 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_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: @@ -265,7 +269,7 @@ def configure(conf): 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') @@ -332,7 +336,7 @@ def configure(conf): else: cflags += [ '/I'+os.path.abspath('.')+'/thirdparty/SDL', - '/arch:SSE', + '/arch:SSE' if conf.env.DEST_CPU == 'x86' else '/arch:AVX', '/GF', '/Gy', '/fp:fast', @@ -358,9 +362,9 @@ def configure(conf): ] linkflags += [ - '/LIBPATH:'+os.path.abspath('.')+'/lib/public', - '/LIBPATH:'+os.path.abspath('.')+'/lib/common/win32/2015/release', - '/LIBPATH:'+os.path.abspath('.')+'/dx9sdk/lib' + '/LIBPATH:'+os.path.abspath('.')+'/lib/win32/public/'+conf.env.DEST_CPU+'/', + '/LIBPATH:'+os.path.abspath('.')+'/lib/win32/common/'+conf.env.DEST_CPU+'/2015/release', + '/LIBPATH:'+os.path.abspath('.')+'/dx9sdk/lib/'+conf.env.DEST_CPU+'/' ] # And here C++ flags starts to be treated separately @@ -381,7 +385,7 @@ def configure(conf): conf.define('MSVC', 1) if conf.env.DEST_CPU == 'x86': conf.define('COMPILER_MSVC32', 1) - elif conf.env.DEST_CPU == 'x86_64': + elif conf.env.DEST_CPU in ['x86_64', 'amd64']: conf.define('COMPILER_MSVC64', 1) if conf.env.COMPILER_CC != 'msvc': @@ -400,7 +404,6 @@ def configure(conf): conf.env.append_unique('LINKFLAGS', linkflags) conf.env.append_unique('INCLUDES', [os.path.abspath('common/')]) - if conf.env.DEST_OS != 'android': if conf.env.DEST_OS != 'win32': if conf.options.SDL: @@ -467,8 +470,8 @@ def configure(conf): 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='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') @@ -476,6 +479,8 @@ def configure(conf): 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)