mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 03:56:10 +08:00
General:
* Fixed a variety of server browser issues with mods based on this SDK * Fixed many warnings on various platforms * Added source code for fgdlib and raytrace * Updated many source files with the latest shared source from TF2. OSX: * Added support for Xcode 4.6 * Switched OSX builds to use Xcode instead of makefiles * Moved libs from src/lib/osx32 to src/lib/public/osx32 or src/lib/common/osx32 to match windows better. Linux: * Moved libs from src/lib/linux32 to src/lib/public/linux32 or src/lib/common/linux32 to match windows better.
This commit is contained in:
@ -877,7 +877,7 @@ unsigned int bf_read::CheckReadUBitLong(int numbits)
|
||||
void bf_read::ReadBits(void *pOutData, int nBits)
|
||||
{
|
||||
#if defined( BB_PROFILING )
|
||||
VPROF( "bf_write::ReadBits" );
|
||||
VPROF( "bf_read::ReadBits" );
|
||||
#endif
|
||||
|
||||
unsigned char *pOut = (unsigned char*)pOutData;
|
||||
@ -1083,7 +1083,7 @@ unsigned int bf_read::ReadBitLong(int numbits, bool bSigned)
|
||||
float bf_read::ReadBitCoord (void)
|
||||
{
|
||||
#if defined( BB_PROFILING )
|
||||
VPROF( "bf_write::ReadBitCoord" );
|
||||
VPROF( "bf_read::ReadBitCoord" );
|
||||
#endif
|
||||
int intval=0,fractval=0,signbit=0;
|
||||
float value = 0.0;
|
||||
@ -1126,7 +1126,7 @@ float bf_read::ReadBitCoord (void)
|
||||
float bf_read::ReadBitCoordMP( bool bIntegral, bool bLowPrecision )
|
||||
{
|
||||
#if defined( BB_PROFILING )
|
||||
VPROF( "bf_write::ReadBitCoordMP" );
|
||||
VPROF( "bf_read::ReadBitCoordMP" );
|
||||
#endif
|
||||
// BitCoordMP float encoding: inbounds bit, integer bit, sign bit, optional int bits, float bits
|
||||
// BitCoordMP integer encoding: inbounds bit, integer bit, optional sign bit, optional int bits.
|
||||
@ -1212,7 +1212,7 @@ float bf_read::ReadBitCoordMP( bool bIntegral, bool bLowPrecision )
|
||||
unsigned int bf_read::ReadBitCoordBits (void)
|
||||
{
|
||||
#if defined( BB_PROFILING )
|
||||
VPROF( "bf_write::ReadBitCoordBits" );
|
||||
VPROF( "bf_read::ReadBitCoordBits" );
|
||||
#endif
|
||||
|
||||
unsigned int flags = ReadUBitLong(2);
|
||||
@ -1231,7 +1231,7 @@ unsigned int bf_read::ReadBitCoordBits (void)
|
||||
unsigned int bf_read::ReadBitCoordMPBits( bool bIntegral, bool bLowPrecision )
|
||||
{
|
||||
#if defined( BB_PROFILING )
|
||||
VPROF( "bf_write::ReadBitCoordMPBits" );
|
||||
VPROF( "bf_read::ReadBitCoordMPBits" );
|
||||
#endif
|
||||
|
||||
unsigned int flags = ReadUBitLong(2);
|
||||
|
@ -1491,14 +1491,34 @@ int V_UCS2ToUTF8( const ucs2 *pUCS2, char *pUTF8, int cubDestSizeInBytes )
|
||||
#elif defined(POSIX)
|
||||
iconv_t conv_t = iconv_open( "UTF-8", "UCS-2LE" );
|
||||
size_t cchResult = -1;
|
||||
size_t nLenUnicde = cubDestSizeInBytes;
|
||||
size_t nMaxUTF8 = cubDestSizeInBytes;
|
||||
|
||||
// pUCS2 will be null-terminated so use that to work out the input
|
||||
// buffer size. Note that we shouldn't assume iconv will stop when it
|
||||
// finds a zero, and nLenUnicde should be given in bytes, so we multiply
|
||||
// it by sizeof( ucs2 ) at the end.
|
||||
size_t nLenUnicde = 0;
|
||||
while ( pUCS2[nLenUnicde] )
|
||||
{
|
||||
++nLenUnicde;
|
||||
}
|
||||
nLenUnicde *= sizeof( ucs2 );
|
||||
|
||||
// Calculate number of bytes we want iconv to write, leaving space
|
||||
// for the null-terminator
|
||||
size_t nMaxUTF8 = cubDestSizeInBytes - 1;
|
||||
char *pIn = (char *)pUCS2;
|
||||
char *pOut = (char *)pUTF8;
|
||||
if ( conv_t > 0 )
|
||||
{
|
||||
cchResult = 0;
|
||||
const size_t nBytesToWrite = nMaxUTF8;
|
||||
cchResult = iconv( conv_t, &pIn, &nLenUnicde, &pOut, &nMaxUTF8 );
|
||||
|
||||
// Calculate how many bytes were actually written and use that to
|
||||
// null-terminate our output string.
|
||||
const size_t nBytesWritten = nBytesToWrite - nMaxUTF8;
|
||||
pUTF8[nBytesWritten] = 0;
|
||||
|
||||
iconv_close( conv_t );
|
||||
if ( (int)cchResult < 0 )
|
||||
cchResult = 0;
|
||||
|
@ -5,11 +5,8 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
$macro SRCDIR ".."
|
||||
|
||||
$macro OUTLIBDIR "$SRCDIR\lib\public" [!$LINUX && !$OSXALL]
|
||||
|
||||
$include "$SRCDIR\vpc_scripts\source_lib_base.vpc"
|
||||
$include "$SRCDIR\vstdlib\vstdlib_exclude.vpc" [$OSXALL]
|
||||
|
||||
$Configuration
|
||||
{
|
||||
|
Reference in New Issue
Block a user