Compare commits
No commits in common. "master" and "musl-port" have entirely different histories.
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@ -2,7 +2,6 @@ name: Build
|
|||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux-i386:
|
build-linux-i386:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -39,7 +38,7 @@ jobs:
|
|||||||
- name: Build windows-i386
|
- name: Build windows-i386
|
||||||
run: |
|
run: |
|
||||||
git submodule init && git submodule update
|
git submodule init && git submodule update
|
||||||
./waf.bat configure -T debug --32bits
|
./waf.bat configure -T debug
|
||||||
./waf.bat build
|
./waf.bat build
|
||||||
|
|
||||||
build-windows-amd64:
|
build-windows-amd64:
|
||||||
@ -50,7 +49,7 @@ jobs:
|
|||||||
- name: Build windows-amd64
|
- name: Build windows-amd64
|
||||||
run: |
|
run: |
|
||||||
git submodule init && git submodule update
|
git submodule init && git submodule update
|
||||||
./waf.bat configure -T debug
|
./waf.bat configure -T debug -8
|
||||||
./waf.bat build
|
./waf.bat build
|
||||||
|
|
||||||
build-dedicated-windows-i386:
|
build-dedicated-windows-i386:
|
||||||
@ -72,7 +71,7 @@ jobs:
|
|||||||
- name: Build dedicated windows-amd64
|
- name: Build dedicated windows-amd64
|
||||||
run: |
|
run: |
|
||||||
git submodule init && git submodule update
|
git submodule init && git submodule update
|
||||||
./waf.bat configure -T debug -d
|
./waf.bat configure -T debug -d -8
|
||||||
./waf.bat build
|
./waf.bat build
|
||||||
|
|
||||||
build-dedicated-linux-i386:
|
build-dedicated-linux-i386:
|
||||||
|
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
@ -38,7 +38,7 @@ jobs:
|
|||||||
- name: Run tests windows-i386
|
- name: Run tests windows-i386
|
||||||
run: |
|
run: |
|
||||||
git submodule init && git submodule update
|
git submodule init && git submodule update
|
||||||
./waf.bat configure -T release --tests --prefix=out/ --32bits
|
./waf.bat configure -T release --tests --prefix=out/
|
||||||
./waf.bat install
|
./waf.bat install
|
||||||
cd out
|
cd out
|
||||||
$env:Path = "bin";
|
$env:Path = "bin";
|
||||||
@ -52,7 +52,7 @@ jobs:
|
|||||||
- name: Run tests windows-amd64
|
- name: Run tests windows-amd64
|
||||||
run: |
|
run: |
|
||||||
git submodule init && git submodule update
|
git submodule init && git submodule update
|
||||||
./waf.bat configure -T release --tests --prefix=out/
|
./waf.bat configure -T release --tests --prefix=out/ -8
|
||||||
./waf.bat install
|
./waf.bat install
|
||||||
cd out
|
cd out
|
||||||
$env:Path = "bin";
|
$env:Path = "bin";
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -37,3 +37,5 @@ waf3*/
|
|||||||
.vscode/
|
.vscode/
|
||||||
.depproj/
|
.depproj/
|
||||||
source-engine.sln
|
source-engine.sln
|
||||||
|
hl2/
|
||||||
|
|
||||||
|
@ -404,9 +404,6 @@ private:
|
|||||||
int m_MouseButtonDownX;
|
int m_MouseButtonDownX;
|
||||||
int m_MouseButtonDownY;
|
int m_MouseButtonDownY;
|
||||||
|
|
||||||
bool m_bResetVsync;
|
|
||||||
int m_nFramesToSkip;
|
|
||||||
|
|
||||||
double m_flPrevGLSwapWindowTime;
|
double m_flPrevGLSwapWindowTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -587,9 +584,6 @@ InitReturnVal_t CSDLMgr::Init()
|
|||||||
m_nWarpDelta = 0;
|
m_nWarpDelta = 0;
|
||||||
m_bRawInput = false;
|
m_bRawInput = false;
|
||||||
|
|
||||||
m_nFramesToSkip = 0;
|
|
||||||
m_bResetVsync = false;
|
|
||||||
|
|
||||||
m_flPrevGLSwapWindowTime = 0.0f;
|
m_flPrevGLSwapWindowTime = 0.0f;
|
||||||
|
|
||||||
memset(m_pixelFormatAttribs, '\0', sizeof (m_pixelFormatAttribs));
|
memset(m_pixelFormatAttribs, '\0', sizeof (m_pixelFormatAttribs));
|
||||||
@ -1437,20 +1431,7 @@ void CSDLMgr::ShowPixels( CShowPixelsParams *params )
|
|||||||
|
|
||||||
m_flPrevGLSwapWindowTime = tm.GetDurationInProgress().GetMillisecondsF();
|
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__ );
|
CheckGLError( __LINE__ );
|
||||||
}
|
}
|
||||||
#endif // DX_TO_GL_ABSTRACTION
|
#endif // DX_TO_GL_ABSTRACTION
|
||||||
@ -1906,7 +1887,6 @@ void CSDLMgr::PumpWindowsMessageLoop()
|
|||||||
}
|
}
|
||||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||||
{
|
{
|
||||||
m_bResetVsync = true; m_nFramesToSkip = 3;
|
|
||||||
m_bHasFocus = true;
|
m_bHasFocus = true;
|
||||||
SDL_ShowCursor( m_bCursorVisible ? 1 : 0 );
|
SDL_ShowCursor( m_bCursorVisible ? 1 : 0 );
|
||||||
CCocoaEvent theEvent;
|
CCocoaEvent theEvent;
|
||||||
|
@ -65,12 +65,9 @@ extern void longjmp( jmp_buf, int ) __attribute__((noreturn));
|
|||||||
#define JPEGLIB_USE_STDIO
|
#define JPEGLIB_USE_STDIO
|
||||||
#if ANDROID
|
#if ANDROID
|
||||||
#include "android/jpeglib/jpeglib.h"
|
#include "android/jpeglib/jpeglib.h"
|
||||||
#elif defined WIN32
|
|
||||||
#include "jpeglib/jpeglib.h"
|
|
||||||
#else
|
#else
|
||||||
#include <jpeglib.h>
|
#include "jpeglib/jpeglib.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef JPEGLIB_USE_STDIO
|
#undef JPEGLIB_USE_STDIO
|
||||||
|
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ bool CDedicatedAppSystemGroup::PreInit( )
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
g_bVGui = CommandLine()->CheckParm( "-vgui" );
|
g_bVGui = !CommandLine()->CheckParm( "-console" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CreateInterfaceFn factory = GetFactory();
|
CreateInterfaceFn factory = GetFactory();
|
||||||
|
@ -38,12 +38,7 @@ def build(bld):
|
|||||||
|
|
||||||
if bld.env.DEST_OS == 'win32':
|
if bld.env.DEST_OS == 'win32':
|
||||||
source += [
|
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:
|
else:
|
||||||
source += [
|
source += [
|
||||||
@ -64,9 +59,6 @@ def build(bld):
|
|||||||
|
|
||||||
libs = ['tier0','vpklib','tier1','tier2','tier3','vstdlib','steam_api','appframework','mathlib', 'EDIT']
|
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
|
install_path = bld.env.LIBDIR
|
||||||
|
|
||||||
bld.shlib(
|
bld.shlib(
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 2 resource.
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
//
|
//
|
||||||
#include "windows.h"
|
#include "afxres.h"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
@ -199,7 +199,7 @@ bool CNetworkStringTableItem::SetUserData( int tick, int length, const void *use
|
|||||||
|
|
||||||
if ( length > 0 )
|
if ( length > 0 )
|
||||||
{
|
{
|
||||||
m_pUserData = new unsigned char[ALIGN_VALUE( length, 4 )];
|
m_pUserData = new unsigned char[ length ];
|
||||||
Q_memcpy( m_pUserData, userData, length );
|
Q_memcpy( m_pUserData, userData, length );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -706,13 +706,11 @@ bool CBaseClient::SendServerInfo( void )
|
|||||||
|
|
||||||
serverinfo.WriteToBuffer( msg );
|
serverinfo.WriteToBuffer( msg );
|
||||||
|
|
||||||
#ifdef _X360
|
if ( IsX360() && serverinfo.m_nMaxClients > 1 )
|
||||||
if ( serverinfo.m_nMaxClients > 1 )
|
|
||||||
{
|
{
|
||||||
Msg( "Telling clients to connect" );
|
Msg( "Telling clients to connect" );
|
||||||
g_pMatchmaking->TellClientsToConnect();
|
g_pMatchmaking->TellClientsToConnect();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// send first tick
|
// send first tick
|
||||||
m_nSignonTick = m_Server->m_nTickCount;
|
m_nSignonTick = m_Server->m_nTickCount;
|
||||||
|
@ -686,7 +686,7 @@ void CDemoRecorder::CloseDemoFile()
|
|||||||
|
|
||||||
m_DemoFile.Close();
|
m_DemoFile.Close();
|
||||||
|
|
||||||
if( g_ClientDLL ) g_ClientDLL->OnDemoRecordStop();
|
g_ClientDLL->OnDemoRecordStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bCloseDemoFile = false;
|
m_bCloseDemoFile = false;
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include "client_pch.h"
|
#include "client_pch.h"
|
||||||
#ifdef SWDS
|
#ifdef SWDS
|
||||||
#include "igame.h"
|
|
||||||
#include "hltvclientstate.h"
|
#include "hltvclientstate.h"
|
||||||
#include "convar.h"
|
#include "convar.h"
|
||||||
#include "enginestats.h"
|
#include "enginestats.h"
|
||||||
@ -38,9 +37,9 @@ bool CL_IsPortalDemo()
|
|||||||
|
|
||||||
bool HandleRedirectAndDebugLog( const char *msg );
|
bool HandleRedirectAndDebugLog( const char *msg );
|
||||||
|
|
||||||
//void BeginLoadingUpdates( MaterialNonInteractiveMode_t mode ) {}
|
void BeginLoadingUpdates( MaterialNonInteractiveMode_t mode ) {}
|
||||||
//void EndLoadingUpdates() {}
|
|
||||||
void RefreshScreenIfNecessary() {}
|
void RefreshScreenIfNecessary() {}
|
||||||
|
void EndLoadingUpdates() {}
|
||||||
|
|
||||||
|
|
||||||
void Con_ColorPrintf( const Color& clr, const char *fmt, ... )
|
void Con_ColorPrintf( const Color& clr, const char *fmt, ... )
|
||||||
|
@ -873,9 +873,9 @@ bool IntersectRayWithBoxBrush( TraceInfo_t *pTraceInfo, const cbrush_t *pBrush,
|
|||||||
FPExceptionDisabler hideExceptions;
|
FPExceptionDisabler hideExceptions;
|
||||||
|
|
||||||
// Load the unaligned ray/box parameters into SIMD registers
|
// Load the unaligned ray/box parameters into SIMD registers
|
||||||
fltx4 start = LoadAlignedSIMD(pTraceInfo->m_start.Base());
|
fltx4 start = LoadUnaligned3SIMD(pTraceInfo->m_start.Base());
|
||||||
fltx4 extents = LoadAlignedSIMD(pTraceInfo->m_extents.Base());
|
fltx4 extents = LoadUnaligned3SIMD(pTraceInfo->m_extents.Base());
|
||||||
fltx4 delta = LoadAlignedSIMD(pTraceInfo->m_delta.Base());
|
fltx4 delta = LoadUnaligned3SIMD(pTraceInfo->m_delta.Base());
|
||||||
fltx4 boxMins = LoadAlignedSIMD( pBox->mins.Base() );
|
fltx4 boxMins = LoadAlignedSIMD( pBox->mins.Base() );
|
||||||
fltx4 boxMaxs = LoadAlignedSIMD( pBox->maxs.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));
|
fltx4 crossPlane = OrSIMD(XorSIMD(startOutMins,endOutMins), XorSIMD(startOutMaxs,endOutMaxs));
|
||||||
// now build the per-axis interval of t for intersections
|
// now build the per-axis interval of t for intersections
|
||||||
fltx4 invDelta = LoadAlignedSIMD(pTraceInfo->m_invDelta.Base());
|
fltx4 invDelta = LoadUnaligned3SIMD(pTraceInfo->m_invDelta.Base());
|
||||||
fltx4 tmins = MulSIMD( offsetMinsExpanded, invDelta );
|
fltx4 tmins = MulSIMD( offsetMinsExpanded, invDelta );
|
||||||
fltx4 tmaxs = MulSIMD( offsetMaxsExpanded, invDelta );
|
fltx4 tmaxs = MulSIMD( offsetMaxsExpanded, invDelta );
|
||||||
// now sort the interval per axis
|
// now sort the interval per axis
|
||||||
@ -1037,9 +1037,9 @@ bool IntersectRayWithBox( const Ray_t &ray, const VectorAligned &inInvDelta, con
|
|||||||
pTrace->fraction = 1.0f;
|
pTrace->fraction = 1.0f;
|
||||||
|
|
||||||
// Load the unaligned ray/box parameters into SIMD registers
|
// Load the unaligned ray/box parameters into SIMD registers
|
||||||
fltx4 start = LoadAlignedSIMD(ray.m_Start.Base());
|
fltx4 start = LoadUnaligned3SIMD(ray.m_Start.Base());
|
||||||
fltx4 extents = LoadAlignedSIMD(ray.m_Extents.Base());
|
fltx4 extents = LoadUnaligned3SIMD(ray.m_Extents.Base());
|
||||||
fltx4 delta = LoadAlignedSIMD(ray.m_Delta.Base());
|
fltx4 delta = LoadUnaligned3SIMD(ray.m_Delta.Base());
|
||||||
fltx4 boxMins = LoadAlignedSIMD( inBoxMins.Base() );
|
fltx4 boxMins = LoadAlignedSIMD( inBoxMins.Base() );
|
||||||
fltx4 boxMaxs = LoadAlignedSIMD( inBoxMaxs.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 )
|
inline bool IsTraceBoxIntersectingBoxBrush( TraceInfo_t *pTraceInfo, cboxbrush_t *pBox )
|
||||||
{
|
{
|
||||||
fltx4 start = LoadAlignedSIMD(pTraceInfo->m_start.Base());
|
fltx4 start = LoadUnaligned3SIMD(pTraceInfo->m_start.Base());
|
||||||
fltx4 mins = LoadAlignedSIMD(pTraceInfo->m_mins.Base());
|
fltx4 mins = LoadUnaligned3SIMD(pTraceInfo->m_mins.Base());
|
||||||
fltx4 maxs = LoadAlignedSIMD(pTraceInfo->m_maxs.Base());
|
fltx4 maxs = LoadUnaligned3SIMD(pTraceInfo->m_maxs.Base());
|
||||||
|
|
||||||
fltx4 boxMins = LoadAlignedSIMD( pBox->mins.Base() );
|
fltx4 boxMins = LoadAlignedSIMD( pBox->mins.Base() );
|
||||||
fltx4 boxMaxs = LoadAlignedSIMD( pBox->maxs.Base() );
|
fltx4 boxMaxs = LoadAlignedSIMD( pBox->maxs.Base() );
|
||||||
@ -1569,15 +1569,15 @@ void FASTCALL CM_TraceToLeaf( TraceInfo_t * RESTRICT pTraceInfo, int ndxLeaf, fl
|
|||||||
if (IsX360())
|
if (IsX360())
|
||||||
{
|
{
|
||||||
// set up some relatively constant variables we'll use in the loop below
|
// set up some relatively constant variables we'll use in the loop below
|
||||||
fltx4 traceStart = LoadAlignedSIMD(pTraceInfo->m_start.Base());
|
fltx4 traceStart = LoadUnaligned3SIMD(pTraceInfo->m_start.Base());
|
||||||
fltx4 traceDelta = LoadAlignedSIMD(pTraceInfo->m_delta.Base());
|
fltx4 traceDelta = LoadUnaligned3SIMD(pTraceInfo->m_delta.Base());
|
||||||
fltx4 traceInvDelta = LoadAlignedSIMD(pTraceInfo->m_invDelta.Base());
|
fltx4 traceInvDelta = LoadUnaligned3SIMD(pTraceInfo->m_invDelta.Base());
|
||||||
static const fltx4 vecEpsilon = {DISPCOLL_DIST_EPSILON,DISPCOLL_DIST_EPSILON,DISPCOLL_DIST_EPSILON,DISPCOLL_DIST_EPSILON};
|
static const fltx4 vecEpsilon = {DISPCOLL_DIST_EPSILON,DISPCOLL_DIST_EPSILON,DISPCOLL_DIST_EPSILON,DISPCOLL_DIST_EPSILON};
|
||||||
// only used in !IS_POINT version:
|
// only used in !IS_POINT version:
|
||||||
fltx4 extents;
|
fltx4 extents;
|
||||||
if (!IS_POINT)
|
if (!IS_POINT)
|
||||||
{
|
{
|
||||||
extents = LoadAlignedSIMD(pTraceInfo->m_extents.Base());
|
extents = LoadUnaligned3SIMD(pTraceInfo->m_extents.Base());
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: this loop probably ought to be unrolled so that we can make a more efficient
|
// TODO: this loop probably ought to be unrolled so that we can make a more efficient
|
||||||
|
@ -42,13 +42,13 @@ struct TraceInfo_t
|
|||||||
m_nCheckDepth = -1;
|
m_nCheckDepth = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorAligned m_start;
|
Vector m_start;
|
||||||
VectorAligned m_end;
|
Vector m_end;
|
||||||
VectorAligned m_mins;
|
Vector m_mins;
|
||||||
VectorAligned m_maxs;
|
Vector m_maxs;
|
||||||
VectorAligned m_extents;
|
Vector m_extents;
|
||||||
VectorAligned m_delta;
|
Vector m_delta;
|
||||||
VectorAligned m_invDelta;
|
Vector m_invDelta;
|
||||||
|
|
||||||
trace_t m_trace;
|
trace_t m_trace;
|
||||||
trace_t m_stabTrace;
|
trace_t m_stabTrace;
|
||||||
|
@ -97,19 +97,22 @@ COM_ExplainDisconnection
|
|||||||
*/
|
*/
|
||||||
void COM_ExplainDisconnection( bool bPrint, const char *fmt, ... )
|
void COM_ExplainDisconnection( bool bPrint, const char *fmt, ... )
|
||||||
{
|
{
|
||||||
#ifdef _X360
|
if ( IsX360() )
|
||||||
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
|
{
|
||||||
#else
|
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
|
||||||
va_list argptr;
|
}
|
||||||
char string[1024];
|
else
|
||||||
|
{
|
||||||
|
va_list argptr;
|
||||||
|
char string[1024];
|
||||||
|
|
||||||
va_start (argptr, fmt);
|
va_start (argptr, fmt);
|
||||||
Q_vsnprintf(string, sizeof( string ), fmt,argptr);
|
Q_vsnprintf(string, sizeof( string ), fmt,argptr);
|
||||||
va_end (argptr);
|
va_end (argptr);
|
||||||
|
|
||||||
Q_strncpy( gszDisconnectReason, string, 256 );
|
Q_strncpy( gszDisconnectReason, string, 256 );
|
||||||
gfExtendedError = true;
|
gfExtendedError = true;
|
||||||
#endif
|
}
|
||||||
|
|
||||||
if ( bPrint )
|
if ( bPrint )
|
||||||
{
|
{
|
||||||
@ -143,18 +146,21 @@ COM_ExtendedExplainDisconnection
|
|||||||
*/
|
*/
|
||||||
void COM_ExtendedExplainDisconnection( bool bPrint, const char *fmt, ... )
|
void COM_ExtendedExplainDisconnection( bool bPrint, const char *fmt, ... )
|
||||||
{
|
{
|
||||||
#ifdef _X360
|
if ( IsX360() )
|
||||||
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
|
{
|
||||||
#else
|
g_pMatchmaking->SessionNotification( SESSION_NOTIFY_LOST_SERVER );
|
||||||
va_list argptr;
|
}
|
||||||
char string[1024];
|
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_strncpy( gszExtendedDisconnectReason, string, 256 );
|
||||||
Q_vsnprintf(string, sizeof( string ), fmt,argptr);
|
}
|
||||||
va_end (argptr);
|
|
||||||
|
|
||||||
Q_strncpy( gszExtendedDisconnectReason, string, 256 );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( bPrint )
|
if ( bPrint )
|
||||||
{
|
{
|
||||||
|
@ -921,7 +921,7 @@ void DownloadThread( void *voidPtr )
|
|||||||
// Delete rc.data, which was allocated in this thread
|
// Delete rc.data, which was allocated in this thread
|
||||||
if ( rc.data != NULL )
|
if ( rc.data != NULL )
|
||||||
{
|
{
|
||||||
free(rc.data);
|
delete[] rc.data;
|
||||||
rc.data = NULL;
|
rc.data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3500,12 +3500,10 @@ void _Host_RunFrame (float time)
|
|||||||
//-------------------
|
//-------------------
|
||||||
_Host_RunFrame_Sound();
|
_Host_RunFrame_Sound();
|
||||||
|
|
||||||
#ifndef DEDICATED
|
|
||||||
if ( g_bVCRSingleStep )
|
if ( g_bVCRSingleStep )
|
||||||
{
|
{
|
||||||
VCR_EnterPausedState();
|
VCR_EnterPausedState();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -4353,20 +4353,20 @@ ModelInstanceHandle_t CModelRender::CreateInstance( IClientRenderable *pRenderab
|
|||||||
|
|
||||||
// validate static color meshes once, now at load/create time
|
// validate static color meshes once, now at load/create time
|
||||||
ValidateStaticPropColorData( handle );
|
ValidateStaticPropColorData( handle );
|
||||||
|
|
||||||
// 360 persists the color meshes across same map loads
|
// 360 persists the color meshes across same map loads
|
||||||
#ifdef _X360
|
if ( !IsX360() || instance.m_ColorMeshHandle == DC_INVALID_HANDLE )
|
||||||
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
|
// builds out color meshes or loads disk colors, now at load/create time
|
||||||
RecomputeStaticLighting( handle );
|
RecomputeStaticLighting( handle );
|
||||||
}
|
}
|
||||||
#endif
|
else
|
||||||
|
if ( r_decalstaticprops.GetBool() && instance.m_LightCacheHandle )
|
||||||
|
{
|
||||||
|
instance.m_AmbientLightingState = *(LightcacheGetStatic( *pCache, NULL, LIGHTCACHEFLAGS_STATIC ));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,8 +31,7 @@ extern ConVar sv_lan;
|
|||||||
static char g_MasterServers[][64] =
|
static char g_MasterServers[][64] =
|
||||||
{
|
{
|
||||||
"185.192.97.130:27010",
|
"185.192.97.130:27010",
|
||||||
"168.138.92.21:27016",
|
"168.138.92.21:27016"
|
||||||
"135.125.188.162:27010"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef DEDICATED
|
#ifdef DEDICATED
|
||||||
|
@ -226,7 +226,7 @@ bool CPureServerWhitelist::LoadCommandsFromKeyValues( KeyValues *kv )
|
|||||||
else
|
else
|
||||||
Warning( "Unknown modifier in whitelist file: %s.\n", mods[i] );
|
Warning( "Unknown modifier in whitelist file: %s.\n", mods[i] );
|
||||||
}
|
}
|
||||||
mods.PurgeAndDeleteElementsArray();
|
mods.PurgeAndDeleteElements();
|
||||||
if (
|
if (
|
||||||
( bFromTrustedSource && ( bAllowFromDisk || bCheckCRC || bAny ) )
|
( bFromTrustedSource && ( bAllowFromDisk || bCheckCRC || bAny ) )
|
||||||
|| ( bAny && bCheckCRC ) )
|
|| ( bAny && bCheckCRC ) )
|
||||||
|
@ -987,7 +987,7 @@ private:
|
|||||||
int m_iTree;
|
int m_iTree;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
class CIntersectPoint : public CPartitionVisitor
|
class CIntersectPoint : public CPartitionVisitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -1009,7 +1009,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
fltx4 m_f4Point;
|
fltx4 m_f4Point;
|
||||||
};
|
};
|
||||||
*/
|
|
||||||
|
|
||||||
class CIntersectBox : public CPartitionVisitor
|
class CIntersectBox : public CPartitionVisitor
|
||||||
{
|
{
|
||||||
@ -1040,8 +1040,8 @@ class CIntersectRay : public CPartitionVisitor
|
|||||||
public:
|
public:
|
||||||
CIntersectRay( CVoxelTree *pPartition, const Ray_t &ray, const Vector &vecInvDelta ) : CPartitionVisitor( pPartition )
|
CIntersectRay( CVoxelTree *pPartition, const Ray_t &ray, const Vector &vecInvDelta ) : CPartitionVisitor( pPartition )
|
||||||
{
|
{
|
||||||
m_f4Start = LoadAlignedSIMD( ray.m_Start.Base() );
|
m_f4Start = LoadUnaligned3SIMD( ray.m_Start.Base() );
|
||||||
m_f4Delta = LoadAlignedSIMD( ray.m_Delta.Base() );
|
m_f4Delta = LoadUnaligned3SIMD( ray.m_Delta.Base() );
|
||||||
m_f4InvDelta = LoadUnaligned3SIMD( vecInvDelta.Base() );
|
m_f4InvDelta = LoadUnaligned3SIMD( vecInvDelta.Base() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1069,10 +1069,10 @@ class CIntersectSweptBox : public CPartitionVisitor
|
|||||||
public:
|
public:
|
||||||
CIntersectSweptBox( CVoxelTree *pPartition, const Ray_t &ray, const Vector &vecInvDelta ) : CPartitionVisitor( pPartition )
|
CIntersectSweptBox( CVoxelTree *pPartition, const Ray_t &ray, const Vector &vecInvDelta ) : CPartitionVisitor( pPartition )
|
||||||
{
|
{
|
||||||
m_f4Start = LoadAlignedSIMD( ray.m_Start.Base() );
|
m_f4Start = LoadUnaligned3SIMD( ray.m_Start.Base() );
|
||||||
m_f4Delta = LoadAlignedSIMD( ray.m_Delta.Base() );
|
m_f4Delta = LoadUnaligned3SIMD( ray.m_Delta.Base() );
|
||||||
m_f4Extents = LoadAlignedSIMD( ray.m_Extents.Base() );
|
|
||||||
m_f4InvDelta = LoadUnaligned3SIMD( vecInvDelta.Base() );
|
m_f4InvDelta = LoadUnaligned3SIMD( vecInvDelta.Base() );
|
||||||
|
m_f4Extents = LoadUnaligned3SIMD( ray.m_Extents.Base() );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Intersects( const float *pMins, const float *pMaxs ) const
|
bool Intersects( const float *pMins, const float *pMaxs ) const
|
||||||
|
@ -1339,6 +1339,7 @@ void CStaticPropMgr::UnserializeModels( CUtlBuffer& buf )
|
|||||||
case 5: UnserializeLump<StaticPropLumpV5_t>(&lump, buf); break;
|
case 5: UnserializeLump<StaticPropLumpV5_t>(&lump, buf); break;
|
||||||
case 6: UnserializeLump<StaticPropLumpV6_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 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:
|
case 10:
|
||||||
{
|
{
|
||||||
if( s_MapVersion == 21 )
|
if( s_MapVersion == 21 )
|
||||||
@ -1347,8 +1348,7 @@ void CStaticPropMgr::UnserializeModels( CUtlBuffer& buf )
|
|||||||
UnserializeLump<StaticPropLumpV10_t>(&lump, buf);
|
UnserializeLump<StaticPropLumpV10_t>(&lump, buf);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 9: UnserializeLump<StaticPropLumpV9_t>(&lump, buf); break;
|
case 11: UnserializeLump<StaticPropLumpV11_t>(&lump, buf);
|
||||||
case 11: UnserializeLump<StaticPropLumpV11_t>(&lump, buf); break;
|
|
||||||
default:
|
default:
|
||||||
Assert("Unexpected version while deserializing lumps.");
|
Assert("Unexpected version while deserializing lumps.");
|
||||||
}
|
}
|
||||||
|
@ -1227,7 +1227,7 @@ void SV_DetermineMulticastRecipients( bool usepas, const Vector& origin, CBitVec
|
|||||||
serverGameClients->ClientEarPosition( pClient->edict, &vecEarPosition );
|
serverGameClients->ClientEarPosition( pClient->edict, &vecEarPosition );
|
||||||
|
|
||||||
int iBitNumber = CM_LeafCluster( CM_PointLeafnum( vecEarPosition ) );
|
int iBitNumber = CM_LeafCluster( CM_PointLeafnum( vecEarPosition ) );
|
||||||
if ( iBitNumber < 0 || !(pMask[iBitNumber>>3] & (1<<(iBitNumber&7)) ) )
|
if ( !(pMask[iBitNumber>>3] & (1<<(iBitNumber&7)) ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
playerbits.Set( i );
|
playerbits.Set( i );
|
||||||
|
@ -1534,7 +1534,7 @@ void Sys_NoCrashDialog()
|
|||||||
|
|
||||||
void Sys_TestSendKey( const char *pKey )
|
void Sys_TestSendKey( const char *pKey )
|
||||||
{
|
{
|
||||||
#if defined(_WIN32) && !defined(USE_SDL) && !defined(_XBOX) && !defined(DEDICATED)
|
#if defined(_WIN32) && !defined(USE_SDL) && !defined(_XBOX)
|
||||||
int key = pKey[0];
|
int key = pKey[0];
|
||||||
if ( pKey[0] == '\\' && pKey[1] == 'r' )
|
if ( pKey[0] == '\\' && pKey[1] == 'r' )
|
||||||
{
|
{
|
||||||
|
@ -263,6 +263,7 @@ GameMessageHandler_t g_GameMessageHandlers[] =
|
|||||||
{ IE_Quit, &CGame::HandleMsg_Close },
|
{ IE_Quit, &CGame::HandleMsg_Close },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void CGame::AppActivate( bool fActive )
|
void CGame::AppActivate( bool fActive )
|
||||||
{
|
{
|
||||||
// If text mode, force it to be active.
|
// If text mode, force it to be active.
|
||||||
@ -298,18 +299,8 @@ void CGame::AppActivate( bool fActive )
|
|||||||
// Clear keyboard states (should be cleared already but...)
|
// Clear keyboard states (should be cleared already but...)
|
||||||
// VGui_ActivateMouse will reactivate the mouse soon.
|
// VGui_ActivateMouse will reactivate the mouse soon.
|
||||||
ClearIOStates();
|
ClearIOStates();
|
||||||
|
|
||||||
UpdateMaterialSystemConfig();
|
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
|
else
|
||||||
{
|
{
|
||||||
@ -364,7 +355,7 @@ void CGame::HandleMsg_Close( const InputEvent_t &event )
|
|||||||
|
|
||||||
void CGame::DispatchInputEvent( const InputEvent_t &event )
|
void CGame::DispatchInputEvent( const InputEvent_t &event )
|
||||||
{
|
{
|
||||||
switch( event.m_nType )
|
switch( event.m_nType & 0xFFFF )
|
||||||
{
|
{
|
||||||
// Handle button events specially,
|
// Handle button events specially,
|
||||||
// since we have all manner of crazy filtering going on when dealing with them
|
// since we have all manner of crazy filtering going on when dealing with them
|
||||||
|
@ -1842,7 +1842,7 @@ void CVEngineServer::PlaybackTempEntity( IRecipientFilter& filter, float delay,
|
|||||||
|
|
||||||
newEvent->bits = buffer.GetNumBitsWritten();
|
newEvent->bits = buffer.GetNumBitsWritten();
|
||||||
int size = Bits2Bytes( buffer.GetNumBitsWritten() );
|
int size = Bits2Bytes( buffer.GetNumBitsWritten() );
|
||||||
newEvent->pData = new byte[ALIGN_VALUE(size,4)];
|
newEvent->pData = new byte[size];
|
||||||
Q_memcpy( newEvent->pData, data, size );
|
Q_memcpy( newEvent->pData, data, size );
|
||||||
|
|
||||||
// add to list
|
// add to list
|
||||||
|
@ -268,7 +268,7 @@ public:
|
|||||||
|
|
||||||
if ( data )
|
if ( data )
|
||||||
{
|
{
|
||||||
g_DrawTreeSelectedPanel = (data) ? (vgui::VPANEL)data->GetPtr( "PanelPtr", 0 ) : 0;
|
g_DrawTreeSelectedPanel = (data) ? (vgui::VPANEL)data->GetInt( "PanelPtr", 0 ) : 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -388,7 +388,7 @@ void VGui_RecursivePrintTree(
|
|||||||
Q_snprintf( str, sizeof( str ), "%s", name );
|
Q_snprintf( str, sizeof( str ), "%s", name );
|
||||||
|
|
||||||
pVal->SetString( "Text", str );
|
pVal->SetString( "Text", str );
|
||||||
pVal->SetPtr( "PanelPtr", (void*)current );
|
pVal->SetInt( "PanelPtr", current );
|
||||||
|
|
||||||
pNewParent = pVal;
|
pNewParent = pVal;
|
||||||
|
|
||||||
@ -417,7 +417,7 @@ bool UpdateItemState(
|
|||||||
vgui::IPanel *ipanel = vgui::ipanel();
|
vgui::IPanel *ipanel = vgui::ipanel();
|
||||||
|
|
||||||
KeyValues *pItemData = pTree->GetItemData( iChildItemId );
|
KeyValues *pItemData = pTree->GetItemData( iChildItemId );
|
||||||
if ( pItemData->GetPtr( "PanelPtr" ) != pSub->GetPtr( "PanelPtr" ) ||
|
if ( pItemData->GetInt( "PanelPtr" ) != pSub->GetInt( "PanelPtr" ) ||
|
||||||
Q_stricmp( pItemData->GetString( "Text" ), pSub->GetString( "Text" ) ) != 0 )
|
Q_stricmp( pItemData->GetString( "Text" ), pSub->GetString( "Text" ) ) != 0 )
|
||||||
{
|
{
|
||||||
pTree->ModifyItem( iChildItemId, pSub );
|
pTree->ModifyItem( iChildItemId, pSub );
|
||||||
@ -425,7 +425,7 @@ bool UpdateItemState(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ok, this is a new panel.
|
// Ok, this is a new panel.
|
||||||
vgui::VPANEL vPanel = (vgui::VPANEL)pSub->GetPtr( "PanelPtr" );
|
vgui::VPANEL vPanel = pSub->GetInt( "PanelPtr" );
|
||||||
|
|
||||||
int iBaseColor[3] = { 255, 255, 255 };
|
int iBaseColor[3] = { 255, 255, 255 };
|
||||||
if ( ipanel->IsPopup( vPanel ) )
|
if ( ipanel->IsPopup( vPanel ) )
|
||||||
@ -433,7 +433,7 @@ bool UpdateItemState(
|
|||||||
iBaseColor[0] = 255; iBaseColor[1] = 255; iBaseColor[2] = 0;
|
iBaseColor[0] = 255; iBaseColor[1] = 255; iBaseColor[2] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( g_FocusPanelList.Find( vPanel ) != vgui::INVALID_PANEL )
|
if ( g_FocusPanelList.Find( vPanel ) != -1 )
|
||||||
{
|
{
|
||||||
iBaseColor[0] = 0; iBaseColor[1] = 255; iBaseColor[2] = 0;
|
iBaseColor[0] = 0; iBaseColor[1] = 255; iBaseColor[2] = 0;
|
||||||
pTree->ExpandItem( iChildItemId, true );
|
pTree->ExpandItem( iChildItemId, true );
|
||||||
|
@ -212,24 +212,25 @@ def build(bld):
|
|||||||
]
|
]
|
||||||
if bld.env.DEST_OS != "darwin":
|
if bld.env.DEST_OS != "darwin":
|
||||||
source += ['audio/snd_dev_sdl.cpp']
|
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':
|
if bld.env.DEST_OS == 'win32':
|
||||||
source += ['../public/tier0/memoverride.cpp']
|
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',
|
||||||
|
]
|
||||||
else:
|
else:
|
||||||
source += ['audio/snd_posix.cpp']
|
source += [
|
||||||
|
'sys_linuxwind.cpp',
|
||||||
|
'audio/snd_posix.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
if bld.env.DEDICATED:
|
if bld.env.DEDICATED:
|
||||||
source += ['cl_null.cpp', 'sys_stubwind.cpp']
|
source += ['cl_null.cpp']
|
||||||
else:
|
else:
|
||||||
source += source_win if bld.env.DEST_OS == 'win32' else ['sys_stubwind.cpp']
|
|
||||||
|
|
||||||
source += [
|
source += [
|
||||||
'client_pch.cpp',
|
'client_pch.cpp',
|
||||||
'cl_rcon.cpp',
|
'cl_rcon.cpp',
|
||||||
|
@ -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 ) );
|
V_strncpy( pFindData->findData.cFileName, V_UnqualifiedFileName( pFindData->m_fileMatchesFromVPKOrPak[0] ), sizeof( pFindData->findData.cFileName ) );
|
||||||
pFindData->findData.dwFileAttributes = 0;
|
pFindData->findData.dwFileAttributes = 0;
|
||||||
delete[] pFindData->m_fileMatchesFromVPKOrPak.Head();
|
delete pFindData->m_fileMatchesFromVPKOrPak.Head();
|
||||||
pFindData->m_fileMatchesFromVPKOrPak.RemoveMultipleFromHead( 1 );
|
pFindData->m_fileMatchesFromVPKOrPak.RemoveMultipleFromHead( 1 );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -696,7 +696,6 @@ int CFileSystem_Stdio::FS_stat( const char *pathT, struct _stat *buf, bool *pbLo
|
|||||||
int rt = _stat( path, buf );
|
int rt = _stat( path, buf );
|
||||||
|
|
||||||
// Workaround bug wherein stat() randomly fails on Windows XP. See comment on function.
|
// Workaround bug wherein stat() randomly fails on Windows XP. See comment on function.
|
||||||
/*
|
|
||||||
#if defined(_WIN32) && defined(FILESYSTEM_MSVC2015_STAT_BUG_WORKAROUND)
|
#if defined(_WIN32) && defined(FILESYSTEM_MSVC2015_STAT_BUG_WORKAROUND)
|
||||||
if ( rt == -1 )
|
if ( rt == -1 )
|
||||||
{
|
{
|
||||||
@ -707,7 +706,6 @@ int CFileSystem_Stdio::FS_stat( const char *pathT, struct _stat *buf, bool *pbLo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // defined(_WIN32) && defined(FILESYSTEM_MSVC2015_STAT_BUG_WORKAROUND)
|
#endif // defined(_WIN32) && defined(FILESYSTEM_MSVC2015_STAT_BUG_WORKAROUND)
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(LINUX) || defined(PLATFORM_BSD)
|
#if defined(LINUX) || defined(PLATFORM_BSD)
|
||||||
if ( rt == -1 )
|
if ( rt == -1 )
|
||||||
|
@ -729,7 +729,7 @@ public:
|
|||||||
void PrecacheMaterial( const char *pMaterialName );
|
void PrecacheMaterial( const char *pMaterialName );
|
||||||
|
|
||||||
virtual bool IsConnectedUserInfoChangeAllowed( IConVar *pCvar );
|
virtual bool IsConnectedUserInfoChangeAllowed( IConVar *pCvar );
|
||||||
virtual void IN_TouchEvent( int type, int fingerId, int x, int y );
|
virtual void IN_TouchEvent( uint data, uint data2, uint data3, uint data4 );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UncacheAllMaterials( );
|
void UncacheAllMaterials( );
|
||||||
@ -1631,7 +1631,6 @@ void CHLClient::LevelInitPreEntity( char const* pMapName )
|
|||||||
g_RagdollLVManager.SetLowViolence( pMapName );
|
g_RagdollLVManager.SetLowViolence( pMapName );
|
||||||
|
|
||||||
gHUD.LevelInit();
|
gHUD.LevelInit();
|
||||||
gTouch.LevelInit();
|
|
||||||
|
|
||||||
#if defined( REPLAY_ENABLED )
|
#if defined( REPLAY_ENABLED )
|
||||||
// Initialize replay ragdoll recorder
|
// Initialize replay ragdoll recorder
|
||||||
@ -2638,20 +2637,24 @@ CSteamID GetSteamIDForPlayerIndex( int iPlayerIndex )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void CHLClient::IN_TouchEvent( int type, int fingerId, int x, int y )
|
void CHLClient::IN_TouchEvent( uint data, uint data2, uint data3, uint data4 )
|
||||||
{
|
{
|
||||||
if( enginevgui->IsGameUIVisible() )
|
if( enginevgui->IsGameUIVisible() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
touch_event_t ev;
|
touch_event_t ev;
|
||||||
|
|
||||||
ev.type = type;
|
ev.type = data & 0xFFFF;
|
||||||
ev.fingerid = fingerId;
|
ev.fingerid = (data >> 16) & 0xFFFF;
|
||||||
memcpy( &ev.x, &x, sizeof(ev.x) );
|
ev.x = (double)((data2 >> 16) & 0xFFFF) / 0xFFFF;
|
||||||
memcpy( &ev.y, &y, sizeof(ev.y) );
|
ev.y = (double)(data2 & 0xFFFF) / 0xFFFF;
|
||||||
|
|
||||||
if( type == IE_FingerMotion )
|
union{uint i;float f;} ifconv;
|
||||||
inputsystem->GetTouchAccumulators( fingerId, ev.dx, ev.dy );
|
ifconv.i = data3;
|
||||||
|
ev.dx = ifconv.f;
|
||||||
|
|
||||||
|
ifconv.i = data4;
|
||||||
|
ev.dy = ifconv.f;
|
||||||
|
|
||||||
gTouch.ProcessEvent( &ev );
|
gTouch.ProcessEvent( &ev );
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ DECLARE_HUDELEMENT( CHudHealth );
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Constructor
|
// Purpose: Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
CHudHealth::CHudHealth( const char *pElementName ) : CHudElement( pElementName ), CHudNumericDisplay(NULL, "HudHealth"), m_pHealthIcon( NULL )
|
CHudHealth::CHudHealth( const char *pElementName ) : CHudElement( pElementName ), CHudNumericDisplay(NULL, "HudHealth")
|
||||||
{
|
{
|
||||||
SetHiddenBits( HIDEHUD_HEALTH | HIDEHUD_PLAYERDEAD );
|
SetHiddenBits( HIDEHUD_HEALTH | HIDEHUD_PLAYERDEAD );
|
||||||
}
|
}
|
||||||
@ -172,4 +172,4 @@ void CHudHealth::Paint( void )
|
|||||||
|
|
||||||
//draw the health icon
|
//draw the health icon
|
||||||
BaseClass::Paint();
|
BaseClass::Paint();
|
||||||
}
|
}
|
@ -152,13 +152,13 @@ void CCSViewRender::PerformNightVisionEffect( const CViewSetup &view )
|
|||||||
render->ViewDrawFade( overlaycolor, pMaterial );
|
render->ViewDrawFade( overlaycolor, pMaterial );
|
||||||
|
|
||||||
// Only one pass in DX7.
|
// Only one pass in DX7.
|
||||||
/* if ( g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 80 )
|
if ( g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 80 )
|
||||||
{
|
{
|
||||||
CMatRenderContextPtr pRenderContext( materials );
|
CMatRenderContextPtr pRenderContext( materials );
|
||||||
pRenderContext->DrawScreenSpaceQuad( pMaterial );
|
pRenderContext->DrawScreenSpaceQuad( pMaterial );
|
||||||
render->ViewDrawFade( overlaycolor, pMaterial );
|
render->ViewDrawFade( overlaycolor, pMaterial );
|
||||||
pRenderContext->DrawScreenSpaceQuad( pMaterial );
|
pRenderContext->DrawScreenSpaceQuad( pMaterial );
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -211,7 +211,6 @@ void CCSViewRender::PerformFlashbangEffect( const CViewSetup &view )
|
|||||||
render->ViewDrawFade( overlaycolor, pMaterial );
|
render->ViewDrawFade( overlaycolor, pMaterial );
|
||||||
|
|
||||||
// just do one pass for dxlevel < 80.
|
// 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,
|
pRenderContext->DrawScreenSpaceRectangle( pMaterial, view.x, view.y, view.width, view.height,
|
||||||
@ -222,7 +221,6 @@ void CCSViewRender::PerformFlashbangEffect( const CViewSetup &view )
|
|||||||
0, 0, m_pFlashTexture->GetActualWidth()-1, m_pFlashTexture->GetActualHeight()-1,
|
0, 0, m_pFlashTexture->GetActualWidth()-1, m_pFlashTexture->GetActualHeight()-1,
|
||||||
m_pFlashTexture->GetActualWidth(), m_pFlashTexture->GetActualHeight() );
|
m_pFlashTexture->GetActualWidth(), m_pFlashTexture->GetActualHeight() );
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
else if ( m_pFlashTexture )
|
else if ( m_pFlashTexture )
|
||||||
{
|
{
|
||||||
@ -235,7 +233,7 @@ void CCSViewRender::PerformFlashbangEffect( const CViewSetup &view )
|
|||||||
render->ViewDrawFade( overlaycolor, pMaterial );
|
render->ViewDrawFade( overlaycolor, pMaterial );
|
||||||
|
|
||||||
// just do one pass for dxlevel < 80.
|
// 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,
|
pRenderContext->DrawScreenSpaceRectangle( pMaterial, view.x, view.y, view.width, view.height,
|
||||||
0, 0, m_pFlashTexture->GetActualWidth()-1, m_pFlashTexture->GetActualHeight()-1,
|
0, 0, m_pFlashTexture->GetActualWidth()-1, m_pFlashTexture->GetActualHeight()-1,
|
||||||
@ -244,7 +242,7 @@ void CCSViewRender::PerformFlashbangEffect( const CViewSetup &view )
|
|||||||
pRenderContext->DrawScreenSpaceRectangle( pMaterial, view.x, view.y, view.width, view.height,
|
pRenderContext->DrawScreenSpaceRectangle( pMaterial, view.x, view.y, view.width, view.height,
|
||||||
0, 0, m_pFlashTexture->GetActualWidth()-1, m_pFlashTexture->GetActualHeight()-1,
|
0, 0, m_pFlashTexture->GetActualWidth()-1, m_pFlashTexture->GetActualHeight()-1,
|
||||||
m_pFlashTexture->GetActualWidth(), m_pFlashTexture->GetActualHeight() );
|
m_pFlashTexture->GetActualWidth(), m_pFlashTexture->GetActualHeight() );
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this does the pure white overlay part of the flashbang effect.
|
// this does the pure white overlay part of the flashbang effect.
|
||||||
|
@ -47,7 +47,7 @@ private:
|
|||||||
DECLARE_HUDELEMENT( CHudArmor );
|
DECLARE_HUDELEMENT( CHudArmor );
|
||||||
|
|
||||||
|
|
||||||
CHudArmor::CHudArmor( const char *pName ) : CHudNumericDisplay( NULL, "HudArmor" ), CHudElement( pName ), m_pArmorIcon( NULL )
|
CHudArmor::CHudArmor( const char *pName ) : CHudNumericDisplay( NULL, "HudArmor" ), CHudElement( pName )
|
||||||
{
|
{
|
||||||
SetHiddenBits( HIDEHUD_HEALTH | HIDEHUD_PLAYERDEAD );
|
SetHiddenBits( HIDEHUD_HEALTH | HIDEHUD_PLAYERDEAD );
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ void CTeamMenu::ApplySchemeSettings(IScheme *pScheme)
|
|||||||
|
|
||||||
if ( *m_szMapName )
|
if ( *m_szMapName )
|
||||||
{
|
{
|
||||||
LoadMapPage( NULL ); // reload the map description to pick up the color
|
LoadMapPage( m_szMapName ); // reload the map description to pick up the color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,23 +185,22 @@ void CTeamMenu::Update()
|
|||||||
void CTeamMenu::LoadMapPage( const char *mapName )
|
void CTeamMenu::LoadMapPage( const char *mapName )
|
||||||
{
|
{
|
||||||
// Save off the map name so we can re-load the page in ApplySchemeSettings().
|
// Save off the map name so we can re-load the page in ApplySchemeSettings().
|
||||||
if( mapName )
|
Q_strncpy( m_szMapName, mapName, strlen( mapName ) + 1 );
|
||||||
Q_strncpy( m_szMapName, mapName, strlen( mapName ) + 1 );
|
|
||||||
|
|
||||||
char mapRES[ MAX_PATH ];
|
char mapRES[ MAX_PATH ];
|
||||||
|
|
||||||
char uilanguage[ 64 ];
|
char uilanguage[ 64 ];
|
||||||
uilanguage[0] = 0;
|
uilanguage[0] = 0;
|
||||||
engine->GetUILanguage( uilanguage, sizeof( uilanguage ) );
|
engine->GetUILanguage( uilanguage, sizeof( uilanguage ) );
|
||||||
|
|
||||||
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_%s.html", m_szMapName, uilanguage );
|
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_%s.html", mapName, uilanguage );
|
||||||
|
|
||||||
bool bFoundHTML = false;
|
bool bFoundHTML = false;
|
||||||
|
|
||||||
if ( !g_pFullFileSystem->FileExists( mapRES ) )
|
if ( !g_pFullFileSystem->FileExists( mapRES ) )
|
||||||
{
|
{
|
||||||
// try english
|
// try english
|
||||||
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_english.html", m_szMapName );
|
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_english.html", mapName );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -241,7 +240,7 @@ void CTeamMenu::LoadMapPage( const char *mapName )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_snprintf( mapRES, sizeof( mapRES ), "maps/%s.txt", m_szMapName);
|
Q_snprintf( mapRES, sizeof( mapRES ), "maps/%s.txt", mapName);
|
||||||
|
|
||||||
// if no map specific description exists, load default text
|
// if no map specific description exists, load default text
|
||||||
if( !g_pFullFileSystem->FileExists( mapRES ) )
|
if( !g_pFullFileSystem->FileExists( mapRES ) )
|
||||||
|
@ -313,7 +313,7 @@ void CTouchControls::ResetToDefaults()
|
|||||||
{
|
{
|
||||||
rgba_t color(255, 255, 255, 155);
|
rgba_t color(255, 255, 255, 155);
|
||||||
char buf[MAX_PATH];
|
char buf[MAX_PATH];
|
||||||
gridcolor = rgba_t(255, 0, 0, 30);
|
gridcolor = rgba_t(255, 0, 0, 50);
|
||||||
|
|
||||||
RemoveButtons();
|
RemoveButtons();
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ void CTouchControls::Init()
|
|||||||
mouse_events = 0;
|
mouse_events = 0;
|
||||||
move_start_x = move_start_y = 0.0f;
|
move_start_x = move_start_y = 0.0f;
|
||||||
m_flPreviousYaw = m_flPreviousPitch = 0.f;
|
m_flPreviousYaw = m_flPreviousPitch = 0.f;
|
||||||
gridcolor = rgba_t(255, 0, 0, 30);
|
gridcolor = rgba_t(255, 0, 0, 50);
|
||||||
|
|
||||||
m_bCutScene = false;
|
m_bCutScene = false;
|
||||||
showtexture = hidetexture = resettexture = closetexture = joytexture = 0;
|
showtexture = hidetexture = resettexture = closetexture = joytexture = 0;
|
||||||
@ -425,13 +425,6 @@ void CTouchControls::Init()
|
|||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTouchControls::LevelInit()
|
|
||||||
{
|
|
||||||
m_bCutScene = false;
|
|
||||||
m_AlphaDiff = 0;
|
|
||||||
m_flHideTouch = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int nextPowerOfTwo(int x)
|
int nextPowerOfTwo(int x)
|
||||||
{
|
{
|
||||||
if( (x & (x - 1)) == 0)
|
if( (x & (x - 1)) == 0)
|
||||||
@ -659,8 +652,6 @@ void CTouchControls::Paint()
|
|||||||
|
|
||||||
CUtlLinkedList<CTouchButton*>::iterator it;
|
CUtlLinkedList<CTouchButton*>::iterator it;
|
||||||
|
|
||||||
const rgba_t buttonEditClr = rgba_t( 61, 153, 0, 40 );
|
|
||||||
|
|
||||||
if( state == state_edit )
|
if( state == state_edit )
|
||||||
{
|
{
|
||||||
vgui::surface()->DrawSetColor(gridcolor.r, gridcolor.g, gridcolor.b, gridcolor.a*3); // 255, 0, 0, 200 <- default here
|
vgui::surface()->DrawSetColor(gridcolor.r, gridcolor.g, gridcolor.b, gridcolor.a*3); // 255, 0, 0, 200 <- default here
|
||||||
@ -687,7 +678,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
|
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(buttonEditClr.r, buttonEditClr.g, buttonEditClr.b, buttonEditClr.a); // 255, 0, 0, 50 <- default here
|
vgui::surface()->DrawSetColor(gridcolor.r, gridcolor.g, gridcolor.b, gridcolor.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 );
|
vgui::surface()->DrawFilledRect( btn->x1*screen_w, btn->y1*screen_h, btn->x2*screen_w, btn->y2*screen_h );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,6 @@ class CTouchControls
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Init( );
|
void Init( );
|
||||||
void LevelInit( );
|
|
||||||
void Shutdown( );
|
void Shutdown( );
|
||||||
|
|
||||||
void Paint( );
|
void Paint( );
|
||||||
|
@ -33,7 +33,6 @@ CAI_PolicingBehavior::CAI_PolicingBehavior( void )
|
|||||||
m_bEnabled = false;
|
m_bEnabled = false;
|
||||||
m_nNumWarnings = 0;
|
m_nNumWarnings = 0;
|
||||||
m_bTargetIsHostile = false;
|
m_bTargetIsHostile = false;
|
||||||
m_hPoliceGoal = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -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_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 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
|
class CCSGameMovement : public CGameMovement
|
||||||
{
|
{
|
||||||
@ -691,11 +691,8 @@ bool CCSGameMovement::CheckJumpButton( void )
|
|||||||
return false; // in air, so no effect
|
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
|
return false; // don't pogo stick
|
||||||
}
|
|
||||||
|
|
||||||
if ( !sv_enablebunnyhopping.GetBool() )
|
if ( !sv_enablebunnyhopping.GetBool() )
|
||||||
{
|
{
|
||||||
|
@ -1151,14 +1151,12 @@ ConVarRef suitcharger( "sk_suitcharger" );
|
|||||||
|
|
||||||
void StripChar(char *szBuffer, const char cWhiteSpace )
|
void StripChar(char *szBuffer, const char cWhiteSpace )
|
||||||
{
|
{
|
||||||
char *src, *dst;
|
|
||||||
|
|
||||||
for (src = dst = szBuffer; *src != '\0'; src++)
|
while ( char *pSpace = strchr( szBuffer, cWhiteSpace ) )
|
||||||
{
|
{
|
||||||
*dst = *src;
|
char *pNextChar = pSpace + sizeof(char);
|
||||||
if (*dst != cWhiteSpace) dst++;
|
V_strcpy( pSpace, pNextChar );
|
||||||
}
|
}
|
||||||
*dst = '\0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMultiplayRules::GetNextLevelName( char *pszNextMap, int bufsize, bool bRandom /* = false */ )
|
void CMultiplayRules::GetNextLevelName( char *pszNextMap, int bufsize, bool bRandom /* = false */ )
|
||||||
|
@ -508,7 +508,7 @@ public:
|
|||||||
if ( panel == m_pDXLevel && RequiresRestart() )
|
if ( panel == m_pDXLevel && RequiresRestart() )
|
||||||
{
|
{
|
||||||
// notify the user that this will require a disconnect
|
// notify the user that this will require a disconnect
|
||||||
QueryBox *box = new QueryBox("#GameUI_SettingRequiresDisconnect_Title", "#GameUI_SettingRequiresDisconnect_Info", this);
|
QueryBox *box = new QueryBox("#GameUI_SettingRequiresDisconnect_Title", "#GameUI_SettingRequiresDisconnect_Info");
|
||||||
box->AddActionSignalTarget( this );
|
box->AddActionSignalTarget( this );
|
||||||
box->SetCancelCommand(new KeyValues("ResetDXLevelCombo"));
|
box->SetCancelCommand(new KeyValues("ResetDXLevelCombo"));
|
||||||
box->DoModal();
|
box->DoModal();
|
||||||
|
@ -1530,6 +1530,16 @@ bool CInputSystem::GetRawMouseAccumulators( int& accumX, int& accumY )
|
|||||||
#endif
|
#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 )
|
void CInputSystem::SetConsoleTextMode( bool bConsoleTextMode )
|
||||||
{
|
{
|
||||||
/* If someone calls this after init, shut it down. */
|
/* If someone calls this after init, shut it down. */
|
||||||
|
@ -44,8 +44,6 @@
|
|||||||
|
|
||||||
#include "steam/steam_api.h"
|
#include "steam/steam_api.h"
|
||||||
|
|
||||||
#define TOUCH_FINGER_MAX_COUNT 10
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implementation of the input system
|
// Implementation of the input system
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -103,7 +101,7 @@ public:
|
|||||||
virtual void *GetHapticsInterfaceAddress() const { return NULL;}
|
virtual void *GetHapticsInterfaceAddress() const { return NULL;}
|
||||||
#endif
|
#endif
|
||||||
bool GetRawMouseAccumulators( int& accumX, int& accumY );
|
bool GetRawMouseAccumulators( int& accumX, int& accumY );
|
||||||
virtual bool GetTouchAccumulators( int fingerId, float &dx, float &dy );
|
bool GetTouchAccumulators( InputEventType_t &event, int &fingerId, int& accumX, int& accumY );
|
||||||
|
|
||||||
virtual void SetConsoleTextMode( bool bConsoleTextMode );
|
virtual void SetConsoleTextMode( bool bConsoleTextMode );
|
||||||
|
|
||||||
@ -460,7 +458,8 @@ public:
|
|||||||
bool m_bRawInputSupported;
|
bool m_bRawInputSupported;
|
||||||
int m_mouseRawAccumX, m_mouseRawAccumY;
|
int m_mouseRawAccumX, m_mouseRawAccumY;
|
||||||
|
|
||||||
float m_touchAccumX[TOUCH_FINGER_MAX_COUNT], m_touchAccumY[TOUCH_FINGER_MAX_COUNT];
|
InputEventType_t m_touchAccumEvent;
|
||||||
|
int m_touchAccumFingerId, m_touchAccumX, m_touchAccumY;
|
||||||
|
|
||||||
// For the 'SleepUntilInput' feature
|
// For the 'SleepUntilInput' feature
|
||||||
HANDLE m_hEvent;
|
HANDLE m_hEvent;
|
||||||
|
@ -48,9 +48,6 @@ void CInputSystem::InitializeTouch( void )
|
|||||||
// abort startup if user requests no touch
|
// abort startup if user requests no touch
|
||||||
if ( CommandLine()->FindParm("-notouch") ) return;
|
if ( CommandLine()->FindParm("-notouch") ) return;
|
||||||
|
|
||||||
memset( m_touchAccumX, 0, sizeof(m_touchAccumX) );
|
|
||||||
memset( m_touchAccumY, 0, sizeof(m_touchAccumY) );
|
|
||||||
|
|
||||||
m_bJoystickInitialized = true;
|
m_bJoystickInitialized = true;
|
||||||
SDL_AddEventWatch(TouchSDLWatcher, this);
|
SDL_AddEventWatch(TouchSDLWatcher, this);
|
||||||
}
|
}
|
||||||
@ -64,35 +61,20 @@ void CInputSystem::ShutdownTouch()
|
|||||||
m_bTouchInitialized = false;
|
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)
|
void CInputSystem::FingerEvent(int eventType, int fingerId, float x, float y, float dx, float dy)
|
||||||
{
|
{
|
||||||
if( fingerId >= TOUCH_FINGER_MAX_COUNT )
|
// Shit, but should work with arm/x86
|
||||||
return;
|
|
||||||
|
|
||||||
if( eventType == IE_FingerUp )
|
int data0 = fingerId << 16 | eventType;
|
||||||
{
|
int _x = (int)((double)x*0xFFFF);
|
||||||
m_touchAccumX[fingerId] = 0.f;
|
int _y = (int)((double)y*0xFFFF);
|
||||||
m_touchAccumY[fingerId] = 0.f;
|
int data1 = _x << 16 | (_y & 0xFFFF);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_touchAccumX[fingerId] += dx;
|
|
||||||
m_touchAccumY[fingerId] += dy;
|
|
||||||
}
|
|
||||||
|
|
||||||
int _x,_y;
|
union{int i;float f;} ifconv;
|
||||||
memcpy( &_x, &x, sizeof(float) );
|
ifconv.f = dx;
|
||||||
memcpy( &_y, &y, sizeof(float) );
|
int _dx = ifconv.i;
|
||||||
PostEvent(eventType, m_nLastSampleTick, fingerId, _x, _y);
|
ifconv.f = dy;
|
||||||
|
int _dy = ifconv.i;
|
||||||
|
|
||||||
|
PostEvent(data0, m_nLastSampleTick, data1, _dx, _dy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,9 +43,18 @@ def build(bld):
|
|||||||
|
|
||||||
if bld.env.DEST_OS == 'win32':
|
if bld.env.DEST_OS == 'win32':
|
||||||
libs += ['USER32']
|
libs += ['USER32']
|
||||||
|
|
||||||
install_path = bld.env.LIBDIR
|
install_path = bld.env.LIBDIR
|
||||||
|
|
||||||
|
# Copy SDL2 dependency
|
||||||
|
if bld.env.DEST_OS == 'win32':
|
||||||
|
bld(
|
||||||
|
rule=(('cp' if 'MSYSTEM' in os.environ or sys.platform != 'win32' else 'copy')+' ${SRC} ${TGT}'),
|
||||||
|
source='../lib/win32/'+bld.env.DEST_CPU+'/SDL2.dll',
|
||||||
|
target='SDL2.dll',
|
||||||
|
install_path=install_path,
|
||||||
|
)
|
||||||
|
|
||||||
bld.shlib(
|
bld.shlib(
|
||||||
source = source,
|
source = source,
|
||||||
target = PROJECT_NAME,
|
target = PROJECT_NAME,
|
||||||
|
2
ivp
2
ivp
@ -1 +1 @@
|
|||||||
Subproject commit 47533475e01cbff05fbc3bbe8b4edc485f292cea
|
Subproject commit 4098acbbe3bc48320496f7533851640cc40cbb89
|
@ -82,12 +82,7 @@ void ColorCorrectionLookup_t::AllocTexture()
|
|||||||
sprintf( name, "ColorCorrection - %p", m_Handle );
|
sprintf( name, "ColorCorrection - %p", m_Handle );
|
||||||
|
|
||||||
m_pColorCorrectionTexture = ITextureInternal::CreateProceduralTexture( name, TEXTURE_GROUP_OTHER,
|
m_pColorCorrectionTexture = ITextureInternal::CreateProceduralTexture( name, TEXTURE_GROUP_OTHER,
|
||||||
COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE,
|
COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, IMAGE_FORMAT_BGRX8888,
|
||||||
#ifdef DX_TO_GL_ABSTRACTION
|
|
||||||
IMAGE_FORMAT_RGBA8888,
|
|
||||||
#else
|
|
||||||
IMAGE_FORMAT_BGRX8888,
|
|
||||||
#endif
|
|
||||||
TEXTUREFLAGS_NOMIP | TEXTUREFLAGS_NOLOD | TEXTUREFLAGS_SINGLECOPY | TEXTUREFLAGS_CLAMPS |
|
TEXTUREFLAGS_NOMIP | TEXTUREFLAGS_NOLOD | TEXTUREFLAGS_SINGLECOPY | TEXTUREFLAGS_CLAMPS |
|
||||||
TEXTUREFLAGS_CLAMPT | TEXTUREFLAGS_CLAMPU | TEXTUREFLAGS_NODEBUGOVERRIDE );
|
TEXTUREFLAGS_CLAMPT | TEXTUREFLAGS_CLAMPU | TEXTUREFLAGS_NODEBUGOVERRIDE );
|
||||||
|
|
||||||
|
@ -31,9 +31,9 @@ public:
|
|||||||
{
|
{
|
||||||
MEM_ALLOC_CREDIT_( "CMatCallQueue.m_Allocator" );
|
MEM_ALLOC_CREDIT_( "CMatCallQueue.m_Allocator" );
|
||||||
#ifdef SWDS
|
#ifdef SWDS
|
||||||
m_Allocator.Init( 2*1024, 0, 0, 16 );
|
m_Allocator.Init( 2*1024, 0, 0, 4 );
|
||||||
#else
|
#else
|
||||||
m_Allocator.Init( IsX360() ? 2*1024*1024 : 8*1024*1024, 64*1024, 256*1024, 16 );
|
m_Allocator.Init( IsX360() ? 2*1024*1024 : 8*1024*1024, 64*1024, 256*1024, 4 );
|
||||||
#endif
|
#endif
|
||||||
m_FunctorFactory.SetAllocator( &m_Allocator );
|
m_FunctorFactory.SetAllocator( &m_Allocator );
|
||||||
m_pHead = m_pTail = NULL;
|
m_pHead = m_pTail = NULL;
|
||||||
|
@ -420,6 +420,13 @@ void MatrixGetColumn( const matrix3x4_t& in, int column, Vector &out )
|
|||||||
out.z = in[2][column];
|
out.z = in[2][column];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MatrixSetColumn( const Vector &in, int column, matrix3x4_t& out )
|
||||||
|
{
|
||||||
|
out[0][column] = in.x;
|
||||||
|
out[1][column] = in.y;
|
||||||
|
out[2][column] = in.z;
|
||||||
|
}
|
||||||
|
|
||||||
void MatrixScaleBy ( const float flScale, matrix3x4_t &out )
|
void MatrixScaleBy ( const float flScale, matrix3x4_t &out )
|
||||||
{
|
{
|
||||||
out[0][0] *= flScale;
|
out[0][0] *= flScale;
|
||||||
@ -1085,6 +1092,57 @@ void SetScaleMatrix( float x, float y, float z, matrix3x4_t &dst )
|
|||||||
dst[2][0] = 0.0f; dst[2][1] = 0.0f; dst[2][2] = z; dst[2][3] = 0.0f;
|
dst[2][0] = 0.0f; dst[2][1] = 0.0f; dst[2][2] = z; dst[2][3] = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: Builds the matrix for a counterclockwise rotation about an arbitrary axis.
|
||||||
|
//
|
||||||
|
// | ax2 + (1 - ax2)cosQ axay(1 - cosQ) - azsinQ azax(1 - cosQ) + aysinQ |
|
||||||
|
// Ra(Q) = | axay(1 - cosQ) + azsinQ ay2 + (1 - ay2)cosQ ayaz(1 - cosQ) - axsinQ |
|
||||||
|
// | azax(1 - cosQ) - aysinQ ayaz(1 - cosQ) + axsinQ az2 + (1 - az2)cosQ |
|
||||||
|
//
|
||||||
|
// Input : mat -
|
||||||
|
// vAxisOrRot -
|
||||||
|
// angle -
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void MatrixBuildRotationAboutAxis( const Vector &vAxisOfRot, float angleDegrees, matrix3x4_t &dst )
|
||||||
|
{
|
||||||
|
float radians;
|
||||||
|
float axisXSquared;
|
||||||
|
float axisYSquared;
|
||||||
|
float axisZSquared;
|
||||||
|
float fSin;
|
||||||
|
float fCos;
|
||||||
|
|
||||||
|
radians = angleDegrees * ( M_PI / 180.0 );
|
||||||
|
fSin = sin( radians );
|
||||||
|
fCos = cos( radians );
|
||||||
|
|
||||||
|
axisXSquared = vAxisOfRot[0] * vAxisOfRot[0];
|
||||||
|
axisYSquared = vAxisOfRot[1] * vAxisOfRot[1];
|
||||||
|
axisZSquared = vAxisOfRot[2] * vAxisOfRot[2];
|
||||||
|
|
||||||
|
// Column 0:
|
||||||
|
dst[0][0] = axisXSquared + (1 - axisXSquared) * fCos;
|
||||||
|
dst[1][0] = vAxisOfRot[0] * vAxisOfRot[1] * (1 - fCos) + vAxisOfRot[2] * fSin;
|
||||||
|
dst[2][0] = vAxisOfRot[2] * vAxisOfRot[0] * (1 - fCos) - vAxisOfRot[1] * fSin;
|
||||||
|
|
||||||
|
// Column 1:
|
||||||
|
dst[0][1] = vAxisOfRot[0] * vAxisOfRot[1] * (1 - fCos) - vAxisOfRot[2] * fSin;
|
||||||
|
dst[1][1] = axisYSquared + (1 - axisYSquared) * fCos;
|
||||||
|
dst[2][1] = vAxisOfRot[1] * vAxisOfRot[2] * (1 - fCos) + vAxisOfRot[0] * fSin;
|
||||||
|
|
||||||
|
// Column 2:
|
||||||
|
dst[0][2] = vAxisOfRot[2] * vAxisOfRot[0] * (1 - fCos) + vAxisOfRot[1] * fSin;
|
||||||
|
dst[1][2] = vAxisOfRot[1] * vAxisOfRot[2] * (1 - fCos) - vAxisOfRot[0] * fSin;
|
||||||
|
dst[2][2] = axisZSquared + (1 - axisZSquared) * fCos;
|
||||||
|
|
||||||
|
// Column 3:
|
||||||
|
dst[0][3] = 0;
|
||||||
|
dst[1][3] = 0;
|
||||||
|
dst[2][3] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Computes the transpose
|
// Computes the transpose
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -1392,6 +1450,33 @@ void VectorYawRotate( const Vector &in, float flYaw, Vector &out)
|
|||||||
out.z = in.z;
|
out.z = in.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
float Bias( float x, float biasAmt )
|
||||||
|
{
|
||||||
|
// WARNING: not thread safe
|
||||||
|
static float lastAmt = -1;
|
||||||
|
static float lastExponent = 0;
|
||||||
|
if( lastAmt != biasAmt )
|
||||||
|
{
|
||||||
|
lastExponent = log( biasAmt ) * -1.4427f; // (-1.4427 = 1 / log(0.5))
|
||||||
|
}
|
||||||
|
float fRet = pow( x, lastExponent );
|
||||||
|
Assert ( !IS_NAN( fRet ) );
|
||||||
|
return fRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float Gain( float x, float biasAmt )
|
||||||
|
{
|
||||||
|
// WARNING: not thread safe
|
||||||
|
if( x < 0.5 )
|
||||||
|
return 0.5f * Bias( 2*x, 1-biasAmt );
|
||||||
|
else
|
||||||
|
return 1 - 0.5f * Bias( 2 - 2*x, 1-biasAmt );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
float SmoothCurve( float x )
|
float SmoothCurve( float x )
|
||||||
{
|
{
|
||||||
// Actual smooth curve. Visualization:
|
// Actual smooth curve. Visualization:
|
||||||
|
1264
mathlib/vmatrix.cpp
1264
mathlib/vmatrix.cpp
File diff suppressed because it is too large
Load Diff
@ -790,7 +790,7 @@ public:
|
|||||||
|
|
||||||
virtual bool IsConnectedUserInfoChangeAllowed( IConVar *pCvar ) = 0;
|
virtual bool IsConnectedUserInfoChangeAllowed( IConVar *pCvar ) = 0;
|
||||||
|
|
||||||
virtual void IN_TouchEvent( int type, int fingerId, int x, int y ) = 0;
|
virtual void IN_TouchEvent( uint data, uint data2, uint data3, uint data4 ) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CLIENT_DLL_INTERFACE_VERSION "VClient017"
|
#define CLIENT_DLL_INTERFACE_VERSION "VClient017"
|
||||||
|
@ -119,7 +119,6 @@ public:
|
|||||||
|
|
||||||
// read and clear accumulated raw input values
|
// read and clear accumulated raw input values
|
||||||
virtual bool GetRawMouseAccumulators( int& accumX, int& accumY ) = 0;
|
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.
|
// 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.
|
// this is used for dedicated servers to not initialize joystick system.
|
||||||
|
@ -22,16 +22,10 @@ extern float (*pfFastCos)(float x);
|
|||||||
|
|
||||||
// The following are not declared as macros because they are often used in limiting situations,
|
// The following are not declared as macros because they are often used in limiting situations,
|
||||||
// and sometimes the compiler simply refuses to inline them for some reason
|
// and sometimes the compiler simply refuses to inline them for some reason
|
||||||
#define FastSqrt(x) sqrtf(x)
|
#define FastSqrt(x) (*pfSqrt)(x)
|
||||||
#define FastRSqrt(x) (1.f/sqrtf(x))
|
#define FastRSqrt(x) (*pfRSqrt)(x)
|
||||||
#define FastRSqrtFast(x) (1.f/sqrtf(x))
|
#define FastRSqrtFast(x) (*pfRSqrtFast)(x)
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define FastSinCos(x,s,c) (*pfFastSinCos)(x,s,c)
|
#define FastSinCos(x,s,c) (*pfFastSinCos)(x,s,c)
|
||||||
#else
|
|
||||||
#define FastSinCos(x,s,c) sincosf(x,s,c)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define FastCos(x) (*pfFastCos)(x)
|
#define FastCos(x) (*pfFastCos)(x)
|
||||||
|
|
||||||
#if defined(__i386__) || defined(_M_IX86)
|
#if defined(__i386__) || defined(_M_IX86)
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
// FP exception clean so this not a turnkey operation.
|
// FP exception clean so this not a turnkey operation.
|
||||||
//#define FP_EXCEPTIONS_ENABLED
|
//#define FP_EXCEPTIONS_ENABLED
|
||||||
|
|
||||||
|
|
||||||
#ifdef FP_EXCEPTIONS_ENABLED
|
#ifdef FP_EXCEPTIONS_ENABLED
|
||||||
#include <float.h> // For _clearfp and _controlfp_s
|
#include <float.h> // For _clearfp and _controlfp_s
|
||||||
#endif
|
#endif
|
||||||
@ -92,11 +93,37 @@ private:
|
|||||||
FPExceptionEnabler& operator=(const FPExceptionEnabler&);
|
FPExceptionEnabler& operator=(const FPExceptionEnabler&);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline float clamp( const float val, const float minVal, const float maxVal )
|
|
||||||
|
|
||||||
|
#ifdef DEBUG // stop crashing edit-and-continue
|
||||||
|
FORCEINLINE float clamp( float val, float minVal, float maxVal )
|
||||||
{
|
{
|
||||||
const float t = val < minVal ? minVal : val;
|
if ( maxVal < minVal )
|
||||||
return t > maxVal ? maxVal : t;
|
return maxVal;
|
||||||
|
else if( val < minVal )
|
||||||
|
return minVal;
|
||||||
|
else if( val > maxVal )
|
||||||
|
return maxVal;
|
||||||
|
else
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
|
#else // DEBUG
|
||||||
|
FORCEINLINE float clamp( float val, float minVal, float maxVal )
|
||||||
|
{
|
||||||
|
#if defined(__i386__) || defined(_M_IX86)
|
||||||
|
_mm_store_ss( &val,
|
||||||
|
_mm_min_ss(
|
||||||
|
_mm_max_ss(
|
||||||
|
_mm_load_ss(&val),
|
||||||
|
_mm_load_ss(&minVal) ),
|
||||||
|
_mm_load_ss(&maxVal) ) );
|
||||||
|
#else
|
||||||
|
val = fpmax(minVal, val);
|
||||||
|
val = fpmin(maxVal, val);
|
||||||
|
#endif
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
#endif // DEBUG
|
||||||
|
|
||||||
//
|
//
|
||||||
// Returns a clamped value in the range [min, max].
|
// Returns a clamped value in the range [min, max].
|
||||||
@ -104,10 +131,17 @@ inline float clamp( const float val, const float minVal, const float maxVal )
|
|||||||
template< class T >
|
template< class T >
|
||||||
inline T clamp( T const &val, T const &minVal, T const &maxVal )
|
inline T clamp( T const &val, T const &minVal, T const &maxVal )
|
||||||
{
|
{
|
||||||
const T t = val< minVal ? minVal : val;
|
if ( maxVal < minVal )
|
||||||
return t > maxVal ? maxVal : t;
|
return maxVal;
|
||||||
|
else if( val < minVal )
|
||||||
|
return minVal;
|
||||||
|
else if( val > maxVal )
|
||||||
|
return maxVal;
|
||||||
|
else
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// plane_t structure
|
// plane_t structure
|
||||||
// !!! if this is changed, it must be changed in asm code too !!!
|
// !!! if this is changed, it must be changed in asm code too !!!
|
||||||
// FIXME: does the asm code even exist anymore?
|
// FIXME: does the asm code even exist anymore?
|
||||||
@ -203,8 +237,8 @@ bool R_CullBoxSkipNear( const Vector& mins, const Vector& maxs, const Frustum_t
|
|||||||
|
|
||||||
struct matrix3x4_t
|
struct matrix3x4_t
|
||||||
{
|
{
|
||||||
inline matrix3x4_t() = default;
|
matrix3x4_t() = default;
|
||||||
inline matrix3x4_t(
|
matrix3x4_t(
|
||||||
float m00, float m01, float m02, float m03,
|
float m00, float m01, float m02, float m03,
|
||||||
float m10, float m11, float m12, float m13,
|
float m10, float m11, float m12, float m13,
|
||||||
float m20, float m21, float m22, float m23 )
|
float m20, float m21, float m22, float m23 )
|
||||||
@ -218,7 +252,7 @@ struct matrix3x4_t
|
|||||||
// Creates a matrix where the X axis = forward
|
// Creates a matrix where the X axis = forward
|
||||||
// the Y axis = left, and the Z axis = up
|
// the Y axis = left, and the Z axis = up
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
inline void Init( const Vector& xAxis, const Vector& yAxis, const Vector& zAxis, const Vector &vecOrigin )
|
void Init( const Vector& xAxis, const Vector& yAxis, const Vector& zAxis, const Vector &vecOrigin )
|
||||||
{
|
{
|
||||||
m_flMatVal[0][0] = xAxis.x; m_flMatVal[0][1] = yAxis.x; m_flMatVal[0][2] = zAxis.x; m_flMatVal[0][3] = vecOrigin.x;
|
m_flMatVal[0][0] = xAxis.x; m_flMatVal[0][1] = yAxis.x; m_flMatVal[0][2] = zAxis.x; m_flMatVal[0][3] = vecOrigin.x;
|
||||||
m_flMatVal[1][0] = xAxis.y; m_flMatVal[1][1] = yAxis.y; m_flMatVal[1][2] = zAxis.y; m_flMatVal[1][3] = vecOrigin.y;
|
m_flMatVal[1][0] = xAxis.y; m_flMatVal[1][1] = yAxis.y; m_flMatVal[1][2] = zAxis.y; m_flMatVal[1][3] = vecOrigin.y;
|
||||||
@ -229,23 +263,26 @@ struct matrix3x4_t
|
|||||||
// Creates a matrix where the X axis = forward
|
// Creates a matrix where the X axis = forward
|
||||||
// the Y axis = left, and the Z axis = up
|
// the Y axis = left, and the Z axis = up
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
inline matrix3x4_t( const Vector& xAxis, const Vector& yAxis, const Vector& zAxis, const Vector &vecOrigin )
|
matrix3x4_t( const Vector& xAxis, const Vector& yAxis, const Vector& zAxis, const Vector &vecOrigin )
|
||||||
{
|
{
|
||||||
Init( xAxis, yAxis, zAxis, vecOrigin );
|
Init( xAxis, yAxis, zAxis, vecOrigin );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Invalidate( void )
|
inline void Invalidate( void )
|
||||||
{
|
{
|
||||||
for( int i=0; i < 12; i++ )
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
((float*)m_flMatVal)[i] = VEC_T_NAN;
|
for (int j = 0; j < 4; j++)
|
||||||
|
{
|
||||||
|
m_flMatVal[i][j] = VEC_T_NAN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline float *operator[]( int i ) { Assert(( i >= 0 ) && ( i < 3 )); return m_flMatVal[i]; }
|
float *operator[]( int i ) { Assert(( i >= 0 ) && ( i < 3 )); return m_flMatVal[i]; }
|
||||||
inline const float *operator[]( int i ) const { Assert(( i >= 0 ) && ( i < 3 )); return m_flMatVal[i]; }
|
const float *operator[]( int i ) const { Assert(( i >= 0 ) && ( i < 3 )); return m_flMatVal[i]; }
|
||||||
inline float *Base() { return &m_flMatVal[0][0]; }
|
float *Base() { return &m_flMatVal[0][0]; }
|
||||||
inline const float *Base() const { return &m_flMatVal[0][0]; }
|
const float *Base() const { return &m_flMatVal[0][0]; }
|
||||||
|
|
||||||
float m_flMatVal[3][4];
|
float m_flMatVal[3][4];
|
||||||
};
|
};
|
||||||
@ -528,13 +565,7 @@ void MatrixInvert( const matrix3x4_t &in, matrix3x4_t &out );
|
|||||||
bool MatricesAreEqual( const matrix3x4_t &src1, const matrix3x4_t &src2, float flTolerance = 1e-5 );
|
bool MatricesAreEqual( const matrix3x4_t &src1, const matrix3x4_t &src2, float flTolerance = 1e-5 );
|
||||||
|
|
||||||
void MatrixGetColumn( const matrix3x4_t &in, int column, Vector &out );
|
void MatrixGetColumn( const matrix3x4_t &in, int column, Vector &out );
|
||||||
|
void MatrixSetColumn( const Vector &in, int column, matrix3x4_t &out );
|
||||||
inline void MatrixSetColumn( const Vector &in, int column, matrix3x4_t& out )
|
|
||||||
{
|
|
||||||
out[0][column] = in.x;
|
|
||||||
out[1][column] = in.y;
|
|
||||||
out[2][column] = in.z;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void MatrixGetTranslation( const matrix3x4_t &in, Vector &out )
|
inline void MatrixGetTranslation( const matrix3x4_t &in, Vector &out )
|
||||||
{
|
{
|
||||||
@ -1048,19 +1079,7 @@ void VectorYawRotate( const Vector& in, float flYaw, Vector &out);
|
|||||||
// 0 1
|
// 0 1
|
||||||
//
|
//
|
||||||
// With a biasAmt of 0.5, Bias returns X.
|
// With a biasAmt of 0.5, Bias returns X.
|
||||||
inline float Bias( float x, float biasAmt )
|
float Bias( float x, float biasAmt );
|
||||||
{
|
|
||||||
// WARNING: not thread safe
|
|
||||||
static float lastAmt = -1;
|
|
||||||
static float lastExponent = 0;
|
|
||||||
if( lastAmt != biasAmt )
|
|
||||||
{
|
|
||||||
lastExponent = log( biasAmt ) * -1.4427f; // (-1.4427 = 1 / log(0.5))
|
|
||||||
}
|
|
||||||
float fRet = pow( x, lastExponent );
|
|
||||||
Assert ( !IS_NAN( fRet ) );
|
|
||||||
return fRet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Gain is similar to Bias, but biasAmt biases towards or away from 0.5.
|
// Gain is similar to Bias, but biasAmt biases towards or away from 0.5.
|
||||||
@ -1092,14 +1111,9 @@ inline float Bias( float x, float biasAmt )
|
|||||||
// |*****
|
// |*****
|
||||||
// |___________________
|
// |___________________
|
||||||
// 0 1
|
// 0 1
|
||||||
inline float Gain( float x, float biasAmt )
|
float Gain( float x, float biasAmt );
|
||||||
{
|
|
||||||
// WARNING: not thread safe
|
|
||||||
if( x < 0.5 )
|
|
||||||
return 0.5f * Bias( 2*x, 1-biasAmt );
|
|
||||||
else
|
|
||||||
return 1 - 0.5f * Bias( 2 - 2*x, 1-biasAmt );
|
|
||||||
}
|
|
||||||
// SmoothCurve maps a 0-1 value into another 0-1 value based on a cosine wave
|
// SmoothCurve maps a 0-1 value into another 0-1 value based on a cosine wave
|
||||||
// where the derivatives of the function at 0 and 1 (and 0.5) are 0. This is useful for
|
// where the derivatives of the function at 0 and 1 (and 0.5) are 0. This is useful for
|
||||||
// any fadein/fadeout effect where it should start and end smoothly.
|
// any fadein/fadeout effect where it should start and end smoothly.
|
||||||
|
@ -1787,14 +1787,14 @@ FORCEINLINE fltx4 LoadAlignedSIMD( const VectorAligned & pSIMD )
|
|||||||
return SetWToZeroSIMD( LoadAlignedSIMD(pSIMD.Base()) );
|
return SetWToZeroSIMD( LoadAlignedSIMD(pSIMD.Base()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USING_ASAN
|
#ifdef __SANITIZE_ADDRESS__
|
||||||
static NO_ASAN fltx4 LoadUnalignedSIMD( const void *pSIMD )
|
static __attribute__((no_sanitize("address"))) fltx4 LoadUnalignedSIMD( const void *pSIMD )
|
||||||
{
|
{
|
||||||
return _mm_loadu_ps( reinterpret_cast<const float *>( pSIMD ) );
|
return _mm_loadu_ps( reinterpret_cast<const float *>( pSIMD ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static NO_ASAN fltx4 LoadUnaligned3SIMD( const void *pSIMD )
|
static __attribute__((no_sanitize("address"))) fltx4 LoadUnaligned3SIMD( const void *pSIMD )
|
||||||
{
|
{
|
||||||
return _mm_loadu_ps( reinterpret_cast<const float *>( pSIMD ) );
|
return _mm_loadu_ps( reinterpret_cast<const float *>( pSIMD ) );
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class Vector2D;
|
|||||||
// 4D Vector4D
|
// 4D Vector4D
|
||||||
//=========================================================
|
//=========================================================
|
||||||
|
|
||||||
class alignas(16) Vector4D
|
class Vector4D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Members
|
// Members
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -345,6 +345,10 @@ unsigned int CPhonemeTag::ComputeDataCheckSum()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Simple language to string and string to language lookup dictionary
|
// Purpose: Simple language to string and string to language lookup dictionary
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
#if defined(__i386__) || defined(__x86_64__)
|
||||||
|
#pragma pack(1)
|
||||||
|
#endif
|
||||||
|
|
||||||
struct CCLanguage
|
struct CCLanguage
|
||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
@ -367,6 +371,9 @@ static CCLanguage g_CCLanguageLookup[] =
|
|||||||
{ CC_THAI, "thai", 0 , 150, 250 },
|
{ CC_THAI, "thai", 0 , 150, 250 },
|
||||||
{ CC_PORTUGUESE,"portuguese", 0 , 0, 150 },
|
{ 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 )
|
void CSentence::ColorForLanguage( int language, unsigned char& r, unsigned char& g, unsigned char& b )
|
||||||
{
|
{
|
||||||
@ -1760,4 +1767,4 @@ void CSentence::CreateEventWordDistribution( char const *pszText, float flSenten
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // !_STATIC_LINKED || _SHARED_LIB
|
#endif // !_STATIC_LINKED || _SHARED_LIB
|
@ -95,7 +95,6 @@ enum soundlevel_t
|
|||||||
|
|
||||||
// NOTE: Valid soundlevel_t values are 0-255.
|
// NOTE: Valid soundlevel_t values are 0-255.
|
||||||
// 256-511 are reserved for sounds using goldsrc compatibility attenuation.
|
// 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.
|
#define MAX_SNDLVL_BITS 9 // Used to encode 0-255 for regular soundlevel_t's and 256-511 for goldsrc-compatible ones.
|
||||||
|
@ -38,17 +38,13 @@
|
|||||||
#define XBOX_CODELINE_ONLY() Error_Compiling_Code_Only_Valid_in_Xbox_Codeline
|
#define XBOX_CODELINE_ONLY() Error_Compiling_Code_Only_Valid_in_Xbox_Codeline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if !defined(PLATFORM_GLIBC) && defined(LINUX) // fuck musl
|
|
||||||
#ifdef nullptr
|
#ifdef nullptr
|
||||||
#undef nullptr
|
#undef nullptr
|
||||||
#endif
|
|
||||||
#define nullptr 0
|
#define nullptr 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// stdio.h
|
// stdio.h
|
||||||
#if !defined( NULL ) || defined( PLATFORM_BSD )
|
#ifdef NULL
|
||||||
#undef NULL
|
#undef NULL
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
#endif
|
#endif
|
||||||
|
@ -594,7 +594,7 @@ typedef void * HINSTANCE;
|
|||||||
#define FMTFUNCTION( a, b )
|
#define FMTFUNCTION( a, b )
|
||||||
#elif defined(GNUC)
|
#elif defined(GNUC)
|
||||||
#define SELECTANY __attribute__((weak))
|
#define SELECTANY __attribute__((weak))
|
||||||
#ifndef DEDICATED
|
#if defined(LINUX) && !defined(DEDICATED)
|
||||||
#define RESTRICT
|
#define RESTRICT
|
||||||
#else
|
#else
|
||||||
#define RESTRICT __restrict
|
#define RESTRICT __restrict
|
||||||
|
@ -1042,7 +1042,7 @@ typedef enum _D3DSHADER_PARAM_REGISTER_TYPE
|
|||||||
D3DSPR_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
|
D3DSPR_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
|
||||||
} D3DSHADER_PARAM_REGISTER_TYPE;
|
} D3DSHADER_PARAM_REGISTER_TYPE;
|
||||||
|
|
||||||
struct alignas(16) D3DMATRIX
|
struct D3DMATRIX
|
||||||
{
|
{
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,9 @@
|
|||||||
#define GLMDEBUG_H
|
#define GLMDEBUG_H
|
||||||
|
|
||||||
#include "tier0/platform.h"
|
#include "tier0/platform.h"
|
||||||
|
#if defined( OSX )
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// include this anywhere you need to be able to compile-out code related specifically to GLM debugging.
|
// include this anywhere you need to be able to compile-out code related specifically to GLM debugging.
|
||||||
|
|
||||||
|
@ -1042,7 +1042,7 @@ typedef enum _D3DSHADER_PARAM_REGISTER_TYPE
|
|||||||
D3DSPR_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
|
D3DSPR_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
|
||||||
} D3DSHADER_PARAM_REGISTER_TYPE;
|
} D3DSHADER_PARAM_REGISTER_TYPE;
|
||||||
|
|
||||||
struct alignas(16) D3DMATRIX
|
struct D3DMATRIX
|
||||||
{
|
{
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,9 @@
|
|||||||
#define GLMDEBUG_H
|
#define GLMDEBUG_H
|
||||||
|
|
||||||
#include "tier0/platform.h"
|
#include "tier0/platform.h"
|
||||||
|
#if defined( OSX )
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// include this anywhere you need to be able to compile-out code related specifically to GLM debugging.
|
// include this anywhere you need to be able to compile-out code related specifically to GLM debugging.
|
||||||
|
|
||||||
|
@ -455,9 +455,7 @@ bool GetVTFPreload360Data( const char *pDebugName, CUtlBuffer &fileBufferIn, CUt
|
|||||||
// compiler pads, the 360 compiler does NOT.
|
// compiler pads, the 360 compiler does NOT.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
// nillerusr: try to avoid problems with pragma pack, remove c++ inheritance to make this structs platform-independent
|
struct VTFFileBaseHeader_t
|
||||||
|
|
||||||
struct alignas(16) VTFFileBaseHeader_t
|
|
||||||
{
|
{
|
||||||
DECLARE_BYTESWAP_DATADESC();
|
DECLARE_BYTESWAP_DATADESC();
|
||||||
char fileTypeString[4]; // "VTF" Valve texture file
|
char fileTypeString[4]; // "VTF" Valve texture file
|
||||||
@ -465,23 +463,22 @@ struct alignas(16) VTFFileBaseHeader_t
|
|||||||
int headerSize;
|
int headerSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct alignas(16) VTFFileHeaderV7_1_t
|
struct VTFFileHeaderV7_1_t : public VTFFileBaseHeader_t
|
||||||
{
|
{
|
||||||
DECLARE_BYTESWAP_DATADESC();
|
DECLARE_BYTESWAP_DATADESC();
|
||||||
char fileTypeString[4]; // "VTF" Valve texture file
|
|
||||||
int version[2]; // version[0].version[1]
|
|
||||||
int headerSize;
|
|
||||||
|
|
||||||
unsigned short width;
|
unsigned short width;
|
||||||
unsigned short height;
|
unsigned short height;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
unsigned short numFrames;
|
unsigned short numFrames;
|
||||||
unsigned short startFrame;
|
unsigned short startFrame;
|
||||||
|
#if !defined( POSIX ) && !defined( _X360 )
|
||||||
// must manually align in order to maintain pack(1) expected layout with existing binaries
|
|
||||||
char pad1[4];
|
|
||||||
VectorAligned reflectivity;
|
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
|
||||||
float bumpScale;
|
float bumpScale;
|
||||||
ImageFormat imageFormat;
|
ImageFormat imageFormat;
|
||||||
unsigned char numMipLevels;
|
unsigned char numMipLevels;
|
||||||
@ -490,65 +487,13 @@ struct alignas(16) VTFFileHeaderV7_1_t
|
|||||||
unsigned char lowResImageHeight;
|
unsigned char lowResImageHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct alignas(16) VTFFileHeaderV7_2_t
|
struct VTFFileHeaderV7_2_t : public VTFFileHeaderV7_1_t
|
||||||
{
|
{
|
||||||
DECLARE_BYTESWAP_DATADESC();
|
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;
|
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) )
|
#define BYTE_POS( byteVal, shft ) uint32( uint32(uint8(byteVal)) << uint8(shft * 8) )
|
||||||
#if !defined( _X360 )
|
#if !defined( _X360 )
|
||||||
#define MK_VTF_RSRC_ID(a, b, c) uint32( BYTE_POS(a, 0) | BYTE_POS(b, 1) | BYTE_POS(c, 2) )
|
#define MK_VTF_RSRC_ID(a, b, c) uint32( BYTE_POS(a, 0) | BYTE_POS(b, 1) | BYTE_POS(c, 2) )
|
||||||
@ -593,6 +538,28 @@ struct ResourceEntryInfo
|
|||||||
unsigned int resData; // Resource data or offset from the beginning of the file
|
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_MAJOR_VERSION 0x0360
|
||||||
#define VTF_X360_MINOR_VERSION 8
|
#define VTF_X360_MINOR_VERSION 8
|
||||||
struct VTFFileHeaderX360_t : public VTFFileBaseHeader_t
|
struct VTFFileHeaderX360_t : public VTFFileBaseHeader_t
|
||||||
|
@ -4,5 +4,5 @@ git submodule init && git submodule update
|
|||||||
|
|
||||||
brew install sdl2
|
brew install sdl2
|
||||||
|
|
||||||
./waf configure -T debug --disable-warns $* &&
|
./waf configure -T debug --64bits --disable-warns $* &&
|
||||||
./waf build
|
./waf build
|
||||||
|
@ -4,5 +4,5 @@ git submodule init && git submodule update
|
|||||||
sudo apt-get 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
|
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 --disable-warns $* &&
|
./waf configure -T debug --64bits --disable-warns $* &&
|
||||||
./waf build
|
./waf build
|
||||||
|
@ -6,5 +6,5 @@ sudo apt-get update
|
|||||||
sudo apt-get install -y aptitude
|
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
|
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 --32bits $* &&
|
PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig ./waf configure -T debug --disable-warns $* &&
|
||||||
./waf build
|
./waf build
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
git submodule init && git submodule update
|
git submodule init && git submodule update
|
||||||
./waf configure -T release --sanitize=address,undefined --disable-warns --tests --prefix=out/ $* &&
|
./waf configure -T release --sanitize=address,undefined --disable-warns --tests -8 --prefix=out/ $* &&
|
||||||
./waf install &&
|
./waf install &&
|
||||||
cd out &&
|
cd out &&
|
||||||
DYLD_LIBRARY_PATH=bin/ ./unittest || exit 1
|
DYLD_LIBRARY_PATH=bin/ ./unittest || exit 1
|
||||||
|
@ -4,7 +4,7 @@ git submodule init && git submodule update
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libbz2-dev
|
sudo apt-get install -y libbz2-dev
|
||||||
|
|
||||||
./waf configure -T release --sanitize=address,undefined --disable-warns --tests --prefix=out/ $* &&
|
./waf configure -T release --sanitize=address,undefined --disable-warns --tests --prefix=out/ --64bits $* &&
|
||||||
./waf install &&
|
./waf install &&
|
||||||
cd out &&
|
cd out &&
|
||||||
LD_LIBRARY_PATH=bin/ ./unittest
|
LD_LIBRARY_PATH=bin/ ./unittest
|
||||||
|
@ -5,7 +5,7 @@ sudo dpkg --add-architecture i386
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y g++-multilib gcc-multilib libbz2-dev:i386
|
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 --32bits --sanitize=address,undefined --disable-warns --tests --prefix=out/ $* &&
|
PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig ./waf configure -T release --sanitize=address,undefined --disable-warns --tests --prefix=out/ $* &&
|
||||||
./waf install &&
|
./waf install &&
|
||||||
cd out &&
|
cd out &&
|
||||||
LD_LIBRARY_PATH=bin/ ./unittest
|
LD_LIBRARY_PATH=bin/ ./unittest
|
||||||
|
@ -90,9 +90,6 @@ def fix_dos_path( path ):
|
|||||||
if find_path == '': find_path = './'
|
if find_path == '': find_path = './'
|
||||||
else: find_path += '/'
|
else: find_path += '/'
|
||||||
|
|
||||||
if not os.path.exists(find_path):
|
|
||||||
return find_path+filename
|
|
||||||
|
|
||||||
dirlist = os.listdir(find_path)
|
dirlist = os.listdir(find_path)
|
||||||
for file in dirlist:
|
for file in dirlist:
|
||||||
if file == filename:
|
if file == filename:
|
||||||
|
@ -215,6 +215,7 @@ class Android:
|
|||||||
# TODO: proper STL support
|
# TODO: proper STL support
|
||||||
return [
|
return [
|
||||||
#os.path.abspath(os.path.join(self.ndk_home, 'sources', 'cxx-stl', 'system', 'include')),
|
#os.path.abspath(os.path.join(self.ndk_home, 'sources', 'cxx-stl', 'system', 'include')),
|
||||||
|
os.path.abspath(os.path.join(self.ndk_home, 'sources', 'cxx-stl', 'stlport', 'stlport')),
|
||||||
os.path.abspath(os.path.join(self.ndk_home, 'sources', 'android', 'support', 'include'))
|
os.path.abspath(os.path.join(self.ndk_home, 'sources', 'android', 'support', 'include'))
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -345,12 +346,8 @@ def configure(conf):
|
|||||||
conf.env.CXXFLAGS += android.cflags(True)
|
conf.env.CXXFLAGS += android.cflags(True)
|
||||||
conf.env.LINKFLAGS += android.linkflags()
|
conf.env.LINKFLAGS += android.linkflags()
|
||||||
conf.env.LDFLAGS += android.ldflags()
|
conf.env.LDFLAGS += android.ldflags()
|
||||||
conf.env.INCLUDES += [
|
conf.env.STLIBPATH += [os.path.abspath(os.path.join(android.ndk_home, 'sources','cxx-stl','stlport','libs',stlarch))]
|
||||||
os.path.abspath(os.path.join(android.ndk_home, 'sources', 'cxx-stl', 'gnu-libstdc++', '4.9', 'include')),
|
conf.env.LDFLAGS += ['-lstlport_static']
|
||||||
os.path.abspath(os.path.join(android.ndk_home, 'sources', 'cxx-stl', 'gnu-libstdc++', '4.9', 'libs', stlarch, 'include'))
|
|
||||||
]
|
|
||||||
conf.env.STLIBPATH += [os.path.abspath(os.path.join(android.ndk_home, 'sources','cxx-stl','gnu-libstdc++','4.9','libs',stlarch))]
|
|
||||||
conf.env.LDFLAGS += ['-lgnustl_static']
|
|
||||||
|
|
||||||
conf.env.HAVE_M = True
|
conf.env.HAVE_M = True
|
||||||
if android.is_hardfp():
|
if android.is_hardfp():
|
||||||
|
@ -1,185 +0,0 @@
|
|||||||
#define _CRT_SECURE_NO_WARNINGS
|
|
||||||
#define STEAM_API_EXPORTS
|
|
||||||
|
|
||||||
#if defined __GNUC__
|
|
||||||
#define S_API extern "C" __attribute__ ((visibility("default")))
|
|
||||||
#elif defined _MSC_VER
|
|
||||||
#define S_API extern "C" __declspec(dllexport)
|
|
||||||
#endif
|
|
||||||
#define NULL 0
|
|
||||||
|
|
||||||
S_API void *g_pSteamClientGameServer;
|
|
||||||
void *g_pSteamClientGameServer = NULL;
|
|
||||||
|
|
||||||
//steam_api.h
|
|
||||||
S_API bool SteamAPI_Init() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API bool SteamAPI_InitSafe() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_Shutdown() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API bool SteamAPI_RestartAppIfNecessary() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_ReleaseCurrentThreadMemory() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_WriteMiniDump() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_SetMiniDumpComment() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_RunCallbacks() {
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_RegisterCallback() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_UnregisterCallback() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_RegisterCallResult() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_UnregisterCallResult() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API bool SteamAPI_IsSteamRunning() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void Steam_RunCallbacks() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void Steam_RegisterInterfaceFuncs() {
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API int Steam_GetHSteamUserCurrent() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API const char *SteamAPI_GetSteamInstallPath() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API int SteamAPI_GetHSteamPipe() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_SetTryCatchCallbacks() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_SetBreakpadAppID() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamAPI_UseBreakpadCrashHandler() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API int GetHSteamPipe() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API int GetHSteamUser() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API int SteamAPI_GetHSteamUser() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamInternal_ContextInit() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamInternal_CreateInterface() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamApps() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamClient() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamFriends() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamHTTP() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamMatchmaking() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamMatchmakingServers() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamNetworking() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamRemoteStorage() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamScreenshots() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamUser() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamUserStats() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void *SteamUtils() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API int SteamGameServer_GetHSteamPipe() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API int SteamGameServer_GetHSteamUser() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API int SteamGameServer_GetIPCCallCount() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API int SteamGameServer_InitSafe() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamGameServer_RunCallbacks() {
|
|
||||||
}
|
|
||||||
|
|
||||||
S_API void SteamGameServer_Shutdown() {
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
#! /usr/bin/env python
|
|
||||||
# encoding: utf-8
|
|
||||||
|
|
||||||
from waflib import Utils
|
|
||||||
import os
|
|
||||||
|
|
||||||
top = '.'
|
|
||||||
PROJECT_NAME = 'steam_api'
|
|
||||||
|
|
||||||
def options(opt):
|
|
||||||
# stub
|
|
||||||
return
|
|
||||||
|
|
||||||
def configure(conf):
|
|
||||||
return
|
|
||||||
|
|
||||||
def build(bld):
|
|
||||||
source = [
|
|
||||||
'steam_api.cpp'
|
|
||||||
]
|
|
||||||
|
|
||||||
includes = [
|
|
||||||
'.',
|
|
||||||
'../public',
|
|
||||||
'../public/tier0',
|
|
||||||
] + bld.env.INCLUDES_SDL2
|
|
||||||
|
|
||||||
defines = []
|
|
||||||
|
|
||||||
libs = []
|
|
||||||
|
|
||||||
install_path = None if bld.env.BUILD_SDK else bld.env.LIBDIR
|
|
||||||
|
|
||||||
bld.shlib(
|
|
||||||
source = source,
|
|
||||||
target = PROJECT_NAME,
|
|
||||||
name = PROJECT_NAME,
|
|
||||||
features = 'c cxx',
|
|
||||||
includes = includes,
|
|
||||||
defines = defines,
|
|
||||||
install_path = install_path,
|
|
||||||
use = libs,
|
|
||||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
|
||||||
idx = bld.get_taskgen_count()
|
|
||||||
)
|
|
||||||
|
|
@ -1 +1 @@
|
|||||||
Subproject commit c5b901ecef515ea068fa8b8a19ca5cd5353905cb
|
Subproject commit aac07c72058aea6267ea60b70a25602b41469d28
|
@ -83,7 +83,7 @@ def build(bld):
|
|||||||
else:
|
else:
|
||||||
libs = ['DL', 'M', 'LOG']
|
libs = ['DL', 'M', 'LOG']
|
||||||
|
|
||||||
install_path = None if bld.env.BUILD_SDK else bld.env.LIBDIR
|
install_path = bld.env.LIBDIR
|
||||||
|
|
||||||
bld.shlib(
|
bld.shlib(
|
||||||
source = source,
|
source = source,
|
||||||
|
@ -1010,7 +1010,7 @@ CUtlString D3DToGL::FixGLSLSwizzle( const char *pDestRegisterName, const char *p
|
|||||||
{
|
{
|
||||||
bool bAbsWrapper = false; // Parameter wrapped in an abs()
|
bool bAbsWrapper = false; // Parameter wrapped in an abs()
|
||||||
bool bAbsNegative = false; // -abs()
|
bool bAbsNegative = false; // -abs()
|
||||||
static char szSrcRegister[128];
|
char szSrcRegister[128];
|
||||||
V_strncpy( szSrcRegister, pSrcRegisterName, sizeof(szSrcRegister) );
|
V_strncpy( szSrcRegister, pSrcRegisterName, sizeof(szSrcRegister) );
|
||||||
|
|
||||||
// Check for abs() or -abs() wrapper and strip it off during the fixup
|
// Check for abs() or -abs() wrapper and strip it off during the fixup
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#elif defined(LINUX)
|
#elif defined(LINUX)
|
||||||
#define _LARGEFILE64_SOURCE
|
|
||||||
#include <sys/vfs.h>
|
#include <sys/vfs.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef OSX
|
#ifdef OSX
|
||||||
|
@ -1500,9 +1500,6 @@ void FileOpenDialog::OnOpen()
|
|||||||
char pFileName[MAX_PATH];
|
char pFileName[MAX_PATH];
|
||||||
GetSelectedFileName( pFileName, sizeof( pFileName ) );
|
GetSelectedFileName( pFileName, sizeof( pFileName ) );
|
||||||
|
|
||||||
if( !pFileName[0] )
|
|
||||||
return;
|
|
||||||
|
|
||||||
int nLen = Q_strlen( pFileName );
|
int nLen = Q_strlen( pFileName );
|
||||||
bool bSpecifiedDirectory = ( pFileName[nLen-1] == '/' || pFileName[nLen-1] == '\\' ) && (!IsOSX() || ( IsOSX() && !Q_stristr( pFileName, ".app" ) ) );
|
bool bSpecifiedDirectory = ( pFileName[nLen-1] == '/' || pFileName[nLen-1] == '\\' ) && (!IsOSX() || ( IsOSX() && !Q_stristr( pFileName, ".app" ) ) );
|
||||||
Q_StripTrailingSlash( pFileName );
|
Q_StripTrailingSlash( pFileName );
|
||||||
|
@ -95,8 +95,6 @@ TextEntry::TextEntry(Panel *parent, const char *panelName) : BaseClass(parent, p
|
|||||||
|
|
||||||
SetEditable(true);
|
SetEditable(true);
|
||||||
|
|
||||||
_dataChanged = false;
|
|
||||||
|
|
||||||
// initialize the line break array
|
// initialize the line break array
|
||||||
m_LineBreaks.AddToTail(BUFFER_SIZE);
|
m_LineBreaks.AddToTail(BUFFER_SIZE);
|
||||||
|
|
||||||
|
@ -376,7 +376,7 @@ static vgui::MouseCode ButtonCodeToMouseCode( ButtonCode_t buttonCode )
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool InputHandleInputEvent( const InputEvent_t &event )
|
bool InputHandleInputEvent( const InputEvent_t &event )
|
||||||
{
|
{
|
||||||
switch( event.m_nType )
|
switch( event.m_nType & 0xFFFF )
|
||||||
{
|
{
|
||||||
case IE_ButtonPressed:
|
case IE_ButtonPressed:
|
||||||
{
|
{
|
||||||
@ -428,10 +428,9 @@ bool InputHandleInputEvent( const InputEvent_t &event )
|
|||||||
case IE_FingerDown:
|
case IE_FingerDown:
|
||||||
{
|
{
|
||||||
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
|
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
|
||||||
float _x, _y;
|
uint data = (uint)event.m_nData;
|
||||||
memcpy( &_x, &event.m_nData2, sizeof(_x) );
|
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF);
|
||||||
memcpy( &_y, &event.m_nData3, sizeof(_y) );
|
y = h*((double)(data & 0xFFFF) / 0xFFFF);
|
||||||
x = w*_x; y = h*_y;
|
|
||||||
g_pIInput->UpdateCursorPosInternal( x, y );
|
g_pIInput->UpdateCursorPosInternal( x, y );
|
||||||
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_PRESSED );
|
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_PRESSED );
|
||||||
g_pIInput->InternalMousePressed( MOUSE_LEFT );
|
g_pIInput->InternalMousePressed( MOUSE_LEFT );
|
||||||
@ -440,10 +439,9 @@ bool InputHandleInputEvent( const InputEvent_t &event )
|
|||||||
case IE_FingerUp:
|
case IE_FingerUp:
|
||||||
{
|
{
|
||||||
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
|
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
|
||||||
float _x, _y;
|
uint data = (uint)event.m_nData;
|
||||||
memcpy( &_x, &event.m_nData2, sizeof(_x) );
|
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF);
|
||||||
memcpy( &_y, &event.m_nData3, sizeof(_y) );
|
y = h*((double)(data & 0xFFFF) / 0xFFFF);
|
||||||
x = w*_x; y = h*_y;
|
|
||||||
g_pIInput->UpdateCursorPosInternal( x, y );
|
g_pIInput->UpdateCursorPosInternal( x, y );
|
||||||
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_RELEASED );
|
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_RELEASED );
|
||||||
g_pIInput->InternalMouseReleased( MOUSE_LEFT );
|
g_pIInput->InternalMouseReleased( MOUSE_LEFT );
|
||||||
@ -452,10 +450,9 @@ bool InputHandleInputEvent( const InputEvent_t &event )
|
|||||||
case IE_FingerMotion:
|
case IE_FingerMotion:
|
||||||
{
|
{
|
||||||
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
|
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h);
|
||||||
float _x, _y;
|
uint data = (uint)event.m_nData;
|
||||||
memcpy( &_x, &event.m_nData2, sizeof(_x) );
|
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF);
|
||||||
memcpy( &_y, &event.m_nData3, sizeof(_y) );
|
y = h*((double)(data & 0xFFFF) / 0xFFFF);
|
||||||
x = w*_x; y = h*_y;
|
|
||||||
g_pIInput->InternalCursorMoved( x, y );
|
g_pIInput->InternalCursorMoved( x, y );
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
427
vstdlib/osversion.cpp
Normal file
427
vstdlib/osversion.cpp
Normal file
@ -0,0 +1,427 @@
|
|||||||
|
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||||
|
//
|
||||||
|
// Purpose:
|
||||||
|
//
|
||||||
|
// $NoKeywords: $
|
||||||
|
//
|
||||||
|
//=============================================================================//
|
||||||
|
|
||||||
|
#include "vstdlib/osversion.h"
|
||||||
|
#include "winlite.h"
|
||||||
|
#include "strtools.h"
|
||||||
|
#include "tier0/dbg.h"
|
||||||
|
|
||||||
|
#ifdef OSX
|
||||||
|
#include <CoreServices/CoreServices.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: return the OS type for this machine
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
EOSType GetOSType()
|
||||||
|
{
|
||||||
|
static EOSType eOSVersion = k_eOSUnknown;
|
||||||
|
|
||||||
|
#if defined( _WIN32 ) && !defined( _X360 )
|
||||||
|
if ( eOSVersion == k_eOSUnknown || eOSVersion == k_eWinUnknown )
|
||||||
|
{
|
||||||
|
eOSVersion = k_eWinUnknown;
|
||||||
|
OSVERSIONINFOEX osvi;
|
||||||
|
Q_memset( &osvi, 0x00, sizeof(osvi) );
|
||||||
|
osvi.dwOSVersionInfoSize = sizeof(osvi);
|
||||||
|
|
||||||
|
if ( GetVersionEx( (OSVERSIONINFO *) &osvi ) )
|
||||||
|
{
|
||||||
|
switch ( osvi.dwPlatformId )
|
||||||
|
{
|
||||||
|
case VER_PLATFORM_WIN32_NT:
|
||||||
|
if ( osvi.dwMajorVersion <= 4 )
|
||||||
|
{
|
||||||
|
eOSVersion = k_eWinNT;
|
||||||
|
}
|
||||||
|
else if ( osvi.dwMajorVersion == 5 )
|
||||||
|
{
|
||||||
|
switch( osvi.dwMinorVersion )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
eOSVersion = k_eWin2000;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
eOSVersion = k_eWinXP;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
eOSVersion = k_eWin2003;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( osvi.dwMajorVersion >= 6 )
|
||||||
|
{
|
||||||
|
if ( osvi.wProductType == VER_NT_WORKSTATION )
|
||||||
|
{
|
||||||
|
switch ( osvi.dwMinorVersion )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
eOSVersion = k_eWinVista;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
eOSVersion = k_eWindows7;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else /* ( osvi.wProductType != VER_NT_WORKSTATION ) */
|
||||||
|
{
|
||||||
|
switch ( osvi.dwMinorVersion )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
eOSVersion = k_eWin2008; // Windows 2008, not R2
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
eOSVersion = k_eWin2008; // Windows 2008 R2
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case VER_PLATFORM_WIN32_WINDOWS:
|
||||||
|
switch ( osvi.dwMinorVersion )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
eOSVersion = k_eWin95;
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
eOSVersion = k_eWin98;
|
||||||
|
break;
|
||||||
|
case 90:
|
||||||
|
eOSVersion = k_eWinME;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case VER_PLATFORM_WIN32s:
|
||||||
|
eOSVersion = k_eWin311;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#elif defined(OSX)
|
||||||
|
if ( eOSVersion == k_eOSUnknown )
|
||||||
|
{
|
||||||
|
SInt32 MajorVer = 0;
|
||||||
|
SInt32 MinorVer = 0;
|
||||||
|
SInt32 PatchVer = 0;
|
||||||
|
OSErr err = noErr;
|
||||||
|
err = Gestalt( gestaltSystemVersionMajor, &MajorVer );
|
||||||
|
if ( err != noErr )
|
||||||
|
return k_eOSUnknown;
|
||||||
|
err = Gestalt( gestaltSystemVersionMinor, &MinorVer );
|
||||||
|
if ( err != noErr )
|
||||||
|
return k_eOSUnknown;
|
||||||
|
err = Gestalt( gestaltSystemVersionBugFix, &PatchVer );
|
||||||
|
if ( err != noErr )
|
||||||
|
return k_eOSUnknown;
|
||||||
|
|
||||||
|
switch ( MajorVer )
|
||||||
|
{
|
||||||
|
case 10:
|
||||||
|
{
|
||||||
|
switch( MinorVer )
|
||||||
|
{
|
||||||
|
case 4:
|
||||||
|
eOSVersion = k_eMacOS104;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
eOSVersion = k_eMacOS105;
|
||||||
|
switch ( PatchVer )
|
||||||
|
{
|
||||||
|
case 8:
|
||||||
|
eOSVersion = k_eMacOS1058;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
eOSVersion = k_eMacOS106;
|
||||||
|
switch ( PatchVer )
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
default:
|
||||||
|
// note the default here - 10.6.4 (5,6...) >= 10.6.3, so we want to
|
||||||
|
// identify as 10.6.3 for sysreqs purposes
|
||||||
|
eOSVersion = k_eMacOS1063;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
eOSVersion = k_eMacOS107;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#elif defined(LINUX)
|
||||||
|
if ( eOSVersion == k_eOSUnknown )
|
||||||
|
{
|
||||||
|
|
||||||
|
FILE *fpKernelVer = fopen( "/proc/version", "r" );
|
||||||
|
|
||||||
|
if ( !fpKernelVer )
|
||||||
|
return k_eLinuxUnknown;
|
||||||
|
|
||||||
|
char rgchVersionLine[1024];
|
||||||
|
char *pchRet = fgets( rgchVersionLine, sizeof(rgchVersionLine), fpKernelVer );
|
||||||
|
fclose( fpKernelVer );
|
||||||
|
|
||||||
|
eOSVersion = k_eLinuxUnknown;
|
||||||
|
|
||||||
|
// move past "Linux version "
|
||||||
|
const char *pchVersion = rgchVersionLine + Q_strlen( "Linux version " );
|
||||||
|
if ( pchRet && *pchVersion == '2' && *(pchVersion+1) == '.' )
|
||||||
|
{
|
||||||
|
pchVersion += 2; // move past "2."
|
||||||
|
if ( *pchVersion == '2' && *(pchVersion+1) == '.' )
|
||||||
|
eOSVersion = k_eLinux22;
|
||||||
|
else if ( *pchVersion == '4' && *(pchVersion+1) == '.' )
|
||||||
|
eOSVersion = k_eLinux24;
|
||||||
|
else if ( *pchVersion == '6' && *(pchVersion+1) == '.' )
|
||||||
|
eOSVersion = k_eLinux26;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return eOSVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: get platform-specific OS details (distro, on linux)
|
||||||
|
// returns a pointer to the input buffer on success (for convenience),
|
||||||
|
// NULL on failure.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
const char *GetOSDetailString( char *pchOutBuf, int cchOutBuf )
|
||||||
|
{
|
||||||
|
#if defined WIN32
|
||||||
|
(void)( pchOutBuf );
|
||||||
|
(void)( cchOutBuf );
|
||||||
|
// no interesting details
|
||||||
|
return NULL;
|
||||||
|
#else
|
||||||
|
#if defined LINUX
|
||||||
|
// we're about to go poking around to see if we can figure out distribution
|
||||||
|
// looking @ any /etc file is fragile (people can change 'em),
|
||||||
|
// but since this is just hardware survey data, we're not super concerned.
|
||||||
|
// a bunch of OS-specific issue files
|
||||||
|
const char *pszIssueFile[] =
|
||||||
|
{
|
||||||
|
"/etc/redhat-release",
|
||||||
|
"/etc/fedora-release",
|
||||||
|
"/etc/slackware-release",
|
||||||
|
"/etc/debian_release",
|
||||||
|
"/etc/mandrake-release",
|
||||||
|
"/etc/yellowdog-release",
|
||||||
|
"/etc/gentoo-release",
|
||||||
|
"/etc/lsb-release",
|
||||||
|
"/etc/SUSE-release",
|
||||||
|
};
|
||||||
|
if ( !pchOutBuf )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
for (int i = 0; i < Q_ARRAYSIZE( pszIssueFile ); i++ )
|
||||||
|
{
|
||||||
|
FILE *fdInfo = fopen( pszIssueFile[i], "r" );
|
||||||
|
if ( !fdInfo )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// prepend the buffer with the name of the file we found for easier grouping
|
||||||
|
snprintf( pchOutBuf, cchOutBuf, "%s\n", pszIssueFile[i] );
|
||||||
|
int cchIssueFile = strlen( pszIssueFile[i] ) + 1;
|
||||||
|
ssize_t cubRead = fread( (void*) (pchOutBuf + cchIssueFile) , sizeof(char), cchOutBuf - cchIssueFile, fdInfo );
|
||||||
|
fclose( fdInfo );
|
||||||
|
|
||||||
|
if ( cubRead < 0 )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// null terminate
|
||||||
|
pchOutBuf[ MIN( cubRead, cchOutBuf-1 ) ] = '\0';
|
||||||
|
return pchOutBuf;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
// if all else fails, just send back uname -a
|
||||||
|
if ( !pchOutBuf )
|
||||||
|
return NULL;
|
||||||
|
FILE *fpUname = popen( "uname -mrsv", "r" );
|
||||||
|
if ( !fpUname )
|
||||||
|
return NULL;
|
||||||
|
size_t cchRead = fread( pchOutBuf, sizeof(char), cchOutBuf, fpUname );
|
||||||
|
pclose( fpUname );
|
||||||
|
|
||||||
|
pchOutBuf[ MIN( cchRead, (size_t)cchOutBuf-1 ) ] = '\0';
|
||||||
|
return pchOutBuf;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: get a friendly name for an OS type
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
const char *GetNameFromOSType( EOSType eOSType )
|
||||||
|
{
|
||||||
|
switch ( eOSType )
|
||||||
|
{
|
||||||
|
case k_eWinUnknown:
|
||||||
|
return "Windows";
|
||||||
|
case k_eWin311:
|
||||||
|
return "Windows 3.11";
|
||||||
|
case k_eWin95:
|
||||||
|
return "Windows 95";
|
||||||
|
case k_eWin98:
|
||||||
|
return "Windows 98";
|
||||||
|
case k_eWinME:
|
||||||
|
return "Windows ME";
|
||||||
|
case k_eWinNT:
|
||||||
|
return "Windows NT";
|
||||||
|
case k_eWin2000:
|
||||||
|
return "Windows 2000";
|
||||||
|
case k_eWinXP:
|
||||||
|
return "Windows XP";
|
||||||
|
case k_eWin2003:
|
||||||
|
return "Windows 2003";
|
||||||
|
case k_eWinVista:
|
||||||
|
return "Windows Vista";
|
||||||
|
case k_eWindows7:
|
||||||
|
return "Windows 7";
|
||||||
|
case k_eWin2008:
|
||||||
|
return "Windows 2008";
|
||||||
|
#ifdef POSIX
|
||||||
|
case k_eMacOSUnknown:
|
||||||
|
return "Mac OS";
|
||||||
|
case k_eMacOS104:
|
||||||
|
return "MacOS 10.4";
|
||||||
|
case k_eMacOS105:
|
||||||
|
return "MacOS 10.5";
|
||||||
|
case k_eMacOS1058:
|
||||||
|
return "MacOS 10.5.8";
|
||||||
|
case k_eMacOS106:
|
||||||
|
return "MacOS 10.6";
|
||||||
|
case k_eMacOS1063:
|
||||||
|
return "MacOS 10.6.3";
|
||||||
|
case k_eMacOS107:
|
||||||
|
return "MacOS 10.7";
|
||||||
|
case k_eLinuxUnknown:
|
||||||
|
return "Linux";
|
||||||
|
case k_eLinux22:
|
||||||
|
return "Linux 2.2";
|
||||||
|
case k_eLinux24:
|
||||||
|
return "Linux 2.4";
|
||||||
|
case k_eLinux26:
|
||||||
|
return "Linux 2.6";
|
||||||
|
#endif
|
||||||
|
default:
|
||||||
|
case k_eOSUnknown:
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// friendly name to OS type, MUST be same size as EOSType enum
|
||||||
|
struct OSTypeNameTuple
|
||||||
|
{
|
||||||
|
EOSType m_OSType;
|
||||||
|
const char *m_pchOSName;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const OSTypeNameTuple k_rgOSTypeToName[] =
|
||||||
|
{
|
||||||
|
{ k_eOSUnknown, "unknown" },
|
||||||
|
{ k_eMacOSUnknown, "macos" },
|
||||||
|
{ k_eMacOS104, "macos104" },
|
||||||
|
{ k_eMacOS105, "macos105" },
|
||||||
|
{ k_eMacOS1058, "macos1058" },
|
||||||
|
{ k_eMacOS106, "macos106" },
|
||||||
|
{ k_eMacOS1063, "macos1063" },
|
||||||
|
{ k_eMacOS107, "macos107" },
|
||||||
|
{ k_eLinuxUnknown, "linux" },
|
||||||
|
{ k_eLinux22, "linux22" },
|
||||||
|
{ k_eLinux24, "linux24" },
|
||||||
|
{ k_eLinux26, "linux26" },
|
||||||
|
{ k_eWinUnknown, "windows" },
|
||||||
|
{ k_eWin311, "win311" },
|
||||||
|
{ k_eWin95, "win95" },
|
||||||
|
{ k_eWin98, "win98" },
|
||||||
|
{ k_eWinME, "winME" },
|
||||||
|
{ k_eWinNT, "winNT" },
|
||||||
|
{ k_eWin2000, "win200" },
|
||||||
|
{ k_eWinXP, "winXP" },
|
||||||
|
{ k_eWin2003, "win2003" },
|
||||||
|
{ k_eWinVista, "winVista" },
|
||||||
|
{ k_eWindows7, "win7" },
|
||||||
|
{ k_eWin2008, "win2008" },
|
||||||
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: convert a friendly OS name to a eostype
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
EOSType GetOSTypeFromString_Deprecated( const char *pchName )
|
||||||
|
{
|
||||||
|
EOSType eOSType;
|
||||||
|
#ifdef WIN32
|
||||||
|
eOSType = k_eWinUnknown;
|
||||||
|
#else
|
||||||
|
eOSType = k_eOSUnknown;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// if this fires, make sure all OS types are in the map
|
||||||
|
Assert( Q_ARRAYSIZE( k_rgOSTypeToName ) == k_eOSTypeMax );
|
||||||
|
if ( !pchName || Q_strlen( pchName ) == 0 )
|
||||||
|
return eOSType;
|
||||||
|
|
||||||
|
for ( int iOS = 0; iOS < Q_ARRAYSIZE( k_rgOSTypeToName ) ; iOS++ )
|
||||||
|
{
|
||||||
|
if ( !Q_stricmp( k_rgOSTypeToName[iOS].m_pchOSName, pchName ) )
|
||||||
|
return k_rgOSTypeToName[iOS].m_OSType;
|
||||||
|
}
|
||||||
|
return eOSType;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OSTypesAreCompatible( EOSType eOSTypeDetected, EOSType eOSTypeRequired )
|
||||||
|
{
|
||||||
|
// check windows (on the positive side of the number line)
|
||||||
|
if ( eOSTypeRequired >= k_eWinUnknown )
|
||||||
|
return ( eOSTypeDetected >= eOSTypeRequired );
|
||||||
|
|
||||||
|
if ( eOSTypeRequired == k_eOSUnknown )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// osx
|
||||||
|
if ( eOSTypeRequired >= k_eMacOSUnknown && eOSTypeRequired < k_eOSUnknown )
|
||||||
|
return ( eOSTypeDetected >= eOSTypeRequired && eOSTypeDetected < k_eOSUnknown );
|
||||||
|
|
||||||
|
// and linux
|
||||||
|
if ( eOSTypeRequired >= k_eLinuxUnknown && eOSTypeRequired < k_eMacOSUnknown )
|
||||||
|
return ( eOSTypeDetected >= eOSTypeRequired && eOSTypeDetected < k_eMacOSUnknown );
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// these strings "windows", "macos", "linux" are part of the
|
||||||
|
// interface, which is why they're hard-coded here, rather than using
|
||||||
|
// the strings in k_rgOSTypeToName
|
||||||
|
const char *GetPlatformName( bool *pbIs64Bit )
|
||||||
|
{
|
||||||
|
if ( pbIs64Bit )
|
||||||
|
*pbIs64Bit = Is64BitOS();
|
||||||
|
|
||||||
|
EOSType eType = GetOSType();
|
||||||
|
if ( OSTypesAreCompatible( eType, k_eWinUnknown ) )
|
||||||
|
return "windows";
|
||||||
|
if ( OSTypesAreCompatible( eType, k_eMacOSUnknown ) )
|
||||||
|
return "macos";
|
||||||
|
if ( OSTypesAreCompatible( eType, k_eLinuxUnknown ) )
|
||||||
|
return "linux";
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
|
@ -21,6 +21,7 @@ def build(bld):
|
|||||||
'cvar.cpp',
|
'cvar.cpp',
|
||||||
'jobthread.cpp',
|
'jobthread.cpp',
|
||||||
'KeyValuesSystem.cpp',
|
'KeyValuesSystem.cpp',
|
||||||
|
'osversion.cpp',
|
||||||
'random.cpp',
|
'random.cpp',
|
||||||
'vcover.cpp',
|
'vcover.cpp',
|
||||||
'../public/tier0/memoverride.cpp'
|
'../public/tier0/memoverride.cpp'
|
||||||
@ -54,7 +55,7 @@ def build(bld):
|
|||||||
elif bld.env.DEST_OS == 'darwin':
|
elif bld.env.DEST_OS == 'darwin':
|
||||||
linkflags += ['-framework', 'CoreServices']
|
linkflags += ['-framework', 'CoreServices']
|
||||||
|
|
||||||
install_path = None if bld.env.BUILD_SDK else bld.env.LIBDIR
|
install_path = bld.env.LIBDIR
|
||||||
|
|
||||||
bld.shlib(
|
bld.shlib(
|
||||||
source = source,
|
source = source,
|
||||||
|
55
vtf/vtf.cpp
55
vtf/vtf.cpp
@ -27,10 +27,7 @@ BEGIN_BYTESWAP_DATADESC( VTFFileBaseHeader_t )
|
|||||||
DEFINE_FIELD( headerSize, FIELD_INTEGER ),
|
DEFINE_FIELD( headerSize, FIELD_INTEGER ),
|
||||||
END_DATADESC()
|
END_DATADESC()
|
||||||
|
|
||||||
BEGIN_BYTESWAP_DATADESC( VTFFileHeaderV7_1_t )
|
BEGIN_BYTESWAP_DATADESC_( VTFFileHeaderV7_1_t, VTFFileBaseHeader_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( width, FIELD_SHORT ),
|
||||||
DEFINE_FIELD( height, FIELD_SHORT ),
|
DEFINE_FIELD( height, FIELD_SHORT ),
|
||||||
DEFINE_FIELD( flags, FIELD_INTEGER ),
|
DEFINE_FIELD( flags, FIELD_INTEGER ),
|
||||||
@ -45,45 +42,17 @@ BEGIN_BYTESWAP_DATADESC( VTFFileHeaderV7_1_t )
|
|||||||
DEFINE_FIELD( lowResImageHeight, FIELD_CHARACTER ),
|
DEFINE_FIELD( lowResImageHeight, FIELD_CHARACTER ),
|
||||||
END_DATADESC()
|
END_DATADESC()
|
||||||
|
|
||||||
BEGIN_BYTESWAP_DATADESC( VTFFileHeaderV7_2_t )
|
BEGIN_BYTESWAP_DATADESC_( VTFFileHeaderV7_2_t, 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 ),
|
|
||||||
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( depth, FIELD_SHORT ),
|
||||||
END_DATADESC()
|
END_DATADESC()
|
||||||
|
|
||||||
BEGIN_BYTESWAP_DATADESC( VTFFileHeaderV7_3_t )
|
BEGIN_BYTESWAP_DATADESC_( VTFFileHeaderV7_3_t, 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 ),
|
|
||||||
DEFINE_FIELD( numResources, FIELD_INTEGER ),
|
DEFINE_FIELD( numResources, FIELD_INTEGER ),
|
||||||
END_DATADESC()
|
END_DATADESC()
|
||||||
|
|
||||||
|
BEGIN_BYTESWAP_DATADESC_( VTFFileHeader_t, VTFFileHeaderV7_2_t )
|
||||||
|
END_DATADESC()
|
||||||
|
|
||||||
BEGIN_BYTESWAP_DATADESC_( VTFFileHeaderX360_t, VTFFileBaseHeader_t )
|
BEGIN_BYTESWAP_DATADESC_( VTFFileHeaderX360_t, VTFFileBaseHeader_t )
|
||||||
DEFINE_FIELD( flags, FIELD_INTEGER ),
|
DEFINE_FIELD( flags, FIELD_INTEGER ),
|
||||||
DEFINE_FIELD( width, FIELD_SHORT ),
|
DEFINE_FIELD( width, FIELD_SHORT ),
|
||||||
@ -934,11 +903,23 @@ static bool ReadHeaderFromBufferPastBaseHeader( CUtlBuffer &buf, VTFFileHeader_t
|
|||||||
else if ( header.version[1] == 2 )
|
else if ( header.version[1] == 2 )
|
||||||
{
|
{
|
||||||
buf.Get( pBuf, sizeof(VTFFileHeaderV7_2_t) - sizeof(VTFFileBaseHeader_t) );
|
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 )
|
else if ( header.version[1] == 1 || header.version[1] == 0 )
|
||||||
{
|
{
|
||||||
// previous version 7.0 or 7.1
|
// previous version 7.0 or 7.1
|
||||||
buf.Get( pBuf, sizeof(VTFFileHeaderV7_1_t) - sizeof(VTFFileBaseHeader_t) );
|
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
|
else
|
||||||
{
|
{
|
||||||
|
90
wscript
90
wscript
@ -26,21 +26,6 @@ FC_CHECK='''extern "C" {
|
|||||||
int main() { return (int)FcInit(); }
|
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
|
Context.Context.line_just = 55 # should fit for everything on 80x26
|
||||||
|
|
||||||
projects={
|
projects={
|
||||||
@ -76,7 +61,7 @@ projects={
|
|||||||
'serverbrowser',
|
'serverbrowser',
|
||||||
'soundemittersystem',
|
'soundemittersystem',
|
||||||
'studiorender',
|
'studiorender',
|
||||||
'stub_steam',
|
'thirdparty/StubSteamAPI',
|
||||||
'tier0',
|
'tier0',
|
||||||
'tier1',
|
'tier1',
|
||||||
'tier2',
|
'tier2',
|
||||||
@ -140,12 +125,11 @@ projects={
|
|||||||
'tier1',
|
'tier1',
|
||||||
'tier2',
|
'tier2',
|
||||||
'tier3',
|
'tier3',
|
||||||
'vgui2/vgui_controls',
|
|
||||||
'vphysics',
|
'vphysics',
|
||||||
'vpklib',
|
'vpklib',
|
||||||
'vstdlib',
|
'vstdlib',
|
||||||
'vtf',
|
'vtf',
|
||||||
'stub_steam'
|
'thirdparty/StubSteamAPI'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,11 +155,6 @@ def get_taskgen_count(self):
|
|||||||
except: idx = 0 # don't set tg_idx_count to not increase counter
|
except: idx = 0 # don't set tg_idx_count to not increase counter
|
||||||
return idx
|
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):
|
def define_platform(conf):
|
||||||
conf.env.DEDICATED = conf.options.DEDICATED
|
conf.env.DEDICATED = conf.options.DEDICATED
|
||||||
conf.env.TESTS = conf.options.TESTS
|
conf.env.TESTS = conf.options.TESTS
|
||||||
@ -183,12 +162,6 @@ def define_platform(conf):
|
|||||||
conf.env.GL = conf.options.GL and not conf.options.TESTS and not conf.options.DEDICATED
|
conf.env.GL = conf.options.GL and not conf.options.TESTS and not conf.options.DEDICATED
|
||||||
conf.env.OPUS = conf.options.OPUS
|
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:
|
if conf.options.DEDICATED:
|
||||||
conf.options.SDL = False
|
conf.options.SDL = False
|
||||||
conf.define('DEDICATED', 1)
|
conf.define('DEDICATED', 1)
|
||||||
@ -213,7 +186,7 @@ def define_platform(conf):
|
|||||||
conf.env.SDL = 1
|
conf.env.SDL = 1
|
||||||
conf.define('USE_SDL', 1)
|
conf.define('USE_SDL', 1)
|
||||||
|
|
||||||
if arch64:
|
if conf.options.ALLOW64:
|
||||||
conf.define('PLATFORM_64BITS', 1)
|
conf.define('PLATFORM_64BITS', 1)
|
||||||
|
|
||||||
if conf.env.DEST_OS == 'linux':
|
if conf.env.DEST_OS == 'linux':
|
||||||
@ -225,8 +198,6 @@ def define_platform(conf):
|
|||||||
'NO_HOOK_MALLOC',
|
'NO_HOOK_MALLOC',
|
||||||
'_DLL_EXT=.so'
|
'_DLL_EXT=.so'
|
||||||
])
|
])
|
||||||
conf.env.append_unique('CFLAGS', '-U_FORTIFY_SOURCE')
|
|
||||||
conf.env.append_unique('CXXFLAGS', '-U_FORTIFY_SOURCE')
|
|
||||||
elif conf.env.DEST_OS == 'android':
|
elif conf.env.DEST_OS == 'android':
|
||||||
conf.env.append_unique('DEFINES', [
|
conf.env.append_unique('DEFINES', [
|
||||||
'ANDROID=1', '_ANDROID=1',
|
'ANDROID=1', '_ANDROID=1',
|
||||||
@ -236,7 +207,6 @@ def define_platform(conf):
|
|||||||
'NO_HOOK_MALLOC',
|
'NO_HOOK_MALLOC',
|
||||||
'_DLL_EXT=.so'
|
'_DLL_EXT=.so'
|
||||||
])
|
])
|
||||||
|
|
||||||
elif conf.env.DEST_OS == 'win32':
|
elif conf.env.DEST_OS == 'win32':
|
||||||
conf.env.append_unique('DEFINES', [
|
conf.env.append_unique('DEFINES', [
|
||||||
'WIN32=1', '_WIN32=1',
|
'WIN32=1', '_WIN32=1',
|
||||||
@ -266,10 +236,6 @@ def define_platform(conf):
|
|||||||
'_DLL_EXT=.so'
|
'_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:
|
if conf.options.DEBUG_ENGINE:
|
||||||
conf.env.append_unique('DEFINES', [
|
conf.env.append_unique('DEFINES', [
|
||||||
'DEBUG', '_DEBUG'
|
'DEBUG', '_DEBUG'
|
||||||
@ -279,14 +245,11 @@ def define_platform(conf):
|
|||||||
'NDEBUG'
|
'NDEBUG'
|
||||||
])
|
])
|
||||||
|
|
||||||
conf.define('GIT_COMMIT_HASH', conf.env.GIT_VERSION)
|
|
||||||
|
|
||||||
|
|
||||||
def options(opt):
|
def options(opt):
|
||||||
grp = opt.add_option_group('Common options')
|
grp = opt.add_option_group('Common options')
|
||||||
|
|
||||||
grp.add_option('-4', '--32bits', action = 'store_true', dest = 'TARGET32', default = False,
|
grp.add_option('-8', '--64bits', action = 'store_true', dest = 'ALLOW64', default = False,
|
||||||
help = 'allow targetting 32-bit engine(Linux/Windows/OSX x86 only) [default: %default]')
|
help = 'allow targetting 64-bit engine(Linux/Windows/OSX x86 only) [default: %default]')
|
||||||
|
|
||||||
grp.add_option('-d', '--dedicated', action = 'store_true', dest = 'DEDICATED', default = False,
|
grp.add_option('-d', '--dedicated', action = 'store_true', dest = 'DEDICATED', default = False,
|
||||||
help = 'build dedicated server [default: %default]')
|
help = 'build dedicated server [default: %default]')
|
||||||
@ -332,7 +295,7 @@ def options(opt):
|
|||||||
def check_deps(conf):
|
def check_deps(conf):
|
||||||
if conf.env.DEST_OS != 'win32':
|
if conf.env.DEST_OS != 'win32':
|
||||||
conf.check_cc(lib='dl', mandatory=False)
|
conf.check_cc(lib='dl', mandatory=False)
|
||||||
conf.check_cc(lib='bz2', mandatory=True)
|
conf.check_cc(lib='bz2', mandatory=False)
|
||||||
conf.check_cc(lib='rt', mandatory=False)
|
conf.check_cc(lib='rt', mandatory=False)
|
||||||
|
|
||||||
if not conf.env.LIB_M: # HACK: already added in xcompile!
|
if not conf.env.LIB_M: # HACK: already added in xcompile!
|
||||||
@ -440,24 +403,19 @@ def configure(conf):
|
|||||||
# subsystem=bld.env.MSVC_SUBSYSTEM
|
# subsystem=bld.env.MSVC_SUBSYSTEM
|
||||||
# TODO: wrapper around bld.stlib, bld.shlib and so on?
|
# TODO: wrapper around bld.stlib, bld.shlib and so on?
|
||||||
conf.env.MSVC_SUBSYSTEM = 'WINDOWS,5.01'
|
conf.env.MSVC_SUBSYSTEM = 'WINDOWS,5.01'
|
||||||
conf.env.MSVC_TARGETS = ['x64'] # explicitly request x86 target for MSVC
|
conf.env.MSVC_TARGETS = ['x86'] # explicitly request x86 target for MSVC
|
||||||
if conf.options.TARGET32:
|
if conf.options.ALLOW64:
|
||||||
conf.env.MSVC_TARGETS = ['x86']
|
conf.env.MSVC_TARGETS = ['x64']
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
conf.load('msvc_pdb_ext msdev msvs msvcdeps')
|
conf.load('msvc_pdb_ext msdev msvs')
|
||||||
conf.load('subproject xcompile compiler_c compiler_cxx gccdeps gitversion clang_compilation_database strip_on_install_v2 waf_unit_test enforce_pic')
|
conf.load('subproject xcompile compiler_c compiler_cxx 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':
|
if conf.env.DEST_OS == 'win32' and conf.env.DEST_CPU == 'amd64':
|
||||||
conf.load('masm')
|
conf.load('masm')
|
||||||
elif conf.env.DEST_OS == 'darwin':
|
elif conf.env.DEST_OS == 'darwin':
|
||||||
conf.load('mm_hook')
|
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)
|
define_platform(conf)
|
||||||
|
conf.define('GIT_COMMIT_HASH', conf.env.GIT_VERSION)
|
||||||
|
|
||||||
if conf.env.TOGLES:
|
if conf.env.TOGLES:
|
||||||
projects['game'] += ['togles']
|
projects['game'] += ['togles']
|
||||||
@ -470,6 +428,11 @@ def configure(conf):
|
|||||||
if conf.options.OPUS or conf.env.DEST_OS == 'android':
|
if conf.options.OPUS or conf.env.DEST_OS == 'android':
|
||||||
projects['game'] += ['engine/voice_codecs/opus']
|
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:
|
if conf.options.DISABLE_WARNS:
|
||||||
compiler_optional_flags = ['-w']
|
compiler_optional_flags = ['-w']
|
||||||
else:
|
else:
|
||||||
@ -527,7 +490,7 @@ def configure(conf):
|
|||||||
flags += ['-fsigned-char']
|
flags += ['-fsigned-char']
|
||||||
|
|
||||||
if conf.env.DEST_CPU == 'arm':
|
if conf.env.DEST_CPU == 'arm':
|
||||||
flags += ['-march=armv7-a', '-mfpu=neon-vfpv4']
|
flags += ['-mfpu=neon-vfpv4']
|
||||||
|
|
||||||
if conf.env.DEST_OS == 'freebsd':
|
if conf.env.DEST_OS == 'freebsd':
|
||||||
linkflags += ['-lexecinfo']
|
linkflags += ['-lexecinfo']
|
||||||
@ -548,32 +511,30 @@ def configure(conf):
|
|||||||
'/TP',
|
'/TP',
|
||||||
'/EHsc'
|
'/EHsc'
|
||||||
]
|
]
|
||||||
|
|
||||||
if conf.options.BUILD_TYPE == 'debug':
|
if conf.options.BUILD_TYPE == 'debug':
|
||||||
linkflags += [
|
linkflags += [
|
||||||
'/FORCE:MULTIPLE',
|
|
||||||
'/INCREMENTAL:NO',
|
'/INCREMENTAL:NO',
|
||||||
'/NODEFAULTLIB:libc',
|
'/NODEFAULTLIB:libc',
|
||||||
'/NODEFAULTLIB:libcd',
|
'/NODEFAULTLIB:libcd',
|
||||||
'/NODEFAULTLIB:libcmt',
|
'/NODEFAULTLIB:libcmt',
|
||||||
'/LARGEADDRESSAWARE'
|
'/FORCE'
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
linkflags += [
|
linkflags += [
|
||||||
'/INCREMENTAL',
|
'/INCREMENTAL',
|
||||||
'/NODEFAULTLIB:libc',
|
'/NODEFAULTLIB:libc',
|
||||||
'/NODEFAULTLIB:libcd',
|
'/NODEFAULTLIB:libcd',
|
||||||
'/NODEFAULTLIB:libcmtd',
|
'/NODEFAULTLIB:libcmtd'
|
||||||
'/LARGEADDRESSAWARE'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
linkflags += [
|
linkflags += [
|
||||||
'/LIBPATH:'+os.path.abspath('.')+'/lib/win32/'+conf.env.DEST_CPU+'/',
|
'/LIBPATH:'+os.path.abspath('.')+'/lib/win32/'+conf.env.DEST_CPU+'/',
|
||||||
'/LIBPATH:'+os.path.abspath('.')+'/dx9sdk/lib/'+conf.env.DEST_CPU+'/'
|
'/LIBPATH:'+os.path.abspath('.')+'/dx9sdk/lib/'+conf.env.DEST_CPU+'/'
|
||||||
]
|
]
|
||||||
|
|
||||||
# And here C++ flags starts to be treated separately
|
# And here C++ flags starts to be treated separately
|
||||||
cxxflags = list(cflags)
|
cxxflags = list(cflags)
|
||||||
if conf.env.DEST_OS != 'win32':
|
if conf.env.DEST_OS != 'win32':
|
||||||
cxxflags += ['-std=c++11','-fpermissive']
|
cxxflags += ['-std=c++11','-fpermissive']
|
||||||
|
|
||||||
@ -627,11 +588,6 @@ def configure(conf):
|
|||||||
def build(bld):
|
def build(bld):
|
||||||
os.environ["CCACHE_DIR"] = os.path.abspath('.ccache/'+bld.env.COMPILER_CC+'/'+bld.env.DEST_OS+'/'+bld.env.DEST_CPU)
|
os.environ["CCACHE_DIR"] = os.path.abspath('.ccache/'+bld.env.COMPILER_CC+'/'+bld.env.DEST_OS+'/'+bld.env.DEST_CPU)
|
||||||
|
|
||||||
if bld.env.DEST_OS in ['win32', 'android']:
|
|
||||||
sdl_name = 'SDL2.dll' if bld.env.DEST_OS == 'win32' else 'libSDL2.so'
|
|
||||||
sdl_path = os.path.join('lib', bld.env.DEST_OS, bld.env.DEST_CPU, sdl_name)
|
|
||||||
bld.install_files(bld.env.LIBDIR, [sdl_path])
|
|
||||||
|
|
||||||
if bld.env.DEST_OS == 'win32':
|
if bld.env.DEST_OS == 'win32':
|
||||||
projects['game'] += ['utils/bzip2']
|
projects['game'] += ['utils/bzip2']
|
||||||
projects['dedicated'] += ['utils/bzip2']
|
projects['dedicated'] += ['utils/bzip2']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user