1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-03 16:13:22 +08:00

Fix compilation on Windows x64

Add precompiled libraries needed to build MetaMod and SourceMod.
This commit is contained in:
Peace-Maker 2020-06-18 15:54:22 +02:00
parent decce90766
commit 0a1b7a75d8
21 changed files with 30 additions and 18 deletions

View File

@ -329,7 +329,7 @@ enum XUSER_SIGNIN_STATE
#if (defined(POSIX)) #if (defined(POSIX))
typedef size_t ULONG_PTR; typedef size_t ULONG_PTR;
#else #elif !(defined(WIN64))
typedef _W64 unsigned long ULONG_PTR; typedef _W64 unsigned long ULONG_PTR;
#endif #endif
typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;

Binary file not shown.

Binary file not shown.

BIN
lib/public/win64/tier0.lib Normal file

Binary file not shown.

BIN
lib/public/win64/tier1.lib Normal file

Binary file not shown.

Binary file not shown.

View File

@ -57,7 +57,7 @@ void ColorQuantize(uint8 const *Image,
{ {
struct QuantizedValue *v=FindQNode(q,p); struct QuantizedValue *v=FindQNode(q,p);
if (v) if (v)
for(int c=0;c<3;c++) for(c=0;c<3;c++)
out_palette[p*3+c]=v->Mean[c]; out_palette[p*3+c]=v->Mean[c];
} }
memset(Error,0,sizeof(Error)); memset(Error,0,sizeof(Error));

View File

@ -3236,6 +3236,7 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright
{ {
s_bSSEEnabled = true; s_bSSEEnabled = true;
#ifndef _WIN64
// Select the SSE specific routines if available // Select the SSE specific routines if available
pfVectorNormalizeFast = _SSE_VectorNormalizeFast; pfVectorNormalizeFast = _SSE_VectorNormalizeFast;
pfInvRSquared = _SSE_InvRSquared; pfInvRSquared = _SSE_InvRSquared;
@ -3245,6 +3246,7 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright
#ifdef _WIN32 #ifdef _WIN32
pfFastSinCos = _SSE_SinCos; pfFastSinCos = _SSE_SinCos;
pfFastCos = _SSE_cos; pfFastCos = _SSE_cos;
#endif
#endif #endif
} }
else else
@ -3255,7 +3257,7 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright
if ( bAllowSSE2 && pi.m_bSSE2 ) if ( bAllowSSE2 && pi.m_bSSE2 )
{ {
s_bSSE2Enabled = true; s_bSSE2Enabled = true;
#ifdef _WIN32 #if defined(_WIN32) && !defined(_WIN64)
pfFastSinCos = _SSE2_SinCos; pfFastSinCos = _SSE2_SinCos;
pfFastCos = _SSE2_cos; pfFastCos = _SSE2_cos;
#endif #endif

View File

@ -198,8 +198,8 @@ static void UpdateStats(struct QuantizedValue *v)
N+=s->Count; N+=s->Count;
for(j=0;j<current_ndims;j++) for(j=0;j<current_ndims;j++)
{ {
uint8 v=s->Value[j]; uint8 v2=s->Value[j];
Means[j]+=v*s->Count; Means[j]+=v2*s->Count;
} }
} }
for(j=0;j<current_ndims;j++) for(j=0;j<current_ndims;j++)
@ -316,7 +316,7 @@ static void SubdivideNode(struct QuantizedValue *n, int whichdim)
// extrema instead. LocalMean[i][0] will be the point with the lowest // extrema instead. LocalMean[i][0] will be the point with the lowest
// value on the dimension and LocalMean[i][1] the one with the lowest // value on the dimension and LocalMean[i][1] the one with the lowest
// value. // value.
for(int i=0;i<current_ndims;i++) for(i=0;i<current_ndims;i++)
{ {
LocalMean[i][0]=minS->Value[i]; LocalMean[i][0]=minS->Value[i];
LocalMean[i][1]=maxS->Value[i]; LocalMean[i][1]=maxS->Value[i];

View File

@ -16,6 +16,9 @@
// memdbgon must be the last include file in a .cpp file!!! // memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h" #include "tier0/memdbgon.h"
#ifndef COMPILER_MSVC64
// Implement for 64-bit Windows if needed.
static const uint32 _sincos_masks[] = { (uint32)0x0, (uint32)~0x0 }; static const uint32 _sincos_masks[] = { (uint32)0x0, (uint32)~0x0 };
static const uint32 _sincos_inv_masks[] = { (uint32)~0x0, (uint32)0x0 }; static const uint32 _sincos_inv_masks[] = { (uint32)~0x0, (uint32)0x0 };
@ -843,3 +846,4 @@ vec_t DotProduct (const vec_t *a, const vec_t *c)
} }
*/ */
#endif // COMPILER_MSVC64

View File

@ -25,7 +25,6 @@ enum NormalDecodeMode_t
// Forward declaration // Forward declaration
#ifdef _WIN32 #ifdef _WIN32
typedef enum _D3DFORMAT D3DFORMAT; typedef enum _D3DFORMAT D3DFORMAT;
typedef enum DXGI_FORMAT;
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -43,7 +43,7 @@ typedef unsigned short MDLHandle_t;
inline MDLHandle_t VoidPtrToMDLHandle( void *ptr ) inline MDLHandle_t VoidPtrToMDLHandle( void *ptr )
{ {
return (MDLHandle_t)(int)ptr; return (MDLHandle_t)(uintp)ptr;
} }
enum enum

View File

@ -2931,6 +2931,12 @@ FORCEINLINE i32x4 IntShiftLeftWordSIMD(const i32x4 &vSrcA, const i32x4 &vSrcB)
// like this. // like this.
FORCEINLINE void ConvertStoreAsIntsSIMD(intx4 * RESTRICT pDest, const fltx4 &vSrc) FORCEINLINE void ConvertStoreAsIntsSIMD(intx4 * RESTRICT pDest, const fltx4 &vSrc)
{ {
#ifdef COMPILER_MSVC64
(*pDest)[0] = SubFloat(vSrc, 0);
(*pDest)[1] = SubFloat(vSrc, 1);
(*pDest)[2] = SubFloat(vSrc, 2);
(*pDest)[3] = SubFloat(vSrc, 3);
#else
__m64 bottom = _mm_cvttps_pi32( vSrc ); __m64 bottom = _mm_cvttps_pi32( vSrc );
__m64 top = _mm_cvttps_pi32( _mm_movehl_ps(vSrc,vSrc) ); __m64 top = _mm_cvttps_pi32( _mm_movehl_ps(vSrc,vSrc) );
@ -2938,6 +2944,7 @@ FORCEINLINE void ConvertStoreAsIntsSIMD(intx4 * RESTRICT pDest, const fltx4 &vSr
*reinterpret_cast<__m64 *>(&(*pDest)[2]) = top; *reinterpret_cast<__m64 *>(&(*pDest)[2]) = top;
_mm_empty(); _mm_empty();
#endif
} }

View File

@ -22,7 +22,7 @@ typedef unsigned char uint8;
#define POSIX 1 #define POSIX 1
#endif #endif
#if defined(__x86_64__) || defined(_WIN64) #if (defined(__x86_64__) || defined(_WIN64)) && !defined(X64BITS)
#define X64BITS #define X64BITS
#endif #endif

View File

@ -1123,7 +1123,7 @@ FORCEINLINE void CBitRead::GrabNextDWord( bool bOverFlowImmediately )
} }
else else
{ {
Assert( reinterpret_cast<int>(m_pDataIn) + 3 < reinterpret_cast<int>(m_pBufferEnd)); Assert( reinterpret_cast<uintp>(m_pDataIn) + 3 < reinterpret_cast<uintp>(m_pBufferEnd));
m_nInBufWord = LittleDWord( *( m_pDataIn++ ) ); m_nInBufWord = LittleDWord( *( m_pDataIn++ ) );
} }
} }

