Compare commits

...

47 Commits
ios ... master

Author SHA1 Message Date
18051fd0de Test
Some checks failed
Build / build-linux-i386 (push) Successful in 13m32s
Build / build-linux-amd64 (push) Successful in 7m19s
Build / build-android-armv7a (push) Successful in 16m54s
Build / build-dedicated-linux-i386 (push) Successful in 11m53s
Build / build-dedicated-linux-amd64 (push) Successful in 6m9s
Tests / tests-linux-i386 (push) Successful in 4m4s
Tests / tests-linux-amd64 (push) Successful in 2m19s
Build / build-windows-i386 (push) Has been cancelled
Build / build-windows-amd64 (push) Has been cancelled
Build / build-dedicated-windows-i386 (push) Has been cancelled
Build / build-dedicated-windows-amd64 (push) Has been cancelled
Build / build-macos-amd64 (push) Has been cancelled
Build / build-dedicated-macos-amd64 (push) Has been cancelled
Tests / tests-macos-amd64 (push) Has been cancelled
Tests / tests-windows-i386 (push) Has been cancelled
Tests / tests-windows-amd64 (push) Has been cancelled
2024-10-28 13:17:45 +08:00
nillerusr
29985681a1
Merge pull request #312 from AruMoon/add-master-server
Add new master server
2023-12-30 11:44:00 +03:00
nillerusr
53cb673849
Merge pull request #328 from er2off/restrictfix
public/tier0/platform.h: Remove __restrict not only for linux
2023-12-30 11:43:48 +03:00
Er2
f72cf388aa public/tier0/platform.h: Remove __restrict not only for linux 2023-12-30 10:34:50 +03:00
nillerusr
87150cc028 ivp: update submodule 2023-12-24 04:24:44 +03:00
nillerusr
704b8aa98e
Merge pull request #323 from coderamen666/patch-1
Allow compilation on Raspberry Pi OS 32 bit
2023-12-13 22:57:38 +03:00
coderamen
c4f13f04a8
Allow compilation on Raspberry Pi OS 32 bit 2023-12-13 13:55:05 -06:00
nillerusr
f402495b24 wscript: make bzip2 mandatory #321 2023-12-13 21:38:18 +03:00
nillerusr
b45295ef7c dedicated(win32): fix crashes( now it works #310 #225 ) 2023-12-13 21:28:17 +03:00
nillerusr
327ea9dee7
Merge pull request #322 from dimhotepus/fix-dedicated-build
[Windows] Fix dedicated server build
2023-12-13 20:24:52 +03:00
nillerusr
ade05ab153 dedicated(win32): fix build issues #322 2023-12-13 20:18:31 +03:00
nillerusr
bfe1baf323
wscript(dedicated): try to fix windows build 2023-12-13 18:19:17 +03:00
nillerusr
a84ee9062c
wscript(dedicated): fix indentation 2023-12-13 18:10:34 +03:00
nillerusr
7c863a351b wscript(win32): restore FORCE parameter for multiple references #322
This is using to override debug crt functions.
Does anyone actually use this?
2023-12-13 17:38:02 +03:00
nillerusr
8fcac9c164 wscript(win32): disable /FORCE linker option added by accident #322 2023-12-13 17:25:20 +03:00
Dmitry Tsarevich
97f6cdfbe2
dedicated: Fix build on Windows 2023-12-02 23:59:49 +03:00
nillerusr
7a3b3cd96f return accidentally commented out engine module( fixes #315 ) 2023-11-28 06:47:35 +03:00
nillerusr
90e2937b32 update waf, enable gccdeps and msvcdeps 2023-11-24 11:28:25 +03:00
nillerusr
23204fcc73 wscipt: fix cant find env cache togl 2023-11-08 22:06:10 +03:00
nillerusr
abb470a471 fix build scripts for workflow 2023-11-08 21:58:33 +03:00
nillerusr
ab527be41a wscript: target 64bit architecture by default 2023-11-08 21:44:30 +03:00
nillerusr
cd1c5bd397 fix build for latest musl 2023-11-08 13:26:46 +00:00
AruMoon
8f8c2556b7 Add new master server 2023-10-25 05:18:51 +05:00
nillerusr
b8558de63e fix crash in some cases 2023-10-23 19:52:35 +03:00
nillerusr
047f8b1185 gameui: fix disconnect in video settings for multiplayer games 2023-10-08 02:40:43 +03:00
nillerusr
035861bf52 disable new/mallloc override on non-windows platforms( #299 ) 2023-10-08 00:50:14 +03:00
nillerusr
a7096679aa
Merge pull request #301 from tyabus/vguidrawtree
engine: Fixed vgui_drawtree on 64 bit engine
2023-10-07 22:09:19 +03:00
tyabus
1f3f05d14a engine: Fixed vgui_drawtree on 64 bit engine 2023-10-07 20:23:37 +06:00
nillerusr
c444095293 fix macOS build again 2023-10-07 04:40:28 +03:00
nillerusr
57f6bf6eea fix some undefined/unspecified behaviours in multiplayer games( may help with #299 ) 2023-10-07 05:04:46 +03:00
nillerusr
2636f1a66d fix macos build( maybe? #296 ) 2023-10-06 03:33:45 +03:00
nillerusr
e7addfc9ad materialsystem: fix color correction on non-windows systems( fixes #137 , #295 related ) 2023-10-06 04:19:51 +03:00
nillerusr
6447101546 Restore tslist for trace info( fix #295 ) 2023-10-05 19:36:24 +03:00
nillerusr
efeda62add fix crash on game close when demo recording 2023-10-04 22:22:31 +03:00
nillerusr
b7bd94c52e cstrike: fix uninitialized pointers in hud 2023-08-23 23:42:08 +03:00
nillerusr
1d4f7fb2cc change touch editor colors 2023-08-22 11:47:19 +03:00
nillerusr
b5d6051d98 cstrike: optimize flashbang 2023-08-22 11:38:13 +03:00
nillerusr
b73f3b70fa cstrike: add autojump convar 2023-08-22 11:11:39 +03:00
nillerusr
2d3f31d37e android: reset vsync after minimizing window 2023-08-18 15:40:38 +03:00
nillerusr
5ea9937457 android: fix black screen after minimizing window in materialsystem queue mode 2023-08-18 13:49:07 +03:00
nillerusr
601cfff164 game: fix touch transparency mode for cut scenes 2023-08-17 15:59:47 +03:00
nillerusr
4f10928299 inputsystem: fix UB in touch events callback, make touch more responsive 2023-08-17 14:31:43 +03:00
nillerusr
02a3c641a6 engine: fix loading static prop lump version 7 2023-08-15 16:47:35 +03:00
nillerusr
7f267853f4 vtf: fix vtf loading for windows arm( and for other platforms ) 2023-08-14 18:26:28 +03:00
nillerusr
3d0025b594 vtf: fix vtf header padding 2023-08-14 16:33:34 +03:00
nillerusr
b6cb0c2696 game: fix UB when reading mapcycle 2023-08-04 14:55:13 +03:00
nillerusr
8acf608b4d engine: optimize traces 2023-08-04 13:57:30 +03:00
66 changed files with 431 additions and 278 deletions

View File

@ -2,6 +2,7 @@ name: Build
on: [push, pull_request]
jobs:
build-linux-i386:
runs-on: ubuntu-latest
@ -38,7 +39,7 @@ jobs:
- name: Build windows-i386
run: |
git submodule init && git submodule update
./waf.bat configure -T debug
./waf.bat configure -T debug --32bits
./waf.bat build
build-windows-amd64:
@ -49,7 +50,7 @@ jobs:
- name: Build windows-amd64
run: |
git submodule init && git submodule update
./waf.bat configure -T debug -8
./waf.bat configure -T debug
./waf.bat build
build-dedicated-windows-i386:
@ -71,7 +72,7 @@ jobs:
- name: Build dedicated windows-amd64
run: |
git submodule init && git submodule update
./waf.bat configure -T debug -d -8
./waf.bat configure -T debug -d
./waf.bat build
build-dedicated-linux-i386:

View File

@ -38,7 +38,7 @@ jobs:
- name: Run tests windows-i386
run: |
git submodule init && git submodule update
./waf.bat configure -T release --tests --prefix=out/
./waf.bat configure -T release --tests --prefix=out/ --32bits
./waf.bat install
cd out
$env:Path = "bin";
@ -52,7 +52,7 @@ jobs:
- name: Run tests windows-amd64
run: |
git submodule init && git submodule update
./waf.bat configure -T release --tests --prefix=out/ -8
./waf.bat configure -T release --tests --prefix=out/
./waf.bat install
cd out
$env:Path = "bin";

View File

@ -404,6 +404,9 @@ private:
int m_MouseButtonDownX;
int m_MouseButtonDownY;
bool m_bResetVsync;
int m_nFramesToSkip;
double m_flPrevGLSwapWindowTime;
};
@ -584,6 +587,9 @@ InitReturnVal_t CSDLMgr::Init()
m_nWarpDelta = 0;
m_bRawInput = false;
m_nFramesToSkip = 0;
m_bResetVsync = false;
m_flPrevGLSwapWindowTime = 0.0f;
memset(m_pixelFormatAttribs, '\0', sizeof (m_pixelFormatAttribs));
@ -1431,7 +1437,20 @@ void CSDLMgr::ShowPixels( CShowPixelsParams *params )
m_flPrevGLSwapWindowTime = tm.GetDurationInProgress().GetMillisecondsF();
#ifdef ANDROID
// ADRENO GPU MOMENT, SKIP 5 FRAMES
if( m_bResetVsync )
{
if( m_nFramesToSkip <= 0 )
{
SDL_GL_SetSwapInterval(swapInterval);
m_bResetVsync = false;
}
else
m_nFramesToSkip--;
}
#endif
CheckGLError( __LINE__ );
}
#endif // DX_TO_GL_ABSTRACTION
@ -1887,6 +1906,7 @@ void CSDLMgr::PumpWindowsMessageLoop()
}
case SDL_WINDOWEVENT_FOCUS_GAINED:
{
m_bResetVsync = true; m_nFramesToSkip = 3;
m_bHasFocus = true;
SDL_ShowCursor( m_bCursorVisible ? 1 : 0 );
CCocoaEvent theEvent;

View File

@ -65,9 +65,12 @@ extern void longjmp( jmp_buf, int ) __attribute__((noreturn));
#define JPEGLIB_USE_STDIO
#if ANDROID
#include "android/jpeglib/jpeglib.h"
#else
#elif defined WIN32
#include "jpeglib/jpeglib.h"
#else
#include <jpeglib.h>
#endif
#undef JPEGLIB_USE_STDIO

View File

@ -278,7 +278,7 @@ bool CDedicatedAppSystemGroup::PreInit( )
return false;
#ifdef _WIN32
g_bVGui = !CommandLine()->CheckParm( "-console" );
g_bVGui = CommandLine()->CheckParm( "-vgui" );
#endif
CreateInterfaceFn factory = GetFactory();

View File

@ -38,7 +38,12 @@ def build(bld):
if bld.env.DEST_OS == 'win32':
source += [
'sys_windows.cpp'
'sys_windows.cpp',
'vgui/CreateMultiplayerGameServerPage.cpp',
'vgui/MainPanel.cpp',
'../public/vgui_controls/vgui_controls.cpp',
'vgui/vguihelpers.cpp',
'console/TextConsoleWin32.cpp'
]
else:
source += [
@ -59,6 +64,9 @@ def build(bld):
libs = ['tier0','vpklib','tier1','tier2','tier3','vstdlib','steam_api','appframework','mathlib', 'EDIT']
if bld.env.DEST_OS == 'win32':
libs += ['vgui_controls', 'USER32', 'SHELL32']
install_path = bld.env.LIBDIR
bld.shlib(

View File

@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
#include "windows.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

View File

@ -199,7 +199,7 @@ bool CNetworkStringTableItem::SetUserData( int tick, int length, const void *use
if ( length > 0 )
{
m_pUserData = new unsigned char[ length ];
m_pUserData = new unsigned char[ALIGN_VALUE( length, 4 )];
Q_memcpy( m_pUserData, userData, length );
}
else

View File

@ -706,11 +706,13 @@ bool CBaseClient::SendServerInfo( void )
serverinfo.WriteToBuffer( msg );
if ( IsX360() && serverinfo.m_nMaxClients > 1 )
#ifdef _X360
if ( serverinfo.m_nMaxClients > 1 )
{
Msg( "Telling clients to connect" );
g_pMatchmaking->TellClientsToConnect();
}
#endif
// send first tick
m_nSignonTick = m_Server->m_nTickCount;

View File

@ -686,7 +686,7 @@ void CDemoRecorder::CloseDemoFile()
m_DemoFile.Close();
g_ClientDLL->OnDemoRecordStop();
if( g_ClientDLL ) g_ClientDLL->OnDemoRecordStop();
}
m_bCloseDemoFile = false;

View File

@ -6,6 +6,7 @@
#include "client_pch.h"
#ifdef SWDS
#include "igame.h"
#include "hltvclientstate.h"
#include "convar.h"
#include "enginestats.h"
@ -37,9 +38,9 @@ bool CL_IsPortalDemo()
bool HandleRedirectAndDebugLog( const char *msg );
void BeginLoadingUpdates( MaterialNonInteractiveMode_t mode ) {}
//void BeginLoadingUpdates( MaterialNonInteractiveMode_t mode ) {}
//void EndLoadingUpdates() {}
void RefreshScreenIfNecessary() {}
void EndLoadingUpdates() {}
void Con_ColorPrintf( const Color& clr, const char *fmt, ... )

View File

@ -873,9 +873,9 @@ bool IntersectRayWithBoxBrush( TraceInfo_t *pTraceInfo, const cbrush_t *pBrush,
FPExceptionDisabler hideExceptions;
// Load the unaligned ray/box parameters into SIMD registers
fltx4 start = LoadUnaligned3SIMD(pTraceInfo->m_start.Base());
fltx4 extents = LoadUnaligned3SIMD(pTraceInfo->m_extents.Base());
fltx4 delta = LoadUnaligned3SIMD(pTraceInfo->m_delta.Base());
fltx4 start = LoadAlignedSIMD(pTraceInfo->m_start.Base());
fltx4 extents = LoadAlignedSIMD(pTraceInfo->m_extents.Base());
fltx4 delta = LoadAlignedSIMD(pTraceInfo->m_delta.Base());
fltx4 boxMins = LoadAlignedSIMD( pBox->mins.Base() );
fltx4 boxMaxs = LoadAlignedSIMD( pBox->maxs.Base() );
@ -899,7 +899,7 @@ bool IntersectRayWithBoxBrush( TraceInfo_t *pTraceInfo, const cbrush_t *pBrush,
fltx4 crossPlane = OrSIMD(XorSIMD(startOutMins,endOutMins), XorSIMD(startOutMaxs,endOutMaxs));
// now build the per-axis interval of t for intersections
fltx4 invDelta = LoadUnaligned3SIMD(pTraceInfo->m_invDelta.Base());
fltx4 invDelta = LoadAlignedSIMD(pTraceInfo->m_invDelta.Base());
fltx4 tmins = MulSIMD( offsetMinsExpanded, invDelta );
fltx4 tmaxs = MulSIMD( offsetMaxsExpanded, invDelta );
// now sort the interval per axis
@ -1037,9 +1037,9 @@ bool IntersectRayWithBox( const Ray_t &ray, const VectorAligned &inInvDelta, con
pTrace->fraction = 1.0f;
// Load the unaligned ray/box parameters into SIMD registers
fltx4 start = LoadUnaligned3SIMD(ray.m_Start.Base());
fltx4 extents = LoadUnaligned3SIMD(ray.m_Extents.Base());
fltx4 delta = LoadUnaligned3SIMD(ray.m_Delta.Base());
fltx4 start = LoadAlignedSIMD(ray.m_Start.Base());
fltx4 extents = LoadAlignedSIMD(ray.m_Extents.Base());
fltx4 delta = LoadAlignedSIMD(ray.m_Delta.Base());
fltx4 boxMins = LoadAlignedSIMD( inBoxMins.Base() );
fltx4 boxMaxs = LoadAlignedSIMD( inBoxMaxs.Base() );
@ -1372,9 +1372,9 @@ void FASTCALL CM_ClipBoxToBrush( TraceInfo_t * RESTRICT pTraceInfo, const cbrush
inline bool IsTraceBoxIntersectingBoxBrush( TraceInfo_t *pTraceInfo, cboxbrush_t *pBox )
{
fltx4 start = LoadUnaligned3SIMD(pTraceInfo->m_start.Base());
fltx4 mins = LoadUnaligned3SIMD(pTraceInfo->m_mins.Base());
fltx4 maxs = LoadUnaligned3SIMD(pTraceInfo->m_maxs.Base());
fltx4 start = LoadAlignedSIMD(pTraceInfo->m_start.Base());
fltx4 mins = LoadAlignedSIMD(pTraceInfo->m_mins.Base());
fltx4 maxs = LoadAlignedSIMD(pTraceInfo->m_maxs.Base());
fltx4 boxMins = LoadAlignedSIMD( pBox->mins.Base() );
fltx4 boxMaxs = LoadAlignedSIMD( pBox->maxs.Base() );
@ -1569,15 +1569,15 @@ void FASTCALL CM_TraceToLeaf( TraceInfo_t * RESTRICT pTraceInfo, int ndxLeaf, fl
if (IsX360())
{
// set up some relatively constant variables we'll use in the loop below
fltx4 traceStart = LoadUnaligned3SIMD(pTraceInfo->m_start.Base());
fltx4 traceDelta = LoadUnaligned3SIMD(pTraceInfo->m_delta.Base());
fltx4 traceInvDelta = LoadUnaligned3SIMD(pTraceInfo->m_invDelta.Base());
fltx4 traceStart = LoadAlignedSIMD(pTraceInfo->m_start.Base());
fltx4 traceDelta = LoadAlignedSIMD(pTraceInfo->m_delta.Base());
fltx4 traceInvDelta = LoadAlignedSIMD(pTraceInfo->m_invDelta.Base());
static const fltx4 vecEpsilon = {DISPCOLL_DIST_EPSILON,DISPCOLL_DIST_EPSILON,DISPCOLL_DIST_EPSILON,DISPCOLL_DIST_EPSILON};
// only used in !IS_POINT version:
fltx4 extents;
if (!IS_POINT)
{
extents = LoadUnaligned3SIMD(pTraceInfo->m_extents.Base());
extents = LoadAlignedSIMD(pTraceInfo->m_extents.Base());
}
// TODO: this loop probably ought to be unrolled so that we can make a more efficient

View File

@ -42,13 +42,13 @@ struct TraceInfo_t
m_nCheckDepth = -1;
}
Vector m_start;
Vector m_end;
Vector m_mins;
Vector m_maxs;
Vector m_extents;
Vector m_delta;
Vector m_invDelta;
VectorAligned m_start;
VectorAligned m_end;
VectorAligned m_mins;
VectorAligned m_maxs;
VectorAligned m_extents;
VectorAligned m_delta;
VectorAligned m_invDelta;
trace_t m_trace;
trace_t m_stabTrace;

View File

@ -97,22 +97,19 @@ COM_ExplainDisconnection
*/
void COM_ExplainDisconnection( bool bPrint, const char *fmt, ... )
{
if ( IsX360() )
{
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
}
else
{
va_list argptr;
char string[1024];
#ifdef _X360
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
#else
va_list argptr;
char string[1024];
va_start (argptr, fmt);
Q_vsnprintf(string, sizeof( string ), fmt,argptr);
va_end (argptr);
va_start (argptr, fmt);
Q_vsnprintf(string, sizeof( string ), fmt,argptr);
va_end (argptr);
Q_strncpy( gszDisconnectReason, string, 256 );
gfExtendedError = true;
}
Q_strncpy( gszDisconnectReason, string, 256 );
gfExtendedError = true;
#endif
if ( bPrint )
{
@ -146,21 +143,18 @@ COM_ExtendedExplainDisconnection
*/
void COM_ExtendedExplainDisconnection( bool bPrint, const char *fmt, ... )
{
if ( IsX360() )
{
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
}
else
{
va_list argptr;
char string[1024];
va_start (argptr, fmt);
Q_vsnprintf(string, sizeof( string ), fmt,argptr);
va_end (argptr);
#ifdef _X360
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
#else
va_list argptr;
char string[1024];
Q_strncpy( gszExtendedDisconnectReason, string, 256 );
}
va_start (argptr, fmt);
Q_vsnprintf(string, sizeof( string ), fmt,argptr);
va_end (argptr);
Q_strncpy( gszExtendedDisconnectReason, string, 256 );
#endif
if ( bPrint )
{

View File

@ -921,7 +921,7 @@ void DownloadThread( void *voidPtr )
// Delete rc.data, which was allocated in this thread
if ( rc.data != NULL )
{
delete[] rc.data;
free(rc.data);
rc.data = NULL;
}

View File

@ -3500,10 +3500,12 @@ void _Host_RunFrame (float time)
//-------------------
_Host_RunFrame_Sound();
#ifndef DEDICATED
if ( g_bVCRSingleStep )
{
VCR_EnterPausedState();
}
#endif
}
else
{

View File

@ -4353,20 +4353,20 @@ ModelInstanceHandle_t CModelRender::CreateInstance( IClientRenderable *pRenderab
// validate static color meshes once, now at load/create time
ValidateStaticPropColorData( handle );
// 360 persists the color meshes across same map loads
if ( !IsX360() || instance.m_ColorMeshHandle == DC_INVALID_HANDLE )
#ifdef _X360
if ( r_decalstaticprops.GetBool() && instance.m_LightCacheHandle )
instance.m_AmbientLightingState = *(LightcacheGetStatic( *pCache, NULL, LIGHTCACHEFLAGS_STATIC ));
#else
if ( instance.m_ColorMeshHandle == DC_INVALID_HANDLE )
{
// builds out color meshes or loads disk colors, now at load/create time
RecomputeStaticLighting( handle );
}
else
if ( r_decalstaticprops.GetBool() && instance.m_LightCacheHandle )
{
instance.m_AmbientLightingState = *(LightcacheGetStatic( *pCache, NULL, LIGHTCACHEFLAGS_STATIC ));
}
#endif
}
return handle;
}

View File

@ -31,7 +31,8 @@ extern ConVar sv_lan;
static char g_MasterServers[][64] =
{
"185.192.97.130:27010",
"168.138.92.21:27016"
"168.138.92.21:27016",
"135.125.188.162:27010"
};
#ifdef DEDICATED

View File

@ -226,7 +226,7 @@ bool CPureServerWhitelist::LoadCommandsFromKeyValues( KeyValues *kv )
else
Warning( "Unknown modifier in whitelist file: %s.\n", mods[i] );
}
mods.PurgeAndDeleteElements();
mods.PurgeAndDeleteElementsArray();
if (
( bFromTrustedSource && ( bAllowFromDisk || bCheckCRC || bAny ) )
|| ( bAny && bCheckCRC ) )

View File

@ -987,7 +987,7 @@ private:
int m_iTree;
};
/*
class CIntersectPoint : public CPartitionVisitor
{
public:
@ -1009,7 +1009,7 @@ public:
private:
fltx4 m_f4Point;
};
*/
class CIntersectBox : public CPartitionVisitor
{
@ -1040,8 +1040,8 @@ class CIntersectRay : public CPartitionVisitor
public:
CIntersectRay( CVoxelTree *pPartition, const Ray_t &ray, const Vector &vecInvDelta ) : CPartitionVisitor( pPartition )
{
m_f4Start = LoadUnaligned3SIMD( ray.m_Start.Base() );
m_f4Delta = LoadUnaligned3SIMD( ray.m_Delta.Base() );
m_f4Start = LoadAlignedSIMD( ray.m_Start.Base() );
m_f4Delta = LoadAlignedSIMD( ray.m_Delta.Base() );
m_f4InvDelta = LoadUnaligned3SIMD( vecInvDelta.Base() );
}
@ -1069,10 +1069,10 @@ class CIntersectSweptBox : public CPartitionVisitor
public:
CIntersectSweptBox( CVoxelTree *pPartition, const Ray_t &ray, const Vector &vecInvDelta ) : CPartitionVisitor( pPartition )
{
m_f4Start = LoadUnaligned3SIMD( ray.m_Start.Base() );
m_f4Delta = LoadUnaligned3SIMD( ray.m_Delta.Base() );
m_f4Start = LoadAlignedSIMD( ray.m_Start.Base() );
m_f4Delta = LoadAlignedSIMD( ray.m_Delta.Base() );
m_f4Extents = LoadAlignedSIMD( ray.m_Extents.Base() );
m_f4InvDelta = LoadUnaligned3SIMD( vecInvDelta.Base() );
m_f4Extents = LoadUnaligned3SIMD( ray.m_Extents.Base() );
}
bool Intersects( const float *pMins, const float *pMaxs ) const

View File

@ -1339,7 +1339,6 @@ void CStaticPropMgr::UnserializeModels( CUtlBuffer& buf )
case 5: UnserializeLump<StaticPropLumpV5_t>(&lump, buf); break;
case 6: UnserializeLump<StaticPropLumpV6_t>(&lump, buf); break;
case 7: // Falls down to version 10. We promoted TF to version 10 to deal with SFM.
case 9: UnserializeLump<StaticPropLumpV9_t>(&lump, buf); break;
case 10:
{
if( s_MapVersion == 21 )
@ -1348,7 +1347,8 @@ void CStaticPropMgr::UnserializeModels( CUtlBuffer& buf )
UnserializeLump<StaticPropLumpV10_t>(&lump, buf);
break;
}
case 11: UnserializeLump<StaticPropLumpV11_t>(&lump, buf);
case 9: UnserializeLump<StaticPropLumpV9_t>(&lump, buf); break;
case 11: UnserializeLump<StaticPropLumpV11_t>(&lump, buf); break;
default:
Assert("Unexpected version while deserializing lumps.");
}

View File

@ -1227,7 +1227,7 @@ void SV_DetermineMulticastRecipients( bool usepas, const Vector& origin, CBitVec
serverGameClients->ClientEarPosition( pClient->edict, &vecEarPosition );
int iBitNumber = CM_LeafCluster( CM_PointLeafnum( vecEarPosition ) );
if ( !(pMask[iBitNumber>>3] & (1<<(iBitNumber&7)) ) )
if ( iBitNumber < 0 || !(pMask[iBitNumber>>3] & (1<<(iBitNumber&7)) ) )
continue;
playerbits.Set( i );

View File

@ -1534,7 +1534,7 @@ void Sys_NoCrashDialog()
void Sys_TestSendKey( const char *pKey )
{
#if defined(_WIN32) && !defined(USE_SDL) && !defined(_XBOX)
#if defined(_WIN32) && !defined(USE_SDL) && !defined(_XBOX) && !defined(DEDICATED)
int key = pKey[0];
if ( pKey[0] == '\\' && pKey[1] == 'r' )
{

View File

@ -263,7 +263,6 @@ GameMessageHandler_t g_GameMessageHandlers[] =
{ IE_Quit, &CGame::HandleMsg_Close },
};
void CGame::AppActivate( bool fActive )
{
// If text mode, force it to be active.
@ -299,8 +298,18 @@ void CGame::AppActivate( bool fActive )
// Clear keyboard states (should be cleared already but...)
// VGui_ActivateMouse will reactivate the mouse soon.
ClearIOStates();
UpdateMaterialSystemConfig();
#ifdef ANDROID
ConVarRef mat_queue_mode( "mat_queue_mode" );
// Hack to reset internal queue buffers
int nSavedQueueMode = mat_queue_mode.GetInt();
mat_queue_mode.SetValue( 0 );
materials->BeginFrame( host_frametime );
materials->EndFrame();
mat_queue_mode.SetValue( nSavedQueueMode );
#endif
}
else
{
@ -355,7 +364,7 @@ void CGame::HandleMsg_Close( const InputEvent_t &event )
void CGame::DispatchInputEvent( const InputEvent_t &event )
{
switch( event.m_nType & 0xFFFF )
switch( event.m_nType )
{
// Handle button events specially,
// since we have all manner of crazy filtering going on when dealing with them

View File

@ -1842,7 +1842,7 @@ void CVEngineServer::PlaybackTempEntity( IRecipientFilter& filter, float delay,
newEvent->bits = buffer.GetNumBitsWritten();
int size = Bits2Bytes( buffer.GetNumBitsWritten() );
newEvent->pData = new byte[size];
newEvent->pData = new byte[ALIGN_VALUE(size,4)];
Q_memcpy( newEvent->pData, data, size );
// add to list

View File

@ -268,7 +268,7 @@ public:
if ( data )
{
g_DrawTreeSelectedPanel = (data) ? (vgui::VPANEL)data->GetInt( "PanelPtr", 0 ) : 0;
g_DrawTreeSelectedPanel = (data) ? (vgui::VPANEL)data->GetPtr( "PanelPtr", 0 ) : 0;
}
else
{
@ -388,7 +388,7 @@ void VGui_RecursivePrintTree(
Q_snprintf( str, sizeof( str ), "%s", name );
pVal->SetString( "Text", str );
pVal->SetInt( "PanelPtr", current );
pVal->SetPtr( "PanelPtr", (void*)current );
pNewParent = pVal;
@ -417,7 +417,7 @@ bool UpdateItemState(
vgui::IPanel *ipanel = vgui::ipanel();
KeyValues *pItemData = pTree->GetItemData( iChildItemId );
if ( pItemData->GetInt( "PanelPtr" ) != pSub->GetInt( "PanelPtr" ) ||
if ( pItemData->GetPtr( "PanelPtr" ) != pSub->GetPtr( "PanelPtr" ) ||
Q_stricmp( pItemData->GetString( "Text" ), pSub->GetString( "Text" ) ) != 0 )
{
pTree->ModifyItem( iChildItemId, pSub );
@ -425,7 +425,7 @@ bool UpdateItemState(
}
// Ok, this is a new panel.
vgui::VPANEL vPanel = pSub->GetInt( "PanelPtr" );
vgui::VPANEL vPanel = (vgui::VPANEL)pSub->GetPtr( "PanelPtr" );
int iBaseColor[3] = { 255, 255, 255 };
if ( ipanel->IsPopup( vPanel ) )
@ -433,7 +433,7 @@ bool UpdateItemState(
iBaseColor[0] = 255; iBaseColor[1] = 255; iBaseColor[2] = 0;
}
if ( g_FocusPanelList.Find( vPanel ) != -1 )
if ( g_FocusPanelList.Find( vPanel ) != vgui::INVALID_PANEL )
{
iBaseColor[0] = 0; iBaseColor[1] = 255; iBaseColor[2] = 0;
pTree->ExpandItem( iChildItemId, true );

View File

@ -212,25 +212,24 @@ def build(bld):
]
if bld.env.DEST_OS != "darwin":
source += ['audio/snd_dev_sdl.cpp']
source_win = [
'audio/snd_dev_direct.cpp',
'audio/snd_dev_wave.cpp',
'audio/voice_mixer_controls.cpp',
'audio/voice_record_dsound.cpp'
]
if bld.env.DEST_OS == 'win32':
source += [
'../public/tier0/memoverride.cpp',
'audio/snd_dev_direct.cpp',
'audio/snd_dev_wave.cpp',
'audio/voice_mixer_controls.cpp',
'audio/voice_record_dsound.cpp',
]
source += ['../public/tier0/memoverride.cpp']
else:
source += [
'sys_linuxwind.cpp',
'audio/snd_posix.cpp',
]
source += ['audio/snd_posix.cpp']
if bld.env.DEDICATED:
source += ['cl_null.cpp']
source += ['cl_null.cpp', 'sys_stubwind.cpp']
else:
source += source_win if bld.env.DEST_OS == 'win32' else ['sys_stubwind.cpp']
source += [
'client_pch.cpp',
'cl_rcon.cpp',

View File

@ -4203,7 +4203,7 @@ bool CBaseFileSystem::FindNextFileInVPKOrPakHelper( FindData_t *pFindData )
{
V_strncpy( pFindData->findData.cFileName, V_UnqualifiedFileName( pFindData->m_fileMatchesFromVPKOrPak[0] ), sizeof( pFindData->findData.cFileName ) );
pFindData->findData.dwFileAttributes = 0;
delete pFindData->m_fileMatchesFromVPKOrPak.Head();
delete[] pFindData->m_fileMatchesFromVPKOrPak.Head();
pFindData->m_fileMatchesFromVPKOrPak.RemoveMultipleFromHead( 1 );
return true;

View File

@ -729,7 +729,7 @@ public:
void PrecacheMaterial( const char *pMaterialName );
virtual bool IsConnectedUserInfoChangeAllowed( IConVar *pCvar );
virtual void IN_TouchEvent( uint data, uint data2, uint data3, uint data4 );
virtual void IN_TouchEvent( int type, int fingerId, int x, int y );
private:
void UncacheAllMaterials( );
@ -1631,6 +1631,7 @@ void CHLClient::LevelInitPreEntity( char const* pMapName )
g_RagdollLVManager.SetLowViolence( pMapName );
gHUD.LevelInit();
gTouch.LevelInit();
#if defined( REPLAY_ENABLED )
// Initialize replay ragdoll recorder
@ -2637,24 +2638,20 @@ CSteamID GetSteamIDForPlayerIndex( int iPlayerIndex )
#endif
void CHLClient::IN_TouchEvent( uint data, uint data2, uint data3, uint data4 )
void CHLClient::IN_TouchEvent( int type, int fingerId, int x, int y )
{
if( enginevgui->IsGameUIVisible() )
return;
touch_event_t ev;
ev.type = data & 0xFFFF;
ev.fingerid = (data >> 16) & 0xFFFF;
ev.x = (double)((data2 >> 16) & 0xFFFF) / 0xFFFF;
ev.y = (double)(data2 & 0xFFFF) / 0xFFFF;
ev.type = type;
ev.fingerid = fingerId;
memcpy( &ev.x, &x, sizeof(ev.x) );
memcpy( &ev.y, &y, sizeof(ev.y) );
union{uint i;float f;} ifconv;
ifconv.i = data3;
ev.dx = ifconv.f;
ifconv.i = data4;
ev.dy = ifconv.f;
if( type == IE_FingerMotion )
inputsystem->GetTouchAccumulators( fingerId, ev.dx, ev.dy );
gTouch.ProcessEvent( &ev );
}

View File

@ -72,7 +72,7 @@ DECLARE_HUDELEMENT( CHudHealth );
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CHudHealth::CHudHealth( const char *pElementName ) : CHudElement( pElementName ), CHudNumericDisplay(NULL, "HudHealth")
CHudHealth::CHudHealth( const char *pElementName ) : CHudElement( pElementName ), CHudNumericDisplay(NULL, "HudHealth"), m_pHealthIcon( NULL )
{
SetHiddenBits( HIDEHUD_HEALTH | HIDEHUD_PLAYERDEAD );
}
@ -172,4 +172,4 @@ void CHudHealth::Paint( void )
//draw the health icon
BaseClass::Paint();
}
}

View File

@ -152,13 +152,13 @@ void CCSViewRender::PerformNightVisionEffect( const CViewSetup &view )
render->ViewDrawFade( overlaycolor, pMaterial );
// Only one pass in DX7.
if ( g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 80 )
/* if ( g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 80 )
{
CMatRenderContextPtr pRenderContext( materials );
pRenderContext->DrawScreenSpaceQuad( pMaterial );
render->ViewDrawFade( overlaycolor, pMaterial );
pRenderContext->DrawScreenSpaceQuad( pMaterial );
}
}*/
}
}
}
@ -211,6 +211,7 @@ void CCSViewRender::PerformFlashbangEffect( const CViewSetup &view )
render->ViewDrawFade( overlaycolor, pMaterial );
// just do one pass for dxlevel < 80.
/*
if (g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 80)
{
pRenderContext->DrawScreenSpaceRectangle( pMaterial, view.x, view.y, view.width, view.height,
@ -221,6 +222,7 @@ void CCSViewRender::PerformFlashbangEffect( const CViewSetup &view )
0, 0, m_pFlashTexture->GetActualWidth()-1, m_pFlashTexture->GetActualHeight()-1,
m_pFlashTexture->GetActualWidth(), m_pFlashTexture->GetActualHeight() );
}
*/
}
else if ( m_pFlashTexture )
{
@ -233,7 +235,7 @@ void CCSViewRender::PerformFlashbangEffect( const CViewSetup &view )
render->ViewDrawFade( overlaycolor, pMaterial );
// just do one pass for dxlevel < 80.
if (g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 80)
/* if (g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 80)
{
pRenderContext->DrawScreenSpaceRectangle( pMaterial, view.x, view.y, view.width, view.height,
0, 0, m_pFlashTexture->GetActualWidth()-1, m_pFlashTexture->GetActualHeight()-1,
@ -242,7 +244,7 @@ void CCSViewRender::PerformFlashbangEffect( const CViewSetup &view )
pRenderContext->DrawScreenSpaceRectangle( pMaterial, view.x, view.y, view.width, view.height,
0, 0, m_pFlashTexture->GetActualWidth()-1, m_pFlashTexture->GetActualHeight()-1,
m_pFlashTexture->GetActualWidth(), m_pFlashTexture->GetActualHeight() );
}
}*/
}
// this does the pure white overlay part of the flashbang effect.

View File

@ -47,7 +47,7 @@ private:
DECLARE_HUDELEMENT( CHudArmor );
CHudArmor::CHudArmor( const char *pName ) : CHudNumericDisplay( NULL, "HudArmor" ), CHudElement( pName )
CHudArmor::CHudArmor( const char *pName ) : CHudNumericDisplay( NULL, "HudArmor" ), CHudElement( pName ), m_pArmorIcon( NULL )
{
SetHiddenBits( HIDEHUD_HEALTH | HIDEHUD_PLAYERDEAD );
}

View File

@ -115,7 +115,7 @@ void CTeamMenu::ApplySchemeSettings(IScheme *pScheme)
if ( *m_szMapName )
{
LoadMapPage( m_szMapName ); // reload the map description to pick up the color
LoadMapPage( NULL ); // reload the map description to pick up the color
}
}
@ -185,22 +185,23 @@ void CTeamMenu::Update()
void CTeamMenu::LoadMapPage( const char *mapName )
{
// Save off the map name so we can re-load the page in ApplySchemeSettings().
Q_strncpy( m_szMapName, mapName, strlen( mapName ) + 1 );
if( mapName )
Q_strncpy( m_szMapName, mapName, strlen( mapName ) + 1 );
char mapRES[ MAX_PATH ];
char uilanguage[ 64 ];
uilanguage[0] = 0;
engine->GetUILanguage( uilanguage, sizeof( uilanguage ) );
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_%s.html", mapName, uilanguage );
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_%s.html", m_szMapName, uilanguage );
bool bFoundHTML = false;
if ( !g_pFullFileSystem->FileExists( mapRES ) )
{
// try english
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_english.html", mapName );
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_english.html", m_szMapName );
}
else
{
@ -240,7 +241,7 @@ void CTeamMenu::LoadMapPage( const char *mapName )
#endif
}
Q_snprintf( mapRES, sizeof( mapRES ), "maps/%s.txt", mapName);
Q_snprintf( mapRES, sizeof( mapRES ), "maps/%s.txt", m_szMapName);
// if no map specific description exists, load default text
if( !g_pFullFileSystem->FileExists( mapRES ) )

View File

@ -313,7 +313,7 @@ void CTouchControls::ResetToDefaults()
{
rgba_t color(255, 255, 255, 155);
char buf[MAX_PATH];
gridcolor = rgba_t(255, 0, 0, 50);
gridcolor = rgba_t(255, 0, 0, 30);
RemoveButtons();
@ -372,7 +372,7 @@ void CTouchControls::Init()
mouse_events = 0;
move_start_x = move_start_y = 0.0f;
m_flPreviousYaw = m_flPreviousPitch = 0.f;
gridcolor = rgba_t(255, 0, 0, 50);
gridcolor = rgba_t(255, 0, 0, 30);
m_bCutScene = false;
showtexture = hidetexture = resettexture = closetexture = joytexture = 0;
@ -425,6 +425,13 @@ void CTouchControls::Init()
initialized = true;
}
void CTouchControls::LevelInit()
{
m_bCutScene = false;
m_AlphaDiff = 0;
m_flHideTouch = 0;
}
int nextPowerOfTwo(int x)
{
if( (x & (x - 1)) == 0)
@ -652,6 +659,8 @@ void CTouchControls::Paint()
CUtlLinkedList<CTouchButton*>::iterator it;
const rgba_t buttonEditClr = rgba_t( 61, 153, 0, 40 );
if( state == state_edit )
{
vgui::surface()->DrawSetColor(gridcolor.r, gridcolor.g, gridcolor.b, gridcolor.a*3); // 255, 0, 0, 200 <- default here
@ -678,7 +687,7 @@ void CTouchControls::Paint()
g_pMatSystemSurface->DrawColoredText( 2, btn->x1*screen_w, btn->y1*screen_h+40, 255, 255, 255, 255, "RGBA: %d %d %d %d", btn->color.r, btn->color.g, btn->color.b, btn->color.a );// color
}
vgui::surface()->DrawSetColor(gridcolor.r, gridcolor.g, gridcolor.b, gridcolor.a); // 255, 0, 0, 50 <- default here
vgui::surface()->DrawSetColor(buttonEditClr.r, buttonEditClr.g, buttonEditClr.b, buttonEditClr.a); // 255, 0, 0, 50 <- default here
vgui::surface()->DrawFilledRect( btn->x1*screen_w, btn->y1*screen_h, btn->x2*screen_w, btn->y2*screen_h );
}
}

View File

@ -161,6 +161,7 @@ class CTouchControls
{
public:
void Init( );
void LevelInit( );
void Shutdown( );
void Paint( );

View File

@ -28,7 +28,7 @@ extern bool g_bMovementOptimizations;
ConVar sv_timebetweenducks( "sv_timebetweenducks", "0", FCVAR_REPLICATED, "Minimum time before recognizing consecutive duck key", true, 0.0, true, 2.0 );
ConVar sv_enableboost( "sv_enableboost", "0", FCVAR_REPLICATED | FCVAR_NOTIFY, "Allow boost exploits");
ConVar cs_autojump( "cs_autojump", "0", FCVAR_REPLICATED | FCVAR_NOTIFY );
class CCSGameMovement : public CGameMovement
{
@ -691,8 +691,11 @@ bool CCSGameMovement::CheckJumpButton( void )
return false; // in air, so no effect
}
if ( mv->m_nOldButtons & IN_JUMP )
if ( (mv->m_nOldButtons & IN_JUMP) &&
(!cs_autojump.GetBool() && m_pCSPlayer->GetGroundEntity()) )
{
return false; // don't pogo stick
}
if ( !sv_enablebunnyhopping.GetBool() )
{

View File

@ -1151,12 +1151,14 @@ ConVarRef suitcharger( "sk_suitcharger" );
void StripChar(char *szBuffer, const char cWhiteSpace )
{
char *src, *dst;
while ( char *pSpace = strchr( szBuffer, cWhiteSpace ) )
for (src = dst = szBuffer; *src != '\0'; src++)
{
char *pNextChar = pSpace + sizeof(char);
V_strcpy( pSpace, pNextChar );
*dst = *src;
if (*dst != cWhiteSpace) dst++;
}
*dst = '\0';
}
void CMultiplayRules::GetNextLevelName( char *pszNextMap, int bufsize, bool bRandom /* = false */ )

View File

@ -508,7 +508,7 @@ public:
if ( panel == m_pDXLevel && RequiresRestart() )
{
// notify the user that this will require a disconnect
QueryBox *box = new QueryBox("#GameUI_SettingRequiresDisconnect_Title", "#GameUI_SettingRequiresDisconnect_Info");
QueryBox *box = new QueryBox("#GameUI_SettingRequiresDisconnect_Title", "#GameUI_SettingRequiresDisconnect_Info", this);
box->AddActionSignalTarget( this );
box->SetCancelCommand(new KeyValues("ResetDXLevelCombo"));
box->DoModal();

View File

@ -1530,16 +1530,6 @@ bool CInputSystem::GetRawMouseAccumulators( int& accumX, int& accumY )
#endif
}
bool CInputSystem::GetTouchAccumulators( InputEventType_t &event, int &fingerId, int& accumX, int& accumY )
{
event = m_touchAccumEvent;
fingerId = m_touchAccumFingerId;
accumX = m_touchAccumX;
accumY = m_touchAccumY;
return m_bJoystickInitialized;
}
void CInputSystem::SetConsoleTextMode( bool bConsoleTextMode )
{
/* If someone calls this after init, shut it down. */

View File

@ -44,6 +44,8 @@
#include "steam/steam_api.h"
#define TOUCH_FINGER_MAX_COUNT 10
//-----------------------------------------------------------------------------
// Implementation of the input system
//-----------------------------------------------------------------------------
@ -101,7 +103,7 @@ public:
virtual void *GetHapticsInterfaceAddress() const { return NULL;}
#endif
bool GetRawMouseAccumulators( int& accumX, int& accumY );
bool GetTouchAccumulators( InputEventType_t &event, int &fingerId, int& accumX, int& accumY );
virtual bool GetTouchAccumulators( int fingerId, float &dx, float &dy );
virtual void SetConsoleTextMode( bool bConsoleTextMode );
@ -458,8 +460,7 @@ public:
bool m_bRawInputSupported;
int m_mouseRawAccumX, m_mouseRawAccumY;
InputEventType_t m_touchAccumEvent;
int m_touchAccumFingerId, m_touchAccumX, m_touchAccumY;
float m_touchAccumX[TOUCH_FINGER_MAX_COUNT], m_touchAccumY[TOUCH_FINGER_MAX_COUNT];
// For the 'SleepUntilInput' feature
HANDLE m_hEvent;

View File

@ -48,6 +48,9 @@ void CInputSystem::InitializeTouch( void )
// abort startup if user requests no touch
if ( CommandLine()->FindParm("-notouch") ) return;
memset( m_touchAccumX, 0, sizeof(m_touchAccumX) );
memset( m_touchAccumY, 0, sizeof(m_touchAccumY) );
m_bJoystickInitialized = true;
SDL_AddEventWatch(TouchSDLWatcher, this);
}
@ -61,20 +64,35 @@ void CInputSystem::ShutdownTouch()
m_bTouchInitialized = false;
}
bool CInputSystem::GetTouchAccumulators( int fingerId, float &dx, float &dy )
{
dx = m_touchAccumX[fingerId];
dy = m_touchAccumY[fingerId];
m_touchAccumX[fingerId] = m_touchAccumY[fingerId] = 0.f;
return true;
}
void CInputSystem::FingerEvent(int eventType, int fingerId, float x, float y, float dx, float dy)
{
// Shit, but should work with arm/x86
if( fingerId >= TOUCH_FINGER_MAX_COUNT )
return;
int data0 = fingerId << 16 | eventType;
int _x = (int)((double)x*0xFFFF);
int _y = (int)((double)y*0xFFFF);
int data1 = _x << 16 | (_y & 0xFFFF);
if( eventType == IE_FingerUp )
{
m_touchAccumX[fingerId] = 0.f;
m_touchAccumY[fingerId] = 0.f;
}
else
{
m_touchAccumX[fingerId] += dx;
m_touchAccumY[fingerId] += dy;
}
union{int i;float f;} ifconv;
ifconv.f = dx;
int _dx = ifconv.i;
ifconv.f = dy;
int _dy = ifconv.i;
PostEvent(data0, m_nLastSampleTick, data1, _dx, _dy);
int _x,_y;
memcpy( &_x, &x, sizeof(float) );
memcpy( &_y, &y, sizeof(float) );
PostEvent(eventType, m_nLastSampleTick, fingerId, _x, _y);
}

2
ivp

@ -1 +1 @@
Subproject commit 4098acbbe3bc48320496f7533851640cc40cbb89
Subproject commit 47533475e01cbff05fbc3bbe8b4edc485f292cea

View File

@ -82,7 +82,12 @@ void ColorCorrectionLookup_t::AllocTexture()
sprintf( name, "ColorCorrection - %p", m_Handle );
m_pColorCorrectionTexture = ITextureInternal::CreateProceduralTexture( name, TEXTURE_GROUP_OTHER,
COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, IMAGE_FORMAT_BGRX8888,
COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE,
#ifdef DX_TO_GL_ABSTRACTION
IMAGE_FORMAT_RGBA8888,
#else
IMAGE_FORMAT_BGRX8888,
#endif
TEXTUREFLAGS_NOMIP | TEXTUREFLAGS_NOLOD | TEXTUREFLAGS_SINGLECOPY | TEXTUREFLAGS_CLAMPS |
TEXTUREFLAGS_CLAMPT | TEXTUREFLAGS_CLAMPU | TEXTUREFLAGS_NODEBUGOVERRIDE );

View File

@ -790,7 +790,7 @@ public:
virtual bool IsConnectedUserInfoChangeAllowed( IConVar *pCvar ) = 0;
virtual void IN_TouchEvent( uint data, uint data2, uint data3, uint data4 ) = 0;
virtual void IN_TouchEvent( int type, int fingerId, int x, int y ) = 0;
};
#define CLIENT_DLL_INTERFACE_VERSION "VClient017"

View File

@ -119,6 +119,7 @@ public:
// read and clear accumulated raw input values
virtual bool GetRawMouseAccumulators( int& accumX, int& accumY ) = 0;
virtual bool GetTouchAccumulators( int fingerId, float &dx, float &dy ) = 0;
// tell the input system that we're not a game, we're console text mode.
// this is used for dedicated servers to not initialize joystick system.

View File

@ -1787,14 +1787,14 @@ FORCEINLINE fltx4 LoadAlignedSIMD( const VectorAligned & pSIMD )
return SetWToZeroSIMD( LoadAlignedSIMD(pSIMD.Base()) );
}
#ifdef __SANITIZE_ADDRESS__
static __attribute__((no_sanitize("address"))) fltx4 LoadUnalignedSIMD( const void *pSIMD )
#ifdef USING_ASAN
static NO_ASAN fltx4 LoadUnalignedSIMD( const void *pSIMD )
{
return _mm_loadu_ps( reinterpret_cast<const float *>( pSIMD ) );
}
static __attribute__((no_sanitize("address"))) fltx4 LoadUnaligned3SIMD( const void *pSIMD )
static NO_ASAN fltx4 LoadUnaligned3SIMD( const void *pSIMD )
{
return _mm_loadu_ps( reinterpret_cast<const float *>( pSIMD ) );
}

View File

@ -345,10 +345,6 @@ unsigned int CPhonemeTag::ComputeDataCheckSum()
//-----------------------------------------------------------------------------
// Purpose: Simple language to string and string to language lookup dictionary
//-----------------------------------------------------------------------------
#if defined(__i386__) || defined(__x86_64__)
#pragma pack(1)
#endif
struct CCLanguage
{
int type;
@ -371,9 +367,6 @@ static CCLanguage g_CCLanguageLookup[] =
{ CC_THAI, "thai", 0 , 150, 250 },
{ CC_PORTUGUESE,"portuguese", 0 , 0, 150 },
};
#if defined(__i386__) || defined(__x86_64__)
#pragma pack()
#endif
void CSentence::ColorForLanguage( int language, unsigned char& r, unsigned char& g, unsigned char& b )
{
@ -1767,4 +1760,4 @@ void CSentence::CreateEventWordDistribution( char const *pszText, float flSenten
}
#endif // !_STATIC_LINKED || _SHARED_LIB
#endif // !_STATIC_LINKED || _SHARED_LIB

View File

@ -95,6 +95,7 @@ enum soundlevel_t
// NOTE: Valid soundlevel_t values are 0-255.
// 256-511 are reserved for sounds using goldsrc compatibility attenuation.
SNDLVBL_MAX = 511
};
#define MAX_SNDLVL_BITS 9 // Used to encode 0-255 for regular soundlevel_t's and 256-511 for goldsrc-compatible ones.

View File

@ -594,7 +594,7 @@ typedef void * HINSTANCE;
#define FMTFUNCTION( a, b )
#elif defined(GNUC)
#define SELECTANY __attribute__((weak))
#if defined(LINUX) && !defined(DEDICATED)
#ifndef DEDICATED
#define RESTRICT
#else
#define RESTRICT __restrict

View File

@ -25,9 +25,7 @@
#define GLMDEBUG_H
#include "tier0/platform.h"
#if defined( OSX )
#include <stdarg.h>
#endif
// include this anywhere you need to be able to compile-out code related specifically to GLM debugging.

View File

@ -25,9 +25,7 @@
#define GLMDEBUG_H
#include "tier0/platform.h"
#if defined( OSX )
#include <stdarg.h>
#endif
// include this anywhere you need to be able to compile-out code related specifically to GLM debugging.

View File

@ -455,7 +455,9 @@ bool GetVTFPreload360Data( const char *pDebugName, CUtlBuffer &fileBufferIn, CUt
// compiler pads, the 360 compiler does NOT.
//-----------------------------------------------------------------------------
struct VTFFileBaseHeader_t
// nillerusr: try to avoid problems with pragma pack, remove c++ inheritance to make this structs platform-independent
struct alignas(16) VTFFileBaseHeader_t
{
DECLARE_BYTESWAP_DATADESC();
char fileTypeString[4]; // "VTF" Valve texture file
@ -463,22 +465,23 @@ struct VTFFileBaseHeader_t
int headerSize;
};
struct VTFFileHeaderV7_1_t : public VTFFileBaseHeader_t
struct alignas(16) VTFFileHeaderV7_1_t
{
DECLARE_BYTESWAP_DATADESC();
char fileTypeString[4]; // "VTF" Valve texture file
int version[2]; // version[0].version[1]
int headerSize;
unsigned short width;
unsigned short height;
unsigned int flags;
unsigned short numFrames;
unsigned short startFrame;
#if !defined( POSIX ) && !defined( _X360 )
VectorAligned reflectivity;
#else
// must manually align in order to maintain pack(1) expected layout with existing binaries
char pad1[4];
Vector reflectivity;
char pad2[4];
#endif
char pad1[4];
VectorAligned reflectivity;
float bumpScale;
ImageFormat imageFormat;
unsigned char numMipLevels;
@ -487,13 +490,65 @@ struct VTFFileHeaderV7_1_t : public VTFFileBaseHeader_t
unsigned char lowResImageHeight;
};
struct VTFFileHeaderV7_2_t : public VTFFileHeaderV7_1_t
struct alignas(16) VTFFileHeaderV7_2_t
{
DECLARE_BYTESWAP_DATADESC();
char fileTypeString[4]; // "VTF" Valve texture file
int version[2]; // version[0].version[1]
int headerSize;
unsigned short width;
unsigned short height;
unsigned int flags;
unsigned short numFrames;
unsigned short startFrame;
// must manually align in order to maintain pack(1) expected layout with existing binaries
char pad1[4];
VectorAligned reflectivity;
float bumpScale;
ImageFormat imageFormat;
unsigned char numMipLevels;
ImageFormat lowResImageFormat;
unsigned char lowResImageWidth;
unsigned char lowResImageHeight;
unsigned short depth;
};
struct alignas(16) VTFFileHeaderV7_3_t
{
DECLARE_BYTESWAP_DATADESC();
char fileTypeString[4]; // "VTF" Valve texture file
int version[2]; // version[0].version[1]
int headerSize;
unsigned short width;
unsigned short height;
unsigned int flags;
unsigned short numFrames;
unsigned short startFrame;
// must manually align in order to maintain pack(1) expected layout with existing binaries
char pad1[4];
VectorAligned reflectivity;
float bumpScale;
ImageFormat imageFormat;
unsigned char numMipLevels;
ImageFormat lowResImageFormat;
unsigned char lowResImageWidth;
unsigned char lowResImageHeight;
unsigned short depth;
char pad4[3];
unsigned int numResources;
};
typedef VTFFileHeaderV7_3_t VTFFileHeader_t;
#define BYTE_POS( byteVal, shft ) uint32( uint32(uint8(byteVal)) << uint8(shft * 8) )
#if !defined( _X360 )
#define MK_VTF_RSRC_ID(a, b, c) uint32( BYTE_POS(a, 0) | BYTE_POS(b, 1) | BYTE_POS(c, 2) )
@ -538,28 +593,6 @@ struct ResourceEntryInfo
unsigned int resData; // Resource data or offset from the beginning of the file
};
struct VTFFileHeaderV7_3_t : public VTFFileHeaderV7_2_t
{
DECLARE_BYTESWAP_DATADESC();
char pad4[3];
unsigned int numResources;
#if defined( _X360 ) || defined( POSIX )
// must manually align in order to maintain pack(1) expected layout with existing binaries
char pad5[8];
#endif
// AFTER THE IMPLICIT PADDING CAUSED BY THE COMPILER....
// *** followed by *** ResourceEntryInfo resources[0];
// Array of resource entry infos sorted ascending by type
};
struct VTFFileHeader_t : public VTFFileHeaderV7_3_t
{
DECLARE_BYTESWAP_DATADESC();
};
#define VTF_X360_MAJOR_VERSION 0x0360
#define VTF_X360_MINOR_VERSION 8
struct VTFFileHeaderX360_t : public VTFFileBaseHeader_t

View File

@ -4,5 +4,5 @@ git submodule init && git submodule update
brew install sdl2
./waf configure -T debug --64bits --disable-warns $* &&
./waf configure -T debug --disable-warns $* &&
./waf build

View File

@ -4,5 +4,5 @@ git submodule init && git submodule update
sudo apt-get update
sudo apt-get install -f -y libopenal-dev g++-multilib gcc-multilib libpng-dev libjpeg-dev libfreetype6-dev libfontconfig1-dev libcurl4-gnutls-dev libsdl2-dev zlib1g-dev libbz2-dev libedit-dev
./waf configure -T debug --64bits --disable-warns $* &&
./waf configure -T debug --disable-warns $* &&
./waf build

View File

@ -6,5 +6,5 @@ sudo apt-get update
sudo apt-get install -y aptitude
sudo aptitude install -y libopenal-dev:i386 g++-multilib gcc-multilib libpng-dev:i386 libjpeg-dev:i386 libfreetype6-dev:i386 libfontconfig1-dev:i386 libcurl4-gnutls-dev:i386 libsdl2-dev:i386 zlib1g-dev:i386 libbz2-dev:i386 libedit-dev:i386
PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig ./waf configure -T debug --disable-warns $* &&
PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig ./waf configure -T debug --disable-warns --32bits $* &&
./waf build

View File

@ -1,7 +1,7 @@
#!/bin/sh
git submodule init && git submodule update
./waf configure -T release --sanitize=address,undefined --disable-warns --tests -8 --prefix=out/ $* &&
./waf configure -T release --sanitize=address,undefined --disable-warns --tests --prefix=out/ $* &&
./waf install &&
cd out &&
DYLD_LIBRARY_PATH=bin/ ./unittest || exit 1

View File

@ -4,7 +4,7 @@ git submodule init && git submodule update
sudo apt-get update
sudo apt-get install -y libbz2-dev
./waf configure -T release --sanitize=address,undefined --disable-warns --tests --prefix=out/ --64bits $* &&
./waf configure -T release --sanitize=address,undefined --disable-warns --tests --prefix=out/ $* &&
./waf install &&
cd out &&
LD_LIBRARY_PATH=bin/ ./unittest

View File

@ -5,7 +5,7 @@ sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y g++-multilib gcc-multilib libbz2-dev:i386
PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig ./waf configure -T release --sanitize=address,undefined --disable-warns --tests --prefix=out/ $* &&
PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig ./waf configure -T release --32bits --sanitize=address,undefined --disable-warns --tests --prefix=out/ $* &&
./waf install &&
cd out &&
LD_LIBRARY_PATH=bin/ ./unittest

View File

@ -1010,7 +1010,7 @@ CUtlString D3DToGL::FixGLSLSwizzle( const char *pDestRegisterName, const char *p
{
bool bAbsWrapper = false; // Parameter wrapped in an abs()
bool bAbsNegative = false; // -abs()
char szSrcRegister[128];
static char szSrcRegister[128];
V_strncpy( szSrcRegister, pSrcRegisterName, sizeof(szSrcRegister) );
// Check for abs() or -abs() wrapper and strip it off during the fixup

View File

@ -32,6 +32,7 @@
#include <sys/param.h>
#include <sys/mount.h>
#elif defined(LINUX)
#define _LARGEFILE64_SOURCE
#include <sys/vfs.h>
#endif
#ifdef OSX

View File

@ -1500,6 +1500,9 @@ void FileOpenDialog::OnOpen()
char pFileName[MAX_PATH];
GetSelectedFileName( pFileName, sizeof( pFileName ) );
if( !pFileName[0] )
return;
int nLen = Q_strlen( pFileName );
bool bSpecifiedDirectory = ( pFileName[nLen-1] == '/' || pFileName[nLen-1] == '\\' ) && (!IsOSX() || ( IsOSX() && !Q_stristr( pFileName, ".app" ) ) );
Q_StripTrailingSlash( pFileName );

View File

@ -376,7 +376,7 @@ static vgui::MouseCode ButtonCodeToMouseCode( ButtonCode_t buttonCode )
//-----------------------------------------------------------------------------
bool InputHandleInputEvent( const InputEvent_t &event )
{
switch( event.m_nType & 0xFFFF )
switch( event.m_nType )
{
case IE_ButtonPressed:
{
@ -428,9 +428,10 @@ bool InputHandleInputEvent( const InputEvent_t &event )
case IE_FingerDown:
{
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
uint data = (uint)event.m_nData;
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF);
y = h*((double)(data & 0xFFFF) / 0xFFFF);
float _x, _y;
memcpy( &_x, &event.m_nData2, sizeof(_x) );
memcpy( &_y, &event.m_nData3, sizeof(_y) );
x = w*_x; y = h*_y;
g_pIInput->UpdateCursorPosInternal( x, y );
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_PRESSED );
g_pIInput->InternalMousePressed( MOUSE_LEFT );
@ -439,9 +440,10 @@ bool InputHandleInputEvent( const InputEvent_t &event )
case IE_FingerUp:
{
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
uint data = (uint)event.m_nData;
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF);
y = h*((double)(data & 0xFFFF) / 0xFFFF);
float _x, _y;
memcpy( &_x, &event.m_nData2, sizeof(_x) );
memcpy( &_y, &event.m_nData3, sizeof(_y) );
x = w*_x; y = h*_y;
g_pIInput->UpdateCursorPosInternal( x, y );
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_RELEASED );
g_pIInput->InternalMouseReleased( MOUSE_LEFT );
@ -450,9 +452,10 @@ bool InputHandleInputEvent( const InputEvent_t &event )
case IE_FingerMotion:
{
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
uint data = (uint)event.m_nData;
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF);
y = h*((double)(data & 0xFFFF) / 0xFFFF);
float _x, _y;
memcpy( &_x, &event.m_nData2, sizeof(_x) );
memcpy( &_y, &event.m_nData3, sizeof(_y) );
x = w*_x; y = h*_y;
g_pIInput->InternalCursorMoved( x, y );
}
return true;

View File

@ -27,7 +27,10 @@ BEGIN_BYTESWAP_DATADESC( VTFFileBaseHeader_t )
DEFINE_FIELD( headerSize, FIELD_INTEGER ),
END_DATADESC()
BEGIN_BYTESWAP_DATADESC_( VTFFileHeaderV7_1_t, VTFFileBaseHeader_t )
BEGIN_BYTESWAP_DATADESC( VTFFileHeaderV7_1_t )
DEFINE_ARRAY( fileTypeString, FIELD_CHARACTER, 4 ),
DEFINE_ARRAY( version, FIELD_INTEGER, 2 ),
DEFINE_FIELD( headerSize, FIELD_INTEGER ),
DEFINE_FIELD( width, FIELD_SHORT ),
DEFINE_FIELD( height, FIELD_SHORT ),
DEFINE_FIELD( flags, FIELD_INTEGER ),
@ -42,17 +45,45 @@ BEGIN_BYTESWAP_DATADESC_( VTFFileHeaderV7_1_t, VTFFileBaseHeader_t )
DEFINE_FIELD( lowResImageHeight, FIELD_CHARACTER ),
END_DATADESC()
BEGIN_BYTESWAP_DATADESC_( VTFFileHeaderV7_2_t, VTFFileHeaderV7_1_t )
BEGIN_BYTESWAP_DATADESC( VTFFileHeaderV7_2_t )
DEFINE_ARRAY( fileTypeString, FIELD_CHARACTER, 4 ),
DEFINE_ARRAY( version, FIELD_INTEGER, 2 ),
DEFINE_FIELD( headerSize, FIELD_INTEGER ),
DEFINE_FIELD( width, FIELD_SHORT ),
DEFINE_FIELD( height, FIELD_SHORT ),
DEFINE_FIELD( flags, FIELD_INTEGER ),
DEFINE_FIELD( numFrames, FIELD_SHORT ),
DEFINE_FIELD( startFrame, FIELD_SHORT ),
DEFINE_FIELD( reflectivity, FIELD_VECTOR ),
DEFINE_FIELD( bumpScale, FIELD_FLOAT ),
DEFINE_FIELD( imageFormat, FIELD_INTEGER ),
DEFINE_FIELD( numMipLevels, FIELD_CHARACTER ),
DEFINE_FIELD( lowResImageFormat, FIELD_INTEGER ),
DEFINE_FIELD( lowResImageWidth, FIELD_CHARACTER ),
DEFINE_FIELD( lowResImageHeight, FIELD_CHARACTER ),
DEFINE_FIELD( depth, FIELD_SHORT ),
END_DATADESC()
BEGIN_BYTESWAP_DATADESC_( VTFFileHeaderV7_3_t, VTFFileHeaderV7_2_t )
BEGIN_BYTESWAP_DATADESC( VTFFileHeaderV7_3_t )
DEFINE_ARRAY( fileTypeString, FIELD_CHARACTER, 4 ),
DEFINE_ARRAY( version, FIELD_INTEGER, 2 ),
DEFINE_FIELD( headerSize, FIELD_INTEGER ),
DEFINE_FIELD( width, FIELD_SHORT ),
DEFINE_FIELD( height, FIELD_SHORT ),
DEFINE_FIELD( flags, FIELD_INTEGER ),
DEFINE_FIELD( numFrames, FIELD_SHORT ),
DEFINE_FIELD( startFrame, FIELD_SHORT ),
DEFINE_FIELD( reflectivity, FIELD_VECTOR ),
DEFINE_FIELD( bumpScale, FIELD_FLOAT ),
DEFINE_FIELD( imageFormat, FIELD_INTEGER ),
DEFINE_FIELD( numMipLevels, FIELD_CHARACTER ),
DEFINE_FIELD( lowResImageFormat, FIELD_INTEGER ),
DEFINE_FIELD( lowResImageWidth, FIELD_CHARACTER ),
DEFINE_FIELD( lowResImageHeight, FIELD_CHARACTER ),
DEFINE_FIELD( depth, FIELD_SHORT ),
DEFINE_FIELD( numResources, FIELD_INTEGER ),
END_DATADESC()
BEGIN_BYTESWAP_DATADESC_( VTFFileHeader_t, VTFFileHeaderV7_2_t )
END_DATADESC()
BEGIN_BYTESWAP_DATADESC_( VTFFileHeaderX360_t, VTFFileBaseHeader_t )
DEFINE_FIELD( flags, FIELD_INTEGER ),
DEFINE_FIELD( width, FIELD_SHORT ),
@ -903,23 +934,11 @@ static bool ReadHeaderFromBufferPastBaseHeader( CUtlBuffer &buf, VTFFileHeader_t
else if ( header.version[1] == 2 )
{
buf.Get( pBuf, sizeof(VTFFileHeaderV7_2_t) - sizeof(VTFFileBaseHeader_t) );
#if defined( _X360 ) || defined (POSIX)
// read 15 dummy bytes to be properly positioned with 7.2 PC data
byte dummy[15];
buf.Get( dummy, 15 );
#endif
}
else if ( header.version[1] == 1 || header.version[1] == 0 )
{
// previous version 7.0 or 7.1
buf.Get( pBuf, sizeof(VTFFileHeaderV7_1_t) - sizeof(VTFFileBaseHeader_t) );
#if defined( _X360 ) || defined (POSIX)
// read a dummy byte to be properly positioned with 7.0/1 PC data
byte dummy;
buf.Get( &dummy, 1 );
#endif
}
else
{

14
waf vendored

File diff suppressed because one or more lines are too long

68
wscript
View File

@ -26,6 +26,21 @@ FC_CHECK='''extern "C" {
int main() { return (int)FcInit(); }
'''
CPP_64BIT_CHECK='''
#define TEST(a) (sizeof(void*) == a ? 1 : -1)
int g_Test[TEST(8)];
int main () { return 0; }
'''
CPP_32BIT_CHECK='''
#define TEST(a) (sizeof(void*) == a ? 1 : -1)
int g_Test[TEST(4)];
int main () { return 0; }
'''
Context.Context.line_just = 55 # should fit for everything on 80x26
projects={
@ -125,6 +140,7 @@ projects={
'tier1',
'tier2',
'tier3',
'vgui2/vgui_controls',
'vphysics',
'vpklib',
'vstdlib',
@ -155,6 +171,11 @@ def get_taskgen_count(self):
except: idx = 0 # don't set tg_idx_count to not increase counter
return idx
@Configure.conf
def run_test(self, fragment, msg):
result = self.check_cxx(fragment=fragment, msg=msg, mandatory = False)
return False if result == None else True
def define_platform(conf):
conf.env.DEDICATED = conf.options.DEDICATED
conf.env.TESTS = conf.options.TESTS
@ -162,6 +183,12 @@ def define_platform(conf):
conf.env.GL = conf.options.GL and not conf.options.TESTS and not conf.options.DEDICATED
conf.env.OPUS = conf.options.OPUS
arch32 = conf.run_test(CPP_32BIT_CHECK, 'Testing 32bit support')
arch64 = conf.run_test(CPP_64BIT_CHECK, 'Testing 64bit support')
if not (arch32 ^ arch64):
conf.fatal('Your compiler sucks')
if conf.options.DEDICATED:
conf.options.SDL = False
conf.define('DEDICATED', 1)
@ -186,7 +213,7 @@ def define_platform(conf):
conf.env.SDL = 1
conf.define('USE_SDL', 1)
if conf.options.ALLOW64:
if arch64:
conf.define('PLATFORM_64BITS', 1)
if conf.env.DEST_OS == 'linux':
@ -239,6 +266,10 @@ def define_platform(conf):
'_DLL_EXT=.so'
])
if conf.env.DEST_OS != 'win32':
conf.define('NO_MEMOVERRIDE_NEW_DELETE', 1)
# conf.define('NO_MALLOC_OVERRIDE', 1)
if conf.options.DEBUG_ENGINE:
conf.env.append_unique('DEFINES', [
'DEBUG', '_DEBUG'
@ -248,11 +279,14 @@ def define_platform(conf):
'NDEBUG'
])
conf.define('GIT_COMMIT_HASH', conf.env.GIT_VERSION)
def options(opt):
grp = opt.add_option_group('Common options')
grp.add_option('-8', '--64bits', action = 'store_true', dest = 'ALLOW64', default = False,
help = 'allow targetting 64-bit engine(Linux/Windows/OSX x86 only) [default: %default]')
grp.add_option('-4', '--32bits', action = 'store_true', dest = 'TARGET32', default = False,
help = 'allow targetting 32-bit engine(Linux/Windows/OSX x86 only) [default: %default]')
grp.add_option('-d', '--dedicated', action = 'store_true', dest = 'DEDICATED', default = False,
help = 'build dedicated server [default: %default]')
@ -298,7 +332,7 @@ def options(opt):
def check_deps(conf):
if conf.env.DEST_OS != 'win32':
conf.check_cc(lib='dl', mandatory=False)
conf.check_cc(lib='bz2', mandatory=False)
conf.check_cc(lib='bz2', mandatory=True)
conf.check_cc(lib='rt', mandatory=False)
if not conf.env.LIB_M: # HACK: already added in xcompile!
@ -406,19 +440,24 @@ def configure(conf):
# 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']
conf.env.MSVC_TARGETS = ['x64'] # explicitly request x86 target for MSVC
if conf.options.TARGET32:
conf.env.MSVC_TARGETS = ['x86']
if sys.platform == 'win32':
conf.load('msvc_pdb_ext msdev msvs')
conf.load('subproject xcompile compiler_c compiler_cxx gitversion clang_compilation_database strip_on_install_v2 waf_unit_test enforce_pic')
conf.load('msvc_pdb_ext msdev msvs msvcdeps')
conf.load('subproject xcompile compiler_c compiler_cxx gccdeps gitversion clang_compilation_database strip_on_install_v2 waf_unit_test enforce_pic')
if conf.env.DEST_OS == 'win32' and conf.env.DEST_CPU == 'amd64':
conf.load('masm')
elif conf.env.DEST_OS == 'darwin':
conf.load('mm_hook')
conf.env.BIT32_MANDATORY = conf.options.TARGET32
if conf.env.BIT32_MANDATORY:
Logs.info('WARNING: will build engine for 32-bit target')
conf.load('force_32bit')
define_platform(conf)
conf.define('GIT_COMMIT_HASH', conf.env.GIT_VERSION)
if conf.env.TOGLES:
projects['game'] += ['togles']
@ -431,11 +470,6 @@ def configure(conf):
if conf.options.OPUS or conf.env.DEST_OS == 'android':
projects['game'] += ['engine/voice_codecs/opus']
conf.env.BIT32_MANDATORY = not conf.options.ALLOW64
if conf.env.BIT32_MANDATORY:
Logs.info('WARNING: will build engine for 32-bit target')
conf.load('force_32bit')
if conf.options.DISABLE_WARNS:
compiler_optional_flags = ['-w']
else:
@ -493,7 +527,7 @@ def configure(conf):
flags += ['-fsigned-char']
if conf.env.DEST_CPU == 'arm':
flags += ['-mfpu=neon-vfpv4']
flags += ['-march=armv7-a', '-mfpu=neon-vfpv4']
if conf.env.DEST_OS == 'freebsd':
linkflags += ['-lexecinfo']
@ -517,11 +551,11 @@ def configure(conf):
if conf.options.BUILD_TYPE == 'debug':
linkflags += [
'/FORCE:MULTIPLE',
'/INCREMENTAL:NO',
'/NODEFAULTLIB:libc',
'/NODEFAULTLIB:libcd',
'/NODEFAULTLIB:libcmt',
'/FORCE',
'/LARGEADDRESSAWARE'
]
else: