fix windows build scripts, add windows opus support

This commit is contained in:
HappyDOGE
2022-07-28 14:27:56 +03:00
parent 90cd6e0e15
commit 3faf6a69ac
149 changed files with 396 additions and 170 deletions
+6 -6
View File
@@ -155,7 +155,7 @@ public:
void ForceRecheckDiskInfo();
// Iterates all entries and gets filesystem info and optionally causes rebuild on any existing items which are out of date
void CheckDiskInfo( bool force_rebuild, long cacheFileTime = 0L );
void CheckDiskInfo( bool force_rebuild, time_t cacheFileTime = 0L );
void SaveManifest();
bool ManifestExists();
@@ -229,8 +229,8 @@ private:
}
FileNameHandle_t handle;
long fileinfo;
long diskfileinfo;
long long fileinfo;
long long diskfileinfo;
int dataIndex;
};
@@ -636,7 +636,7 @@ bool CUtlCachedFileData<T>::Init()
SetDirty( true );
return true;
}
long fileTime = g_pFullFileSystem->GetFileTime( m_sRepositoryFileName, "MOD" );
time_t fileTime = g_pFullFileSystem->GetFileTime( m_sRepositoryFileName, "MOD" );
int size = g_pFullFileSystem->Size( fh );
bool deletefile = false;
@@ -908,7 +908,7 @@ public:
// Iterates all entries and causes rebuild on any existing items which are out of date
template <class T>
void CUtlCachedFileData<T>::CheckDiskInfo( bool forcerebuild, long cacheFileTime )
void CUtlCachedFileData<T>::CheckDiskInfo( bool forcerebuild, time_t cacheFileTime )
{
char fn[ 512 ];
int i;
@@ -958,7 +958,7 @@ void CUtlCachedFileData<T>::CheckDiskInfo( bool forcerebuild, long cacheFileTime
}
else
{
long pathTime = g_pFullFileSystem->GetPathTime( fn, "GAME" );
time_t pathTime = g_pFullFileSystem->GetPathTime( fn, "GAME" );
bCheck = (pathTime > cacheFileTime) ? true : false;
}
+5 -3
View File
@@ -21,6 +21,8 @@
#include "tier1/checksum_md5.h"
#include "tier1/refcount.h"
#include <time.h>
#ifdef _WIN32
#pragma once
#endif
@@ -521,7 +523,7 @@ public:
virtual bool IsFileWritable( char const *pFileName, const char *pPathID = 0 ) = 0;
virtual bool SetFileWritable( char const *pFileName, bool writable, const char *pPathID = 0 ) = 0;
virtual long GetFileTime( const char *pFileName, const char *pPathID = 0 ) = 0;
virtual time_t GetFileTime( const char *pFileName, const char *pPathID = 0 ) = 0;
//--------------------------------------------------------
// Reads/writes files to utlbuffers. Use this for optimal read performance when doing open/read/close
@@ -616,7 +618,7 @@ public:
// File I/O and info
virtual bool IsDirectory( const char *pFileName, const char *pathID = 0 ) = 0;
virtual void FileTimeToString( char* pStrip, int maxCharsIncludingTerminator, long fileTime ) = 0;
virtual void FileTimeToString( char* pStrip, int maxCharsIncludingTerminator, time_t fileTime ) = 0;
//--------------------------------------------------------
// Open file operations
@@ -844,7 +846,7 @@ public:
}
virtual int GetPathIndex( const FileNameHandle_t &handle ) = 0;
virtual long GetPathTime( const char *pPath, const char *pPathID ) = 0;
virtual time_t GetPathTime( const char *pPath, const char *pPathID ) = 0;
virtual DVDMode_t GetDVDMode() = 0;
+4 -3
View File
@@ -14,6 +14,7 @@
#include "filesystem.h"
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#ifdef AsyncRead
#undef AsyncRead
@@ -52,7 +53,7 @@ public:
virtual bool FileExists( const char *pFileName, const char *pPathID ) { return m_pBaseFileSystemPassThru->FileExists( pFileName, pPathID ); }
virtual bool IsFileWritable( char const *pFileName, const char *pPathID ) { return m_pBaseFileSystemPassThru->IsFileWritable( pFileName, pPathID ); }
virtual bool SetFileWritable( char const *pFileName, bool writable, const char *pPathID ) { return m_pBaseFileSystemPassThru->SetFileWritable( pFileName, writable, pPathID ); }
virtual long GetFileTime( const char *pFileName, const char *pPathID ) { return m_pBaseFileSystemPassThru->GetFileTime( pFileName, pPathID ); }
virtual time_t GetFileTime( const char *pFileName, const char *pPathID ) { return m_pBaseFileSystemPassThru->GetFileTime( pFileName, pPathID ); }
virtual bool ReadFile( const char *pFileName, const char *pPath, CUtlBuffer &buf, int nMaxBytes = 0, int nStartingByte = 0, FSAllocFunc_t pfnAlloc = NULL ) { return m_pBaseFileSystemPassThru->ReadFile( pFileName, pPath, buf, nMaxBytes, nStartingByte, pfnAlloc ); }
virtual bool WriteFile( const char *pFileName, const char *pPath, CUtlBuffer &buf ) { return m_pBaseFileSystemPassThru->WriteFile( pFileName, pPath, buf ); }
virtual bool UnzipFile( const char *pFileName, const char *pPath, const char *pDestination ) { return m_pBaseFileSystemPassThru->UnzipFile( pFileName, pPath, pDestination ); }
@@ -100,7 +101,7 @@ public:
virtual bool RenameFile( char const *pOldPath, char const *pNewPath, const char *pathID ) { return m_pFileSystemPassThru->RenameFile( pOldPath, pNewPath, pathID ); }
virtual void CreateDirHierarchy( const char *path, const char *pathID ) { m_pFileSystemPassThru->CreateDirHierarchy( path, pathID ); }
virtual bool IsDirectory( const char *pFileName, const char *pathID ) { return m_pFileSystemPassThru->IsDirectory( pFileName, pathID ); }
virtual void FileTimeToString( char* pStrip, int maxCharsIncludingTerminator, long fileTime ) { m_pFileSystemPassThru->FileTimeToString( pStrip, maxCharsIncludingTerminator, fileTime ); }
virtual void FileTimeToString( char* pStrip, int maxCharsIncludingTerminator, time_t fileTime ) { m_pFileSystemPassThru->FileTimeToString( pStrip, maxCharsIncludingTerminator, fileTime ); }
virtual void SetBufferSize( FileHandle_t file, unsigned nBytes ) { m_pFileSystemPassThru->SetBufferSize( file, nBytes ); }
virtual bool IsOk( FileHandle_t file ) { return m_pFileSystemPassThru->IsOk( file ); }
virtual bool EndOfFile( FileHandle_t file ) { return m_pFileSystemPassThru->EndOfFile( file ); }
@@ -211,7 +212,7 @@ public:
virtual bool ReadToBuffer( FileHandle_t hFile, CUtlBuffer &buf, int nMaxBytes = 0, FSAllocFunc_t pfnAlloc = NULL ) { return m_pFileSystemPassThru->ReadToBuffer( hFile, buf, nMaxBytes, pfnAlloc ); }
virtual bool FullPathToRelativePathEx( const char *pFullPath, const char *pPathId, OUT_Z_CAP(maxLenInChars) char *pDest, int maxLenInChars ) { return m_pFileSystemPassThru->FullPathToRelativePathEx( pFullPath, pPathId, pDest, maxLenInChars ); }
virtual int GetPathIndex( const FileNameHandle_t &handle ) { return m_pFileSystemPassThru->GetPathIndex( handle ); }
virtual long GetPathTime( const char *pPath, const char *pPathID ) { return m_pFileSystemPassThru->GetPathTime( pPath, pPathID ); }
virtual time_t GetPathTime( const char *pPath, const char *pPathID ) { return m_pFileSystemPassThru->GetPathTime( pPath, pPathID ); }
virtual DVDMode_t GetDVDMode() { return m_pFileSystemPassThru->GetDVDMode(); }
+41 -9
View File
@@ -1149,14 +1149,14 @@ inline void CVertexBuilder::FastAdvanceNVertices( int n )
#ifndef COMPILER_MSVC64
// #ifndef COMPILER_MSVC64
// Implement for 64-bit Windows if needed.
//-----------------------------------------------------------------------------
// Fast Vertex! No need to call advance vertex, and no random access allowed
//-----------------------------------------------------------------------------
inline void CVertexBuilder::FastVertex( const ModelVertexDX7_t &vertex )
{
#if defined(__arm__) || defined(__aarch64__)
#if defined(__arm__) || defined(__aarch64__) || defined(PLATFORM_WINDOWS_PC64)
FastVertexSSE( vertex );
#else
Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed
@@ -1224,7 +1224,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX7_t &vertex )
Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed
Assert( m_nCurrentVertex < m_nMaxVertexCount );
#if defined( _WIN32 ) && !defined( _X360 )
#if defined( _WIN32 ) && !defined( _X360 ) && !defined( PLATFORM_64BITS )
const void *pRead = &vertex;
void *pCurrPos = m_pCurrPosition;
__asm
@@ -1240,7 +1240,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX7_t &vertex )
movntps [edi + 16], xmm1
movntps [edi + 32], xmm2
}
#elif defined(GNUC)
#elif defined(GNUC) || defined(PLATFORM_WINDOWS_PC64)
const char *pRead = (char *)&vertex;
char *pCurrPos = (char *)m_pCurrPosition;
__m128 m1 = _mm_load_ps( (float *)pRead );
@@ -1271,7 +1271,7 @@ inline void CVertexBuilder::Fast4VerticesSSE(
Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed
Assert( m_nCurrentVertex < m_nMaxVertexCount-3 );
#if defined( _WIN32 ) && !defined( _X360 )
#if defined( _WIN32 ) && !defined( _X360 ) && !defined( PLATFORM_64BITS )
void *pCurrPos = m_pCurrPosition;
__asm
{
@@ -1313,6 +1313,38 @@ inline void CVertexBuilder::Fast4VerticesSSE(
movntps [edi + 80+96], xmm5
}
#elif defined(__arm__) || defined(PLATFORM_WINDOWS_PC64)
const void *pReadA = &vtx_a;
const void *pReadB = &vtx_b;
const void *pReadC = &vtx_c;
const void *pReadD = &vtx_d;
void *pCurrPos = m_pCurrPosition;
__m128 m1 = _mm_load_ps( (float *)pReadA );
__m128 m2 = _mm_load_ps( (float *)((intp)pReadA + 16) );
__m128 m3 = _mm_load_ps( (float *)((intp)pReadA + 32) );
__m128 m4 = _mm_load_ps( (float *)pReadB );
__m128 m5 = _mm_load_ps( (float *)((intp)pReadB + 16) );
__m128 m6 = _mm_load_ps( (float *)((intp)pReadB + 32) );
_mm_stream_ps( (float *)pCurrPos, m1 );
_mm_stream_ps( (float *)((intp)pCurrPos + 16), m2 );
_mm_stream_ps( (float *)((intp)pCurrPos + 32), m3 );
_mm_stream_ps( (float *)((intp)pCurrPos + 48), m4 );
_mm_stream_ps( (float *)((intp)pCurrPos + 64), m5 );
_mm_stream_ps( (float *)((intp)pCurrPos + 80), m6 );
m1 = _mm_load_ps( (float *)pReadC );
m2 = _mm_load_ps( (float *)((intp)pReadC + 16) );
m3 = _mm_load_ps( (float *)((intp)pReadC + 32) );
m4 = _mm_load_ps( (float *)pReadD );
m5 = _mm_load_ps( (float *)((intp)pReadD + 16) );
m6 = _mm_load_ps( (float *)((intp)pReadD + 32) );
_mm_stream_ps( (float *)((intp)pCurrPos + 0+96), m1 );
_mm_stream_ps( (float *)((intp)pCurrPos + 16+96), m2 );
_mm_stream_ps( (float *)((intp)pCurrPos + 32+96), m3 );
_mm_stream_ps( (float *)((intp)pCurrPos + 48+96), m4 );
_mm_stream_ps( (float *)((intp)pCurrPos + 64+96), m5 );
_mm_stream_ps( (float *)((intp)pCurrPos + 80+96), m6 );
#else
Error( "Implement CMeshBuilder::Fast4VerticesSSE\n");
#endif
@@ -1326,7 +1358,7 @@ inline void CVertexBuilder::Fast4VerticesSSE(
inline void CVertexBuilder::FastVertex( const ModelVertexDX8_t &vertex )
{
#if defined(__arm__) || defined(__aarch64__)
#if defined(__arm__) || defined(__aarch64__) || defined(PLATFORM_WINDOWS_PC64)
FastVertexSSE( vertex );
#else
Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed
@@ -1402,7 +1434,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex )
Assert( m_CompressionType == VERTEX_COMPRESSION_NONE ); // FIXME: support compressed verts if needed
Assert( m_nCurrentVertex < m_nMaxVertexCount );
#if defined( _WIN32 ) && !defined( _X360 )
#if defined( _WIN32 ) && !defined( _X360 ) && !defined( PLATFORM_64BITS )
const void *pRead = &vertex;
void *pCurrPos = m_pCurrPosition;
__asm
@@ -1420,7 +1452,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex )
movntps [edi + 32], xmm2
movntps [edi + 48], xmm3
}
#elif defined(GNUC)
#elif defined(GNUC) || defined(PLATFORM_WINDOWS_PC64)
const void *pRead = &vertex;
void *pCurrPos = m_pCurrPosition;
@@ -1455,7 +1487,7 @@ inline void CVertexBuilder::FastVertexSSE( const ModelVertexDX8_t &vertex )
m_bWrittenUserData = false;
#endif
}
#endif // COMPILER_MSVC64
// #endif // COMPILER_MSVC64
//-----------------------------------------------------------------------------
+16
View File
@@ -358,6 +358,18 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent();
#define VerifyEquals( _exp, _expectedValue ) AssertEquals( _exp, _expectedValue )
#define DbgVerify( _exp ) Assert( _exp )
#ifdef _DEBUG
#define DbgAssert( _exp ) Assert( _exp )
#else
#define DbgAssert( _exp ) ((void)0)
#endif
#ifdef _DEBUG
#define DbgAssert( _exp ) Assert( _exp )
#else
#define DbgAssert( _exp ) ((void)0)
#endif
#define AssertMsg1( _exp, _msg, a1 ) AssertMsg( _exp, _msg, a1 )
#define AssertMsg2( _exp, _msg, a1, a2 ) AssertMsg( _exp, _msg, a1, a2 )
#define AssertMsg3( _exp, _msg, a1, a2, a3 ) AssertMsg( _exp, _msg, a1, a2, a3 )
@@ -383,6 +395,7 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent();
#define VerifyMsg3( _exp, _msg, a1, a2, a3 ) (_exp)
#define VerifyEquals( _exp, _expectedValue ) (_exp)
#define DbgVerify( _exp ) (_exp)
#define DbgAssert( _exp ) ((void)0)
#define AssertMsg1( _exp, _msg, a1 ) ((void)0)
#define AssertMsg2( _exp, _msg, a1, a2 ) ((void)0)
@@ -397,6 +410,9 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent();
#endif // DBGFLAG_ASSERT
// Source2 compatibility macro
#define AssertDbg( X ) DbgAssert( X )
// The Always version of the assert macros are defined even when DBGFLAG_ASSERT is not,
// so they will be available even in release.
#define AssertAlways( _exp ) _AssertMsg( _exp, _T("Assertion Failed: ") _T(#_exp), ((void)0), false )
+2
View File
@@ -28,7 +28,9 @@
#endif
// Undefine this if using a compiler lacking threadsafe RTTI (like vc6)
#ifndef COMPILER_MSVC
#define MEM_DEBUG_CLASSNAME 1
#endif
#include <stddef.h>
#if defined( OSX )
+1 -1
View File
@@ -216,7 +216,7 @@ inline bool ThreadInMainThread()
#endif
// NOTE: ThreadedLoadLibraryFunc_t needs to return the sleep time in milliseconds or TT_INFINITE
typedef int (*ThreadedLoadLibraryFunc_t)();
typedef uintp (*ThreadedLoadLibraryFunc_t)(void *pParam);
PLATFORM_INTERFACE void SetThreadedLoadLibraryFunc( ThreadedLoadLibraryFunc_t func );
PLATFORM_INTERFACE ThreadedLoadLibraryFunc_t GetThreadedLoadLibraryFunc();
+1 -1
View File
@@ -13,7 +13,7 @@
#include "tier1/tier1.h"
#include "tier1/strtools.h"
#define DbgAssert Assert
// #define DbgAssert Assert
#define kMILLION (1000000)
#define kTHOUSAND (1000)