Browse Source

Merge branch 'master' into dmc

dmc
Night Owl 8 years ago
parent
commit
a856faabf8
  1. 2
      cl_dll/MOTD.cpp
  2. 2
      cl_dll/hl/hl_weapons.cpp
  3. 2
      cl_dll/hud_spectator.cpp
  4. 2
      cl_dll/input_xash3d.cpp
  5. 2
      cl_dll/message.cpp
  6. 4
      cl_dll/util.cpp
  7. 4
      dlls/crossbow.cpp
  8. 4
      dlls/effects.cpp
  9. 2
      dlls/mpstubb.cpp
  10. 2
      dlls/nodes.cpp
  11. 2
      dlls/stats.cpp
  12. 20
      dlls/util.cpp
  13. 2
      dlls/weapons.cpp
  14. 4
      dlls/world.cpp
  15. 8
      engine/cdll_int.h
  16. 28
      pm_shared/pm_defs.h

2
cl_dll/MOTD.cpp

@ -130,7 +130,7 @@ int CHudMOTD::MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf )
BEGIN_READ( pbuf, iSize ); BEGIN_READ( pbuf, iSize );
int is_finished = READ_BYTE(); int is_finished = READ_BYTE();
strncat( m_szMOTD, READ_STRING(), sizeof(m_szMOTD) ); strncat( m_szMOTD, READ_STRING(), sizeof(m_szMOTD) - 1 );
if( is_finished ) if( is_finished )
{ {

2
cl_dll/hl/hl_weapons.cpp

@ -288,7 +288,7 @@ Only produces random numbers to match the server ones.
*/ */
Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker, int shared_rand ) Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker, int shared_rand )
{ {
float x, y, z; float x = 0, y = 0, z;
for( ULONG iShot = 1; iShot <= cShots; iShot++ ) for( ULONG iShot = 1; iShot <= cShots; iShot++ )
{ {

2
cl_dll/hud_spectator.cpp

@ -969,7 +969,7 @@ void CHudSpectator::DrawOverviewLayer()
if ( hasMapImage) if ( hasMapImage)
{ {
i = m_MapSprite->numframes / (4*3); i = m_MapSprite->numframes / (4*3);
i = sqrt(i); i = sqrt(float(i));
xTiles = i*4; xTiles = i*4;
yTiles = i*3; yTiles = i*3;
} }

2
cl_dll/input_xash3d.cpp

@ -54,7 +54,7 @@ float rel_pitch;
#define IMPULSE_DOWN 2 #define IMPULSE_DOWN 2
#define IMPULSE_UP 4 #define IMPULSE_UP 4
bool CL_IsDead(); int CL_IsDead( void );
Vector dead_viewangles(0, 0, 0); Vector dead_viewangles(0, 0, 0);
void IN_ToggleButtons( float forwardmove, float sidemove ) void IN_ToggleButtons( float forwardmove, float sidemove )

2
cl_dll/message.cpp

@ -310,7 +310,7 @@ int CHudMessage::Draw( float fTime )
{ {
int i, drawn; int i, drawn;
client_textmessage_t *pMessage; client_textmessage_t *pMessage;
float endTime; float endTime = 0;
drawn = 0; drawn = 0;

4
cl_dll/util.cpp

@ -32,6 +32,10 @@
extern vec3_t vec3_origin; extern vec3_t vec3_origin;
#ifdef _MSC_VER
vec3_t vec3_origin;
#endif
double sqrt( double x ); double sqrt( double x );
float Length( const float *v ) float Length( const float *v )

4
dlls/crossbow.cpp

@ -27,6 +27,8 @@
#define BOLT_AIR_VELOCITY 2000 #define BOLT_AIR_VELOCITY 2000
#define BOLT_WATER_VELOCITY 1000 #define BOLT_WATER_VELOCITY 1000
extern BOOL gPhysicsInterfaceInitialized;
// UNDONE: Save/restore this? Don't forget to set classname and LINK_ENTITY_TO_CLASS() // UNDONE: Save/restore this? Don't forget to set classname and LINK_ENTITY_TO_CLASS()
// //
// OVERLOADS SOME ENTVARS: // OVERLOADS SOME ENTVARS:
@ -167,10 +169,12 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther )
pev->angles.z = RANDOM_LONG( 0, 360 ); pev->angles.z = RANDOM_LONG( 0, 360 );
pev->nextthink = gpGlobals->time + 10.0; pev->nextthink = gpGlobals->time + 10.0;
if (gPhysicsInterfaceInitialized) {
// g-cont. Setup movewith feature // g-cont. Setup movewith feature
pev->movetype = MOVETYPE_COMPOUND; // set movewith type pev->movetype = MOVETYPE_COMPOUND; // set movewith type
pev->aiment = ENT( pOther->pev ); // set parent pev->aiment = ENT( pOther->pev ); // set parent
} }
}
if( UTIL_PointContents( pev->origin ) != CONTENTS_WATER ) if( UTIL_PointContents( pev->origin ) != CONTENTS_WATER )
{ {

4
dlls/effects.cpp

@ -410,7 +410,7 @@ LINK_ENTITY_TO_CLASS( trip_beam, CTripBeam )
void CTripBeam::Spawn( void ) void CTripBeam::Spawn( void )
{ {
CLightning::Spawn(); CLightning::Spawn();
SetTouch( &TriggerTouch ); SetTouch( &CLightning::TriggerTouch );
pev->solid = SOLID_TRIGGER; pev->solid = SOLID_TRIGGER;
RelinkBeam(); RelinkBeam();
} }
@ -1267,7 +1267,7 @@ void CSprite::TurnOn( void )
pev->effects = 0; pev->effects = 0;
if( ( pev->framerate && m_maxFrame > 1.0 ) || ( pev->spawnflags & SF_SPRITE_ONCE ) ) if( ( pev->framerate && m_maxFrame > 1.0 ) || ( pev->spawnflags & SF_SPRITE_ONCE ) )
{ {
SetThink( &CSprite::CSprite::AnimateThink ); SetThink( &CSprite::AnimateThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
m_lastTime = gpGlobals->time; m_lastTime = gpGlobals->time;
} }

2
dlls/mpstubb.cpp

@ -74,7 +74,7 @@ void CBaseMonster::MonsterInitDead( void )
// Setup health counters, etc. // Setup health counters, etc.
BecomeDead(); BecomeDead();
SetThink( &CorpseFallThink ); SetThink( &CBaseMonster::CorpseFallThink );
pev->nextthink = gpGlobals->time + 0.5; pev->nextthink = gpGlobals->time + 0.5;
} }

2
dlls/nodes.cpp

@ -45,6 +45,8 @@ LINK_ENTITY_TO_CLASS( info_node_air, CNodeEnt )
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#define CreateDirectory(p, n) mkdir(p, 0777) #define CreateDirectory(p, n) mkdir(p, 0777)
#else
#define CreateDirectory(p, n) CreateDirectoryA(p, n)
#endif #endif
//========================================================= //=========================================================

2
dlls/stats.cpp

@ -15,7 +15,7 @@
#include "weapons.h" #include "weapons.h"
#include "soundent.h" #include "soundent.h"
#include "monsters.h" #include "monsters.h"
#include "..\engine\shake.h" #include "../engine/shake.h"
#include "decals.h" #include "decals.h"
#include "gamerules.h" #include "gamerules.h"

20
dlls/util.cpp

@ -2384,22 +2384,22 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou
*( (EOFFSET *)pOutputData ) = 0; *( (EOFFSET *)pOutputData ) = 0;
break; break;
case FIELD_VECTOR: case FIELD_VECTOR:
#ifdef __VFP_FP__
memcpy( pOutputData, pInputData, sizeof( Vector ) );
#else
( (float *)pOutputData )[0] = ( (float *)pInputData )[0]; ( (float *)pOutputData )[0] = ( (float *)pInputData )[0];
( (float *)pOutputData )[1] = ( (float *)pInputData )[1]; ( (float *)pOutputData )[1] = ( (float *)pInputData )[1];
( (float *)pOutputData )[2] = ( (float *)pInputData )[2]; ( (float *)pOutputData )[2] = ( (float *)pInputData )[2];
#endif
break; break;
case FIELD_POSITION_VECTOR: case FIELD_POSITION_VECTOR:
#ifdef __VFP_FP__ #ifdef __VFP_FP__
float tmp; {
memcpy( &tmp, (char *)pInputData + 0, 4 ); Vector tmp;
tmp += position.x; memcpy( &tmp, pInputData, sizeof( Vector ) );
memcpy( (char *)pOutputData + 0, &tmp, 4 ); tmp = tmp + position;
memcpy( &tmp, (char *)pInputData + 4, 4 ); memcpy( pOutputData, &tmp, sizeof( Vector ) );
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 #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;

2
dlls/weapons.cpp

@ -1041,7 +1041,7 @@ void CBasePlayerAmmo::DefaultTouch( CBaseEntity *pOther )
//========================================================= //=========================================================
int CBasePlayerWeapon::ExtractAmmo( CBasePlayerWeapon *pWeapon ) int CBasePlayerWeapon::ExtractAmmo( CBasePlayerWeapon *pWeapon )
{ {
int iReturn; int iReturn = 0;
if( pszAmmo1() != NULL ) if( pszAmmo1() != NULL )
{ {

4
dlls/world.cpp

@ -824,6 +824,8 @@ static physics_interface_t gPhysicsInterface =
DispatchPhysicsEntity, DispatchPhysicsEntity,
}; };
BOOL gPhysicsInterfaceInitialized = FALSE;
int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEngine, physics_interface_t *pFunctionTable ) int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEngine, physics_interface_t *pFunctionTable )
{ {
if( !pFunctionTable || !pfuncsFromEngine || iVersion != SV_PHYSICS_INTERFACE_VERSION ) if( !pFunctionTable || !pfuncsFromEngine || iVersion != SV_PHYSICS_INTERFACE_VERSION )
@ -836,6 +838,6 @@ int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEn
// fill engine callbacks // fill engine callbacks
memcpy( pFunctionTable, &gPhysicsInterface, sizeof(physics_interface_t) ); memcpy( pFunctionTable, &gPhysicsInterface, sizeof(physics_interface_t) );
gPhysicsInterfaceInitialized = TRUE;
return TRUE; return TRUE;
} }

8
engine/cdll_int.h

@ -93,6 +93,12 @@ typedef struct client_textmessage_s
const char *pMessage; const char *pMessage;
} client_textmessage_t; } client_textmessage_t;
#if __MSC_VER == 1200
#define ulonglong_t __int64
#else
#define ulonglong_t unsigned long long
#endif
typedef struct hud_player_info_s typedef struct hud_player_info_s
{ {
char *name; char *name;
@ -106,7 +112,7 @@ typedef struct hud_player_info_s
short topcolor; short topcolor;
short bottomcolor; short bottomcolor;
unsigned long long m_nSteamID; ulonglong_t m_nSteamID;
} hud_player_info_t; } hud_player_info_t;
typedef struct cl_enginefuncs_s typedef struct cl_enginefuncs_s

28
pm_shared/pm_defs.h

@ -194,7 +194,12 @@ typedef struct playermove_s
int (*PM_PointContents)( float *p, int *truecontents /*filled in if this is non-null*/ ); int (*PM_PointContents)( float *p, int *truecontents /*filled in if this is non-null*/ );
int (*PM_TruePointContents)( float *p ); int (*PM_TruePointContents)( float *p );
int (*PM_HullPointContents)( struct hull_s *hull, int num, float *p ); int (*PM_HullPointContents)( struct hull_s *hull, int num, float *p );
#ifdef __MINGW32__
pmtrace_t *(*PM_PlayerTrace_real)( pmtrace_t * retvalue, float *start, float *end, int traceFlags, int ignore_pe );
#else
pmtrace_t (*PM_PlayerTrace)( float *start, float *end, int traceFlags, int ignore_pe ); pmtrace_t (*PM_PlayerTrace)( float *start, float *end, int traceFlags, int ignore_pe );
#endif
struct pmtrace_s *(*PM_TraceLine)( float *start, float *end, int flags, int usehulll, int ignore_pe ); struct pmtrace_s *(*PM_TraceLine)( float *start, float *end, int flags, int usehulll, int ignore_pe );
long (*RandomLong)( long lLow, long lHigh ); long (*RandomLong)( long lLow, long lHigh );
float (*RandomFloat)( float flLow, float flHigh ); float (*RandomFloat)( float flLow, float flHigh );
@ -213,9 +218,32 @@ typedef struct playermove_s
void (*PM_PlaySound)( int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch ); void (*PM_PlaySound)( int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch );
const char *(*PM_TraceTexture)( int ground, float *vstart, float *vend ); const char *(*PM_TraceTexture)( int ground, float *vstart, float *vend );
void (*PM_PlaybackEventFull)( int flags, int clientindex, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); void (*PM_PlaybackEventFull)( int flags, int clientindex, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
#ifdef __MINGW32__
pmtrace_t *(*PM_PlayerTraceEx_real) (pmtrace_t *retvalue, float *start, float *end, int traceFlags, int (*pfnIgnore)( physent_t *pe ));
#else
pmtrace_t (*PM_PlayerTraceEx) (float *start, float *end, int traceFlags, int (*pfnIgnore)( physent_t *pe )); pmtrace_t (*PM_PlayerTraceEx) (float *start, float *end, int traceFlags, int (*pfnIgnore)( physent_t *pe ));
#endif
int (*PM_TestPlayerPositionEx) (float *pos, pmtrace_t *ptrace, int (*pfnIgnore)( physent_t *pe )); int (*PM_TestPlayerPositionEx) (float *pos, pmtrace_t *ptrace, int (*pfnIgnore)( physent_t *pe ));
struct pmtrace_s *(*PM_TraceLineEx)( float *start, float *end, int flags, int usehulll, int (*pfnIgnore)( physent_t *pe )); struct pmtrace_s *(*PM_TraceLineEx)( float *start, float *end, int flags, int usehulll, int (*pfnIgnore)( physent_t *pe ));
struct msurface_s *(*PM_TraceSurface)( int ground, float *vstart, float *vend ); struct msurface_s *(*PM_TraceSurface)( int ground, float *vstart, float *vend );
} playermove_t; } playermove_t;
#ifdef __MINGW32__
static pmtrace_t _pm_globalresult, _pm_globaltmp;
static inline pmtrace_t PM_PlayerTrace_wrap( float *start, float *end, int traceFlags, int ignore_pe, playermove_t *pmove )
{
_pm_globaltmp = pmove->touchindex[MAX_PHYSENTS -1];
pmove->PM_PlayerTrace_real( &_pm_globalresult, start, end, traceFlags, ignore_pe );
return _pm_globalresult;
}
static inline pmtrace_t PM_PlayerTraceEx_wrap( float *start, float *end, int traceFlags, int (*pfnIgnore)( physent_t *pe ), playermove_t *pmove )
{
_pm_globaltmp = pmove->touchindex[MAX_PHYSENTS -1];
pmove->PM_PlayerTraceEx_real( &_pm_globalresult, start, end, traceFlags, pfnIgnore );
return _pm_globalresult;
}
#define PM_PlayerTrace(a,b,c,d) touchindex[MAX_PHYSENTS -1] = PM_PlayerTrace_wrap( a, b, c, d, pmove );pmove->touchindex[MAX_PHYSENTS -1] = _pm_globaltmp
#define PM_PlayerTraceEx(a,b,c,d) touchindex[MAX_PHYSENTS -1] = PM_PlayerTraceEx_wrap( a, b, c, d, pmove );pmove->touchindex[MAX_PHYSENTS -1] = _pm_globaltmp
#endif
#endif//PM_DEFS_H #endif//PM_DEFS_H

Loading…
Cancel
Save