mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-05-30 00:11:14 +00:00
Merge remote-tracking branch 'DanielGibson/linux'
This commit is contained in:
commit
9abdf06367
20 changed files with 94 additions and 66 deletions
|
@ -83,8 +83,10 @@ typedef struct cm_vertex_s
|
||||||
{
|
{
|
||||||
idVec3 p; // vertex point
|
idVec3 p; // vertex point
|
||||||
int checkcount; // for multi-check avoidance
|
int checkcount; // for multi-check avoidance
|
||||||
unsigned long side; // each bit tells at which side this vertex passes one of the trace model edges
|
// DG: use int instead of long for 64bit compatibility
|
||||||
unsigned long sideSet; // each bit tells if sidedness for the trace model edge has been calculated yet
|
unsigned int side; // each bit tells at which side this vertex passes one of the trace model edges
|
||||||
|
unsigned int sideSet; // each bit tells if sidedness for the trace model edge has been calculated yet
|
||||||
|
// DG end
|
||||||
} cm_vertex_t;
|
} cm_vertex_t;
|
||||||
|
|
||||||
typedef struct cm_edge_s
|
typedef struct cm_edge_s
|
||||||
|
@ -92,8 +94,10 @@ typedef struct cm_edge_s
|
||||||
int checkcount; // for multi-check avoidance
|
int checkcount; // for multi-check avoidance
|
||||||
unsigned short internal; // a trace model can never collide with internal edges
|
unsigned short internal; // a trace model can never collide with internal edges
|
||||||
unsigned short numUsers; // number of polygons using this edge
|
unsigned short numUsers; // number of polygons using this edge
|
||||||
unsigned long side; // each bit tells at which side of this edge one of the trace model vertices passes
|
// DG: use int instead of long for 64bit compatibility
|
||||||
unsigned long sideSet; // each bit tells if sidedness for the trace model vertex has been calculated yet
|
unsigned int side; // each bit tells at which side of this edge one of the trace model vertices passes
|
||||||
|
unsigned int sideSet; // each bit tells if sidedness for the trace model vertex has been calculated yet
|
||||||
|
// DG end
|
||||||
int vertexNum[2]; // start and end point of edge
|
int vertexNum[2]; // start and end point of edge
|
||||||
idVec3 normal; // edge normal
|
idVec3 normal; // edge normal
|
||||||
} cm_edge_t;
|
} cm_edge_t;
|
||||||
|
|
|
@ -104,9 +104,9 @@ private:
|
||||||
mutable pvsCurrent_t currentPVS[MAX_CURRENT_PVS];
|
mutable pvsCurrent_t currentPVS[MAX_CURRENT_PVS];
|
||||||
// used to create PVS
|
// used to create PVS
|
||||||
int portalVisBytes;
|
int portalVisBytes;
|
||||||
int portalVisLongs;
|
int portalVisLongs; // DG: Note: these are really ints now..
|
||||||
int areaVisBytes;
|
int areaVisBytes;
|
||||||
int areaVisLongs;
|
int areaVisLongs; // DG: Note: these are really ints now..
|
||||||
struct pvsPortal_s* pvsPortals;
|
struct pvsPortal_s* pvsPortals;
|
||||||
struct pvsArea_s* pvsAreas;
|
struct pvsArea_s* pvsAreas;
|
||||||
|
|
||||||
|
|
|
@ -312,7 +312,9 @@ idClass::FindUninitializedMemory
|
||||||
void idClass::FindUninitializedMemory()
|
void idClass::FindUninitializedMemory()
|
||||||
{
|
{
|
||||||
#ifdef ID_DEBUG_UNINITIALIZED_MEMORY
|
#ifdef ID_DEBUG_UNINITIALIZED_MEMORY
|
||||||
unsigned long* ptr = ( ( unsigned long* )this ) - 1;
|
// DG: use int instead of long for 64bit compatibility
|
||||||
|
unsigned int* ptr = ( ( unsigned int* )this ) - 1;
|
||||||
|
// DG end
|
||||||
int size = *ptr;
|
int size = *ptr;
|
||||||
assert( ( size & 3 ) == 0 );
|
assert( ( size & 3 ) == 0 );
|
||||||
size >>= 2;
|
size >>= 2;
|
||||||
|
|
|
@ -1726,7 +1726,9 @@ idCompressor_Arithmetic::GetCurrentCount
|
||||||
*/
|
*/
|
||||||
int idCompressor_Arithmetic::GetCurrentCount()
|
int idCompressor_Arithmetic::GetCurrentCount()
|
||||||
{
|
{
|
||||||
return ( unsigned int )( ( ( ( ( long ) code - low ) + 1 ) * scale - 1 ) / ( ( ( long ) high - low ) + 1 ) );
|
// DG: use int instead of long for 64bit compatibility
|
||||||
|
return ( unsigned int )( ( ( ( ( int ) code - low ) + 1 ) * scale - 1 ) / ( ( ( int ) high - low ) + 1 ) );
|
||||||
|
// DG end
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1805,9 +1807,11 @@ idCompressor_Arithmetic::RemoveSymbolFromStream
|
||||||
*/
|
*/
|
||||||
void idCompressor_Arithmetic::RemoveSymbolFromStream( acSymbol_t* symbol )
|
void idCompressor_Arithmetic::RemoveSymbolFromStream( acSymbol_t* symbol )
|
||||||
{
|
{
|
||||||
long range;
|
// DG: use int instead of long for 64bit compatibility
|
||||||
|
int range;
|
||||||
|
|
||||||
range = ( long )( high - low ) + 1;
|
range = ( int )( high - low ) + 1;
|
||||||
|
// DG end
|
||||||
high = low + ( unsigned short )( ( range * symbol->high ) / scale - 1 );
|
high = low + ( unsigned short )( ( range * symbol->high ) / scale - 1 );
|
||||||
low = low + ( unsigned short )( ( range * symbol->low ) / scale );
|
low = low + ( unsigned short )( ( range * symbol->low ) / scale );
|
||||||
|
|
||||||
|
|
|
@ -286,7 +286,7 @@ typedef struct huffmanNode_s
|
||||||
|
|
||||||
typedef struct huffmanCode_s
|
typedef struct huffmanCode_s
|
||||||
{
|
{
|
||||||
unsigned long bits[8];
|
unsigned int bits[8]; // DG: use int instead of long for 64bit compatibility
|
||||||
int numBits;
|
int numBits;
|
||||||
} huffmanCode_t;
|
} huffmanCode_t;
|
||||||
|
|
||||||
|
@ -2721,4 +2721,4 @@ idDeclLocal::EverReferenced
|
||||||
bool idDeclLocal::EverReferenced() const
|
bool idDeclLocal::EverReferenced() const
|
||||||
{
|
{
|
||||||
return everReferenced;
|
return everReferenced;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,9 @@ FS_WriteFloatString
|
||||||
*/
|
*/
|
||||||
int FS_WriteFloatString( char* buf, const char* fmt, va_list argPtr )
|
int FS_WriteFloatString( char* buf, const char* fmt, va_list argPtr )
|
||||||
{
|
{
|
||||||
long i;
|
// DG: replaced long with int for 64bit compatibility in the whole function
|
||||||
unsigned long u;
|
int i;
|
||||||
|
unsigned int u;
|
||||||
double f;
|
double f;
|
||||||
char* str;
|
char* str;
|
||||||
int index;
|
int index;
|
||||||
|
@ -84,27 +85,27 @@ int FS_WriteFloatString( char* buf, const char* fmt, va_list argPtr )
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
case 'i':
|
case 'i':
|
||||||
i = va_arg( argPtr, long );
|
i = va_arg( argPtr, int );
|
||||||
index += sprintf( buf + index, format.c_str(), i );
|
index += sprintf( buf + index, format.c_str(), i );
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
u = va_arg( argPtr, unsigned long );
|
u = va_arg( argPtr, unsigned int );
|
||||||
index += sprintf( buf + index, format.c_str(), u );
|
index += sprintf( buf + index, format.c_str(), u );
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
u = va_arg( argPtr, unsigned long );
|
u = va_arg( argPtr, unsigned int );
|
||||||
index += sprintf( buf + index, format.c_str(), u );
|
index += sprintf( buf + index, format.c_str(), u );
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
u = va_arg( argPtr, unsigned long );
|
u = va_arg( argPtr, unsigned int );
|
||||||
index += sprintf( buf + index, format.c_str(), u );
|
index += sprintf( buf + index, format.c_str(), u );
|
||||||
break;
|
break;
|
||||||
case 'X':
|
case 'X':
|
||||||
u = va_arg( argPtr, unsigned long );
|
u = va_arg( argPtr, unsigned int );
|
||||||
index += sprintf( buf + index, format.c_str(), u );
|
index += sprintf( buf + index, format.c_str(), u );
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
i = va_arg( argPtr, long );
|
i = va_arg( argPtr, int );
|
||||||
index += sprintf( buf + index, format.c_str(), ( char ) i );
|
index += sprintf( buf + index, format.c_str(), ( char ) i );
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
|
@ -150,6 +151,7 @@ int FS_WriteFloatString( char* buf, const char* fmt, va_list argPtr )
|
||||||
}
|
}
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
|
// DG end
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -2797,7 +2797,7 @@ void idFileSystemLocal::CreateCRCsForResourceFileList( const idFileList& list )
|
||||||
}
|
}
|
||||||
|
|
||||||
// All tables read, now seek to each one and calculate the CRC.
|
// All tables read, now seek to each one and calculate the CRC.
|
||||||
idTempArray< unsigned long > innerFileCRCs( numFileResources );
|
idTempArray< unsigned int > innerFileCRCs( numFileResources ); // DG: use int instead of long for 64bit compatibility
|
||||||
for( int innerFileIndex = 0; innerFileIndex < numFileResources; ++innerFileIndex )
|
for( int innerFileIndex = 0; innerFileIndex < numFileResources; ++innerFileIndex )
|
||||||
{
|
{
|
||||||
const char* innerFileDataBegin = currentFile->GetDataPtr() + cacheEntries[innerFileIndex].offset;
|
const char* innerFileDataBegin = currentFile->GetDataPtr() + cacheEntries[innerFileIndex].offset;
|
||||||
|
@ -2806,7 +2806,7 @@ void idFileSystemLocal::CreateCRCsForResourceFileList( const idFileList& list )
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the CRC for all the CRCs.
|
// Get the CRC for all the CRCs.
|
||||||
const unsigned long totalCRC = CRC32_BlockChecksum( innerFileCRCs.Ptr(), innerFileCRCs.Size() );
|
const unsigned int totalCRC = CRC32_BlockChecksum( innerFileCRCs.Ptr(), innerFileCRCs.Size() ); // DG: use int instead of long for 64bit compatibility
|
||||||
|
|
||||||
// Write the .crc file corresponding to the .resources file.
|
// Write the .crc file corresponding to the .resources file.
|
||||||
idStr crcFilename = list.GetFile( fileIndex );
|
idStr crcFilename = list.GetFile( fileIndex );
|
||||||
|
|
|
@ -44,7 +44,7 @@ static const char sixtet_to_base64[] =
|
||||||
void idBase64::Encode( const byte* from, int size )
|
void idBase64::Encode( const byte* from, int size )
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
unsigned long w;
|
unsigned int w; // DG: use int instead of long for 64bit compatibility
|
||||||
byte* to;
|
byte* to;
|
||||||
|
|
||||||
EnsureAlloced( 4 * ( size + 3 ) / 3 + 2 ); // ratio and padding + trailing \0
|
EnsureAlloced( 4 * ( size + 3 ) / 3 + 2 ); // ratio and padding + trailing \0
|
||||||
|
@ -101,7 +101,7 @@ idBase64::Decode
|
||||||
*/
|
*/
|
||||||
int idBase64::Decode( byte* to ) const
|
int idBase64::Decode( byte* to ) const
|
||||||
{
|
{
|
||||||
unsigned long w;
|
unsigned int w; // DG: use int instead of long for 64bit compatibility
|
||||||
int i, j;
|
int i, j;
|
||||||
size_t n;
|
size_t n;
|
||||||
static char base64_to_sixtet[256];
|
static char base64_to_sixtet[256];
|
||||||
|
|
|
@ -1511,7 +1511,7 @@ typedef struct operator_s
|
||||||
|
|
||||||
typedef struct value_s
|
typedef struct value_s
|
||||||
{
|
{
|
||||||
signed long int intvalue;
|
signed int intvalue; // DG: use int instead of long for 64bit compatibility
|
||||||
double floatvalue;
|
double floatvalue;
|
||||||
int parentheses;
|
int parentheses;
|
||||||
struct value_s* prev, *next;
|
struct value_s* prev, *next;
|
||||||
|
@ -1606,7 +1606,7 @@ int PC_OperatorPriority( int op )
|
||||||
|
|
||||||
#define FreeOperator(op)
|
#define FreeOperator(op)
|
||||||
|
|
||||||
int idParser::EvaluateTokens( idToken* tokens, signed long int* intvalue, double* floatvalue, int integer )
|
int idParser::EvaluateTokens( idToken* tokens, signed int* intvalue, double* floatvalue, int integer )
|
||||||
{
|
{
|
||||||
operator_t* o, *firstoperator, *lastoperator;
|
operator_t* o, *firstoperator, *lastoperator;
|
||||||
value_t* v, *firstvalue, *lastvalue, *v1, *v2;
|
value_t* v, *firstvalue, *lastvalue, *v1, *v2;
|
||||||
|
@ -2117,7 +2117,7 @@ int idParser::EvaluateTokens( idToken* tokens, signed long int* intvalue, double
|
||||||
idParser::Evaluate
|
idParser::Evaluate
|
||||||
================
|
================
|
||||||
*/
|
*/
|
||||||
int idParser::Evaluate( signed long int* intvalue, double* floatvalue, int integer )
|
int idParser::Evaluate( signed int* intvalue, double* floatvalue, int integer )
|
||||||
{
|
{
|
||||||
idToken token, *firsttoken, *lasttoken;
|
idToken token, *firsttoken, *lasttoken;
|
||||||
idToken* t, *nexttoken;
|
idToken* t, *nexttoken;
|
||||||
|
@ -2224,7 +2224,7 @@ int idParser::Evaluate( signed long int* intvalue, double* floatvalue, int integ
|
||||||
idParser::DollarEvaluate
|
idParser::DollarEvaluate
|
||||||
================
|
================
|
||||||
*/
|
*/
|
||||||
int idParser::DollarEvaluate( signed long int* intvalue, double* floatvalue, int integer )
|
int idParser::DollarEvaluate( signed int* intvalue, double* floatvalue, int integer )
|
||||||
{
|
{
|
||||||
int indent, defined = false;
|
int indent, defined = false;
|
||||||
idToken token, *firsttoken, *lasttoken;
|
idToken token, *firsttoken, *lasttoken;
|
||||||
|
@ -2345,7 +2345,7 @@ idParser::Directive_elif
|
||||||
*/
|
*/
|
||||||
int idParser::Directive_elif()
|
int idParser::Directive_elif()
|
||||||
{
|
{
|
||||||
signed long int value;
|
signed int value; // DG: use int instead of long for 64bit compatibility
|
||||||
int type, skip;
|
int type, skip;
|
||||||
|
|
||||||
idParser::PopIndent( &type, &skip );
|
idParser::PopIndent( &type, &skip );
|
||||||
|
@ -2370,7 +2370,7 @@ idParser::Directive_if
|
||||||
*/
|
*/
|
||||||
int idParser::Directive_if()
|
int idParser::Directive_if()
|
||||||
{
|
{
|
||||||
signed long int value;
|
signed int value; // DG: use int instead of long for 64bit compatibility
|
||||||
int skip;
|
int skip;
|
||||||
|
|
||||||
if( !idParser::Evaluate( &value, NULL, true ) )
|
if( !idParser::Evaluate( &value, NULL, true ) )
|
||||||
|
@ -2477,7 +2477,7 @@ idParser::Directive_eval
|
||||||
*/
|
*/
|
||||||
int idParser::Directive_eval()
|
int idParser::Directive_eval()
|
||||||
{
|
{
|
||||||
signed long int value;
|
signed int value; // DG: use int instead of long for 64bit compatibility
|
||||||
idToken token;
|
idToken token;
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
|
@ -2644,7 +2644,7 @@ idParser::DollarDirective_evalint
|
||||||
*/
|
*/
|
||||||
int idParser::DollarDirective_evalint()
|
int idParser::DollarDirective_evalint()
|
||||||
{
|
{
|
||||||
signed long int value;
|
signed int value; // DG: use int instead of long for 64bit compatibility
|
||||||
idToken token;
|
idToken token;
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
|
@ -2697,7 +2697,7 @@ int idParser::DollarDirective_evalfloat()
|
||||||
token = buf;
|
token = buf;
|
||||||
token.type = TT_NUMBER;
|
token.type = TT_NUMBER;
|
||||||
token.subtype = TT_FLOAT | TT_LONG | TT_DECIMAL | TT_VALUESVALID;
|
token.subtype = TT_FLOAT | TT_LONG | TT_DECIMAL | TT_VALUESVALID;
|
||||||
token.intvalue = ( unsigned long ) fabs( value );
|
token.intvalue = ( unsigned int ) fabs( value ); // DG: use int instead of long for 64bit compatibility
|
||||||
token.floatvalue = fabs( value );
|
token.floatvalue = fabs( value );
|
||||||
idParser::UnreadSourceToken( &token );
|
idParser::UnreadSourceToken( &token );
|
||||||
if( value < 0 )
|
if( value < 0 )
|
||||||
|
|
|
@ -232,9 +232,11 @@ private:
|
||||||
int Directive_ifndef();
|
int Directive_ifndef();
|
||||||
int Directive_else();
|
int Directive_else();
|
||||||
int Directive_endif();
|
int Directive_endif();
|
||||||
int EvaluateTokens( idToken* tokens, signed long int* intvalue, double* floatvalue, int integer );
|
// DG: use int instead of long for 64bit compatibility
|
||||||
int Evaluate( signed long int* intvalue, double* floatvalue, int integer );
|
int EvaluateTokens( idToken* tokens, signed int* intvalue, double* floatvalue, int integer );
|
||||||
int DollarEvaluate( signed long int* intvalue, double* floatvalue, int integer );
|
int Evaluate( signed int* intvalue, double* floatvalue, int integer );
|
||||||
|
int DollarEvaluate( signed int* intvalue, double* floatvalue, int integer );
|
||||||
|
// DG end
|
||||||
int Directive_define();
|
int Directive_define();
|
||||||
int Directive_elif();
|
int Directive_elif();
|
||||||
int Directive_if();
|
int Directive_if();
|
||||||
|
|
|
@ -1043,7 +1043,7 @@ idStr::FileNameHash
|
||||||
int idStr::FileNameHash() const
|
int idStr::FileNameHash() const
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
long hash;
|
int hash; // DG: use int instead of long for 64bit compatibility
|
||||||
char letter;
|
char letter;
|
||||||
|
|
||||||
hash = 0;
|
hash = 0;
|
||||||
|
@ -1059,7 +1059,7 @@ int idStr::FileNameHash() const
|
||||||
{
|
{
|
||||||
letter = '/';
|
letter = '/';
|
||||||
}
|
}
|
||||||
hash += ( long )( letter ) * ( i + 119 );
|
hash += ( long )( letter ) * ( i + 119 ); // DG: use int instead of long for 64bit compatibility
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
hash &= ( FILE_HASH_SIZE - 1 );
|
hash &= ( FILE_HASH_SIZE - 1 );
|
||||||
|
|
|
@ -99,7 +99,9 @@ public:
|
||||||
void NumberValue(); // calculate values for a TT_NUMBER
|
void NumberValue(); // calculate values for a TT_NUMBER
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned long intvalue; // integer value
|
// DG: use int instead of long for 64bit compatibility
|
||||||
|
unsigned int intvalue; // integer value
|
||||||
|
// DG end
|
||||||
double floatvalue; // floating point value
|
double floatvalue; // floating point value
|
||||||
const char* whiteSpaceStart_p; // start of white space before token, only used by idLexer
|
const char* whiteSpaceStart_p; // start of white space before token, only used by idLexer
|
||||||
const char* whiteSpaceEnd_p; // end of white space before token, only used by idLexer
|
const char* whiteSpaceEnd_p; // end of white space before token, only used by idLexer
|
||||||
|
|
|
@ -108,10 +108,11 @@ ID_INLINE float idRandom::CRandomFloat()
|
||||||
class idRandom2
|
class idRandom2
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
idRandom2( unsigned long seed = 0 );
|
// DG: use int instead of long for 64bit compatibility in this whole class
|
||||||
|
idRandom2( unsigned int seed = 0 );
|
||||||
|
|
||||||
void SetSeed( unsigned long seed );
|
void SetSeed( unsigned int seed );
|
||||||
unsigned long GetSeed() const;
|
unsigned int GetSeed() const;
|
||||||
|
|
||||||
int RandomInt(); // random integer in the range [0, MAX_RAND]
|
int RandomInt(); // random integer in the range [0, MAX_RAND]
|
||||||
int RandomInt( int max ); // random integer in the range [0, max]
|
int RandomInt( int max ); // random integer in the range [0, max]
|
||||||
|
@ -121,23 +122,23 @@ public:
|
||||||
static const int MAX_RAND = 0x7fff;
|
static const int MAX_RAND = 0x7fff;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned long seed;
|
unsigned int seed;
|
||||||
|
|
||||||
static const unsigned long IEEE_ONE = 0x3f800000;
|
static const unsigned int IEEE_ONE = 0x3f800000;
|
||||||
static const unsigned long IEEE_MASK = 0x007fffff;
|
static const unsigned int IEEE_MASK = 0x007fffff;
|
||||||
};
|
};
|
||||||
|
|
||||||
ID_INLINE idRandom2::idRandom2( unsigned long seed )
|
ID_INLINE idRandom2::idRandom2( unsigned int seed )
|
||||||
{
|
{
|
||||||
this->seed = seed;
|
this->seed = seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
ID_INLINE void idRandom2::SetSeed( unsigned long seed )
|
ID_INLINE void idRandom2::SetSeed( unsigned int seed )
|
||||||
{
|
{
|
||||||
this->seed = seed;
|
this->seed = seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
ID_INLINE unsigned long idRandom2::GetSeed() const
|
ID_INLINE unsigned int idRandom2::GetSeed() const
|
||||||
{
|
{
|
||||||
return seed;
|
return seed;
|
||||||
}
|
}
|
||||||
|
@ -159,7 +160,7 @@ ID_INLINE int idRandom2::RandomInt( int max )
|
||||||
|
|
||||||
ID_INLINE float idRandom2::RandomFloat()
|
ID_INLINE float idRandom2::RandomFloat()
|
||||||
{
|
{
|
||||||
unsigned long i;
|
unsigned int i;
|
||||||
seed = 1664525L * seed + 1013904223L;
|
seed = 1664525L * seed + 1013904223L;
|
||||||
i = idRandom2::IEEE_ONE | ( seed & idRandom2::IEEE_MASK );
|
i = idRandom2::IEEE_ONE | ( seed & idRandom2::IEEE_MASK );
|
||||||
return ( ( *( float* )&i ) - 1.0f );
|
return ( ( *( float* )&i ) - 1.0f );
|
||||||
|
@ -167,10 +168,11 @@ ID_INLINE float idRandom2::RandomFloat()
|
||||||
|
|
||||||
ID_INLINE float idRandom2::CRandomFloat()
|
ID_INLINE float idRandom2::CRandomFloat()
|
||||||
{
|
{
|
||||||
unsigned long i;
|
unsigned int i;
|
||||||
seed = 1664525L * seed + 1013904223L;
|
seed = 1664525L * seed + 1013904223L;
|
||||||
i = idRandom2::IEEE_ONE | ( seed & idRandom2::IEEE_MASK );
|
i = idRandom2::IEEE_ONE | ( seed & idRandom2::IEEE_MASK );
|
||||||
return ( 2.0f * ( *( float* )&i ) - 3.0f );
|
return ( 2.0f * ( *( float* )&i ) - 3.0f );
|
||||||
}
|
}
|
||||||
|
// DG end
|
||||||
|
|
||||||
#endif /* !__MATH_RANDOM_H__ */
|
#endif /* !__MATH_RANDOM_H__ */
|
||||||
|
|
|
@ -124,7 +124,7 @@ void idSIMD::Shutdown() {
|
||||||
|
|
||||||
idSIMDProcessor *p_simd;
|
idSIMDProcessor *p_simd;
|
||||||
idSIMDProcessor *p_generic;
|
idSIMDProcessor *p_generic;
|
||||||
long baseClocks = 0;
|
int baseClocks = 0; // DG: use int instead of long for 64bit compatibility
|
||||||
|
|
||||||
#if defined(_MSC_VER) && defined(_M_IX86)
|
#if defined(_MSC_VER) && defined(_M_IX86)
|
||||||
#define TIME_TYPE int
|
#define TIME_TYPE int
|
||||||
|
|
|
@ -280,13 +280,17 @@ void VPCALL idSIMD_SSE::BlendJoints( idJointQuat* joints, const idJointQuat* ble
|
||||||
float omega;
|
float omega;
|
||||||
float scale0;
|
float scale0;
|
||||||
float scale1;
|
float scale1;
|
||||||
unsigned long signBit;
|
// DG: use int instead of long for 64bit compatibility
|
||||||
|
unsigned int signBit;
|
||||||
|
// DG end
|
||||||
|
|
||||||
cosom = jointQuat.x * blendQuat.x + jointQuat.y * blendQuat.y + jointQuat.z * blendQuat.z + jointQuat.w * blendQuat.w;
|
cosom = jointQuat.x * blendQuat.x + jointQuat.y * blendQuat.y + jointQuat.z * blendQuat.z + jointQuat.w * blendQuat.w;
|
||||||
|
|
||||||
signBit = ( *( unsigned long* )&cosom ) & ( 1 << 31 );
|
// DG: use int instead of long for 64bit compatibility
|
||||||
|
signBit = ( *( unsigned int* )&cosom ) & ( 1 << 31 );
|
||||||
|
|
||||||
( *( unsigned long* )&cosom ) ^= signBit;
|
( *( unsigned int* )&cosom ) ^= signBit;
|
||||||
|
// DG end
|
||||||
|
|
||||||
scale0 = 1.0f - cosom * cosom;
|
scale0 = 1.0f - cosom * cosom;
|
||||||
scale0 = ( scale0 <= 0.0f ) ? 1e-10f : scale0;
|
scale0 = ( scale0 <= 0.0f ) ? 1e-10f : scale0;
|
||||||
|
@ -295,7 +299,7 @@ void VPCALL idSIMD_SSE::BlendJoints( idJointQuat* joints, const idJointQuat* ble
|
||||||
scale0 = idMath::Sin16( ( 1.0f - lerp ) * omega ) * sinom;
|
scale0 = idMath::Sin16( ( 1.0f - lerp ) * omega ) * sinom;
|
||||||
scale1 = idMath::Sin16( lerp * omega ) * sinom;
|
scale1 = idMath::Sin16( lerp * omega ) * sinom;
|
||||||
|
|
||||||
( *( unsigned long* )&scale1 ) ^= signBit;
|
( *( unsigned int* )&scale1 ) ^= signBit; // DG: use int instead of long for 64bit compatibility
|
||||||
|
|
||||||
jointQuat.x = scale0 * jointQuat.x + scale1 * blendQuat.x;
|
jointQuat.x = scale0 * jointQuat.x + scale1 * blendQuat.x;
|
||||||
jointQuat.y = scale0 * jointQuat.y + scale1 * blendQuat.y;
|
jointQuat.y = scale0 * jointQuat.y + scale1 * blendQuat.y;
|
||||||
|
|
|
@ -40,7 +40,7 @@ typedef unsigned char byte; // 8 bits
|
||||||
typedef unsigned short word; // 16 bits
|
typedef unsigned short word; // 16 bits
|
||||||
typedef unsigned int dword; // 32 bits
|
typedef unsigned int dword; // 32 bits
|
||||||
typedef unsigned int uint;
|
typedef unsigned int uint;
|
||||||
typedef unsigned long ulong;
|
// typedef unsigned long ulong; // DG: long should be avoided.
|
||||||
|
|
||||||
typedef signed char int8;
|
typedef signed char int8;
|
||||||
typedef unsigned char uint8;
|
typedef unsigned char uint8;
|
||||||
|
|
|
@ -1573,7 +1573,7 @@ void idLobby::SendConnectionRequest()
|
||||||
idBitMsg msg( buffer, sizeof( buffer ) );
|
idBitMsg msg( buffer, sizeof( buffer ) );
|
||||||
|
|
||||||
// Add the current version info to the handshake
|
// Add the current version info to the handshake
|
||||||
const unsigned long localChecksum = NetGetVersionChecksum();
|
const unsigned int localChecksum = NetGetVersionChecksum(); // DG: use int instead of long for 64bit compatibility
|
||||||
|
|
||||||
NET_VERBOSE_PRINT( "NET: version = %i\n", localChecksum );
|
NET_VERBOSE_PRINT( "NET: version = %i\n", localChecksum );
|
||||||
|
|
||||||
|
@ -1754,11 +1754,11 @@ idLobby::CheckVersion
|
||||||
*/
|
*/
|
||||||
bool idLobby::CheckVersion( idBitMsg& msg, lobbyAddress_t peerAddress )
|
bool idLobby::CheckVersion( idBitMsg& msg, lobbyAddress_t peerAddress )
|
||||||
{
|
{
|
||||||
const unsigned long remoteChecksum = msg.ReadLong();
|
const unsigned int remoteChecksum = msg.ReadLong(); // DG: use int instead of long for 64bit compatibility
|
||||||
|
|
||||||
if( net_checkVersion.GetInteger() == 1 )
|
if( net_checkVersion.GetInteger() == 1 )
|
||||||
{
|
{
|
||||||
const unsigned long localChecksum = NetGetVersionChecksum();
|
const unsigned int localChecksum = NetGetVersionChecksum(); // DG: use int instead of long for 64bit compatibility
|
||||||
|
|
||||||
NET_VERBOSE_PRINT( "NET: Comparing handshake version - localChecksum = %i, remoteChecksum = %i\n", localChecksum, remoteChecksum );
|
NET_VERBOSE_PRINT( "NET: Comparing handshake version - localChecksum = %i, remoteChecksum = %i\n", localChecksum, remoteChecksum );
|
||||||
return ( remoteChecksum == localChecksum );
|
return ( remoteChecksum == localChecksum );
|
||||||
|
@ -2312,7 +2312,9 @@ uint32 idLobby::GetPartyTokenAsHost()
|
||||||
{
|
{
|
||||||
// I don't know if this is mathematically sound, but it seems reasonable.
|
// I don't know if this is mathematically sound, but it seems reasonable.
|
||||||
// Don't do this at app startup (i.e. in the constructor) or it will be a lot less random.
|
// Don't do this at app startup (i.e. in the constructor) or it will be a lot less random.
|
||||||
unsigned long seed = Sys_Milliseconds(); // time app has been running
|
// DG: use int instead of long for 64bit compatibility
|
||||||
|
unsigned int seed = Sys_Milliseconds(); // time app has been running
|
||||||
|
// DG end
|
||||||
idLocalUser* masterUser = session->GetSignInManager().GetMasterLocalUser();
|
idLocalUser* masterUser = session->GetSignInManager().GetMasterLocalUser();
|
||||||
if( masterUser != NULL )
|
if( masterUser != NULL )
|
||||||
{
|
{
|
||||||
|
@ -2865,7 +2867,7 @@ void idLobby::HandleReliableMsg( int p, idBitMsg& msg )
|
||||||
// This message is sent from the peers to state they are done loading the map
|
// This message is sent from the peers to state they are done loading the map
|
||||||
VERIFY_CONNECTED_PEER( p, actingGameStateLobbyType, RELIABLE_LOADING_DONE );
|
VERIFY_CONNECTED_PEER( p, actingGameStateLobbyType, RELIABLE_LOADING_DONE );
|
||||||
|
|
||||||
unsigned long networkChecksum = 0;
|
unsigned int networkChecksum = 0; // DG: use int instead of long for 64bit compatibility
|
||||||
networkChecksum = msg.ReadLong();
|
networkChecksum = msg.ReadLong();
|
||||||
|
|
||||||
peer.networkChecksum = networkChecksum;
|
peer.networkChecksum = networkChecksum;
|
||||||
|
|
|
@ -334,7 +334,9 @@ public:
|
||||||
int lastProcTime; // Used to determine when a packet was processed for sending to this peer
|
int lastProcTime; // Used to determine when a packet was processed for sending to this peer
|
||||||
int lastInBandProcTime; // Last time a in-band packet was processed for sending
|
int lastInBandProcTime; // Last time a in-band packet was processed for sending
|
||||||
int lastFragmentSendTime; // Last time a fragment was sent out (fragments are processed msg's, waiting to be fully sent)
|
int lastFragmentSendTime; // Last time a fragment was sent out (fragments are processed msg's, waiting to be fully sent)
|
||||||
unsigned long networkChecksum; // Checksum used to determine if a peer loaded the network resources the EXACT same as the server did
|
// DG: use int instead of long for 64bit compatibility
|
||||||
|
unsigned int networkChecksum; // Checksum used to determine if a peer loaded the network resources the EXACT same as the server did
|
||||||
|
// DG end
|
||||||
int pauseSnapshots;
|
int pauseSnapshots;
|
||||||
|
|
||||||
lobbyAddress_t address;
|
lobbyAddress_t address;
|
||||||
|
|
|
@ -426,7 +426,7 @@ struct sysMemoryStats_t
|
||||||
int availExtendedVirtual;
|
int availExtendedVirtual;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef unsigned long address_t;
|
// typedef unsigned long address_t; // DG: this isn't even used
|
||||||
|
|
||||||
void Sys_Init();
|
void Sys_Init();
|
||||||
void Sys_Shutdown();
|
void Sys_Shutdown();
|
||||||
|
|
|
@ -4592,7 +4592,7 @@ void idSessionLocal::ListServersCommon()
|
||||||
idBitMsg msg( buffer, sizeof( buffer ) );
|
idBitMsg msg( buffer, sizeof( buffer ) );
|
||||||
|
|
||||||
// Add the current version info to the query
|
// Add the current version info to the query
|
||||||
const unsigned long localChecksum = NetGetVersionChecksum();
|
const unsigned int localChecksum = NetGetVersionChecksum(); // DG: use int instead of long for 64bit compatibility
|
||||||
|
|
||||||
NET_VERBOSE_PRINT( "ListServers: Hash checksum: %i, broadcasting to: %s\n", localChecksum, address.ToString() );
|
NET_VERBOSE_PRINT( "ListServers: Hash checksum: %i, broadcasting to: %s\n", localChecksum, address.ToString() );
|
||||||
|
|
||||||
|
@ -4614,8 +4614,10 @@ void idSessionLocal::HandleDedicatedServerQueryRequest( lobbyAddress_t& remoteAd
|
||||||
|
|
||||||
bool canJoin = true;
|
bool canJoin = true;
|
||||||
|
|
||||||
const unsigned long localChecksum = NetGetVersionChecksum();
|
// DG: use int instead of long for 64bit compatibility
|
||||||
const unsigned long remoteChecksum = msg.ReadLong();
|
const unsigned int localChecksum = NetGetVersionChecksum();
|
||||||
|
const unsigned int remoteChecksum = msg.ReadLong();
|
||||||
|
// DG end
|
||||||
|
|
||||||
if( remoteChecksum != localChecksum )
|
if( remoteChecksum != localChecksum )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue