|
|
@ -1,6 +1,6 @@ |
|
|
|
/***
|
|
|
|
/***
|
|
|
|
* |
|
|
|
* |
|
|
|
* Copyright (c) 1996-2002, Valve LLC. All rights reserved. |
|
|
|
* Copyright (c) 1996-2001, Valve LLC. All rights reserved. |
|
|
|
* |
|
|
|
* |
|
|
|
* This product contains software technology licensed from Id |
|
|
|
* This product contains software technology licensed from Id |
|
|
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. |
|
|
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. |
|
|
@ -354,15 +354,17 @@ BOOL UTIL_GetNextBestWeapon( CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeap |
|
|
|
// ripped this out of the engine
|
|
|
|
// ripped this out of the engine
|
|
|
|
float UTIL_AngleMod(float a) |
|
|
|
float UTIL_AngleMod(float a) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (a < 0) |
|
|
|
/*if (a < 0)
|
|
|
|
{ |
|
|
|
{ |
|
|
|
a = a + 360 * ((int)(a / 360) + 1); |
|
|
|
a = a + 360 * ((int)(a / 360) + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (a >= 360) |
|
|
|
else if (a >= 360) |
|
|
|
{ |
|
|
|
{ |
|
|
|
a = a - 360 * ((int)(a / 360)); |
|
|
|
a = a - 360 * ((int)(a / 360)); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
// a = (360.0/65536) * ((int)(a*(65536/360.0)) & 65535);
|
|
|
|
// a = (360.0/65536) * ((int)(a*(65536/360.0)) & 65535);
|
|
|
|
|
|
|
|
a = fmod( a, 360.0f ); |
|
|
|
|
|
|
|
if( a < 0 ) a += 360; |
|
|
|
return a; |
|
|
|
return a; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1003,7 +1005,9 @@ float UTIL_VecToYaw( const Vector &vec ) |
|
|
|
|
|
|
|
|
|
|
|
void UTIL_SetOrigin( entvars_t *pev, const Vector &vecOrigin ) |
|
|
|
void UTIL_SetOrigin( entvars_t *pev, const Vector &vecOrigin ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
SET_ORIGIN(ENT(pev), vecOrigin ); |
|
|
|
edict_t *ent = ENT(pev); |
|
|
|
|
|
|
|
if ( ent ) |
|
|
|
|
|
|
|
SET_ORIGIN( ent, vecOrigin ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UTIL_ParticleEffect( const Vector &vecOrigin, const Vector &vecDirection, ULONG ulColor, ULONG ulCount ) |
|
|
|
void UTIL_ParticleEffect( const Vector &vecOrigin, const Vector &vecDirection, ULONG ulColor, ULONG ulCount ) |
|
|
@ -1655,7 +1659,11 @@ static int gSizes[FIELD_TYPECOUNT] = |
|
|
|
sizeof(float)*3, // FIELD_POSITION_VECTOR
|
|
|
|
sizeof(float)*3, // FIELD_POSITION_VECTOR
|
|
|
|
sizeof(int *), // FIELD_POINTER
|
|
|
|
sizeof(int *), // FIELD_POINTER
|
|
|
|
sizeof(int), // FIELD_INTEGER
|
|
|
|
sizeof(int), // FIELD_INTEGER
|
|
|
|
|
|
|
|
#ifdef GNUC |
|
|
|
|
|
|
|
sizeof(int *)*2, // FIELD_FUNCTION
|
|
|
|
|
|
|
|
#else |
|
|
|
sizeof(int *), // FIELD_FUNCTION
|
|
|
|
sizeof(int *), // FIELD_FUNCTION
|
|
|
|
|
|
|
|
#endif |
|
|
|
sizeof(int), // FIELD_BOOLEAN
|
|
|
|
sizeof(int), // FIELD_BOOLEAN
|
|
|
|
sizeof(short), // FIELD_SHORT
|
|
|
|
sizeof(short), // FIELD_SHORT
|
|
|
|
sizeof(char), // FIELD_CHARACTER
|
|
|
|
sizeof(char), // FIELD_CHARACTER
|
|
|
@ -1965,7 +1973,7 @@ void CSave :: WritePositionVector( const char *pname, const float *value, int co |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CSave :: WriteFunction( const char *pname, const int *data, int count ) |
|
|
|
void CSave :: WriteFunction( const char *pname, void **data, int count ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const char *functionName; |
|
|
|
const char *functionName; |
|
|
|
|
|
|
|
|
|
|
@ -2133,7 +2141,7 @@ int CSave :: WriteFields( const char *pname, void *pBaseData, TYPEDESCRIPTION *p |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case FIELD_FUNCTION: |
|
|
|
case FIELD_FUNCTION: |
|
|
|
WriteFunction( pTest->fieldName, (int *)(char *)pOutputData, pTest->fieldSize ); |
|
|
|
WriteFunction( pTest->fieldName, (void **)pOutputData, pTest->fieldSize ); |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
ALERT( at_error, "Bad field type\n" ); |
|
|
|
ALERT( at_error, "Bad field type\n" ); |
|
|
@ -2241,13 +2249,20 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou |
|
|
|
switch( pTest->fieldType ) |
|
|
|
switch( pTest->fieldType ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case FIELD_TIME: |
|
|
|
case FIELD_TIME: |
|
|
|
|
|
|
|
#ifdef __VFP_FP__ |
|
|
|
|
|
|
|
memcpy(&timeData, pInputData, 4); |
|
|
|
|
|
|
|
// Re-base time variables
|
|
|
|
|
|
|
|
timeData += time; |
|
|
|
|
|
|
|
memcpy(pOutputData, &timeData, 4); |
|
|
|
|
|
|
|
#else |
|
|
|
timeData = *(float *)pInputData; |
|
|
|
timeData = *(float *)pInputData; |
|
|
|
// Re-base time variables
|
|
|
|
// Re-base time variables
|
|
|
|
timeData += time; |
|
|
|
timeData += time; |
|
|
|
*((float *)pOutputData) = timeData; |
|
|
|
*((float *)pOutputData) = timeData; |
|
|
|
|
|
|
|
#endif |
|
|
|
break; |
|
|
|
break; |
|
|
|
case FIELD_FLOAT: |
|
|
|
case FIELD_FLOAT: |
|
|
|
*((float *)pOutputData) = *(float *)pInputData; |
|
|
|
memcpy(pOutputData, pInputData, 4); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case FIELD_MODELNAME: |
|
|
|
case FIELD_MODELNAME: |
|
|
|
case FIELD_SOUNDNAME: |
|
|
|
case FIELD_SOUNDNAME: |
|
|
@ -2325,9 +2340,22 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou |
|
|
|
((float *)pOutputData)[2] = ((float *)pInputData)[2]; |
|
|
|
((float *)pOutputData)[2] = ((float *)pInputData)[2]; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case FIELD_POSITION_VECTOR: |
|
|
|
case FIELD_POSITION_VECTOR: |
|
|
|
|
|
|
|
#ifdef __VFP_FP__ |
|
|
|
|
|
|
|
float tmp; |
|
|
|
|
|
|
|
memcpy(&tmp, (char *)pInputData + 0, 4); |
|
|
|
|
|
|
|
tmp += position.x; |
|
|
|
|
|
|
|
memcpy((char *)pOutputData + 0, &tmp, 4); |
|
|
|
|
|
|
|
memcpy(&tmp, (char *)pInputData + 4, 4); |
|
|
|
|
|
|
|
tmp += position.y; |
|
|
|
|
|
|
|
memcpy((char *)pOutputData + 4, &tmp, 4); |
|
|
|
|
|
|
|
memcpy(&tmp, (char *)pInputData + 8, 4); |
|
|
|
|
|
|
|
tmp += position.z; |
|
|
|
|
|
|
|
memcpy((char *)pOutputData + 8, &tmp, 4); |
|
|
|
|
|
|
|
#else |
|
|
|
((float *)pOutputData)[0] = ((float *)pInputData)[0] + position.x; |
|
|
|
((float *)pOutputData)[0] = ((float *)pInputData)[0] + position.x; |
|
|
|
((float *)pOutputData)[1] = ((float *)pInputData)[1] + position.y; |
|
|
|
((float *)pOutputData)[1] = ((float *)pInputData)[1] + position.y; |
|
|
|
((float *)pOutputData)[2] = ((float *)pInputData)[2] + position.z; |
|
|
|
((float *)pOutputData)[2] = ((float *)pInputData)[2] + position.z; |
|
|
|
|
|
|
|
#endif |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case FIELD_BOOLEAN: |
|
|
|
case FIELD_BOOLEAN: |
|
|
|