View File

@ -2228,7 +2228,7 @@ bool KeyValues::WriteAsBinary( CUtlBuffer &buffer )
} }
case TYPE_PTR: case TYPE_PTR:
{ {
buffer.PutUnsignedInt( (int)dat->m_pValue ); buffer.PutPtr( dat->m_pValue );
} }
default: default:
@ -2323,7 +2323,7 @@ bool KeyValues::ReadAsBinary( CUtlBuffer &buffer )
} }
case TYPE_PTR: case TYPE_PTR:
{ {
dat->m_pValue = (void*)buffer.GetUnsignedInt(); dat->m_pValue = buffer.GetPtr();
} }
default: default:

View File

@ -331,7 +331,7 @@ bool bf_write::WriteBits(const void *pInData, int nBits)
} }
// Align output to dword boundary // Align output to dword boundary
while (((unsigned long)pOut & 3) != 0 && nBitsLeft >= 8) while (((uintp)pOut & 3) != 0 && nBitsLeft >= 8)
{ {
WriteUBitLong( *pOut, 8, false ); WriteUBitLong( *pOut, 8, false );
@ -808,7 +808,7 @@ void old_bf_read::ReadBits(void *pOutData, int nBits)
// align output to dword boundary // align output to dword boundary
while( ((unsigned long)pOut & 3) != 0 && nBitsLeft >= 8 ) while( ((uintp)pOut & 3) != 0 && nBitsLeft >= 8 )
{ {
*pOut = (unsigned char)ReadUBitLong(8); *pOut = (unsigned char)ReadUBitLong(8);
++pOut; ++pOut;

View File

@ -147,7 +147,7 @@ JustAfew:
// The low-order two bits of pb and nBuffer in total control the // The low-order two bits of pb and nBuffer in total control the
// upfront work. // upfront work.
// //
nFront = ((unsigned int)pb) & 3; nFront = ((uintp)pb) & 3;
nBuffer -= nFront; nBuffer -= nFront;
switch (nFront) switch (nFront)
{ {

View File

@ -154,7 +154,7 @@ static HMODULE InternalLoadLibrary( const char *pName )
return LoadLibraryEx( pName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ); return LoadLibraryEx( pName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH );
#endif #endif
} }
unsigned ThreadedLoadLibraryFunc( void *pParam ) uintp ThreadedLoadLibraryFunc( void *pParam )
{ {
ThreadedLoadLibaryContext_t *pContext = (ThreadedLoadLibaryContext_t*)pParam; ThreadedLoadLibaryContext_t *pContext = (ThreadedLoadLibaryContext_t*)pParam;
pContext->m_hLibrary = InternalLoadLibrary(pContext->m_pLibraryName); pContext->m_hLibrary = InternalLoadLibrary(pContext->m_pLibraryName);

View File

@ -483,7 +483,7 @@ void CBitRead::ReadBits(void *pOutData, int nBits)
// align output to dword boundary // align output to dword boundary
while( ((unsigned long)pOut & 3) != 0 && nBitsLeft >= 8 ) while( ((uintp)pOut & 3) != 0 && nBitsLeft >= 8 )
{ {
*pOut = (unsigned char)ReadUBitLong(8); *pOut = (unsigned char)ReadUBitLong(8);
++pOut; ++pOut;

View File

@ -10,7 +10,7 @@
#include "processor_detect_linux.cpp" #include "processor_detect_linux.cpp"
#elif defined( _X360 ) #elif defined( _X360 ) || defined( WIN64 )
bool CheckMMXTechnology(void) { return false; } bool CheckMMXTechnology(void) { return false; }
bool CheckSSETechnology(void) { return false; } bool CheckSSETechnology(void) { return false; }