Merge master to gravgun. Hide Voice code under NO_VOICEGAMEMGR macro and enable it in Android.mk

This commit is contained in:
a1batross 2016-06-05 01:47:45 +03:00
commit 472d6b5156
23 changed files with 75 additions and 67 deletions

View File

View File

@ -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 \

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -20,7 +20,6 @@
#define HSPRITE HSPRITE_win32
#include <windows.h>
#undef HSPRITE
#else
typedef struct point_s{
int x;

View File

@ -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 \

View File

@ -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 )
{

View File

@ -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;

View File

@ -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 );

View File

@ -565,4 +565,4 @@ class CEgonAmmo : public CBasePlayerAmmo
};
LINK_ENTITY_TO_CLASS( ammo_egonclip, CEgonAmmo );
#endif
#endif

View File

@ -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;
}

View File

@ -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 )

View File

@ -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;

View File

@ -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
}
}

View File

@ -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;

View File

@ -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

View File

@ -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 )

View File

@ -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:

View File

@ -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?

View File

@ -98,6 +98,7 @@ typedef struct client_textmessage_s
#else
#define longlong_t long long
#endif
typedef struct hud_player_info_s
{
char *name;

View File

@ -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

View File

@ -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