mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-03-13 05:51:19 +00:00
Merge master to gravgun. Hide Voice code under NO_VOICEGAMEMGR macro and enable it in Android.mk
This commit is contained in:
commit
472d6b5156
0
.gitigonre → .gitignore
vendored
0
.gitigonre → .gitignore
vendored
@ -91,7 +91,7 @@ SRCS+=./input_xash3d.cpp
|
||||
SRCS+=./scoreboard.cpp
|
||||
SRCS+=./MOTD.cpp
|
||||
INCLUDES = -I../common -I. -I../game_shared -I../pm_shared -I../engine -I../dlls
|
||||
DEFINES = -Wextra -Wno-missing-field-initializers -Wno-write-strings -DLINUX -D_LINUX -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -DCLIENT_WEAPONS -DCLIENT_DLL -fpermissive
|
||||
DEFINES = -Wextra -Wno-missing-field-initializers -Wno-write-strings -DLINUX -D_LINUX -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -DCLIENT_WEAPONS -DCLIENT_DLL
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/. \
|
||||
$(LOCAL_PATH)/../common \
|
||||
|
@ -167,7 +167,7 @@ int CHudDeathNotice :: MsgFunc_DeathMsg( const char *pszName, int iSize, void *p
|
||||
|
||||
char killedwith[32];
|
||||
strcpy( killedwith, "d_" );
|
||||
strncat( killedwith, READ_STRING(), 31 );
|
||||
strncat( killedwith, READ_STRING(), sizeof(killedwith) );
|
||||
|
||||
|
||||
gHUD.m_Spectator.DeathMessage(victim);
|
||||
|
@ -67,7 +67,6 @@ int CHudGeiger::Draw (float flTime)
|
||||
float flvol = 0.0f;
|
||||
int rg[3];
|
||||
int i = 0;
|
||||
|
||||
if (m_iGeigerRange < 1000 && m_iGeigerRange > 0)
|
||||
{
|
||||
// peicewise linear is better than continuous formula for this
|
||||
|
@ -867,16 +867,13 @@ bool CHudSpectator::IsActivePlayer(cl_entity_t * ent)
|
||||
|
||||
bool CHudSpectator::ParseOverviewFile( )
|
||||
{
|
||||
char filename[255];
|
||||
char levelname[255];
|
||||
char token[1024];
|
||||
char filename[255] = { 0 };
|
||||
char levelname[255] = { 0 };
|
||||
char token[1024] = { 0 };
|
||||
float height;
|
||||
|
||||
char *pfile = NULL;
|
||||
|
||||
memset( filename, 0, 255 );
|
||||
memset( levelname, 0, 255 );
|
||||
memset( token, 0, 1024 );
|
||||
memset( &m_OverviewData, 0, sizeof(m_OverviewData));
|
||||
|
||||
// fill in standrd values
|
||||
|
@ -20,7 +20,6 @@
|
||||
#define HSPRITE HSPRITE_win32
|
||||
#include <windows.h>
|
||||
#undef HSPRITE
|
||||
|
||||
#else
|
||||
typedef struct point_s{
|
||||
int x;
|
||||
|
@ -13,10 +13,11 @@ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard)
|
||||
LOCAL_MODULE_FILENAME = libserver_hardfp
|
||||
endif
|
||||
|
||||
LOCAL_CFLAGS += -D_LINUX -DCLIENT_WEAPONS -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf \
|
||||
-fno-exceptions -Wextra -Wno-write-strings -fpermissive
|
||||
# Xash doesn't have any voice chat, so remove it from gamedll too.
|
||||
LOCAL_CFLAGS += -D_LINUX -DCLIENT_WEAPONS -DNO_VOICEGAMEMGR -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf \
|
||||
-fno-exceptions -Wextra -Wno-write-strings
|
||||
|
||||
LOCAL_CPPFLAGS := $(LOCAL_CFLAGS) -frtti -fpermissive
|
||||
LOCAL_CPPFLAGS := $(LOCAL_CFLAGS) -frtti
|
||||
|
||||
LOCAL_C_INCLUDES := $(SDL_PATH)/include \
|
||||
$(LOCAL_PATH)/. \
|
||||
@ -99,8 +100,8 @@ LOCAL_SRC_FILES := agrunt.cpp airtank.cpp \
|
||||
rat.cpp \
|
||||
roach.cpp \
|
||||
rpg.cpp \
|
||||
satchel.cpp \
|
||||
schedule.cpp \
|
||||
satchel.cpp \
|
||||
schedule.cpp \
|
||||
scientist.cpp \
|
||||
scripted.cpp \
|
||||
shotgun.cpp \
|
||||
|
@ -212,8 +212,8 @@ public:
|
||||
(this->*m_pfnUse)( pActivator, pCaller, useType, value );
|
||||
}
|
||||
virtual void Blocked( CBaseEntity *pOther ) { if (m_pfnBlocked) (this->*m_pfnBlocked)( pOther ); }
|
||||
|
||||
virtual float TouchGravGun( CBaseEntity *attacker, int stage ){ return 0; }
|
||||
|
||||
// allow engine to allocate instance data
|
||||
void *operator new( size_t stAllocateBlock, entvars_t *pev )
|
||||
{
|
||||
|
@ -204,8 +204,10 @@ void ClientPutInServer( edict_t *pEntity )
|
||||
|
||||
}
|
||||
|
||||
//#include "voice_gamemgr.h"
|
||||
//extern CVoiceGameMgr g_VoiceGameMgr;
|
||||
#ifndef NO_VOICEGAMEMGR
|
||||
#include "voice_gamemgr.h"
|
||||
extern CVoiceGameMgr g_VoiceGameMgr;
|
||||
#endif
|
||||
|
||||
//// HOST_SAY
|
||||
// String comes in as
|
||||
@ -314,8 +316,10 @@ void Host_Say( edict_t *pEntity, int teamonly )
|
||||
continue;
|
||||
|
||||
// can the receiver hear the sender? or has he muted him?
|
||||
//if ( g_VoiceGameMgr.PlayerHasBlockedPlayer( client, player ) )
|
||||
//continue;
|
||||
#ifndef NO_VOICEGAMEMGR
|
||||
if ( g_VoiceGameMgr.PlayerHasBlockedPlayer( client, player ) )
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if ( teamonly && g_pGameRules->PlayerRelationship(client, CBaseEntity::Instance(pEntity)) != GR_TEAMMATE )
|
||||
continue;
|
||||
|
@ -811,7 +811,9 @@ void CGib :: Spawn( const char *szGibModel )
|
||||
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
|
||||
|
||||
pev->nextthink = gpGlobals->time + 4;
|
||||
|
||||
m_lifeTime = 250;
|
||||
|
||||
SetThink( &CGib::WaitTillLand );
|
||||
SetTouch( &CGib::BounceGibTouch );
|
||||
|
||||
|
@ -565,4 +565,4 @@ class CEgonAmmo : public CBasePlayerAmmo
|
||||
};
|
||||
LINK_ENTITY_TO_CLASS( ammo_egonclip, CEgonAmmo );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -47,26 +47,10 @@ BOOL WINAPI DllMain(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern "C" void DLLEXPORT GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) __attribute__((__stdcall__)) ;
|
||||
|
||||
|
||||
extern "C" void DLLEXPORT GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals )
|
||||
{
|
||||
memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t));
|
||||
gpGlobals = pGlobals;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
extern "C" {
|
||||
|
||||
void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals )
|
||||
{
|
||||
memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t));
|
||||
gpGlobals = pGlobals;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
extern "C" void DLLEXPORT GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals )
|
||||
{
|
||||
memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t));
|
||||
gpGlobals = pGlobals;
|
||||
}
|
||||
|
@ -174,6 +174,7 @@ float CItem::TouchGravGun( CBaseEntity *attacker, int stage)
|
||||
pev->nextthink = g_pGameRules->FlItemRespawnTime( this );
|
||||
return 200;
|
||||
}
|
||||
|
||||
void CItem::Materialize( void )
|
||||
{
|
||||
if ( pev->effects & EF_NODRAW )
|
||||
|
@ -154,7 +154,6 @@ public:
|
||||
static void SpawnHeadGib( entvars_t *pevVictim );
|
||||
static void SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human );
|
||||
static void SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs );
|
||||
|
||||
virtual float TouchGravGun( CBaseEntity *attacker, int stage )
|
||||
{
|
||||
pev->nextthink = gpGlobals->time + m_lifeTime;
|
||||
|
@ -43,7 +43,9 @@ extern int g_teamplay;
|
||||
|
||||
float g_flIntermissionStartTime = 0;
|
||||
|
||||
//CVoiceGameMgr g_VoiceGameMgr;
|
||||
#ifndef NO_VOICEGAMEMGR
|
||||
CVoiceGameMgr g_VoiceGameMgr;
|
||||
#endif
|
||||
|
||||
class CMultiplayGameMgrHelper : public IVoiceGameMgrHelper
|
||||
{
|
||||
@ -69,8 +71,10 @@ static CMultiplayGameMgrHelper g_GameMgrHelper;
|
||||
|
||||
CHalfLifeMultiplay :: CHalfLifeMultiplay()
|
||||
{
|
||||
//g_VoiceGameMgr.Init(&g_GameMgrHelper, gpGlobals->maxClients);
|
||||
|
||||
#ifndef NO_VOICEGAMEMGR
|
||||
g_VoiceGameMgr.Init(&g_GameMgrHelper, gpGlobals->maxClients);
|
||||
#endif
|
||||
|
||||
RefreshSkillData();
|
||||
m_flIntermissionEndTime = 0;
|
||||
g_flIntermissionStartTime = 0;
|
||||
@ -116,9 +120,11 @@ CHalfLifeMultiplay :: CHalfLifeMultiplay()
|
||||
|
||||
BOOL CHalfLifeMultiplay::ClientCommand( CBasePlayer *pPlayer, const char *pcmd )
|
||||
{
|
||||
//if(g_VoiceGameMgr.ClientCommand(pPlayer, pcmd))
|
||||
//return TRUE;
|
||||
|
||||
#ifndef NO_VOICEGAMEMGR
|
||||
if(g_VoiceGameMgr.ClientCommand(pPlayer, pcmd))
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
return CGameRules::ClientCommand(pPlayer, pcmd);
|
||||
}
|
||||
|
||||
@ -186,8 +192,9 @@ extern cvar_t mp_chattime;
|
||||
//=========================================================
|
||||
void CHalfLifeMultiplay :: Think ( void )
|
||||
{
|
||||
//g_VoiceGameMgr.Update(gpGlobals->frametime);
|
||||
|
||||
#ifndef NO_VOICEGAMEMGR
|
||||
g_VoiceGameMgr.Update(gpGlobals->frametime);
|
||||
#endif
|
||||
///// Check game rules /////
|
||||
static int last_frags;
|
||||
static int last_time;
|
||||
@ -397,7 +404,9 @@ BOOL CHalfLifeMultiplay :: GetNextBestWeapon( CBasePlayer *pPlayer, CBasePlayerI
|
||||
//=========================================================
|
||||
BOOL CHalfLifeMultiplay :: ClientConnected( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] )
|
||||
{
|
||||
//g_VoiceGameMgr.ClientConnected(pEntity);
|
||||
#ifndef NO_VOICEGAMEMGR
|
||||
g_VoiceGameMgr.ClientConnected(pEntity);
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -573,8 +582,8 @@ void CHalfLifeMultiplay :: PlayerSpawn( CBasePlayer *pPlayer )
|
||||
{
|
||||
pPlayer->GiveNamedItem( "weapon_crowbar" );
|
||||
pPlayer->GiveNamedItem( "weapon_9mmhandgun" );
|
||||
pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );// 4 full reloads
|
||||
pPlayer->GiveNamedItem( "weapon_gravgun" );
|
||||
pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );// 4 full reloads
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3323,7 +3323,6 @@ void CGraph :: ComputeStaticRoutingTables( void )
|
||||
if ( BestNextNodes ) delete[] BestNextNodes;
|
||||
if ( pRoute ) delete[] pRoute;
|
||||
if ( pMyPath ) delete[] pMyPath;
|
||||
|
||||
Routes = 0;
|
||||
BestNextNodes = 0;
|
||||
pRoute = 0;
|
||||
|
@ -309,13 +309,13 @@ public:
|
||||
char m_SbarString1[ SBAR_STRING_SIZE ];
|
||||
|
||||
float m_flNextChatTime;
|
||||
|
||||
virtual float TouchGravGun( CBaseEntity *attacker, int stage )
|
||||
{
|
||||
if( stage == 3 )
|
||||
return 200;
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
#define AUTOAIM_2DEGREES 0.0348994967025
|
||||
|
@ -68,8 +68,10 @@ CHalfLifeTeamplay :: CHalfLifeTeamplay()
|
||||
|
||||
extern cvar_t timeleft, fragsleft;
|
||||
|
||||
#ifndef NO_VOICEGAMEMGR
|
||||
#include "voice_gamemgr.h"
|
||||
//extern CVoiceGameMgr g_VoiceGameMgr;
|
||||
extern CVoiceGameMgr g_VoiceGameMgr;
|
||||
#endif
|
||||
|
||||
void CHalfLifeTeamplay :: Think ( void )
|
||||
{
|
||||
@ -80,8 +82,10 @@ void CHalfLifeTeamplay :: Think ( void )
|
||||
int frags_remaining = 0;
|
||||
int time_remaining = 0;
|
||||
|
||||
//g_VoiceGameMgr.Update(gpGlobals->frametime);
|
||||
|
||||
#ifndef NO_VOICEGAMEMGR
|
||||
g_VoiceGameMgr.Update(gpGlobals->frametime);
|
||||
#endif
|
||||
|
||||
if ( g_fGameOver ) // someone else quit the game already
|
||||
{
|
||||
CHalfLifeMultiplay::Think();
|
||||
@ -145,9 +149,11 @@ void CHalfLifeTeamplay :: Think ( void )
|
||||
//=========================================================
|
||||
BOOL CHalfLifeTeamplay :: ClientCommand( CBasePlayer *pPlayer, const char *pcmd )
|
||||
{
|
||||
//if(g_VoiceGameMgr.ClientCommand(pPlayer, pcmd))
|
||||
//return TRUE;
|
||||
|
||||
#ifdef NO_VOICEGAMEMGR
|
||||
if(g_VoiceGameMgr.ClientCommand(pPlayer, pcmd))
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
if ( FStrEq( pcmd, "menuselect" ) )
|
||||
{
|
||||
if ( CMD_ARGC() < 2 )
|
||||
|
@ -2378,7 +2378,7 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou
|
||||
if ( strlen( (char *)pInputData ) == 0 )
|
||||
*((void**)pOutputData) = 0;
|
||||
else
|
||||
*((void**)pOutputData) = FUNCTION_FROM_NAME( (char *)pInputData );
|
||||
*((void**)pOutputData) = (void**)FUNCTION_FROM_NAME( (char *)pInputData );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -532,10 +532,11 @@ void CBasePlayerItem::Materialize( void )
|
||||
UTIL_SetOrigin( pev, m_SpawnPoint );// link into world.
|
||||
else
|
||||
UTIL_SetOrigin( pev, m_SpawnPoint = pev->origin );
|
||||
|
||||
SetTouch( &CBasePlayerItem::DefaultTouch );
|
||||
SetThink( NULL );
|
||||
|
||||
}
|
||||
|
||||
float CBasePlayerItem::TouchGravGun( CBaseEntity *attacker, int stage )
|
||||
{
|
||||
if( stage == 2 )
|
||||
@ -556,6 +557,11 @@ float CBasePlayerItem::TouchGravGun( CBaseEntity *attacker, int stage )
|
||||
return 200;
|
||||
}
|
||||
|
||||
UTIL_SetOrigin( pev, pev->origin );// link into world.
|
||||
SetTouch( &CBasePlayerItem::DefaultTouch);
|
||||
SetThink( NULL );
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
// AttemptToMaterialize - the item is trying to rematerialize,
|
||||
// should it do so now or wait longer?
|
||||
|
@ -98,6 +98,7 @@ typedef struct client_textmessage_s
|
||||
#else
|
||||
#define longlong_t long long
|
||||
#endif
|
||||
|
||||
typedef struct hud_player_info_s
|
||||
{
|
||||
char *name;
|
||||
|
@ -488,4 +488,4 @@ extern NEW_DLL_FUNCTIONS gNewDLLFunctions;
|
||||
typedef int (*APIFUNCTION)( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
|
||||
typedef int (*APIFUNCTION2)( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
|
||||
|
||||
#endif//EIFACE_H
|
||||
#endif//EIFACE_H
|
||||
|
@ -81,6 +81,7 @@ typedef struct physent_s
|
||||
vec3_t vuser3;
|
||||
vec3_t vuser4;
|
||||
} physent_t;
|
||||
|
||||
typedef struct hull_s hull_t;
|
||||
|
||||
typedef struct playermove_s
|
||||
@ -219,4 +220,4 @@ typedef struct playermove_s
|
||||
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 );
|
||||
} playermove_t;
|
||||
#endif//PM_DEFS_H
|
||||
#endif//PM_DEFS_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user