1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-21 04:56:01 +08:00

TF2 win64 + Ambuild tier1/mathlib + long=devil (#198)

* Fix compilation for windows, setup ambuild

* Add built tier1 and mathlib for win64

* Ensure compilation is working on windows and linux

* Add -fPIC

* Add compiled libs, with optimisation enabled

* Added windows lib

* Fix hl2sdk for windows

* Longs are the devil

* Fix up threadtools functions

* Add updated libs

* Rework lib naming, and package script

* Update lib directory according to new packaging

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
This commit is contained in:
Benoist
2024-03-09 04:57:12 +01:00
committed by GitHub
parent dcf515fea8
commit 8a6d1c6cd2
82 changed files with 830 additions and 1933 deletions

View File

@ -29,7 +29,7 @@ void CBitWrite::StartWriting( void *pData, int nBytes, int iStartBit, int nBits
{
// Make sure it's dword aligned and padded.
Assert( (nBytes % 4) == 0 );
Assert(((unsigned long)pData & 3) == 0);
Assert(((uint32_t)pData & 3) == 0);
Assert( iStartBit == 0 );
m_pData = (uint32 *) pData;
m_pDataOut = m_pData;
@ -107,8 +107,8 @@ void CBitWrite::WriteLongLong(int64 val)
// Insert the two DWORDS according to network endian
const short endianIndex = 0x0100;
byte *idx = (byte*)&endianIndex;
WriteUBitLong(pLongs[*idx++], sizeof(long) << 3);
WriteUBitLong(pLongs[*idx], sizeof(long) << 3);
WriteUBitLong(pLongs[*idx++], sizeof(uint32_t) << 3);
WriteUBitLong(pLongs[*idx], sizeof(uint32_t) << 3);
}
bool CBitWrite::WriteBits(const void *pInData, int nBits)
@ -390,7 +390,7 @@ bool CBitRead::Seek( int nPosition )
void CBitRead::StartReading( const void *pData, int nBytes, int iStartBit, int nBits )
{
// Make sure it's dword aligned and padded.
Assert(((unsigned long)pData & 3) == 0);
Assert(((uint32_t)pData & 3) == 0);
m_pData = (uint32 *) pData;
m_pDataIn = m_pData;
m_nDataBytes = nBytes;
@ -471,8 +471,8 @@ int64 CBitRead::ReadLongLong( void )
// Read the two DWORDs according to network endian
const short endianIndex = 0x0100;
byte *idx = (byte*)&endianIndex;
pLongs[*idx++] = ReadUBitLong(sizeof(long) << 3);
pLongs[*idx] = ReadUBitLong(sizeof(long) << 3);
pLongs[*idx++] = ReadUBitLong(sizeof(uint32_t) << 3);
pLongs[*idx] = ReadUBitLong(sizeof(uint32_t) << 3);
return retval;
}
@ -483,7 +483,7 @@ void CBitRead::ReadBits(void *pOutData, int nBits)
// align output to dword boundary
while( ((unsigned long)pOut & 3) != 0 && nBitsLeft >= 8 )
while( ((uintptr_t)pOut & 3) != 0 && nBitsLeft >= 8 )
{
*pOut = (unsigned char)ReadUBitLong(8);
++pOut;
@ -496,8 +496,8 @@ void CBitRead::ReadBits(void *pOutData, int nBits)
// read dwords
while ( nBitsLeft >= 32 )
{
*((unsigned long*)pOut) = ReadUBitLong(32);
pOut += sizeof(unsigned long);
*((uint32_t*)pOut) = ReadUBitLong(32);
pOut += sizeof(uint32_t);
nBitsLeft -= 32;
}
}