2004-08-23 00:15:46 +00:00
/*
Copyright ( C ) 1996 - 1997 Id Software , Inc .
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
2011-06-25 12:00:59 +00:00
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE .
2004-08-23 00:15:46 +00:00
See the GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
// cl_tent.c -- client side temporary entities
# include "quakedef.h"
# include "particles.h"
entity_state_t * CL_FindPacketEntity ( int num ) ;
# ifdef Q2CLIENT
2014-05-16 01:34:58 +00:00
static const char * q2efnames [ ] =
{
2015-12-12 19:25:15 +00:00
" TEQ2_GUNSHOT " ,
" TEQ2_BLOOD " ,
" TEQ2_BLASTER " ,
" TEQ2_RAILTRAIL " ,
" TEQ2_SHOTGUN " ,
" TEQ2_EXPLOSION1 " ,
" TEQ2_EXPLOSION2 " ,
" TEQ2_ROCKET_EXPLOSION " ,
" TEQ2_GRENADE_EXPLOSION " ,
" TEQ2_SPARKS " ,
NULL , //"TEQ2_SPLASH",
" TEQ2_BUBBLETRAIL " ,
" TEQ2_SCREEN_SPARKS " ,
" TEQ2_SHIELD_SPARKS " ,
" TEQ2_BULLET_SPARKS " ,
NULL , //"TEQ2_LASER_SPARKS",
NULL , //"TEQ2_PARASITE_ATTACK",
" TEQ2_ROCKET_EXPLOSION_WATER " ,
" TEQ2_GRENADE_EXPLOSION_WATER " ,
NULL , //"TEQ2_MEDIC_CABLE_ATTACK",
" TEQ2_BFG_EXPLOSION " ,
" TEQ2_BFG_BIGEXPLOSION " ,
" TEQ2_BOSSTPORT " ,
NULL , //"TEQ2_BFG_LASER",
NULL , //"TEQ2_GRAPPLE_CABLE",
" TEQ2_WELDING_SPARKS " ,
" TEQ2_GREENBLOOD " ,
" TEQ2_BLUEHYPERBLASTER " ,
" TEQ2_PLASMA_EXPLOSION " ,
" TEQ2_TUNNEL_SPARKS " ,
" TEQ2_BLASTER2 " ,
" TEQ2_RAILTRAIL2 " ,
" TEQ2_FLAME " ,
NULL , //"TEQ2_LIGHTNING",
" TEQ2_DEBUGTRAIL " ,
" TEQ2_PLAIN_EXPLOSION " ,
" TEQ2_FLASHLIGHT " ,
" TEQ2_FORCEWALL " ,
NULL , //"TEQ2_HEATBEAM",
NULL , //"TEQ2_MONSTER_HEATBEAM",
2016-01-18 05:22:07 +00:00
NULL , //"TEQ2_STEAM",
2015-12-12 19:25:15 +00:00
" TEQ2_BUBBLETRAIL2 " ,
" TEQ2_MOREBLOOD " ,
" TEQ2_HEATBEAM_SPARKS " ,
" TEQ2_HEATBEAM_STEAM " ,
" TEQ2_CHAINFIST_SMOKE " ,
" TEQ2_ELECTRIC_SPARKS " ,
" TEQ2_TRACKER_EXPLOSION " ,
" TEQ2_TELEPORT_EFFECT " ,
" TEQ2_DBALL_GOAL " ,
2016-01-18 05:22:07 +00:00
NULL , //"TEQ2_WIDOWBEAMOUT",
NULL , //"TEQ2_NUKEBLAST",
2015-12-12 19:25:15 +00:00
" TEQ2_WIDOWSPLASH " ,
" TEQ2_EXPLOSION1_BIG " ,
" TEQ2_EXPLOSION1_NP " ,
" TEQ2_FLECHETTE " ,
NULL , //"TEQ2_CR_LEADERBLASTER",
NULL , //"TEQ2_CR_BLASTER_MUZZLEFLASH",
NULL , //"TEQ2_CR_BLUE_MUZZLEFLASH",
NULL , //"TEQ2_CR_SMART_MUZZLEFLASH",
NULL , //"TEQ2_CR_LEADERFIELD",
NULL , //"TEQ2_CR_DEATHFIELD",
NULL , //"TEQ2_CR_BLASTERBEAM",
NULL , //"TEQ2_CR_STAIN",
NULL , //"TEQ2_CR_FIRE",
NULL , //"TEQ2_CR_CABLEGUT",
NULL , //"TEQ2_CR_SMOKE",
//the rest have no specific value meanings
//slashes block
" te_splashunknown " ,
" te_splashsparks " ,
" te_splashbluewater " ,
" te_splashbrownwater " ,
" te_splashslime " ,
" te_splashlava " ,
" te_splashblood " ,
" TR_BLASTERTRAIL " ,
" TR_BLASTERTRAIL2 " ,
" TRQ2_GIB " ,
" TRQ2_GREENGIB " ,
" TRQ2_ROCKET " ,
" TRQ2_GRENADE " ,
" TR_TRAP " ,
" TR_FLAG1 " ,
" TR_FLAG2 " ,
" TR_TAGTRAIL " ,
" TR_TRACKER " ,
" TR_IONRIPPER " ,
" TR_PLASMA " ,
" EF_BFGPARTICLES " ,
" EF_FLIES " ,
" EF_TRAP " ,
" EF_TRACKERSHELL " ,
" ev_item_respawn " ,
" ev_player_teleport " ,
" ev_footstep " ,
2014-05-16 01:34:58 +00:00
} ;
int pt_q2 [ sizeof ( q2efnames ) / sizeof ( q2efnames [ 0 ] ) ] ;
2004-08-23 00:15:46 +00:00
# endif
2014-05-16 01:34:58 +00:00
int
pt_muzzleflash = P_INVALID ,
pt_gunshot = P_INVALID ,
ptdp_gunshotquad = P_INVALID ,
pt_spike = P_INVALID ,
ptdp_spikequad = P_INVALID ,
pt_superspike = P_INVALID ,
ptdp_superspikequad = P_INVALID ,
pt_wizspike = P_INVALID ,
pt_knightspike = P_INVALID ,
pt_explosion = P_INVALID ,
ptdp_explosionquad = P_INVALID ,
pt_tarexplosion = P_INVALID ,
pt_teleportsplash = P_INVALID ,
pt_lavasplash = P_INVALID ,
ptdp_smallflash = P_INVALID ,
ptdp_flamejet = P_INVALID ,
ptdp_flame = P_INVALID ,
ptdp_blood = P_INVALID ,
ptdp_spark = P_INVALID ,
ptdp_plasmaburn = P_INVALID ,
ptdp_tei_g3 = P_INVALID ,
ptdp_tei_smoke = P_INVALID ,
ptdp_tei_bigexplosion = P_INVALID ,
ptdp_tei_plasmahit = P_INVALID ,
ptdp_stardust = P_INVALID ,
rt_rocket = P_INVALID ,
rt_grenade = P_INVALID ,
rt_blood = P_INVALID ,
rt_wizspike = P_INVALID ,
rt_slightblood = P_INVALID ,
rt_knightspike = P_INVALID ,
rt_vorespike = P_INVALID ,
rtdp_nexuizplasma = P_INVALID ,
rtdp_glowtrail = P_INVALID ,
ptqw_blood = P_INVALID ,
ptqw_lightningblood = P_INVALID ,
rtqw_railtrail = P_INVALID ,
ptfte_bullet = P_INVALID ,
ptfte_superbullet = P_INVALID ;
2015-07-14 14:47:00 +00:00
typedef struct {
/*static stuff*/
char * modelname ;
char * beamparticles ;
char * beamimpactparticle ;
int bflags ;
/*cached stuff*/
model_t * model ;
int ef_beam ;
int ef_impact ;
} tentmodels_t ;
2015-12-12 19:25:15 +00:00
struct beam_s {
2015-07-14 14:47:00 +00:00
tentmodels_t * info ;
2004-08-23 00:15:46 +00:00
int entity ;
short tag ;
2015-07-14 14:47:00 +00:00
// short pad;
// qbyte pad;
2014-04-06 15:16:39 +00:00
qbyte bflags ;
2004-08-23 00:15:46 +00:00
qbyte type ;
qbyte skin ;
2014-04-06 15:16:39 +00:00
unsigned int rflags ;
2015-07-14 14:47:00 +00:00
2004-08-23 00:15:46 +00:00
float endtime ;
float alpha ;
vec3_t start , end ;
2014-04-06 15:16:39 +00:00
vec3_t offset ; //when attached, this is the offset from the owning entity. probably only z is meaningful.
2015-07-14 14:47:00 +00:00
// int particlecolour; //some effects have specific colours. which is weird.
2005-05-30 04:34:47 +00:00
trailstate_t * trailstate ;
2005-08-06 22:39:28 +00:00
trailstate_t * emitstate ;
2015-12-12 19:25:15 +00:00
} ;
2004-08-23 00:15:46 +00:00
2012-05-09 15:30:53 +00:00
beam_t * cl_beams ;
int cl_beams_max ;
2004-08-23 00:15:46 +00:00
typedef struct
{
vec3_t origin ;
2005-03-18 06:14:07 +00:00
vec3_t oldorigin ;
2010-08-28 17:14:38 +00:00
vec3_t velocity ;
2004-08-23 00:15:46 +00:00
int firstframe ;
int numframes ;
int type ;
2005-09-04 05:48:26 +00:00
vec3_t angles ;
2012-01-17 07:57:46 +00:00
vec3_t avel ;
2005-09-04 05:48:26 +00:00
int flags ;
2012-01-17 07:57:46 +00:00
float gravity ;
2014-04-12 03:31:59 +00:00
float startalpha ;
float endalpha ;
2016-07-12 00:40:13 +00:00
float scale ;
2004-08-23 00:15:46 +00:00
float start ;
2005-05-26 12:55:34 +00:00
float framerate ;
2004-08-23 00:15:46 +00:00
model_t * model ;
2005-03-18 06:14:07 +00:00
int skinnum ;
2014-04-12 03:31:59 +00:00
int traileffect ;
trailstate_t * trailstate ;
2004-08-23 00:15:46 +00:00
} explosion_t ;
2012-05-09 15:30:53 +00:00
explosion_t * cl_explosions ;
int cl_explosions_max ;
2004-08-23 00:15:46 +00:00
2006-05-28 21:56:04 +00:00
static int explosions_running ;
static int beams_running ;
2015-07-14 14:47:00 +00:00
static tentmodels_t beamtypes [ ] =
{
2015-12-12 19:25:15 +00:00
{ " progs/bolt.mdl " , " TE_LIGHTNING1 " , " TE_LIGHTNING1_END " } ,
{ " progs/bolt2.mdl " , " TE_LIGHTNING2 " , " TE_LIGHTNING2_END " } ,
{ " progs/bolt3.mdl " , " TE_LIGHTNING3 " , " TE_LIGHTNING3_END " } ,
{ " progs/beam.mdl " , " te_beam " , " te_beam_end " } , //a CTF addition, but has other potential uses, sadly.
{ " models/monsters/parasite/segment/tris.md2 " , " te_parasite_attack " , " te_parasite_attack_end " } ,
{ " models/ctf/segment/tris.md2 " , " te_grapple_cable " , " te_grapple_cable_end " } ,
{ " models/proj/beam/tris.md2 " , " te_heatbeam " , " te_heatbeam_end " } ,
{ " models/proj/lightning/tris.md2 " , " TE_LIGHTNING2 " , " TE_LIGHTNING2_END " } ,
{ " models/stltng2.mdl " , " te_stream_lightning_small " , NULL } ,
{ " models/stchain.mdl " , " te_stream_chain " , NULL } ,
{ " models/stsunsf1.mdl " , " te_stream_sunstaff1 " , NULL } ,
{ " models/stsunsf2.mdl " , NULL , NULL } ,
{ " models/stsunsf1.mdl " , " te_stream_sunstaff2 " , NULL } ,
{ " models/stlghtng.mdl " , " te_stream_lightning " , NULL } ,
{ " models/stclrbm.mdl " , " te_stream_colorbeam " , NULL } ,
{ " models/stice.mdl " , " te_stream_icechunks " , NULL } ,
{ " models/stmedgaz.mdl " , " te_stream_gaze " , NULL } ,
{ " models/fambeam.mdl " , " te_stream_famine " , NULL } ,
2015-07-14 14:47:00 +00:00
} ;
2004-08-23 00:15:46 +00:00
sfx_t * cl_sfx_wizhit ;
sfx_t * cl_sfx_knighthit ;
sfx_t * cl_sfx_tink1 ;
sfx_t * cl_sfx_ric1 ;
sfx_t * cl_sfx_ric2 ;
sfx_t * cl_sfx_ric3 ;
sfx_t * cl_sfx_r_exp3 ;
2014-10-05 20:04:11 +00:00
cvar_t cl_expsprite = CVARFD ( " cl_expsprite " , " 0 " , CVAR_ARCHIVE , " Display a central sprite in explosion effects. QuakeWorld typically does so, NQ mods should not (which is problematic when played with the qw protocol). " ) ;
2011-12-26 15:19:13 +00:00
cvar_t r_explosionlight = CVARFC ( " r_explosionlight " , " 1 " , CVAR_ARCHIVE , Cvar_Limiter_ZeroToOne_Callback ) ;
2010-07-11 02:22:39 +00:00
cvar_t cl_truelightning = CVARF ( " cl_truelightning " , " 0 " , CVAR_SEMICHEAT ) ;
cvar_t cl_beam_trace = CVAR ( " cl_beam_trace " , " 0 " ) ;
2013-03-12 22:57:40 +00:00
cvar_t cl_legacystains = CVARD ( " cl_legacystains " , " 1 " , " WARNING: this cvar will default to 0 and later removed at some point " ) ; //FIXME: do as the description says!
2013-03-12 23:10:12 +00:00
cvar_t cl_shaftlight = { " gl_shaftlight " , " 0.8 " } ;
2004-08-23 00:15:46 +00:00
2005-07-14 01:57:34 +00:00
typedef struct {
sfx_t * * sfx ;
char * efname ;
} tentsfx_t ;
tentsfx_t tentsfx [ ] =
{
{ & cl_sfx_wizhit , " wizard/hit.wav " } ,
{ & cl_sfx_knighthit , " hknight/hit.wav " } ,
{ & cl_sfx_tink1 , " weapons/tink1.wav " } ,
{ & cl_sfx_ric1 , " weapons/ric1.wav " } ,
{ & cl_sfx_ric2 , " weapons/ric2.wav " } ,
{ & cl_sfx_ric3 , " weapons/ric3.wav " } ,
{ & cl_sfx_r_exp3 , " weapons/r_exp3.wav " }
} ;
2005-08-27 23:28:39 +00:00
vec3_t playerbeam_end [ MAX_SPLITS ] ;
2010-12-05 02:46:07 +00:00
2015-08-20 03:17:47 +00:00
typedef struct associatedeffect_s
2010-12-05 02:46:07 +00:00
{
2015-08-20 03:17:47 +00:00
struct associatedeffect_s * next ;
2010-12-05 02:46:07 +00:00
char mname [ MAX_QPATH ] ;
char pname [ MAX_QPATH ] ;
enum
{
AE_TRAIL ,
AE_EMIT ,
} type ;
2016-10-22 07:06:51 +00:00
unsigned int meflags ;
2015-08-20 03:17:47 +00:00
} associatedeffect_t ;
associatedeffect_t * associatedeffect ;
2010-12-05 02:46:07 +00:00
void CL_AssociateEffect_f ( void )
{
char * modelname = Cmd_Argv ( 1 ) ;
char * effectname = Cmd_Argv ( 2 ) ;
2016-10-22 07:06:51 +00:00
int type , i ;
unsigned int flags = 0 ;
2015-08-20 03:17:47 +00:00
struct associatedeffect_s * ae ;
2010-12-05 02:46:07 +00:00
if ( ! strcmp ( Cmd_Argv ( 0 ) , " r_trail " ) )
type = AE_TRAIL ;
else
{
2016-10-22 07:06:51 +00:00
type = AE_EMIT ;
for ( i = 3 ; i < Cmd_Argc ( ) ; i + + )
{
const char * fn = Cmd_Argv ( i ) ;
if ( ! strcmp ( fn , " replace " ) | | ! strcmp ( fn , " 1 " ) )
flags | = MDLF_EMITREPLACE ;
else if ( ! strcmp ( fn , " forwards " ) | | ! strcmp ( fn , " forward " ) )
flags | = MDLF_EMITFORWARDS ;
else if ( ! strcmp ( fn , " 0 " ) )
; //1 or 0 are legacy, meaning replace or not
else
Con_DPrintf ( " %s %s: unknown flag %s \n " , Cmd_Argv ( 0 ) , modelname , fn ) ;
}
2010-12-05 02:46:07 +00:00
}
if (
strstr ( modelname , " player " ) | |
strstr ( modelname , " eyes " ) | |
strstr ( modelname , " flag " ) | |
strstr ( modelname , " tf_stan " ) | |
strstr ( modelname , " .bsp " ) | |
strstr ( modelname , " turr " ) )
{
Con_Printf ( " Sorry: Not allowed to attach effects to model \" %s \" \n " , modelname ) ;
return ;
}
if ( strlen ( modelname ) > = MAX_QPATH | | strlen ( effectname ) > = MAX_QPATH )
return ;
/*replace the old one if it exists*/
for ( ae = associatedeffect ; ae ; ae = ae - > next )
{
if ( ! strcmp ( ae - > mname , modelname ) )
if ( ( ae - > type = = AE_TRAIL ) = = ( type = = AE_TRAIL ) )
break ;
}
if ( ! ae )
{
ae = Z_Malloc ( sizeof ( * ae ) ) ;
strcpy ( ae - > mname , modelname ) ;
ae - > next = associatedeffect ;
associatedeffect = ae ;
}
2016-10-22 07:06:51 +00:00
ae - > type = type ;
ae - > meflags = flags ;
strcpy ( ae - > pname , effectname ) ;
2010-12-05 02:46:07 +00:00
2014-10-05 20:04:11 +00:00
if ( pe )
CL_RegisterParticles ( ) ;
2010-12-05 02:46:07 +00:00
}
2012-05-14 01:41:08 +00:00
void CL_InitTEntSounds ( void )
2004-08-23 00:15:46 +00:00
{
2005-07-14 01:57:34 +00:00
int i ;
for ( i = 0 ; i < sizeof ( tentsfx ) / sizeof ( tentsfx [ 0 ] ) ; i + + )
{
2005-07-16 00:53:08 +00:00
if ( COM_FCheckExists ( va ( " sound/%s " , tentsfx [ i ] . efname ) ) )
2005-07-14 01:57:34 +00:00
* tentsfx [ i ] . sfx = S_PrecacheSound ( tentsfx [ i ] . efname ) ;
else
* tentsfx [ i ] . sfx = NULL ;
}
2012-05-14 01:41:08 +00:00
}
/*
= = = = = = = = = = = = = = = = =
CL_ParseTEnts
= = = = = = = = = = = = = = = = =
*/
void CL_InitTEnts ( void )
{
int i ;
for ( i = 0 ; i < sizeof ( tentsfx ) / sizeof ( tentsfx [ 0 ] ) ; i + + )
* tentsfx [ i ] . sfx = NULL ;
2004-08-23 00:15:46 +00:00
2011-01-30 01:32:30 +00:00
Cmd_AddCommand ( " r_effect " , CL_AssociateEffect_f ) ;
Cmd_AddCommand ( " r_trail " , CL_AssociateEffect_f ) ;
2010-12-05 02:46:07 +00:00
2004-08-23 00:15:46 +00:00
Cvar_Register ( & cl_expsprite , " Temporary entity control " ) ;
2004-10-10 06:32:29 +00:00
Cvar_Register ( & cl_truelightning , " Temporary entity control " ) ;
2005-08-27 23:28:39 +00:00
Cvar_Register ( & cl_beam_trace , " Temporary entity control " ) ;
2005-07-20 08:04:46 +00:00
Cvar_Register ( & r_explosionlight , " Temporary entity control " ) ;
2013-03-12 22:57:40 +00:00
Cvar_Register ( & cl_legacystains , " Temporary entity control " ) ;
2013-03-12 23:10:12 +00:00
Cvar_Register ( & cl_shaftlight , " Temporary entity control " ) ;
2004-08-23 00:15:46 +00:00
}
2010-12-05 02:46:07 +00:00
void CL_ShutdownTEnts ( void )
{
2015-08-20 03:17:47 +00:00
struct associatedeffect_s * ae ;
2010-12-05 02:46:07 +00:00
while ( associatedeffect )
{
ae = associatedeffect ;
associatedeffect = ae - > next ;
BZ_Free ( ae ) ;
}
}
2011-06-18 12:25:36 +00:00
void CL_ClearTEntParticleState ( void )
{
int i ;
2014-04-06 15:16:39 +00:00
for ( i = 0 ; i < cl_beams_max ; i + + )
2011-06-18 12:25:36 +00:00
{
2014-07-01 07:05:16 +00:00
if ( cl_beams [ i ] . trailstate )
P_DelinkTrailstate ( & ( cl_beams [ i ] . trailstate ) ) ;
if ( cl_beams [ i ] . emitstate )
P_DelinkTrailstate ( & ( cl_beams [ i ] . emitstate ) ) ;
2011-06-18 12:25:36 +00:00
}
}
2010-12-05 02:46:07 +00:00
void P_LoadedModel ( model_t * mod )
{
2015-08-20 03:17:47 +00:00
struct associatedeffect_s * ae ;
2010-12-05 02:46:07 +00:00
mod - > particleeffect = P_INVALID ;
mod - > particletrail = P_INVALID ;
2016-10-22 07:06:51 +00:00
mod - > engineflags & = ~ ( MDLF_EMITREPLACE | MDLF_EMITFORWARDS ) ;
mod - > engineflags | = MDLF_RECALCULATERAIN ;
2010-12-05 02:46:07 +00:00
for ( ae = associatedeffect ; ae ; ae = ae - > next )
{
if ( ! strcmp ( ae - > mname , mod - > name ) )
{
switch ( ae - > type )
{
case AE_TRAIL :
mod - > particletrail = P_FindParticleType ( ae - > pname ) ;
break ;
case AE_EMIT :
mod - > particleeffect = P_FindParticleType ( ae - > pname ) ;
2016-10-22 07:06:51 +00:00
mod - > engineflags | = ae - > meflags ;
2010-12-05 02:46:07 +00:00
break ;
}
}
}
if ( mod - > particletrail = = P_INVALID )
2015-03-03 07:54:10 +00:00
P_DefaultTrail ( 0 , mod - > flags , & mod - > particletrail , & mod - > traildefaultindex ) ;
2010-12-05 02:46:07 +00:00
}
2012-01-17 07:57:46 +00:00
void CL_RefreshCustomTEnts ( void ) ;
2008-11-09 22:29:28 +00:00
void CL_RegisterParticles ( void )
{
2010-12-05 02:46:07 +00:00
model_t * mod ;
2014-08-25 07:35:41 +00:00
extern model_t * mod_known ;
2010-12-05 02:46:07 +00:00
extern int mod_numknown ;
int i ;
for ( i = 0 , mod = mod_known ; i < mod_numknown ; i + + , mod + + )
{
2014-10-05 20:04:11 +00:00
if ( mod - > loadstate = = MLS_LOADED )
2010-12-05 02:46:07 +00:00
{
P_LoadedModel ( mod ) ;
}
}
2014-04-24 01:53:01 +00:00
pt_muzzleflash = P_FindParticleType ( " TE_MUZZLEFLASH " ) ;
2010-12-05 02:46:07 +00:00
pt_gunshot = P_FindParticleType ( " TE_GUNSHOT " ) ; /*shotgun*/
ptdp_gunshotquad = P_FindParticleType ( " TE_GUNSHOTQUAD " ) ; /*DP: quadded shotgun*/
pt_spike = P_FindParticleType ( " TE_SPIKE " ) ; /*nailgun*/
ptdp_spikequad = P_FindParticleType ( " TE_SPIKEQUAD " ) ; /*DP: quadded nailgun*/
pt_superspike = P_FindParticleType ( " TE_SUPERSPIKE " ) ; /*nailgun*/
ptdp_superspikequad = P_FindParticleType ( " TE_SUPERSPIKEQUAD " ) ; /*DP: quadded nailgun*/
pt_wizspike = P_FindParticleType ( " TE_WIZSPIKE " ) ; //scrag missile impact
pt_knightspike = P_FindParticleType ( " TE_KNIGHTSPIKE " ) ; //hellknight missile impact
pt_explosion = P_FindParticleType ( " TE_EXPLOSION " ) ; /*rocket/grenade launcher impacts/far too many things*/
ptdp_explosionquad = P_FindParticleType ( " TE_EXPLOSIONQUAD " ) ; /*nailgun*/
pt_tarexplosion = P_FindParticleType ( " TE_TAREXPLOSION " ) ; //tarbaby/spawn dying.
pt_teleportsplash = P_FindParticleType ( " TE_TELEPORT " ) ; /*teleporters*/
pt_lavasplash = P_FindParticleType ( " TE_LAVASPLASH " ) ; //e1m7 boss dying.
ptdp_smallflash = P_FindParticleType ( " TE_SMALLFLASH " ) ; //DP:
ptdp_flamejet = P_FindParticleType ( " TE_FLAMEJET " ) ; //DP:
ptdp_flame = P_FindParticleType ( " EF_FLAME " ) ; //DP:
ptdp_blood = P_FindParticleType ( " TE_BLOOD " ) ; /*when you hit something with the shotgun/axe/nailgun - nq uses the general particle builtin*/
ptdp_spark = P_FindParticleType ( " TE_SPARK " ) ; //DPTE_SPARK
ptdp_plasmaburn = P_FindParticleType ( " TE_PLASMABURN " ) ;
ptdp_tei_g3 = P_FindParticleType ( " TE_TEI_G3 " ) ;
ptdp_tei_smoke = P_FindParticleType ( " TE_TEI_SMOKE " ) ;
ptdp_tei_bigexplosion = P_FindParticleType ( " TE_TEI_BIGEXPLOSION " ) ;
ptdp_tei_plasmahit = P_FindParticleType ( " TE_TEI_PLASMAHIT " ) ;
ptdp_stardust = P_FindParticleType ( " EF_STARDUST " ) ;
rt_rocket = P_FindParticleType ( " TR_ROCKET " ) ; /*rocket trail*/
rt_grenade = P_FindParticleType ( " TR_GRENADE " ) ; /*grenade trail*/
rt_blood = P_FindParticleType ( " TR_BLOOD " ) ; /*blood trail*/
rt_wizspike = P_FindParticleType ( " TR_WIZSPIKE " ) ;
rt_slightblood = P_FindParticleType ( " TR_SLIGHTBLOOD " ) ;
rt_knightspike = P_FindParticleType ( " TR_KNIGHTSPIKE " ) ;
rt_vorespike = P_FindParticleType ( " TR_VORESPIKE " ) ;
2016-07-12 00:40:13 +00:00
//rtdp_neharasmoke = P_FindParticleType("TR_NEHAHRASMOKE");
2010-12-05 02:46:07 +00:00
rtdp_nexuizplasma = P_FindParticleType ( " TR_NEXUIZPLASMA " ) ;
rtdp_glowtrail = P_FindParticleType ( " TR_GLOWTRAIL " ) ;
/*internal to psystem*/ P_FindParticleType ( " SVC_PARTICLE " ) ;
ptqw_blood = P_FindParticleType ( " TE_BLOOD " ) ;
ptqw_lightningblood = P_FindParticleType ( " TE_LIGHTNINGBLOOD " ) ;
2011-06-25 12:00:59 +00:00
2014-05-16 01:48:12 +00:00
# ifdef Q2CLIENT
2014-05-10 13:42:13 +00:00
if ( cls . protocol = = CP_QUAKE2 )
{
2014-05-16 01:34:58 +00:00
for ( i = 0 ; i < sizeof ( pt_q2 ) / sizeof ( pt_q2 [ 0 ] ) ; i + + )
2015-12-12 19:25:15 +00:00
{
if ( ! q2efnames [ i ] )
{
pt_q2 [ i ] = P_INVALID ;
continue ;
}
pt_q2 [ i ] = P_FindParticleType ( va ( " q2part.%s " , q2efnames [ i ] ) ) ;
2014-05-16 01:34:58 +00:00
2015-12-12 19:25:15 +00:00
# ifdef _DEBUG
if ( pt_q2 [ i ] = = P_INVALID & & pt_q2 [ 0 ] ! = P_INVALID )
Con_Printf ( " effect q2part.%s was not declared \n " , q2efnames [ i ] ) ;
# endif
}
/*ptq2_blood = P_FindParticleType("q2part.TEQ2_BLOOD");
2014-05-10 13:42:13 +00:00
rtq2_railtrail = P_FindParticleType ( " q2part.TR_RAILTRAIL " ) ;
rtq2_blastertrail = P_FindParticleType ( " q2part.TR_BLASTERTRAIL " ) ;
2015-12-12 19:25:15 +00:00
ptq2_blasterparticles = P_FindParticleType ( " q2part.TE_BLASTERPARTICLES " ) ;
rtq2_bubbletrail = P_FindParticleType ( " q2part.TE_BUBBLETRAIL " ) ;
rtq2_gib = P_FindParticleType ( " q2part.TR_GIB " ) ;
rtq2_rocket = P_FindParticleType ( " q2part.TR_ROCKET " ) ;
rtq2_grenade = P_FindParticleType ( " q2part.TR_GRENADE " ) ;
ptq2_bfgparticles = P_FindParticleType ( " q2part.TR_BFGPARTICLES " ) ;
ptq2_flies = P_FindParticleType ( " q2part.TR_FLIES " ) ;
ptq2_trap = P_FindParticleType ( " q2part.TR_TRAP " ) ;
ptq2_trackershell = P_FindParticleType ( " q2part.TR_TRACKERSHELL " ) ; */
2014-05-10 13:42:13 +00:00
}
else
{
2014-05-16 01:34:58 +00:00
for ( i = 0 ; i < sizeof ( pt_q2 ) / sizeof ( pt_q2 [ 0 ] ) ; i + + )
pt_q2 [ i ] = P_INVALID ;
2014-05-10 13:42:13 +00:00
}
2014-05-16 01:48:12 +00:00
# endif
2010-12-05 02:46:07 +00:00
rtqw_railtrail = P_FindParticleType ( " TE_RAILTRAIL " ) ;
ptfte_bullet = P_FindParticleType ( " TE_BULLET " ) ;
ptfte_superbullet = P_FindParticleType ( " TE_SUPERBULLET " ) ;
2012-01-17 07:57:46 +00:00
CL_RefreshCustomTEnts ( ) ;
2015-07-14 14:47:00 +00:00
for ( i = 0 ; i < countof ( beamtypes ) ; i + + )
{
//we can normally expect the server to have precache_modeled these models, so any lookups should be just a lookup, and thus relatively cheap.
beamtypes [ i ] . model = NULL ;
beamtypes [ i ] . ef_beam = beamtypes [ i ] . beamparticles ? P_FindParticleType ( beamtypes [ i ] . beamparticles ) : P_INVALID ;
beamtypes [ i ] . ef_impact = beamtypes [ i ] . beamimpactparticle ? P_FindParticleType ( beamtypes [ i ] . beamimpactparticle ) : P_INVALID ;
}
//FIXME
for ( i = 0 ; i < cl_explosions_max ; i + + )
cl_explosions [ i ] . model = NULL ;
2008-11-09 22:29:28 +00:00
}
2004-08-23 00:15:46 +00:00
# ifdef Q2CLIENT
enum {
q2cl_mod_explode ,
q2cl_mod_smoke ,
q2cl_mod_flash ,
q2cl_mod_parasite_tip ,
q2cl_mod_explo4 ,
q2cl_mod_bfg_explo ,
q2cl_mod_powerscreen ,
q2cl_mod_max
} ;
tentmodels_t q2tentmodels [ q2cl_mod_max ] = {
{ " models/objects/explode/tris.md2 " } ,
{ " models/objects/smoke/tris.md2 " } ,
{ " models/objects/flash/tris.md2 " } ,
{ " models/monsters/parasite/tip/tris.md2 " } ,
{ " models/objects/r_explode/tris.md2 " } ,
{ " sprites/s_bfg2.sp2 " } ,
{ " models/items/armor/effect/tris.md2 " }
} ;
int CLQ2_RegisterTEntModels ( void )
{
// int i;
// for (i = 0; i < q2cl_mod_max; i++)
// if (!CL_CheckOrDownloadFile(q2tentmodels[i].modelname, false))
// return false;
return true ;
2011-06-25 12:00:59 +00:00
}
2004-08-23 00:15:46 +00:00
# endif
2014-04-12 03:31:59 +00:00
static void CL_ClearExplosion ( explosion_t * exp , vec3_t org )
{
exp - > endalpha = 0 ;
exp - > startalpha = 1 ;
2016-07-12 00:40:13 +00:00
exp - > scale = 1 ;
2014-04-12 03:31:59 +00:00
exp - > gravity = 0 ;
exp - > flags = 0 ;
exp - > model = NULL ;
exp - > firstframe = - 1 ;
exp - > framerate = 10 ;
VectorClear ( exp - > velocity ) ;
VectorClear ( exp - > angles ) ;
VectorClear ( exp - > avel ) ;
2014-06-02 16:50:40 +00:00
if ( pe )
P_DelinkTrailstate ( & ( exp - > trailstate ) ) ;
2014-04-12 03:31:59 +00:00
exp - > traileffect = P_INVALID ;
VectorCopy ( org , exp - > origin ) ;
VectorCopy ( org , exp - > oldorigin ) ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = =
CL_ClearTEnts
= = = = = = = = = = = = = = = = =
*/
void CL_ClearTEnts ( void )
{
2014-04-12 03:31:59 +00:00
int i ;
2012-05-14 01:41:08 +00:00
CL_ClearTEntParticleState ( ) ;
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
CL_ShutdownTEnts ( ) ;
2012-05-14 01:41:08 +00:00
2012-05-09 15:30:53 +00:00
cl_beams_max = 0 ;
BZ_Free ( cl_beams ) ;
cl_beams = NULL ;
2012-05-10 19:09:51 +00:00
beams_running = 0 ;
2012-05-09 15:30:53 +00:00
2014-04-12 03:31:59 +00:00
for ( i = 0 ; i < cl_explosions_max ; i + + )
CL_ClearExplosion ( cl_explosions + i , vec3_origin ) ;
2012-05-09 15:30:53 +00:00
cl_explosions_max = 0 ;
BZ_Free ( cl_explosions ) ;
cl_explosions = NULL ;
2012-05-10 19:09:51 +00:00
explosions_running = 0 ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = =
CL_AllocExplosion
= = = = = = = = = = = = = = = = =
*/
2014-04-12 03:31:59 +00:00
explosion_t * CL_AllocExplosion ( vec3_t org )
2004-08-23 00:15:46 +00:00
{
int i ;
float time ;
int index ;
2011-06-25 12:00:59 +00:00
2006-05-28 21:56:04 +00:00
for ( i = 0 ; i < explosions_running ; i + + )
{
2004-08-23 00:15:46 +00:00
if ( ! cl_explosions [ i ] . model )
{
2014-04-12 03:31:59 +00:00
CL_ClearExplosion ( & cl_explosions [ i ] , org ) ;
2004-08-23 00:15:46 +00:00
return & cl_explosions [ i ] ;
}
2006-05-28 21:56:04 +00:00
}
2012-05-09 15:30:53 +00:00
// if (i == explosions_running && i < cl_maxexplosions.ival)
2006-05-28 21:56:04 +00:00
{
2012-05-09 15:30:53 +00:00
if ( i = = cl_explosions_max )
{
cl_explosions_max = ( i + 1 ) * 2 ;
cl_explosions = BZ_Realloc ( cl_explosions , sizeof ( * cl_explosions ) * cl_explosions_max ) ;
2014-04-12 03:31:59 +00:00
memset ( cl_explosions + i , 0 , sizeof ( * cl_explosions ) * ( cl_explosions_max - i ) ) ;
2012-05-09 15:30:53 +00:00
}
2006-05-28 21:56:04 +00:00
explosions_running + + ;
2014-04-12 03:31:59 +00:00
CL_ClearExplosion ( & cl_explosions [ i ] , org ) ;
2006-05-28 21:56:04 +00:00
return & cl_explosions [ i ] ;
}
2004-08-23 00:15:46 +00:00
// find the oldest explosion
time = cl . time ;
index = 0 ;
2012-05-09 15:30:53 +00:00
for ( i = 0 ; i < cl_explosions_max ; i + + )
2004-08-23 00:15:46 +00:00
if ( cl_explosions [ i ] . start < time )
{
time = cl_explosions [ i ] . start ;
index = i ;
}
2014-04-12 03:31:59 +00:00
CL_ClearExplosion ( & cl_explosions [ index ] , org ) ;
2004-08-23 00:15:46 +00:00
return & cl_explosions [ index ] ;
}
/*
= = = = = = = = = = = = = = = = =
CL_ParseBeam
= = = = = = = = = = = = = = = = =
*/
2015-07-14 14:47:00 +00:00
beam_t * CL_NewBeam ( int entity , int tag , tentmodels_t * btype )
2004-08-23 00:15:46 +00:00
{
beam_t * b ;
int i ;
2005-08-03 23:14:59 +00:00
// override any beam with the same entity (unless they used world)
if ( entity )
2005-07-28 04:11:38 +00:00
{
2006-05-28 21:56:04 +00:00
for ( i = 0 , b = cl_beams ; i < beams_running ; i + + , b + + )
2005-07-28 04:11:38 +00:00
if ( b - > entity = = entity & & b - > tag = = tag )
{
2015-07-14 14:47:00 +00:00
b - > info = btype ;
2005-07-28 04:11:38 +00:00
return b ;
}
}
2004-08-23 00:15:46 +00:00
// find a free beam
2006-05-28 21:56:04 +00:00
for ( i = 0 , b = cl_beams ; i < beams_running ; i + + , b + + )
2004-08-23 00:15:46 +00:00
{
2015-07-14 14:47:00 +00:00
if ( ! b - > info )
2004-08-23 00:15:46 +00:00
{
2015-07-14 14:47:00 +00:00
b - > info = btype ;
2004-08-23 00:15:46 +00:00
return b ;
}
}
2006-05-28 21:56:04 +00:00
2012-05-09 15:30:53 +00:00
// if (i == beams_running && i < cl_maxbeams.ival)
2006-05-28 21:56:04 +00:00
{
2012-05-09 15:30:53 +00:00
if ( i = = cl_beams_max )
{
2012-05-14 01:41:08 +00:00
int nm = ( i + 1 ) * 2 ;
CL_ClearTEntParticleState ( ) ;
cl_beams = BZ_Realloc ( cl_beams , nm * sizeof ( * cl_beams ) ) ;
memset ( cl_beams + cl_beams_max , 0 , sizeof ( * cl_beams ) * ( nm - cl_beams_max ) ) ;
cl_beams_max = nm ;
2012-05-09 15:30:53 +00:00
}
2006-05-28 21:56:04 +00:00
beams_running + + ;
2015-07-14 14:47:00 +00:00
cl_beams [ i ] . info = btype ;
2006-05-28 21:56:04 +00:00
return & cl_beams [ i ] ;
}
2004-08-23 00:15:46 +00:00
return NULL ;
}
# define STREAM_ATTACHED 16
# define STREAM_TRANSLUCENT 32
2015-12-12 19:25:15 +00:00
beam_t * CL_AddBeam ( enum beamtype_e tent , int ent , vec3_t start , vec3_t end ) //fixme: use TE_ numbers instead of 0 - 5
2004-08-23 00:15:46 +00:00
{
beam_t * b ;
model_t * m ;
2005-05-18 23:15:58 +00:00
int btype , etype ;
2005-08-27 23:28:39 +00:00
int i ;
2005-08-06 22:39:28 +00:00
vec3_t impact , normal ;
vec3_t extra ;
2004-08-23 00:15:46 +00:00
2015-07-14 14:47:00 +00:00
//zquake compat requires some parsing weirdness.
2004-08-23 00:15:46 +00:00
switch ( tent )
{
2015-07-14 14:47:00 +00:00
case BT_Q1LIGHTNING1 :
2005-09-08 22:52:46 +00:00
if ( ent < 0 & & ent > = - 512 ) //a zquake concept. ent between -1 and -maxplayers is to be taken to be a railtrail from a particular player instead of a beam.
2004-08-23 00:15:46 +00:00
{
2005-10-08 22:35:20 +00:00
// TODO: add support for those finnicky colored railtrails...
2014-10-05 20:04:11 +00:00
if ( P_ParticleTrail ( start , end , rtqw_railtrail , - ent , NULL , NULL ) )
2005-10-08 22:35:20 +00:00
P_ParticleTrailIndex ( start , end , 208 , 8 , NULL ) ;
2015-12-12 19:25:15 +00:00
return NULL ;
2004-08-23 00:15:46 +00:00
}
break ;
2015-07-14 14:47:00 +00:00
case BT_Q1LIGHTNING2 :
2004-08-31 09:16:56 +00:00
if ( ent < 0 & & ent > = - MAX_CLIENTS ) //based on the railgun concept - this adds a rogue style TE_BEAM effect.
2015-07-14 14:47:00 +00:00
tent = BT_Q1BEAM ;
2004-08-23 00:15:46 +00:00
break ;
2015-07-14 14:47:00 +00:00
default :
2014-05-16 01:34:58 +00:00
break ;
2004-08-23 00:15:46 +00:00
}
2015-07-14 14:47:00 +00:00
btype = beamtypes [ tent ] . ef_beam ;
etype = beamtypes [ tent ] . ef_impact ;
2011-10-27 15:46:36 +00:00
/*don't bother loading the model if we have a particle effect for it instead*/
if ( ruleset_allow_particle_lightning . ival & & btype > = 0 )
m = NULL ;
else
2015-07-14 14:47:00 +00:00
{
m = beamtypes [ tent ] . model ;
if ( ! m )
m = beamtypes [ tent ] . model = Mod_ForName ( beamtypes [ tent ] . modelname , MLV_WARN ) ;
}
2011-10-27 15:46:36 +00:00
2014-10-05 20:04:11 +00:00
if ( m & & m - > loadstate ! = MLS_LOADED )
2009-04-06 00:34:32 +00:00
CL_CheckOrEnqueDownloadFile ( m - > name , NULL , 0 ) ;
2005-08-27 23:28:39 +00:00
// save end position for truelightning
if ( ent )
{
2006-05-28 21:56:04 +00:00
for ( i = 0 ; i < cl . splitclients ; i + + )
2005-08-27 23:28:39 +00:00
{
2013-06-23 02:17:02 +00:00
playerview_t * pv = & cl . playerview [ i ] ;
2015-06-22 11:49:15 +00:00
if ( ent = = ( ( pv - > cam_state = = CAM_EYECAM ) ? ( pv - > cam_spec_track + 1 ) : ( pv - > playernum + 1 ) ) )
2005-08-27 23:28:39 +00:00
{
VectorCopy ( end , playerbeam_end [ i ] ) ;
break ;
}
}
}
2008-11-09 22:29:28 +00:00
if ( etype > = 0 & & cls . state = = ca_active & & etype ! = P_INVALID )
2005-03-29 13:52:15 +00:00
{
2009-11-04 21:16:50 +00:00
if ( cl_beam_trace . ival )
2005-09-09 02:01:30 +00:00
{
VectorSubtract ( end , start , normal ) ;
VectorNormalize ( normal ) ;
VectorMA ( end , 4 , normal , extra ) ; //extend the end-point by four
2016-07-12 00:40:13 +00:00
if ( CL_TraceLine ( start , extra , impact , normal , NULL ) > = 1 )
2005-09-09 02:01:30 +00:00
etype = - 1 ;
}
else
{
VectorCopy ( end , impact ) ;
normal [ 0 ] = normal [ 1 ] = normal [ 2 ] = 0 ;
}
2005-03-29 13:52:15 +00:00
}
2004-08-23 00:15:46 +00:00
2015-07-14 14:47:00 +00:00
b = CL_NewBeam ( ent , - 1 , & beamtypes [ tent ] ) ;
2004-08-23 00:15:46 +00:00
if ( ! b )
{
2011-06-25 12:00:59 +00:00
Con_Printf ( " beam list overflow! \n " ) ;
2015-12-12 19:25:15 +00:00
return NULL ;
2004-08-23 00:15:46 +00:00
}
2014-04-24 01:53:01 +00:00
b - > rflags = RF_NOSHADOW ;
2004-08-23 00:15:46 +00:00
b - > entity = ent ;
2015-07-14 14:47:00 +00:00
b - > info = & beamtypes [ tent ] ;
2004-08-23 00:15:46 +00:00
b - > tag = - 1 ;
2014-04-06 15:16:39 +00:00
b - > bflags | = /*STREAM_ATTACHED|*/ 1 ;
2004-08-23 00:15:46 +00:00
b - > endtime = cl . time + 0.2 ;
b - > alpha = 1 ;
VectorCopy ( start , b - > start ) ;
VectorCopy ( end , b - > end ) ;
2005-08-06 22:39:28 +00:00
if ( etype > = 0 )
{
P_RunParticleEffectState ( impact , normal , 1 , etype , & ( b - > emitstate ) ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( end , - 10 , - 10 , - 10 , 20 ) ;
2005-08-06 22:39:28 +00:00
}
2015-12-12 19:25:15 +00:00
return b ;
}
void CL_ParseBeamOffset ( enum beamtype_e tent )
{
int ent ;
vec3_t start , end , offset ;
beam_t * b ;
ent = MSGCL_ReadEntity ( ) ;
start [ 0 ] = MSG_ReadCoord ( ) ;
start [ 1 ] = MSG_ReadCoord ( ) ;
start [ 2 ] = MSG_ReadCoord ( ) ;
end [ 0 ] = MSG_ReadCoord ( ) ;
end [ 1 ] = MSG_ReadCoord ( ) ;
end [ 2 ] = MSG_ReadCoord ( ) ;
MSG_ReadPos ( offset ) ;
b = CL_AddBeam ( tent , ent , start , end ) ;
if ( b )
VectorCopy ( offset , b - > offset ) ;
2004-08-23 00:15:46 +00:00
}
2015-12-12 19:25:15 +00:00
beam_t * CL_ParseBeam ( enum beamtype_e tent )
2005-08-03 23:14:59 +00:00
{
int ent ;
vec3_t start , end ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
ent = MSGCL_ReadEntity ( ) ;
2011-06-25 12:00:59 +00:00
2005-08-03 23:14:59 +00:00
start [ 0 ] = MSG_ReadCoord ( ) ;
start [ 1 ] = MSG_ReadCoord ( ) ;
start [ 2 ] = MSG_ReadCoord ( ) ;
2011-06-25 12:00:59 +00:00
2005-08-03 23:14:59 +00:00
end [ 0 ] = MSG_ReadCoord ( ) ;
end [ 1 ] = MSG_ReadCoord ( ) ;
end [ 2 ] = MSG_ReadCoord ( ) ;
2015-12-12 19:25:15 +00:00
return CL_AddBeam ( tent , ent , start , end ) ;
2005-08-03 23:14:59 +00:00
}
2014-04-06 15:16:39 +00:00
//finds the latest non-lerped position
float * CL_FindLatestEntityOrigin ( int entnum )
{
int i ;
packet_entities_t * pe ;
int framenum = cl . validsequence & UPDATE_MASK ;
pe = & cl . inframes [ framenum ] . packet_entities ;
for ( i = 0 ; i < pe - > num_entities ; i + + )
{
if ( pe - > entities [ i ] . number = = entnum )
return pe - > entities [ i ] . origin ;
}
if ( entnum > 0 & & entnum < = MAX_CLIENTS )
{
entnum - - ;
if ( cl . inframes [ framenum ] . playerstate [ entnum ] . messagenum = = cl . parsecount )
return cl . inframes [ framenum ] . playerstate [ entnum ] . origin ;
}
return NULL ;
}
2004-08-23 00:15:46 +00:00
void CL_ParseStream ( int type )
{
int ent ;
vec3_t start , end ;
beam_t * b , * b2 ;
int flags ;
int tag ;
float duration ;
int skin ;
2015-07-14 14:47:00 +00:00
tentmodels_t * info ;
2011-06-25 12:00:59 +00:00
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
ent = MSGCL_ReadEntity ( ) ;
2004-08-23 00:15:46 +00:00
flags = MSG_ReadByte ( ) ;
tag = flags & 15 ;
flags - = tag ;
duration = ( float ) MSG_ReadByte ( ) * 0.05 ;
skin = 0 ;
2010-08-16 02:03:02 +00:00
if ( type = = TEH2_STREAM_COLORBEAM )
2004-08-23 00:15:46 +00:00
{
skin = MSG_ReadByte ( ) ;
}
start [ 0 ] = MSG_ReadCoord ( ) ;
start [ 1 ] = MSG_ReadCoord ( ) ;
start [ 2 ] = MSG_ReadCoord ( ) ;
end [ 0 ] = MSG_ReadCoord ( ) ;
end [ 1 ] = MSG_ReadCoord ( ) ;
end [ 2 ] = MSG_ReadCoord ( ) ;
2015-07-14 14:47:00 +00:00
switch ( type )
{
case TEH2_STREAM_LIGHTNING_SMALL :
info = & beamtypes [ BT_H2LIGHTNING_SMALL ] ;
flags | = 2 ;
break ;
case TEH2_STREAM_LIGHTNING :
info = & beamtypes [ BT_H2LIGHTNING ] ;
flags | = 2 ;
break ;
case TEH2_STREAM_ICECHUNKS :
info = & beamtypes [ BT_H2ICECHUNKS ] ;
flags | = 2 ;
if ( cl_legacystains . ival ) Surf_AddStain ( end , - 10 , - 10 , 0 , 20 ) ;
break ;
case TEH2_STREAM_SUNSTAFF1 :
info = & beamtypes [ BT_H2SUNSTAFF1 ] ;
break ;
case TEH2_STREAM_SUNSTAFF2 :
info = & beamtypes [ BT_H2SUNSTAFF2 ] ;
if ( cl_legacystains . ival ) Surf_AddStain ( end , - 10 , - 10 , - 10 , 20 ) ;
break ;
case TEH2_STREAM_COLORBEAM :
info = & beamtypes [ BT_H2COLORBEAM ] ;
break ;
case TEH2_STREAM_GAZE :
info = & beamtypes [ BT_H2GAZE ] ;
break ;
case TEH2_STREAM_FAMINE :
info = & beamtypes [ BT_H2FAMINE ] ;
break ;
case TEH2_STREAM_CHAIN :
info = & beamtypes [ BT_H2CHAIN ] ;
break ;
default :
Con_Printf ( " CL_ParseStream: type %i \n " , type ) ;
info = & beamtypes [ BT_H2LIGHTNING ] ;
break ;
}
b = CL_NewBeam ( ent , tag , info ) ;
2004-08-23 00:15:46 +00:00
if ( ! b )
{
2011-06-25 12:00:59 +00:00
Con_Printf ( " beam list overflow! \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-04-24 01:53:01 +00:00
b - > rflags = RF_NOSHADOW ;
2004-08-23 00:15:46 +00:00
b - > entity = ent ;
b - > tag = tag ;
2014-04-06 15:16:39 +00:00
b - > bflags = flags ;
2004-08-23 00:15:46 +00:00
b - > endtime = cl . time + duration ;
b - > alpha = 1 ;
2010-08-28 17:14:38 +00:00
b - > skin = skin ;
2004-08-23 00:15:46 +00:00
VectorCopy ( start , b - > start ) ;
VectorCopy ( end , b - > end ) ;
2014-04-06 15:16:39 +00:00
if ( b - > bflags & STREAM_ATTACHED )
{
float * entorg = CL_FindLatestEntityOrigin ( ent ) ;
if ( ! entorg )
b - > bflags & = ~ STREAM_ATTACHED ; //not found, attached isn't valid.
else
{
VectorSubtract ( b - > start , entorg , b - > offset ) ;
}
}
2015-07-14 14:47:00 +00:00
//special handling...
2004-08-23 00:15:46 +00:00
switch ( type )
{
2010-08-16 02:03:02 +00:00
case TEH2_STREAM_SUNSTAFF1 :
2015-07-14 14:47:00 +00:00
if ( info - > ef_beam = = P_INVALID )
2004-08-23 00:15:46 +00:00
{
2015-07-14 14:47:00 +00:00
b2 = CL_NewBeam ( ent , tag + 128 , & beamtypes [ BT_H2SUNSTAFF1_SUB ] ) ;
2005-05-18 23:15:58 +00:00
if ( b2 )
{
2014-04-06 15:16:39 +00:00
P_DelinkTrailstate ( & b2 - > trailstate ) ;
P_DelinkTrailstate ( & b2 - > emitstate ) ;
2005-05-18 23:15:58 +00:00
memcpy ( b2 , b , sizeof ( * b2 ) ) ;
2014-04-06 15:16:39 +00:00
b2 - > trailstate = NULL ;
b2 - > emitstate = NULL ;
2005-05-18 23:15:58 +00:00
b2 - > alpha = 0.5 ;
2014-04-24 01:53:01 +00:00
b2 - > rflags = RF_TRANSLUCENT | RF_NOSHADOW ;
2005-05-18 23:15:58 +00:00
}
2004-08-23 00:15:46 +00:00
}
2014-04-06 15:16:39 +00:00
//FIXME: we don't add the blob corners+smoke
2004-08-23 00:15:46 +00:00
break ;
}
}
/*
= = = = = = = = = = = = = = = = =
CL_ParseTEnt
= = = = = = = = = = = = = = = = =
*/
# ifdef NQPROT
void CL_ParseTEnt ( qboolean nqprot )
# else
void CL_ParseTEnt ( void )
# endif
{
# ifndef NQPROT
# define nqprot false //it's easier
# endif
int type ;
vec3_t pos , pos2 ;
dlight_t * dl ;
int rnd ;
// explosion_t *ex;
2005-08-03 23:14:59 +00:00
int cnt , colour ;
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
# ifdef CSQC_DAT
2014-03-30 08:55:06 +00:00
//I know I'm going to regret this.
if ( CSQC_ParseTempEntity ( ) )
return ;
2008-11-09 22:29:28 +00:00
# endif
2014-03-30 08:55:06 +00:00
type = MSG_ReadByte ( ) ;
2008-11-09 22:29:28 +00:00
2013-03-12 22:57:40 +00:00
if ( nqprot )
{
//easiest way to handle these
2015-10-11 11:34:58 +00:00
//should probably also do qwgunshot ones with nq protocols or something
2013-03-12 22:57:40 +00:00
switch ( type )
{
case TENQ_EXPLOSION2 :
type = TEQW_EXPLOSION2 ;
break ;
case TENQ_BEAM :
type = TEQW_BEAM ;
break ;
2014-10-05 20:04:11 +00:00
case TE_EXPLOSION :
2015-08-20 03:17:47 +00:00
type = TEQW_EXPLOSIONNOSPRITE ;
2014-10-05 20:04:11 +00:00
break ;
2015-10-11 11:34:58 +00:00
case TE_GUNSHOT :
type = TE_GUNSHOT_NQCOMPAT ;
break ;
case TE_GUNSHOT_NQCOMPAT :
type = TE_GUNSHOT ;
break ;
2013-03-12 22:57:40 +00:00
default :
break ;
}
}
2015-10-11 11:34:58 +00:00
//right, nq vs qw doesn't matter now, supposedly.
if ( cl_shownet . ival > = 2 )
{
static char * te_names [ ] = {
" spike " , " superspike " , " qwgunshot " , " qwexplosion " ,
" tarexplosion " , " lightning1 " , " lightning2 " , " wizspike " ,
" knightspike " , " lightning3 " , " lavasplash " , " teleport " ,
" blood " , " lightningblood " , " bullet " , " superbullet " , //bullets deprecated
" railtrail " , " beam " , " explosion2 " , " nqexplosion " ,
" nqgunshot " , " ? " , " ? " , " ? " ,
# ifdef HEXEN2
" h2lightsml " , " h2chain " , " h2sunstf1 " , " h2sunstf2 " ,
" h2light " , " h2cb " , " h2ic " , " h2gaze " ,
" h2famine " , " h2partexp "
# endif
} ;
if ( type < countof ( te_names ) )
Con_Printf ( " te_%s \n " , te_names [ type ] ) ;
else
Con_Printf ( " te_%i \n " , type ) ;
}
2004-08-23 00:15:46 +00:00
switch ( type )
{
case TE_WIZSPIKE : // spike hitting wall
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , 0 , - 10 , 20 ) ;
2004-08-23 00:15:46 +00:00
2005-03-10 03:55:18 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_wizspike ) )
P_RunParticleEffect ( pos , vec3_origin , 20 , 30 ) ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_wizhit , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
break ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
case TE_KNIGHTSPIKE : // spike hitting wall
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 20 ) ;
2004-08-23 00:15:46 +00:00
2005-03-10 03:55:18 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_knightspike ) )
P_RunParticleEffect ( pos , vec3_origin , 226 , 20 ) ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_knighthit , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
break ;
2011-06-25 12:00:59 +00:00
2010-03-25 22:56:11 +00:00
case TEDP_SPIKEQUAD :
2005-07-08 00:37:52 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 20 ) ;
2005-07-08 00:37:52 +00:00
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , ptdp_spikequad ) )
2005-07-08 00:37:52 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_spike ) )
if ( P_RunParticleEffectType ( pos , NULL , 10 , pt_gunshot ) )
P_RunParticleEffect ( pos , vec3_origin , 0 , 10 ) ;
if ( rand ( ) % 5 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_tink1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-07-08 00:37:52 +00:00
else
{
rnd = rand ( ) & 3 ;
if ( rnd = = 1 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-07-08 00:37:52 +00:00
else if ( rnd = = 2 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric2 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-07-08 00:37:52 +00:00
else
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-07-08 00:37:52 +00:00
}
break ;
2004-08-23 00:15:46 +00:00
case TE_SPIKE : // spike hitting wall
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 20 ) ;
2004-08-23 00:15:46 +00:00
2005-03-10 03:55:18 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_spike ) )
if ( P_RunParticleEffectType ( pos , NULL , 10 , pt_gunshot ) )
P_RunParticleEffect ( pos , vec3_origin , 0 , 10 ) ;
2004-08-23 00:15:46 +00:00
2005-07-08 00:37:52 +00:00
if ( rand ( ) % 5 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_tink1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-07-08 00:37:52 +00:00
else
{
rnd = rand ( ) & 3 ;
if ( rnd = = 1 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-07-08 00:37:52 +00:00
else if ( rnd = = 2 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric2 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-07-08 00:37:52 +00:00
else
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-07-08 00:37:52 +00:00
}
break ;
2010-03-25 22:56:11 +00:00
case TEDP_SUPERSPIKEQUAD : // super spike hitting wall
2005-07-08 00:37:52 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 20 ) ;
2005-07-08 00:37:52 +00:00
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , ptdp_superspikequad ) )
2005-07-08 00:37:52 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_superspike ) )
if ( P_RunParticleEffectType ( pos , NULL , 2 , pt_spike ) )
if ( P_RunParticleEffectType ( pos , NULL , 20 , pt_gunshot ) )
P_RunParticleEffect ( pos , vec3_origin , 0 , 20 ) ;
2004-08-23 00:15:46 +00:00
if ( rand ( ) % 5 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_tink1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else
{
rnd = rand ( ) & 3 ;
if ( rnd = = 1 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else if ( rnd = = 2 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric2 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
}
break ;
case TE_SUPERSPIKE : // super spike hitting wall
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 20 ) ;
2004-08-23 00:15:46 +00:00
2005-03-10 03:55:18 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_superspike ) )
if ( P_RunParticleEffectType ( pos , NULL , 2 , pt_spike ) )
if ( P_RunParticleEffectType ( pos , NULL , 20 , pt_gunshot ) )
P_RunParticleEffect ( pos , vec3_origin , 0 , 20 ) ;
2004-08-23 00:15:46 +00:00
if ( rand ( ) % 5 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_tink1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else
{
rnd = rand ( ) & 3 ;
if ( rnd = = 1 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else if ( rnd = = 2 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric2 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
}
break ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
# ifdef PEXT_TE_BULLET
case TE_BULLET :
if ( ! ( cls . fteprotocolextensions & PEXT_TE_BULLET ) )
2005-09-18 02:12:30 +00:00
Host_EndGame ( " Thought PEXT_TE_BULLET was disabled " ) ;
2004-08-23 00:15:46 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 20 ) ;
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , ptfte_bullet ) )
2005-03-10 03:55:18 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 10 , pt_gunshot ) )
P_RunParticleEffect ( pos , vec3_origin , 0 , 10 ) ;
2004-08-23 00:15:46 +00:00
if ( rand ( ) % 5 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_tink1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else
{
rnd = rand ( ) & 3 ;
if ( rnd = = 1 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else if ( rnd = = 2 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric2 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
}
break ;
case TE_SUPERBULLET :
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 20 ) ;
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , ptfte_superbullet ) )
if ( P_RunParticleEffectType ( pos , NULL , 2 , ptfte_bullet ) )
2005-03-10 03:55:18 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 20 , pt_gunshot ) )
P_RunParticleEffect ( pos , vec3_origin , 0 , 20 ) ;
2004-08-23 00:15:46 +00:00
if ( rand ( ) % 5 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_tink1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else
{
rnd = rand ( ) & 3 ;
if ( rnd = = 1 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric1 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else if ( rnd = = 2 )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric2 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
else
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_ric3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2011-06-25 12:00:59 +00:00
}
2004-08-23 00:15:46 +00:00
break ;
# endif
2010-03-25 22:56:11 +00:00
case TEDP_EXPLOSIONQUAD : // rocket explosion
2005-07-08 00:37:52 +00:00
// particles
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , ptdp_explosionquad ) )
2005-10-08 22:35:20 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_explosion ) )
P_RunParticleEffect ( pos , NULL , 107 , 1024 ) ; // should be 97-111
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 1 , - 1 , - 1 , 100 ) ;
2011-06-25 12:00:59 +00:00
2005-07-08 00:37:52 +00:00
// light
2005-08-26 22:56:51 +00:00
if ( r_explosionlight . value )
{
2005-07-20 08:04:46 +00:00
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
2006-04-21 05:23:51 +00:00
dl - > radius = 150 + r_explosionlight . value * 200 ;
2005-07-20 08:04:46 +00:00
dl - > die = cl . time + 1 ;
dl - > decay = 300 ;
2011-06-25 12:00:59 +00:00
2012-01-01 02:26:42 +00:00
dl - > color [ 0 ] = 4.0 ;
dl - > color [ 1 ] = 2.0 ;
dl - > color [ 2 ] = 0.5 ;
2005-07-20 08:04:46 +00:00
dl - > channelfade [ 0 ] = 0.196 ;
dl - > channelfade [ 1 ] = 0.23 ;
dl - > channelfade [ 2 ] = 0.12 ;
}
2005-07-08 00:37:52 +00:00
// sound
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_r_exp3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2011-06-25 12:00:59 +00:00
// sprite
2009-11-04 21:16:50 +00:00
if ( cl_expsprite . ival ) // temp hopefully
2005-07-08 00:37:52 +00:00
{
2014-04-12 03:31:59 +00:00
explosion_t * ex = CL_AllocExplosion ( pos ) ;
2005-07-08 00:37:52 +00:00
ex - > start = cl . time ;
2014-03-30 08:55:06 +00:00
ex - > model = Mod_ForName ( " progs/s_explod.spr " , MLV_WARN ) ;
2014-04-12 03:31:59 +00:00
ex - > endalpha = ex - > startalpha ; //don't fade out
2005-07-08 00:37:52 +00:00
}
break ;
2015-08-20 03:17:47 +00:00
case TEQW_EXPLOSIONNOSPRITE : //nq-style, no sprite
2014-10-05 20:04:11 +00:00
case TE_EXPLOSION : //qw-style, with (optional) sprite
2004-08-23 00:15:46 +00:00
// particles
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2005-10-08 22:35:20 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_explosion ) )
P_RunParticleEffect ( pos , NULL , 107 , 1024 ) ; // should be 97-111
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 1 , - 1 , - 1 , 100 ) ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
// light
2005-08-26 22:56:51 +00:00
if ( r_explosionlight . value )
{
2005-08-26 21:59:36 +00:00
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
2006-04-21 05:23:51 +00:00
dl - > radius = 150 + r_explosionlight . value * 200 ;
2012-11-27 03:23:19 +00:00
dl - > die = cl . time + 0.75 ;
dl - > decay = dl - > radius * 2 ;
2011-06-25 12:00:59 +00:00
2012-01-01 02:26:42 +00:00
dl - > color [ 0 ] = 4.0 ;
dl - > color [ 1 ] = 2.0 ;
dl - > color [ 2 ] = 0.5 ;
dl - > channelfade [ 0 ] = 0.784 ;
dl - > channelfade [ 1 ] = 0.92 ;
dl - > channelfade [ 2 ] = 0.48 ;
2005-08-26 21:59:36 +00:00
}
2004-08-23 00:15:46 +00:00
// sound
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_r_exp3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2011-06-25 12:00:59 +00:00
// sprite
2014-10-05 20:04:11 +00:00
if ( type = = TE_EXPLOSION & & cl_expsprite . ival ) // temp hopefully
2004-08-23 00:15:46 +00:00
{
2014-04-12 03:31:59 +00:00
explosion_t * ex = CL_AllocExplosion ( pos ) ;
2004-08-23 00:15:46 +00:00
ex - > start = cl . time ;
2014-03-30 08:55:06 +00:00
ex - > model = Mod_ForName ( " progs/s_explod.spr " , MLV_WARN ) ;
2004-08-23 00:15:46 +00:00
}
break ;
2005-07-14 01:57:34 +00:00
2013-03-12 22:57:40 +00:00
case TEQW_EXPLOSION2 :
{
int colorStart ;
int colorLength ;
2015-08-20 03:17:47 +00:00
int ef ;
2013-03-12 22:57:40 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
colorStart = MSG_ReadByte ( ) ;
colorLength = MSG_ReadByte ( ) ;
2015-08-20 03:17:47 +00:00
ef = P_FindParticleType ( va ( " TE_EXPLOSION2_%i_%i " , colorStart , colorLength ) ) ;
if ( ef = = P_INVALID )
ef = pt_explosion ;
P_RunParticleEffectType ( pos , NULL , 1 , ef ) ;
2013-03-12 22:57:40 +00:00
if ( r_explosionlight . value )
{
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
dl - > radius = 350 ;
dl - > die = cl . time + 0.5 ;
dl - > decay = 300 ;
}
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_r_exp3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2013-03-12 22:57:40 +00:00
}
break ;
2010-03-25 22:56:11 +00:00
case TEDP_EXPLOSIONRGB :
2005-07-14 01:57:34 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2005-10-08 22:35:20 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_explosion ) )
P_RunParticleEffect ( pos , NULL , 107 , 1024 ) ; // should be 97-111
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 1 , - 1 , - 1 , 100 ) ;
2011-06-25 12:00:59 +00:00
2005-07-14 01:57:34 +00:00
// light
2005-08-26 22:56:51 +00:00
if ( r_explosionlight . value )
{
2005-07-20 08:04:46 +00:00
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
2006-04-21 05:23:51 +00:00
dl - > radius = 150 + r_explosionlight . value * 200 ;
2005-07-20 08:04:46 +00:00
dl - > die = cl . time + 0.5 ;
dl - > decay = 300 ;
2011-06-25 12:00:59 +00:00
2005-07-20 08:04:46 +00:00
dl - > color [ 0 ] = 0.4f * MSG_ReadByte ( ) / 255.0f ;
dl - > color [ 1 ] = 0.4f * MSG_ReadByte ( ) / 255.0f ;
dl - > color [ 2 ] = 0.4f * MSG_ReadByte ( ) / 255.0f ;
dl - > channelfade [ 0 ] = 0 ;
dl - > channelfade [ 1 ] = 0 ;
dl - > channelfade [ 2 ] = 0 ;
}
2005-07-14 01:57:34 +00:00
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_r_exp3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-07-14 01:57:34 +00:00
break ;
2010-03-25 22:56:11 +00:00
case TEDP_TEI_BIGEXPLOSION :
2005-07-14 01:57:34 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , ptdp_tei_bigexplosion ) )
2005-10-08 22:35:20 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_explosion ) )
P_RunParticleEffect ( pos , NULL , 107 , 1024 ) ; // should be 97-111
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 1 , - 1 , - 1 , 100 ) ;
2011-06-25 12:00:59 +00:00
2005-07-14 01:57:34 +00:00
// light
2005-08-26 22:56:51 +00:00
if ( r_explosionlight . value )
{
2005-08-26 21:59:36 +00:00
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
// no point in doing this the fuh/ez way
2011-06-25 12:00:59 +00:00
dl - > radius = 500 * r_explosionlight . value ;
2005-08-26 21:59:36 +00:00
dl - > die = cl . time + 1 ;
dl - > decay = 500 ;
2011-06-25 12:00:59 +00:00
2011-12-27 08:35:19 +00:00
dl - > color [ 0 ] = 2.0f ;
dl - > color [ 1 ] = 1.5f ;
dl - > color [ 2 ] = 0.75f ;
2005-08-26 21:59:36 +00:00
dl - > channelfade [ 0 ] = 0 ;
dl - > channelfade [ 1 ] = 0 ;
dl - > channelfade [ 2 ] = 0 ;
}
2005-07-14 01:57:34 +00:00
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_r_exp3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-07-14 01:57:34 +00:00
break ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
case TE_TAREXPLOSION : // tarbaby explosion
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2008-11-09 22:29:28 +00:00
P_RunParticleEffectType ( pos , NULL , 1 , pt_tarexplosion ) ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , cl_sfx_r_exp3 , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
break ;
case TE_LIGHTNING1 : // lightning bolts
2015-07-14 14:47:00 +00:00
CL_ParseBeam ( BT_Q1LIGHTNING1 ) ;
break ;
2004-08-23 00:15:46 +00:00
case TE_LIGHTNING2 : // lightning bolts
2015-07-14 14:47:00 +00:00
CL_ParseBeam ( BT_Q1LIGHTNING2 ) ;
2004-08-23 00:15:46 +00:00
break ;
2004-08-26 07:38:52 +00:00
case TE_LIGHTNING3 : // lightning bolts
2015-07-14 14:47:00 +00:00
CL_ParseBeam ( BT_Q1LIGHTNING3 ) ;
2004-08-26 07:38:52 +00:00
break ;
2011-06-25 12:00:59 +00:00
case TE_LAVASPLASH :
2004-08-23 00:15:46 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2008-11-09 22:29:28 +00:00
P_RunParticleEffectType ( pos , NULL , 1 , pt_lavasplash ) ;
2004-08-23 00:15:46 +00:00
break ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
case TE_TELEPORT :
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2005-03-15 22:51:01 +00:00
P_RunParticleEffectType ( pos , NULL , 1 , pt_teleportsplash ) ;
2004-08-23 00:15:46 +00:00
break ;
2010-03-25 22:56:11 +00:00
case TEDP_GUNSHOTQUAD : // bullet hitting wall
2005-07-08 00:37:52 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 20 ) ;
2005-07-08 00:37:52 +00:00
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , ptdp_gunshotquad ) )
2005-07-08 00:37:52 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_gunshot ) )
P_RunParticleEffect ( pos , vec3_origin , 0 , 20 ) ;
break ;
2015-10-11 11:34:58 +00:00
2004-08-23 00:15:46 +00:00
case TE_GUNSHOT : // bullet hitting wall
2015-10-11 11:34:58 +00:00
case TE_GUNSHOT_NQCOMPAT :
if ( type = = TE_GUNSHOT_NQCOMPAT )
2004-08-23 00:15:46 +00:00
cnt = 1 ;
else
cnt = MSG_ReadByte ( ) ;
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 20 ) ;
2004-08-23 00:15:46 +00:00
2005-03-10 03:55:18 +00:00
if ( P_RunParticleEffectType ( pos , NULL , cnt , pt_gunshot ) )
P_RunParticleEffect ( pos , vec3_origin , 0 , 20 * cnt ) ;
2004-08-23 00:15:46 +00:00
break ;
2011-06-25 12:00:59 +00:00
2010-03-25 22:56:11 +00:00
case TEQW_BLOOD : // bullets hitting body
2004-08-23 00:15:46 +00:00
cnt = MSG_ReadByte ( ) ;
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , 0 , - 10 , - 10 , 40 ) ;
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , NULL , cnt , ptqw_blood ) )
if ( P_RunParticleEffectType ( pos , NULL , cnt , ptdp_blood ) )
P_RunParticleEffect ( pos , vec3_origin , 73 , 20 * cnt ) ;
2004-08-23 00:15:46 +00:00
break ;
2010-03-25 22:56:11 +00:00
case TEQW_LIGHTNINGBLOOD : // lightning hitting body
2004-08-23 00:15:46 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , 1 , - 10 , - 10 , 20 ) ;
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , ptqw_lightningblood ) )
2005-03-10 03:55:18 +00:00
P_RunParticleEffect ( pos , vec3_origin , 225 , 50 ) ;
2004-08-23 00:15:46 +00:00
break ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
case TEQW_BEAM :
2015-07-14 14:47:00 +00:00
CL_ParseBeam ( BT_Q1BEAM ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
break ;
2004-08-23 00:15:46 +00:00
case TE_RAILTRAIL :
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
pos2 [ 0 ] = MSG_ReadCoord ( ) ;
pos2 [ 1 ] = MSG_ReadCoord ( ) ;
pos2 [ 2 ] = MSG_ReadCoord ( ) ;
2005-10-08 22:35:20 +00:00
2014-10-05 20:04:11 +00:00
if ( P_ParticleTrail ( pos , pos2 , rtqw_railtrail , 0 , NULL , NULL ) )
2015-12-12 19:25:15 +00:00
P_ParticleTrailIndex ( pos , pos2 , 208 , 8 , NULL ) ;
2004-08-23 00:15:46 +00:00
break ;
2010-08-16 02:03:02 +00:00
case TEH2_STREAM_LIGHTNING_SMALL :
case TEH2_STREAM_CHAIN :
case TEH2_STREAM_SUNSTAFF1 :
case TEH2_STREAM_SUNSTAFF2 :
case TEH2_STREAM_LIGHTNING :
case TEH2_STREAM_COLORBEAM :
case TEH2_STREAM_ICECHUNKS :
case TEH2_STREAM_GAZE :
case TEH2_STREAM_FAMINE :
2004-08-23 00:15:46 +00:00
CL_ParseStream ( type ) ;
break ;
2010-03-25 22:56:11 +00:00
case TEDP_BLOOD :
2004-11-20 00:56:15 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
pos2 [ 0 ] = MSG_ReadChar ( ) ;
pos2 [ 1 ] = MSG_ReadChar ( ) ;
pos2 [ 2 ] = MSG_ReadChar ( ) ;
cnt = MSG_ReadByte ( ) ;
2005-05-18 23:15:58 +00:00
2008-11-09 22:29:28 +00:00
P_RunParticleEffectType ( pos , pos2 , cnt , ptdp_blood ) ;
2004-11-20 00:56:15 +00:00
break ;
2010-03-25 22:56:11 +00:00
case TEDP_SPARK :
2015-08-20 03:17:47 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ; //org
2004-11-20 00:56:15 +00:00
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2015-08-20 03:17:47 +00:00
pos2 [ 0 ] = MSG_ReadChar ( ) ; //vel
2004-11-20 00:56:15 +00:00
pos2 [ 1 ] = MSG_ReadChar ( ) ;
pos2 [ 2 ] = MSG_ReadChar ( ) ;
cnt = MSG_ReadByte ( ) ;
{
2008-11-09 22:29:28 +00:00
P_RunParticleEffectType ( pos , pos2 , cnt , ptdp_spark ) ;
2004-11-20 00:56:15 +00:00
}
break ;
2010-03-25 22:56:11 +00:00
case TEDP_BLOODSHOWER :
2015-08-20 03:17:47 +00:00
{
vec3_t vel = { 0 , 0 , 0 } ;
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2005-05-15 18:49:04 +00:00
2015-08-20 03:17:47 +00:00
pos2 [ 0 ] = MSG_ReadCoord ( ) ;
pos2 [ 1 ] = MSG_ReadCoord ( ) ;
pos2 [ 2 ] = MSG_ReadCoord ( ) ;
2005-05-15 18:49:04 +00:00
2015-08-20 03:17:47 +00:00
vel [ 2 ] = - MSG_ReadCoord ( ) ;
2005-05-15 18:49:04 +00:00
2015-08-20 03:17:47 +00:00
cnt = MSG_ReadShort ( ) ;
2005-05-15 18:49:04 +00:00
2015-08-20 03:17:47 +00:00
P_RunParticleCube ( P_FindParticleType ( " te_bloodshower " ) , pos , pos2 , vel , vel , cnt , 0 , false , 0 ) ;
2005-05-15 18:49:04 +00:00
}
break ;
2010-03-25 22:56:11 +00:00
case TEDP_SMALLFLASH :
2004-11-20 00:56:15 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2005-03-13 21:00:26 +00:00
// light
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
dl - > radius = 200 ;
dl - > decay = 1000 ;
dl - > die = cl . time + 0.2 ;
2011-12-27 08:35:19 +00:00
dl - > color [ 0 ] = 2.0 ;
dl - > color [ 1 ] = 2.0 ;
dl - > color [ 2 ] = 2.0 ;
2004-11-20 00:56:15 +00:00
break ;
2010-03-25 22:56:11 +00:00
case TEDP_CUSTOMFLASH :
2004-11-20 00:56:15 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
// light
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
dl - > radius = MSG_ReadByte ( ) * 8 ;
pos2 [ 0 ] = ( MSG_ReadByte ( ) + 1 ) * ( 1.0 / 256.0 ) ;
dl - > die = cl . time + pos2 [ 0 ] ;
dl - > decay = dl - > radius / pos2 [ 0 ] ;
2011-06-25 12:00:59 +00:00
2011-12-27 08:35:19 +00:00
dl - > color [ 0 ] = MSG_ReadByte ( ) * ( 1.0f / 127.0f ) ;
dl - > color [ 1 ] = MSG_ReadByte ( ) * ( 1.0f / 127.5f ) ;
dl - > color [ 2 ] = MSG_ReadByte ( ) * ( 1.0f / 127.0f ) ;
2011-06-25 12:00:59 +00:00
2004-11-20 00:56:15 +00:00
break ;
2010-03-25 22:56:11 +00:00
case TEDP_FLAMEJET :
2005-03-13 21:00:26 +00:00
// origin
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2004-11-26 06:06:43 +00:00
2005-03-13 21:00:26 +00:00
// velocity
pos2 [ 0 ] = MSG_ReadCoord ( ) ;
pos2 [ 1 ] = MSG_ReadCoord ( ) ;
pos2 [ 2 ] = MSG_ReadCoord ( ) ;
2004-11-26 06:06:43 +00:00
2005-03-13 21:00:26 +00:00
// count
cnt = MSG_ReadByte ( ) ;
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , pos2 , cnt , ptdp_flamejet ) )
2005-03-15 02:57:02 +00:00
P_RunParticleEffect ( pos , pos2 , 232 , cnt ) ;
2004-11-26 06:06:43 +00:00
break ;
2010-03-25 22:56:11 +00:00
case TEDP_PLASMABURN :
2005-03-13 21:00:26 +00:00
// origin
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
// stain (Hopefully this is close to how DP does it)
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 30 ) ;
2004-11-26 06:06:43 +00:00
2015-08-20 03:17:47 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , P_FindParticleType ( " te_plasmaburn " ) ) )
P_RunParticleEffect ( pos , vec3_origin , 15 , 50 ) ;
2004-11-26 06:06:43 +00:00
break ;
2010-03-25 22:56:11 +00:00
case TEDP_TEI_G3 : //nexuiz's nex beam
2005-04-16 16:21:27 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2004-11-20 00:56:15 +00:00
2005-04-16 16:21:27 +00:00
pos2 [ 0 ] = MSG_ReadCoord ( ) ;
pos2 [ 1 ] = MSG_ReadCoord ( ) ;
pos2 [ 2 ] = MSG_ReadCoord ( ) ;
2004-11-20 00:56:15 +00:00
2005-04-16 16:21:27 +00:00
//sigh...
MSG_ReadCoord ( ) ;
MSG_ReadCoord ( ) ;
MSG_ReadCoord ( ) ;
2004-11-20 00:56:15 +00:00
2014-10-05 20:04:11 +00:00
if ( P_ParticleTrail ( pos , pos2 , P_FindParticleType ( " te_nexbeam " ) , 0 , NULL , NULL ) )
2005-10-08 22:35:20 +00:00
P_ParticleTrailIndex ( pos , pos2 , 15 , 0 , NULL ) ;
2004-11-20 00:56:15 +00:00
break ;
2010-03-25 22:56:11 +00:00
case TEDP_SMOKE :
2005-05-13 10:42:48 +00:00
//org
pos [ 0 ] = MSG_ReadCoord ( ) ;
2005-07-01 19:23:00 +00:00
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2005-05-13 10:42:48 +00:00
//dir
pos2 [ 0 ] = MSG_ReadCoord ( ) ;
2005-07-01 19:23:00 +00:00
pos2 [ 1 ] = MSG_ReadCoord ( ) ;
pos2 [ 2 ] = MSG_ReadCoord ( ) ;
2005-05-13 10:42:48 +00:00
//count
cnt = MSG_ReadByte ( ) ;
{
2008-11-09 22:29:28 +00:00
P_RunParticleEffectType ( pos , pos2 , cnt , ptdp_tei_smoke ) ;
2005-05-13 10:42:48 +00:00
}
break ;
2010-03-25 22:56:11 +00:00
case TEDP_TEI_PLASMAHIT :
2005-04-16 16:21:27 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
2004-11-20 00:56:15 +00:00
2005-04-16 16:21:27 +00:00
//dir
pos2 [ 0 ] = MSG_ReadCoord ( ) ;
pos2 [ 1 ] = MSG_ReadCoord ( ) ;
pos2 [ 2 ] = MSG_ReadCoord ( ) ;
cnt = MSG_ReadByte ( ) ;
2004-11-20 00:56:15 +00:00
2005-04-16 16:21:27 +00:00
{
2008-11-09 22:29:28 +00:00
P_RunParticleEffectType ( pos , pos2 , cnt , ptdp_tei_plasmahit ) ;
2005-04-16 16:21:27 +00:00
}
2004-11-20 00:56:15 +00:00
break ;
2010-03-25 22:56:11 +00:00
case TEDP_PARTICLECUBE :
2005-08-03 23:14:59 +00:00
{
vec3_t dir ;
int jitter ;
int gravity ;
//min
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
//max
pos2 [ 0 ] = MSG_ReadCoord ( ) ;
pos2 [ 1 ] = MSG_ReadCoord ( ) ;
pos2 [ 2 ] = MSG_ReadCoord ( ) ;
//dir
dir [ 0 ] = MSG_ReadCoord ( ) ;
dir [ 1 ] = MSG_ReadCoord ( ) ;
dir [ 2 ] = MSG_ReadCoord ( ) ;
cnt = MSG_ReadShort ( ) ; //count
colour = MSG_ReadByte ( ) ; //colour
gravity = MSG_ReadByte ( ) ; //gravity flag
jitter = MSG_ReadCoord ( ) ; //jitter
2013-12-29 22:48:28 +00:00
P_RunParticleCube ( P_INVALID , pos , pos2 , dir , dir , cnt , colour , gravity , jitter ) ;
2005-08-03 23:14:59 +00:00
}
break ;
2010-03-25 22:56:11 +00:00
case TEDP_PARTICLERAIN :
2005-08-03 23:14:59 +00:00
{
vec3_t dir ;
//min
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
//max
pos2 [ 0 ] = MSG_ReadCoord ( ) ;
pos2 [ 1 ] = MSG_ReadCoord ( ) ;
pos2 [ 2 ] = MSG_ReadCoord ( ) ;
//dir
dir [ 0 ] = MSG_ReadCoord ( ) ;
dir [ 1 ] = MSG_ReadCoord ( ) ;
dir [ 2 ] = MSG_ReadCoord ( ) ;
2012-09-30 05:52:03 +00:00
cnt = ( unsigned short ) MSG_ReadShort ( ) ; //count
2005-08-03 23:14:59 +00:00
colour = MSG_ReadByte ( ) ; //colour
P_RunParticleWeather ( pos , pos2 , dir , cnt , colour , " rain " ) ;
}
break ;
2010-03-25 22:56:11 +00:00
case TEDP_PARTICLESNOW :
2005-08-03 23:14:59 +00:00
{
vec3_t dir ;
//min
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
//max
pos2 [ 0 ] = MSG_ReadCoord ( ) ;
pos2 [ 1 ] = MSG_ReadCoord ( ) ;
pos2 [ 2 ] = MSG_ReadCoord ( ) ;
//dir
dir [ 0 ] = MSG_ReadCoord ( ) ;
dir [ 1 ] = MSG_ReadCoord ( ) ;
dir [ 2 ] = MSG_ReadCoord ( ) ;
2012-09-30 05:52:03 +00:00
cnt = ( unsigned short ) MSG_ReadShort ( ) ; //count
2005-08-03 23:14:59 +00:00
colour = MSG_ReadByte ( ) ; //colour
P_RunParticleWeather ( pos , pos2 , dir , cnt , colour , " snow " ) ;
}
break ;
2005-07-14 01:57:34 +00:00
2005-08-03 23:14:59 +00:00
default :
2004-08-23 00:15:46 +00:00
Host_EndGame ( " CL_ParseTEnt: bad type - %i " , type ) ;
}
}
void MSG_ReadPos ( vec3_t pos ) ;
void MSG_ReadDir ( vec3_t dir ) ;
typedef struct {
2010-08-28 17:14:38 +00:00
char name [ 64 ] ;
2004-08-23 00:15:46 +00:00
int netstyle ;
int particleeffecttype ;
char stain [ 3 ] ;
qbyte radius ;
vec3_t dlightrgb ;
float dlightradius ;
float dlighttime ;
2004-08-30 06:07:13 +00:00
vec3_t dlightcfade ;
2004-08-23 00:15:46 +00:00
} clcustomtents_t ;
2012-11-29 13:37:48 +00:00
typedef struct custtentinst_s
2004-08-23 00:15:46 +00:00
{
2012-11-29 13:37:48 +00:00
struct custtentinst_s * next ;
clcustomtents_t * type ;
int id ;
2004-08-23 00:15:46 +00:00
vec3_t pos ;
vec3_t pos2 ;
vec3_t dir ;
2012-11-29 13:37:48 +00:00
int count ;
} custtentinst_t ;
custtentinst_t * activepcusttents ;
2014-04-24 01:53:01 +00:00
void CL_SpawnCustomTEnt ( custtentinst_t * info )
2012-11-29 13:37:48 +00:00
{
clcustomtents_t * t = info - > type ;
qboolean failed ;
if ( t - > netstyle & CTE_ISBEAM )
{
if ( t - > netstyle & ( CTE_CUSTOMVELOCITY | CTE_CUSTOMDIRECTION ) )
{
vec3_t org ;
int i , j ;
//FIXME: pvs cull
2012-12-04 19:37:57 +00:00
if ( t - > particleeffecttype = = - 1 )
failed = true ;
else
2012-11-29 13:37:48 +00:00
{
2012-12-04 19:37:57 +00:00
failed = false ;
2012-11-29 13:37:48 +00:00
for ( i = 0 ; i < info - > count ; i + + )
{
for ( j = 0 ; j < 3 ; j + + )
{
org [ j ] = info - > pos [ j ] + ( info - > pos2 [ j ] - info - > pos [ j ] ) * frandom ( ) ;
}
2012-12-04 19:37:57 +00:00
failed | = P_RunParticleEffectType ( org , info - > dir , 1 , t - > particleeffecttype ) ;
2012-11-29 13:37:48 +00:00
}
}
}
else
2014-10-05 20:04:11 +00:00
failed = P_ParticleTrail ( info - > pos , info - > pos2 , t - > particleeffecttype , 0 , NULL , NULL ) ;
2012-11-29 13:37:48 +00:00
}
else
{
2013-03-12 22:47:42 +00:00
if ( t - > netstyle & ( CTE_CUSTOMVELOCITY | CTE_CUSTOMDIRECTION ) )
2012-11-29 13:37:48 +00:00
failed = P_RunParticleEffectType ( info - > pos , info - > dir , info - > count , t - > particleeffecttype ) ;
else
failed = P_RunParticleEffectType ( info - > pos , NULL , info - > count , t - > particleeffecttype ) ;
}
if ( failed )
Con_DPrintf ( " Failed to create effect %s \n " , t - > name ) ;
if ( t - > netstyle & CTE_STAINS )
{ //added at pos2 - end of trail
2013-07-14 12:22:51 +00:00
Surf_AddStain ( info - > pos2 , t - > stain [ 0 ] , t - > stain [ 1 ] , t - > stain [ 2 ] , 40 ) ;
2012-11-29 13:37:48 +00:00
}
if ( t - > netstyle & CTE_GLOWS )
{ //added at pos1 firer's end.
dlight_t * dl ;
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( info - > pos , dl - > origin ) ;
dl - > radius = t - > dlightradius * 4 ;
dl - > die = cl . time + t - > dlighttime ;
dl - > decay = t - > radius / t - > dlighttime ;
dl - > color [ 0 ] = t - > dlightrgb [ 0 ] ;
dl - > color [ 1 ] = t - > dlightrgb [ 1 ] ;
dl - > color [ 2 ] = t - > dlightrgb [ 2 ] ;
if ( t - > netstyle & CTE_CHANNELFADE )
{
dl - > channelfade [ 0 ] = t - > dlightcfade [ 0 ] ;
dl - > channelfade [ 1 ] = t - > dlightcfade [ 1 ] ;
dl - > channelfade [ 2 ] = t - > dlightcfade [ 2 ] ;
}
/*
if ( dl - > color [ 0 ] < 0 )
dl - > channelfade [ 0 ] = 0 ;
else
dl - > channelfade [ 0 ] = dl - > color [ 0 ] / t - > dlighttime ;
if ( dl - > color [ 1 ] < 0 )
dl - > channelfade [ 1 ] = 0 ;
else
dl - > channelfade [ 1 ] = dl - > color [ 0 ] / t - > dlighttime ;
if ( dl - > color [ 2 ] < 0 )
dl - > channelfade [ 2 ] = 0 ;
else
dl - > channelfade [ 2 ] = dl - > color [ 0 ] / t - > dlighttime ;
*/
}
}
void CL_RunPCustomTEnts ( void )
{
custtentinst_t * ef ;
static float lasttime ;
float since = cl . time - lasttime ;
if ( since < 0 )
lasttime = cl . time ;
else if ( since < 1 / 60.0 )
return ;
lasttime = cl . time ;
for ( ef = activepcusttents ; ef ; ef = ef - > next )
{
2014-04-24 01:53:01 +00:00
CL_SpawnCustomTEnt ( ef ) ;
2012-11-29 13:37:48 +00:00
}
}
clcustomtents_t customtenttype [ 255 ] ; //network based.
2016-07-12 00:40:13 +00:00
qboolean CL_WriteCustomTEnt ( sizebuf_t * buf , int id )
{
clcustomtents_t * t ;
if ( ( unsigned ) id > = 255u )
return false ;
t = & customtenttype [ id ] ;
if ( * t - > name )
{
MSG_WriteByte ( buf , svcfte_customtempent ) ;
MSG_WriteByte ( buf , 255 ) ;
MSG_WriteByte ( buf , id ) ;
MSG_WriteByte ( buf , t - > netstyle ) ;
MSG_WriteString ( buf , t - > name ) ;
if ( t - > netstyle & CTE_STAINS )
{
MSG_WriteChar ( buf , t - > stain [ 0 ] ) ;
MSG_WriteChar ( buf , t - > stain [ 1 ] ) ;
MSG_WriteChar ( buf , t - > stain [ 2 ] ) ;
MSG_WriteByte ( buf , t - > radius ) ;
}
if ( t - > netstyle & CTE_GLOWS )
{
MSG_WriteByte ( buf , t - > dlightrgb [ 0 ] * 255 ) ;
MSG_WriteByte ( buf , t - > dlightrgb [ 1 ] * 255 ) ;
MSG_WriteByte ( buf , t - > dlightrgb [ 2 ] * 255 ) ;
MSG_WriteByte ( buf , t - > dlightradius ) ;
MSG_WriteByte ( buf , t - > dlighttime * 16 ) ;
if ( t - > netstyle & CTE_CHANNELFADE )
{
MSG_WriteByte ( buf , t - > dlightcfade [ 0 ] * 64 ) ;
MSG_WriteByte ( buf , t - > dlightcfade [ 1 ] * 64 ) ;
MSG_WriteByte ( buf , t - > dlightcfade [ 2 ] * 64 ) ;
}
}
}
return true ;
}
2012-11-29 13:37:48 +00:00
void CL_ParseCustomTEnt ( void )
{
2004-08-23 00:15:46 +00:00
char * str ;
clcustomtents_t * t ;
int type = MSG_ReadByte ( ) ;
2012-11-29 13:37:48 +00:00
custtentinst_t info ;
2004-08-23 00:15:46 +00:00
2005-01-29 02:26:42 +00:00
if ( type = = 255 ) //255 is register
2004-08-23 00:15:46 +00:00
{
type = MSG_ReadByte ( ) ;
if ( type = = 255 )
Host_EndGame ( " Custom temp type 255 isn't valid \n " ) ;
t = & customtenttype [ type ] ;
t - > netstyle = MSG_ReadByte ( ) ;
str = MSG_ReadString ( ) ;
2010-08-28 17:14:38 +00:00
Q_strncpyz ( t - > name , str , sizeof ( t - > name ) ) ;
2010-12-05 02:46:07 +00:00
t - > particleeffecttype = P_FindParticleType ( str ) ;
2016-07-12 00:40:13 +00:00
if ( cl_shownet . ival > = 3 )
Con_Printf ( " \t define \" %s \" (%x) \n " , t - > name , t - > netstyle ) ;
2004-08-23 00:15:46 +00:00
if ( t - > netstyle & CTE_STAINS )
{
t - > stain [ 0 ] = MSG_ReadChar ( ) ;
t - > stain [ 1 ] = MSG_ReadChar ( ) ;
t - > stain [ 2 ] = MSG_ReadChar ( ) ;
t - > radius = MSG_ReadByte ( ) ;
}
else
t - > radius = 0 ;
if ( t - > netstyle & CTE_GLOWS )
{
t - > dlightrgb [ 0 ] = MSG_ReadByte ( ) / 255.0f ;
t - > dlightrgb [ 1 ] = MSG_ReadByte ( ) / 255.0f ;
t - > dlightrgb [ 2 ] = MSG_ReadByte ( ) / 255.0f ;
t - > dlightradius = MSG_ReadByte ( ) ;
t - > dlighttime = MSG_ReadByte ( ) / 16.0f ;
2004-08-30 06:07:13 +00:00
if ( t - > netstyle & CTE_CHANNELFADE )
{
t - > dlightcfade [ 0 ] = MSG_ReadByte ( ) / 64.0f ;
t - > dlightcfade [ 1 ] = MSG_ReadByte ( ) / 64.0f ;
t - > dlightcfade [ 2 ] = MSG_ReadByte ( ) / 64.0f ;
}
2004-08-23 00:15:46 +00:00
}
else
t - > dlighttime = 0 ;
return ;
}
t = & customtenttype [ type ] ;
2016-07-12 00:40:13 +00:00
if ( cl_shownet . ival > = 3 )
Con_Printf ( " \t spawn \" %s \" (%x) \n " , t - > name , t - > netstyle ) ;
2012-11-29 13:37:48 +00:00
info . type = t ;
if ( t - > netstyle & CTE_PERSISTANT )
2004-08-23 00:15:46 +00:00
{
2012-11-29 13:37:48 +00:00
info . id = MSG_ReadShort ( ) ;
2004-08-23 00:15:46 +00:00
}
else
2012-11-29 13:37:48 +00:00
info . id = 0 ;
if ( info . id & 0x8000 )
2004-08-23 00:15:46 +00:00
{
2012-11-29 13:37:48 +00:00
VectorClear ( info . pos ) ;
VectorClear ( info . pos2 ) ;
info . count = 0 ;
VectorClear ( info . dir ) ;
}
else
{
MSG_ReadPos ( info . pos ) ;
if ( t - > netstyle & CTE_ISBEAM )
MSG_ReadPos ( info . pos2 ) ;
else
VectorCopy ( info . pos , info . pos2 ) ;
2012-01-17 07:57:46 +00:00
2004-08-23 00:15:46 +00:00
if ( t - > netstyle & CTE_CUSTOMCOUNT )
2012-11-29 13:37:48 +00:00
info . count = MSG_ReadByte ( ) ;
2004-08-23 00:15:46 +00:00
else
2012-11-29 13:37:48 +00:00
info . count = 1 ;
2004-08-23 00:15:46 +00:00
2010-08-28 17:14:38 +00:00
if ( t - > netstyle & CTE_CUSTOMVELOCITY )
{
2012-11-29 13:37:48 +00:00
info . dir [ 0 ] = MSG_ReadCoord ( ) ;
info . dir [ 1 ] = MSG_ReadCoord ( ) ;
info . dir [ 2 ] = MSG_ReadCoord ( ) ;
2010-08-28 17:14:38 +00:00
}
else if ( t - > netstyle & CTE_CUSTOMDIRECTION )
2012-11-29 13:37:48 +00:00
MSG_ReadDir ( info . dir ) ;
else
VectorClear ( info . dir ) ;
2004-08-23 00:15:46 +00:00
}
2011-06-25 12:00:59 +00:00
2012-11-29 13:37:48 +00:00
if ( t - > netstyle & CTE_PERSISTANT )
{
if ( info . id & 0x8000 )
2004-08-30 06:07:13 +00:00
{
2012-11-29 13:37:48 +00:00
custtentinst_t * * link , * o ;
for ( link = & activepcusttents ; * link ; )
{
o = * link ;
if ( o - > id = = info . id )
{
* link = o - > next ;
Z_Free ( o ) ;
}
else
link = & ( * link ) - > next ;
}
2004-08-30 06:07:13 +00:00
}
2004-08-23 00:15:46 +00:00
else
2012-11-29 13:37:48 +00:00
{
//heap fragmentation is going to suck here.
custtentinst_t * n = Z_Malloc ( sizeof ( * n ) ) ;
info . next = activepcusttents ;
* n = info ;
activepcusttents = n ;
}
2004-08-23 00:15:46 +00:00
}
2012-11-29 13:37:48 +00:00
else
2014-04-24 01:53:01 +00:00
CL_SpawnCustomTEnt ( & info ) ;
2004-08-23 00:15:46 +00:00
}
2012-01-17 07:57:46 +00:00
void CL_RefreshCustomTEnts ( void )
{
int i ;
for ( i = 0 ; i < sizeof ( customtenttype ) / sizeof ( customtenttype [ 0 ] ) ; i + + )
2014-04-06 15:16:39 +00:00
{
2012-11-29 13:37:48 +00:00
customtenttype [ i ] . particleeffecttype = ( ! * customtenttype [ i ] . name ) ? - 1 : P_FindParticleType ( customtenttype [ i ] . name ) ;
2013-03-12 22:44:00 +00:00
2014-04-06 15:16:39 +00:00
// if (customtenttype[i].particleeffecttype == P_INVALID && *customtenttype[i].name)
// Con_DPrintf("%s was not loaded\n", customtenttype[i].name);
}
2013-03-12 22:44:00 +00:00
if ( cl . particle_ssprecaches )
{
2014-08-25 07:35:41 +00:00
for ( i = 0 ; i < MAX_SSPARTICLESPRE ; i + + )
2013-03-12 22:44:00 +00:00
{
if ( cl . particle_ssname [ i ] )
2014-03-30 08:55:06 +00:00
cl . particle_ssprecache [ i ] = P_FindParticleType ( cl . particle_ssname [ i ] ) ;
else
cl . particle_ssprecache [ i ] = P_INVALID ;
2013-03-12 22:44:00 +00:00
}
}
if ( cl . particle_csprecaches )
{
2014-08-25 07:35:41 +00:00
for ( i = 0 ; i < MAX_CSPARTICLESPRE ; i + + )
2013-03-12 22:44:00 +00:00
{
if ( cl . particle_csname [ i ] )
2014-03-30 08:55:06 +00:00
cl . particle_csprecache [ i ] = P_FindParticleType ( cl . particle_csname [ i ] ) ;
else
cl . particle_csprecache [ i ] = P_INVALID ;
2013-03-12 22:44:00 +00:00
}
}
2014-10-05 20:04:11 +00:00
# ifdef CSQC_DAT
CSQC_ResetTrails ( ) ;
# endif
2012-01-17 07:57:46 +00:00
}
2004-08-23 00:15:46 +00:00
void CL_ClearCustomTEnts ( void )
{
int i ;
2012-11-29 13:37:48 +00:00
custtentinst_t * p ;
while ( activepcusttents )
{
p = activepcusttents ;
activepcusttents = p - > next ;
Z_Free ( p ) ;
}
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < sizeof ( customtenttype ) / sizeof ( customtenttype [ 0 ] ) ; i + + )
2012-11-29 13:37:48 +00:00
{
* customtenttype [ i ] . name = 0 ;
2004-08-23 00:15:46 +00:00
customtenttype [ i ] . particleeffecttype = - 1 ;
2012-11-29 13:37:48 +00:00
}
2004-08-23 00:15:46 +00:00
}
2013-03-12 22:44:00 +00:00
int CL_TranslateParticleFromServer ( int qceffect )
2012-07-05 19:42:36 +00:00
{
2013-03-12 22:44:00 +00:00
if ( cl . particle_ssprecaches & & qceffect > = 0 & & qceffect < MAX_SSPARTICLESPRE )
2012-07-05 19:42:36 +00:00
{
/*proper precaches*/
2014-03-30 08:55:06 +00:00
return cl . particle_ssprecache [ qceffect ] ;
2012-07-05 19:42:36 +00:00
}
2013-03-12 22:44:00 +00:00
else if ( - qceffect > = 0 & & - qceffect < MAX_CSPARTICLESPRE )
2012-07-05 19:42:36 +00:00
{
2013-03-12 22:44:00 +00:00
qceffect = - qceffect ;
2014-03-30 08:55:06 +00:00
return cl . particle_csprecache [ qceffect ] ;
2012-07-05 19:42:36 +00:00
}
2013-03-12 22:44:00 +00:00
else
2014-04-24 01:53:01 +00:00
return P_INVALID ;
2012-07-05 19:42:36 +00:00
}
void CL_ParseTrailParticles ( void )
2008-11-09 22:29:28 +00:00
{
int entityindex ;
int effectindex ;
vec3_t start , end ;
trailstate_t * * ts ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
entityindex = MSGCL_ReadEntity ( ) ;
2008-11-09 22:29:28 +00:00
effectindex = ( unsigned short ) MSG_ReadShort ( ) ;
start [ 0 ] = MSG_ReadCoord ( ) ;
start [ 1 ] = MSG_ReadCoord ( ) ;
start [ 2 ] = MSG_ReadCoord ( ) ;
end [ 0 ] = MSG_ReadCoord ( ) ;
end [ 1 ] = MSG_ReadCoord ( ) ;
end [ 2 ] = MSG_ReadCoord ( ) ;
2012-07-05 19:42:36 +00:00
effectindex = CL_TranslateParticleFromServer ( effectindex ) ;
2012-01-01 02:26:42 +00:00
2008-11-09 22:29:28 +00:00
if ( entityindex & & ( unsigned int ) entityindex < MAX_EDICTS )
ts = & cl . lerpents [ entityindex ] . trailstate ;
else
ts = NULL ;
2014-10-05 20:04:11 +00:00
if ( P_ParticleTrail ( start , end , effectindex , entityindex , NULL , ts ) )
P_ParticleTrail ( start , end , rt_blood , entityindex , NULL , ts ) ;
2008-11-09 22:29:28 +00:00
}
2012-07-05 19:42:36 +00:00
void CL_ParsePointParticles ( qboolean compact )
2008-11-09 22:29:28 +00:00
{
vec3_t org , dir ;
unsigned int count , effectindex ;
effectindex = ( unsigned short ) MSG_ReadShort ( ) ;
org [ 0 ] = MSG_ReadCoord ( ) ;
org [ 1 ] = MSG_ReadCoord ( ) ;
org [ 2 ] = MSG_ReadCoord ( ) ;
if ( compact )
{
dir [ 0 ] = dir [ 1 ] = dir [ 2 ] = 0 ;
count = 1 ;
}
else
{
dir [ 0 ] = MSG_ReadCoord ( ) ;
dir [ 1 ] = MSG_ReadCoord ( ) ;
dir [ 2 ] = MSG_ReadCoord ( ) ;
count = ( unsigned short ) MSG_ReadShort ( ) ;
}
2012-07-05 19:42:36 +00:00
effectindex = CL_TranslateParticleFromServer ( effectindex ) ;
2012-01-01 02:26:42 +00:00
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( org , dir , count , effectindex ) )
P_RunParticleEffect ( org , dir , 15 , 15 ) ;
}
2005-03-10 03:55:18 +00:00
void CLNQ_ParseParticleEffect ( void )
2004-08-23 00:15:46 +00:00
{
vec3_t org , dir ;
2011-02-27 15:01:56 +00:00
int i , msgcount , color ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 3 ; i + + )
org [ i ] = MSG_ReadCoord ( ) ;
for ( i = 0 ; i < 3 ; i + + )
dir [ i ] = MSG_ReadChar ( ) * ( 1.0 / 16 ) ;
msgcount = MSG_ReadByte ( ) ;
color = MSG_ReadByte ( ) ;
if ( msgcount = = 255 )
2011-02-27 15:01:56 +00:00
{
// treat as spriteless explosion (qtest/some mods require this)
if ( P_RunParticleEffectType ( org , NULL , 1 , pt_explosion ) )
P_RunParticleEffect ( org , NULL , 107 , 1024 ) ; // should be 97-111
}
2004-08-23 00:15:46 +00:00
else
2011-02-27 15:01:56 +00:00
P_RunParticleEffect ( org , dir , color , msgcount ) ;
2004-08-23 00:15:46 +00:00
}
2005-03-10 03:55:18 +00:00
void CL_ParseParticleEffect2 ( void )
2004-08-23 00:15:46 +00:00
{
vec3_t org , dmin , dmax ;
int i , msgcount , color , effect ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 3 ; i + + )
org [ i ] = MSG_ReadCoord ( ) ;
for ( i = 0 ; i < 3 ; i + + )
dmin [ i ] = MSG_ReadFloat ( ) ;
for ( i = 0 ; i < 3 ; i + + )
dmax [ i ] = MSG_ReadFloat ( ) ;
color = MSG_ReadShort ( ) ;
msgcount = MSG_ReadByte ( ) ;
effect = MSG_ReadByte ( ) ;
2005-03-10 03:55:18 +00:00
P_RunParticleEffect2 ( org , dmin , dmax , color , effect , msgcount ) ;
2004-08-23 00:15:46 +00:00
}
2005-03-10 03:55:18 +00:00
void CL_ParseParticleEffect3 ( void )
2004-08-23 00:15:46 +00:00
{
vec3_t org , box ;
int i , msgcount , color , effect ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 3 ; i + + )
org [ i ] = MSG_ReadCoord ( ) ;
for ( i = 0 ; i < 3 ; i + + )
box [ i ] = MSG_ReadByte ( ) ;
color = MSG_ReadShort ( ) ;
msgcount = MSG_ReadByte ( ) ;
effect = MSG_ReadByte ( ) ;
2005-03-10 03:55:18 +00:00
P_RunParticleEffect3 ( org , box , color , effect , msgcount ) ;
2004-08-23 00:15:46 +00:00
}
2005-03-10 03:55:18 +00:00
void CL_ParseParticleEffect4 ( void )
2004-08-23 00:15:46 +00:00
{
vec3_t org ;
int i , msgcount , color , effect ;
float radius ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 3 ; i + + )
org [ i ] = MSG_ReadCoord ( ) ;
radius = MSG_ReadByte ( ) ;
color = MSG_ReadShort ( ) ;
msgcount = MSG_ReadByte ( ) ;
effect = MSG_ReadByte ( ) ;
2005-03-10 03:55:18 +00:00
P_RunParticleEffect4 ( org , radius , color , effect , msgcount ) ;
2004-08-23 00:15:46 +00:00
}
2016-07-12 00:40:13 +00:00
void CL_SpawnSpriteEffect ( vec3_t org , vec3_t dir , vec3_t orientationup , model_t * model , int startframe , int framecount , float framerate , float alpha , float scale , float randspin , float gravity , int traileffect , unsigned int renderflags , int skinnum )
2005-07-01 19:23:00 +00:00
{
explosion_t * ex ;
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( org ) ;
2005-07-01 19:23:00 +00:00
ex - > start = cl . time ;
ex - > model = model ;
ex - > firstframe = startframe ;
ex - > numframes = framecount ;
ex - > framerate = framerate ;
2015-12-12 19:25:15 +00:00
ex - > skinnum = skinnum ;
2014-04-12 03:31:59 +00:00
ex - > traileffect = traileffect ;
2016-07-12 00:40:13 +00:00
ex - > scale = scale ;
2014-04-06 15:16:39 +00:00
2014-05-10 13:42:13 +00:00
ex - > flags | = renderflags ;
2005-07-01 19:23:00 +00:00
2014-04-12 03:31:59 +00:00
//sprites always use a fixed alpha. models can too if the alpha is < 0
if ( model - > type = = mod_sprite | | alpha < 0 )
ex - > endalpha = fabs ( alpha ) ;
ex - > startalpha = fabs ( alpha ) ;
2014-05-10 13:42:13 +00:00
if ( ex - > endalpha < 1 | | ex - > startalpha < 1 )
ex - > flags | = RF_TRANSLUCENT ;
2012-01-17 07:57:46 +00:00
if ( randspin )
{
ex - > angles [ 0 ] = frandom ( ) * 360 ;
ex - > angles [ 1 ] = frandom ( ) * 360 ;
ex - > angles [ 2 ] = frandom ( ) * 360 ;
ex - > avel [ 0 ] = crandom ( ) * randspin ;
ex - > avel [ 1 ] = crandom ( ) * randspin ;
ex - > avel [ 2 ] = crandom ( ) * randspin ;
}
ex - > gravity = gravity ;
2010-08-28 17:14:38 +00:00
2014-05-10 13:42:13 +00:00
if ( orientationup )
{
ex - > angles [ 0 ] = acos ( orientationup [ 2 ] ) / M_PI * 180 ;
if ( orientationup [ 0 ] )
ex - > angles [ 1 ] = atan2 ( orientationup [ 1 ] , orientationup [ 0 ] ) / M_PI * 180 ;
else if ( orientationup [ 1 ] > 0 )
ex - > angles [ 1 ] = 90 ;
else if ( orientationup [ 1 ] < 0 )
ex - > angles [ 1 ] = 270 ;
else
ex - > angles [ 1 ] = 0 ;
ex - > angles [ 0 ] * = - 1 ;
}
2010-08-28 17:14:38 +00:00
if ( dir )
2012-01-17 07:57:46 +00:00
{
2014-05-10 13:42:13 +00:00
// vec3_t spos;
// float dlen;
// dlen = -10/VectorLength(dir);
// VectorMA(ex->origin, dlen, dir, spos);
// TraceLineN(spos, org, ex->origin, NULL);
2010-08-28 17:14:38 +00:00
VectorCopy ( dir , ex - > velocity ) ;
2012-01-17 07:57:46 +00:00
}
2010-08-28 17:14:38 +00:00
else
VectorClear ( ex - > velocity ) ;
2005-07-01 19:23:00 +00:00
}
2004-11-20 00:56:15 +00:00
// [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
// [vector] org [short] modelindex [short] startframe [byte] framecount [byte] framerate
void CL_ParseEffect ( qboolean effect2 )
{
vec3_t org ;
int modelindex ;
int startframe ;
int framecount ;
int framerate ;
2014-04-12 03:31:59 +00:00
model_t * mod ;
2004-11-20 00:56:15 +00:00
org [ 0 ] = MSG_ReadCoord ( ) ;
org [ 1 ] = MSG_ReadCoord ( ) ;
org [ 2 ] = MSG_ReadCoord ( ) ;
if ( effect2 )
modelindex = MSG_ReadShort ( ) ;
else
modelindex = MSG_ReadByte ( ) ;
if ( effect2 )
startframe = MSG_ReadShort ( ) ;
else
startframe = MSG_ReadByte ( ) ;
framecount = MSG_ReadByte ( ) ;
framerate = MSG_ReadByte ( ) ;
2014-04-12 03:31:59 +00:00
mod = cl . model_precache [ modelindex ] ;
2016-07-12 00:40:13 +00:00
CL_SpawnSpriteEffect ( org , NULL , NULL , mod , startframe , framecount , framerate , mod - > type = = mod_sprite ? - 1 : 1 , 1 , 0 , 0 , P_INVALID , 0 , 0 ) ;
2004-11-20 00:56:15 +00:00
}
2004-08-23 00:15:46 +00:00
# ifdef Q2CLIENT
void CL_SmokeAndFlash ( vec3_t origin )
{
explosion_t * ex ;
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( origin ) ;
2005-03-18 06:14:07 +00:00
VectorClear ( ex - > angles ) ;
2004-08-23 00:15:46 +00:00
// ex->type = ex_misc;
2005-03-18 06:14:07 +00:00
ex - > numframes = 4 ;
2014-03-31 17:06:41 +00:00
ex - > flags = RF_TRANSLUCENT ;
2005-03-18 06:14:07 +00:00
ex - > start = cl . time ;
2014-03-30 08:55:06 +00:00
ex - > model = Mod_ForName ( q2tentmodels [ q2cl_mod_smoke ] . modelname , MLV_WARN ) ;
2004-08-23 00:15:46 +00:00
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( origin ) ;
2005-03-18 06:14:07 +00:00
VectorClear ( ex - > angles ) ;
2004-08-23 00:15:46 +00:00
// ex->type = ex_flash;
2005-03-18 06:14:07 +00:00
ex - > flags = Q2RF_FULLBRIGHT ;
ex - > numframes = 2 ;
ex - > start = cl . time ;
2014-03-30 08:55:06 +00:00
ex - > model = Mod_ForName ( q2tentmodels [ q2cl_mod_flash ] . modelname , MLV_WARN ) ;
2004-08-23 00:15:46 +00:00
}
2005-03-18 06:14:07 +00:00
void CL_Laser ( vec3_t start , vec3_t end , int colors )
{
2014-04-12 03:31:59 +00:00
explosion_t * ex = CL_AllocExplosion ( start ) ;
2005-03-18 06:14:07 +00:00
ex - > firstframe = 0 ;
ex - > numframes = 10 ;
2014-04-12 03:31:59 +00:00
ex - > startalpha = 0.33f ;
ex - > endalpha = 0 ;
2010-07-11 02:22:39 +00:00
ex - > model = NULL ;
2005-03-18 06:14:07 +00:00
ex - > skinnum = ( colors > > ( ( rand ( ) % 4 ) * 8 ) ) & 0xff ;
VectorCopy ( start , ex - > origin ) ;
VectorCopy ( end , ex - > oldorigin ) ;
2014-03-31 17:06:41 +00:00
ex - > flags = RF_TRANSLUCENT | Q2RF_BEAM ;
2005-03-18 06:14:07 +00:00
ex - > start = cl . time ;
2005-10-08 22:35:20 +00:00
ex - > framerate = 100 ; // smoother fading
2005-03-18 06:14:07 +00:00
}
2016-01-18 05:22:07 +00:00
void CLQ2_ParseSteam ( void )
{
vec3_t pos , dir ;
2016-02-15 06:01:17 +00:00
/*qbyte colour;
2016-01-18 05:22:07 +00:00
short magnitude ;
2016-02-15 06:01:17 +00:00
unsigned int duration ; */
2016-01-18 05:22:07 +00:00
signed int id = MSG_ReadShort ( ) ;
2016-02-15 06:01:17 +00:00
/*qbyte count =*/ MSG_ReadByte ( ) ;
2016-01-18 05:22:07 +00:00
MSG_ReadPos ( pos ) ;
MSG_ReadPos ( dir ) ;
2016-02-15 06:01:17 +00:00
/*colour =*/ MSG_ReadByte ( ) ;
/*magnitude =*/ MSG_ReadShort ( ) ;
2016-01-18 05:22:07 +00:00
if ( id = = - 1 )
2016-02-15 06:01:17 +00:00
/*duration =*/ MSG_ReadLong ( ) ;
2016-01-18 05:22:07 +00:00
else
2016-02-15 06:01:17 +00:00
/*duration = 0;*/
2016-01-18 05:22:07 +00:00
Con_Printf ( " FIXME: CLQ2_ParseSteam: stub \n " ) ;
}
2015-05-03 19:57:46 +00:00
static struct {
qbyte colour ;
char * name ;
} q2splash_info [ ] =
{
{ 0x00 , " q2part.te_splashunknown " } ,
{ 0xe0 , " q2part.te_splashsparks " } ,
{ 0xb0 , " q2part.te_splashbluewater " } ,
{ 0x50 , " q2part.te_splashbrownwater " } ,
{ 0xd0 , " q2part.te_splashslime " } ,
{ 0xe0 , " q2part.te_splashlava " } ,
{ 0xe8 , " q2part.te_splashblood " }
} ;
2004-08-23 00:15:46 +00:00
# define ATTN_NONE 0
# define ATTN_NORM 1
# define ATTN_STATIC 1
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
void Q2S_StartSound ( vec3_t origin , int entnum , int entchannel , sfx_t * sfx , float fvol , float attenuation , float delay )
2004-08-23 00:15:46 +00:00
{
2016-07-12 00:40:13 +00:00
S_StartSound ( entnum , entchannel , sfx , origin , NULL , fvol , attenuation , - delay , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
}
void CLQ2_ParseTEnt ( void )
{
2015-12-12 19:25:15 +00:00
beam_t * b ;
2004-08-23 00:15:46 +00:00
int type ;
2014-05-16 01:34:58 +00:00
int pt ;
2004-08-23 00:15:46 +00:00
vec3_t pos , pos2 , dir ;
explosion_t * ex ;
int cnt ;
int color ;
int r ;
2014-08-25 07:35:41 +00:00
int ent ;
2004-08-23 00:15:46 +00:00
// int magnitude;
type = MSG_ReadByte ( ) ;
2015-12-12 19:25:15 +00:00
if ( type < = Q2TE_MAX )
{
2014-05-16 01:34:58 +00:00
pt = pt_q2 [ type ] ;
2015-12-12 19:25:15 +00:00
if ( pt = = P_INVALID & & q2efnames [ type ] )
{
Con_Printf ( " Q2TE legacy code: te %i \n " , type ) ;
goto fixme ;
}
}
2014-05-16 01:34:58 +00:00
else
pt = P_INVALID ;
2004-08-23 00:15:46 +00:00
switch ( type )
{
2014-05-16 01:34:58 +00:00
case Q2TE_GUNSHOT : //grey tall thing with smoke+sparks
case Q2TE_BLOOD : //red tall thing
case Q2TE_SPARKS : //orange tall thing (with not many particles)
case Q2TE_BLASTER : //regular blaster
case Q2TE_SHOTGUN : //gunshot with less particles
case Q2TE_SCREEN_SPARKS : //green+grey tall
case Q2TE_SHIELD_SPARKS : //blue+grey tall
case Q2TE_BULLET_SPARKS : //orange+grey tall+smoke
case Q2TE_GREENBLOOD : //yellow...
case Q2TE_BLASTER2 : //green version of te_blaster
case Q2TE_MOREBLOOD : //te_blood*2
case Q2TE_HEATBEAM_SPARKS : //white outwards puffs
case Q2TE_HEATBEAM_STEAM : //orange outwards puffs
case Q2TE_ELECTRIC_SPARKS : //blue tall
case Q2TE_FLECHETTE : //grey version of te_blaster
2014-05-10 13:42:13 +00:00
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
2014-05-16 01:34:58 +00:00
P_RunParticleEffectType ( pos , dir , 1 , pt ) ;
break ;
2015-12-12 19:25:15 +00:00
case Q2TE_BFG_LASER :
MSG_ReadPos ( pos ) ;
MSG_ReadPos ( pos2 ) ;
CL_Laser ( pos , pos2 , 0xd0d1d2d3 ) ;
break ;
2014-05-16 01:34:58 +00:00
case Q2TE_RAILTRAIL : //blue spiral, grey particles
case Q2TE_BUBBLETRAIL : //grey sparse trail, slow riser
2015-12-12 19:25:15 +00:00
// case Q2TE_BFG_LASER: //green laser
2014-05-16 01:34:58 +00:00
case Q2TE_DEBUGTRAIL : //long lived blue trail
case Q2TE_BUBBLETRAIL2 : //grey rising trail
case Q2TE_BLUEHYPERBLASTER : //TE_BLASTER without model+light
2014-05-10 13:42:13 +00:00
MSG_ReadPos ( pos ) ;
2014-05-16 01:34:58 +00:00
MSG_ReadPos ( pos2 ) ;
2014-10-05 20:04:11 +00:00
P_ParticleTrail ( pos , pos2 , pt , 0 , NULL , NULL ) ;
2014-05-16 01:34:58 +00:00
break ;
case Q2TE_EXPLOSION1 : //column
case Q2TE_EXPLOSION2 : //splits
case Q2TE_ROCKET_EXPLOSION : //top blob/column
case Q2TE_GRENADE_EXPLOSION : //indistinguishable from TE_EXPLOSION2
case Q2TE_ROCKET_EXPLOSION_WATER : //rocket but with different sound
case Q2TE_GRENADE_EXPLOSION_WATER : //different sound
case Q2TE_BFG_EXPLOSION : //green light+sprite
case Q2TE_BFG_BIGEXPLOSION : //green+white fast particles
case Q2TE_BOSSTPORT : //splitting+merging+upwards particles.
case Q2TE_PLASMA_EXPLOSION : //looks like rocket explosion to me
case Q2TE_PLAIN_EXPLOSION : //looks like rocket explosion to me
case Q2TE_CHAINFIST_SMOKE : //small smoke
case Q2TE_TRACKER_EXPLOSION : //black light, slow particles
case Q2TE_TELEPORT_EFFECT : //q1-style teleport
case Q2TE_DBALL_GOAL : //q1-style teleport
case Q2TE_NUKEBLAST : //dome expansion (blue/white particles)
case Q2TE_WIDOWSPLASH : //dome (orange+gravity)
case Q2TE_EXPLOSION1_BIG : //buggy model
case Q2TE_EXPLOSION1_NP : //looks like a rocket explosion to me
2014-05-10 13:42:13 +00:00
MSG_ReadPos ( pos ) ;
2014-05-16 01:34:58 +00:00
P_RunParticleEffectType ( pos , NULL , 1 , pt ) ;
2014-05-10 13:42:13 +00:00
break ;
2014-05-16 01:34:58 +00:00
case Q2TE_SPLASH :
cnt = MSG_ReadByte ( ) ;
2014-05-10 13:42:13 +00:00
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
2015-12-12 19:25:15 +00:00
r = MSG_ReadByte ( ) + Q2SPLASH_UNKNOWN ;
if ( r > Q2SPLASH_MAX )
2014-05-16 01:34:58 +00:00
r = Q2SPLASH_UNKNOWN ;
2015-12-12 19:25:15 +00:00
pt = pt_q2 [ r ] ;
2014-05-16 01:34:58 +00:00
P_RunParticleEffectType ( pos , NULL , 1 , pt ) ;
2014-05-10 13:42:13 +00:00
break ;
2014-05-16 01:34:58 +00:00
case Q2TE_PARASITE_ATTACK :
case Q2TE_MEDIC_CABLE_ATTACK :
2015-07-14 14:47:00 +00:00
CL_ParseBeam ( BT_Q2PARASITE ) ;
2014-05-16 01:34:58 +00:00
break ;
case Q2TE_HEATBEAM :
2015-12-12 19:25:15 +00:00
b = CL_ParseBeam ( BT_Q2HEATBEAM ) ; //2, 7, -3
if ( b )
{
b - > bflags | = STREAM_ATTACHED ;
VectorSet ( b - > offset , 2 , 7 , - 3 ) ;
}
break ;
2014-05-16 01:34:58 +00:00
case Q2TE_MONSTER_HEATBEAM :
2015-12-12 19:25:15 +00:00
b = CL_ParseBeam ( BT_Q2HEATBEAM ) ;
if ( b )
b - > bflags | = STREAM_ATTACHED ;
2014-05-16 01:34:58 +00:00
break ;
case Q2TE_GRAPPLE_CABLE :
2015-12-12 19:25:15 +00:00
CL_ParseBeamOffset ( BT_Q2GRAPPLE ) ;
2014-05-10 13:42:13 +00:00
break ;
2014-08-25 07:35:41 +00:00
case Q2TE_LIGHTNING :
ent = MSGCL_ReadEntity ( ) ;
2015-12-12 19:25:15 +00:00
/*toent =*/ MSGCL_ReadEntity ( ) ; //ident only.
2014-08-25 07:35:41 +00:00
pos [ 0 ] = MSG_ReadCoord ( ) ;
pos [ 1 ] = MSG_ReadCoord ( ) ;
pos [ 2 ] = MSG_ReadCoord ( ) ;
pos2 [ 0 ] = MSG_ReadCoord ( ) ;
pos2 [ 1 ] = MSG_ReadCoord ( ) ;
pos2 [ 2 ] = MSG_ReadCoord ( ) ;
2015-12-12 19:25:15 +00:00
CL_AddBeam ( BT_Q2LIGHTNING , ent , pos , pos2 ) ;
2014-08-25 07:35:41 +00:00
break ;
2015-12-12 19:25:15 +00:00
case Q2TE_LASER_SPARKS :
cnt = MSG_ReadByte ( ) ;
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
color = MSG_ReadByte ( ) ;
2015-12-28 17:41:39 +00:00
P_RunParticleEffectPalette ( " q2part.TEQ2_LASER_SPARKS " , pos , dir , color , cnt ) ;
2015-12-12 19:25:15 +00:00
break ;
2014-08-25 07:35:41 +00:00
2014-05-16 01:34:58 +00:00
/*
case Q2TE_LASER_SPARKS :
case Q2TE_WELDING_SPARKS :
case Q2TE_TUNNEL_SPARKS :
break ;
//Q2TE_RAILTRAIL2, ?
//Q2TE_FLAME, ?
case Q2TE_FLASHLIGHT :
break ;
case Q2TE_FORCEWALL :
break ;
case Q2TE_WIDOWBEAMOUT :
break ;
*/
2016-01-18 05:22:07 +00:00
case Q2TE_STEAM :
CLQ2_ParseSteam ( ) ;
break ;
2014-05-16 01:34:58 +00:00
2014-05-10 13:42:13 +00:00
default :
2015-12-12 19:25:15 +00:00
// Con_Printf("CLQ2_ParseTEnt: bad/non-implemented type %i\n", type);
2014-05-10 13:42:13 +00:00
goto fixme ;
// Host_EndGame ("CLQ2_ParseTEnt: bad/non-implemented type %i", type);
// break;
}
return ;
fixme :
2015-12-12 19:25:15 +00:00
Con_DPrintf ( " Q2TE legacy code: te %i \n " , type ) ;
2014-05-10 13:42:13 +00:00
switch ( type )
{
2004-08-23 00:15:46 +00:00
case Q2TE_BLOOD : // bullet hitting flesh
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
2015-12-12 19:25:15 +00:00
if ( P_RunParticleEffectType ( pos , dir , 1 , pt_q2 [ Q2TE_BLOOD ] ) )
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , dir , 1 , ptqw_blood ) )
P_RunParticleEffect ( pos , dir , 0xe8 , 60 ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , 0 , - 10 , - 10 , 40 ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_GUNSHOT : // bullet hitting wall
case Q2TE_SPARKS :
case Q2TE_BULLET_SPARKS :
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
if ( type = = Q2TE_GUNSHOT )
2005-03-10 03:55:18 +00:00
P_RunParticleEffect ( pos , dir , 0 , 40 ) ;
2004-08-23 00:15:46 +00:00
else
2005-03-10 03:55:18 +00:00
P_RunParticleEffect ( pos , dir , 0xe0 , 6 ) ;
2004-08-23 00:15:46 +00:00
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 20 ) ;
2004-08-23 00:15:46 +00:00
if ( type ! = Q2TE_SPARKS )
{
CL_SmokeAndFlash ( pos ) ;
2011-06-25 12:00:59 +00:00
2005-03-15 22:51:01 +00:00
// impact sound (nope, not the same as Q1...)
2004-08-23 00:15:46 +00:00
cnt = rand ( ) & 15 ;
if ( cnt = = 1 )
2005-03-15 22:51:01 +00:00
Q2S_StartSound ( pos , 0 , 0 , S_PrecacheSound ( " world/ric1.wav " ) , 1 , ATTN_NORM , 0 ) ;
2004-08-23 00:15:46 +00:00
else if ( cnt = = 2 )
2005-03-15 22:51:01 +00:00
Q2S_StartSound ( pos , 0 , 0 , S_PrecacheSound ( " world/ric2.wav " ) , 1 , ATTN_NORM , 0 ) ;
2004-08-23 00:15:46 +00:00
else if ( cnt = = 3 )
2005-03-15 22:51:01 +00:00
Q2S_StartSound ( pos , 0 , 0 , S_PrecacheSound ( " world/ric3.wav " ) , 1 , ATTN_NORM , 0 ) ;
2004-08-23 00:15:46 +00:00
}
break ;
case Q2TE_SCREEN_SPARKS :
case Q2TE_SHIELD_SPARKS :
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
if ( type = = Q2TE_SCREEN_SPARKS )
2005-03-10 03:55:18 +00:00
P_RunParticleEffect ( pos , dir , 0xd0 , 40 ) ;
2004-08-23 00:15:46 +00:00
else
2005-03-10 03:55:18 +00:00
P_RunParticleEffect ( pos , dir , 0xb0 , 40 ) ;
2004-08-23 00:15:46 +00:00
//FIXME : replace or remove this sound
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , S_PrecacheSound ( " weapons/lashit.wav " ) , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_SHOTGUN : // bullet hitting wall
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
2005-03-10 03:55:18 +00:00
P_RunParticleEffect ( pos , dir , 0 , 20 ) ;
2005-03-18 06:14:07 +00:00
CL_SmokeAndFlash ( pos ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 10 , - 10 , 20 ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_SPLASH : // bullet hitting water
cnt = MSG_ReadByte ( ) ;
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
r = MSG_ReadByte ( ) ;
2015-05-03 19:57:46 +00:00
if ( r > sizeof ( q2splash_info ) / sizeof ( q2splash_info [ 0 ] ) )
r = 0 ;
2015-12-12 19:25:15 +00:00
if ( P_RunParticleEffectType ( pos , dir , cnt , pt_q2 [ Q2SPLASH_UNKNOWN + r ] ) )
2015-05-03 19:57:46 +00:00
P_RunParticleEffect ( pos , dir , q2splash_info [ r ] . colour , cnt ) ;
2004-08-23 00:15:46 +00:00
if ( r = = Q2SPLASH_SPARKS )
{
r = rand ( ) & 3 ;
2005-03-15 22:51:01 +00:00
if ( r = = 1 )
Q2S_StartSound ( pos , 0 , 0 , S_PrecacheSound ( " world/spark5.wav " ) , 1 , ATTN_NORM , 0 ) ;
else if ( r = = 2 )
Q2S_StartSound ( pos , 0 , 0 , S_PrecacheSound ( " world/spark6.wav " ) , 1 , ATTN_NORM , 0 ) ;
else
Q2S_StartSound ( pos , 0 , 0 , S_PrecacheSound ( " world/spark7.wav " ) , 1 , ATTN_NORM , 0 ) ;
2004-08-23 00:15:46 +00:00
}
break ;
case Q2TE_LASER_SPARKS :
cnt = MSG_ReadByte ( ) ;
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
color = MSG_ReadByte ( ) ;
2005-03-10 03:55:18 +00:00
P_RunParticleEffect ( pos , dir , color , cnt ) ;
2004-08-23 00:15:46 +00:00
break ;
// RAFAEL
case Q2TE_BLUEHYPERBLASTER :
MSG_ReadPos ( pos ) ;
MSG_ReadPos ( dir ) ;
2015-12-12 19:25:15 +00:00
if ( P_RunParticleEffectType ( pos , dir , 1 , pt_q2 [ Q2TE_BLUEHYPERBLASTER ] ) )
if ( P_RunParticleEffectType ( pos , dir , 1 , pt_q2 [ Q2TE_BLASTER ] ) )
P_RunParticleEffect ( pos , dir , 0xe0 , 40 ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_BLASTER : // blaster hitting wall
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
2015-12-12 19:25:15 +00:00
if ( P_RunParticleEffectType ( pos , dir , 1 , pt_q2 [ Q2TE_BLASTER ] ) )
2005-03-15 22:51:01 +00:00
P_RunParticleEffect ( pos , dir , 0xe0 , 40 ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , 0 , - 5 , - 10 , 20 ) ;
2004-08-23 00:15:46 +00:00
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( pos ) ;
2004-08-23 00:15:46 +00:00
ex - > start = cl . time ;
2014-03-30 08:55:06 +00:00
ex - > model = Mod_ForName ( q2tentmodels [ q2cl_mod_explode ] . modelname , MLV_WARN ) ;
2004-08-23 00:15:46 +00:00
ex - > firstframe = 0 ;
ex - > numframes = 4 ;
2014-03-31 17:06:41 +00:00
ex - > flags = Q2RF_FULLBRIGHT | RF_ADDITIVE | RF_NOSHADOW | RF_TRANSLUCENT ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
ex - > angles [ 0 ] = acos ( dir [ 2 ] ) / M_PI * 180 ;
// PMM - fixed to correct for pitch of 0
if ( dir [ 0 ] )
ex - > angles [ 1 ] = atan2 ( dir [ 1 ] , dir [ 0 ] ) / M_PI * 180 ;
else if ( dir [ 1 ] > 0 )
ex - > angles [ 1 ] = 90 ;
else if ( dir [ 1 ] < 0 )
ex - > angles [ 1 ] = 270 ;
else
ex - > angles [ 1 ] = 0 ;
ex - > angles [ 0 ] * = - 1 ;
2005-03-15 22:51:01 +00:00
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , S_PrecacheSound ( " weapons/lashit.wav " ) , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-09-04 05:48:26 +00:00
// light
if ( r_explosionlight . value )
{
dlight_t * dl ;
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
2006-04-21 05:23:51 +00:00
dl - > radius = 150 * r_explosionlight . value ;
2005-09-04 05:48:26 +00:00
dl - > die = cl . time + 0.4 ;
dl - > decay = 400 ;
2011-12-27 08:35:19 +00:00
dl - > color [ 0 ] = 1 ;
dl - > color [ 1 ] = 1 ;
2005-09-04 05:48:26 +00:00
dl - > color [ 2 ] = 0.0 ;
dl - > channelfade [ 0 ] = 0.5 ;
dl - > channelfade [ 1 ] = 0.51 ;
dl - > channelfade [ 2 ] = 0.0 ;
}
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_RAILTRAIL : // railgun effect
MSG_ReadPos ( pos ) ;
MSG_ReadPos ( pos2 ) ;
2015-12-12 19:25:15 +00:00
if ( P_ParticleTrail ( pos , pos2 , pt_q2 [ Q2TE_RAILTRAIL ] , 0 , NULL , NULL ) )
2005-10-08 22:35:20 +00:00
P_ParticleTrailIndex ( pos , pos2 , 0x74 , 8 , NULL ) ;
2005-03-15 22:51:01 +00:00
Q2S_StartSound ( pos , 0 , 0 , S_PrecacheSound ( " weapons/railgf1a.wav " ) , 1 , ATTN_NORM , 0 ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_EXPLOSION2 :
case Q2TE_GRENADE_EXPLOSION :
case Q2TE_GRENADE_EXPLOSION_WATER :
MSG_ReadPos ( pos ) ;
2005-10-08 22:35:20 +00:00
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_explosion ) )
P_RunParticleEffect ( pos , NULL , 0xe0 , 256 ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 1 , - 1 , - 1 , 100 ) ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
// light
2005-08-26 22:56:51 +00:00
if ( r_explosionlight . value )
{
2004-08-23 00:15:46 +00:00
dlight_t * dl ;
2005-07-20 08:04:46 +00:00
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
2006-04-21 05:23:51 +00:00
dl - > radius = 150 + r_explosionlight . value * 200 ;
2005-07-20 08:04:46 +00:00
dl - > die = cl . time + 0.5 ;
dl - > decay = 300 ;
2011-12-27 08:35:19 +00:00
dl - > color [ 0 ] = 1.0 ;
dl - > color [ 1 ] = 0.5 ;
dl - > color [ 2 ] = 0.5 ;
2005-09-04 05:48:26 +00:00
dl - > channelfade [ 0 ] = 0.36 ;
dl - > channelfade [ 1 ] = 0.19 ;
dl - > channelfade [ 2 ] = 0.19 ;
2004-08-23 00:15:46 +00:00
}
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
// sound
2005-03-15 22:51:01 +00:00
if ( type = = Q2TE_GRENADE_EXPLOSION_WATER )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , S_PrecacheSound ( " weapons/xpld_wat.wav " ) , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-03-15 22:51:01 +00:00
else
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , S_PrecacheSound ( " weapons/grenlx1a.wav " ) , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
// sprite
2011-06-25 12:00:59 +00:00
2011-04-23 20:37:20 +00:00
// if (!R_ParticleExplosionHeart(pos))
2004-08-23 00:15:46 +00:00
{
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( pos ) ;
2004-08-23 00:15:46 +00:00
VectorClear ( ex - > angles ) ;
ex - > start = cl . time ;
2014-03-30 08:55:06 +00:00
ex - > model = Mod_ForName ( q2tentmodels [ q2cl_mod_explo4 ] . modelname , MLV_WARN ) ;
2004-08-23 00:15:46 +00:00
ex - > firstframe = 30 ;
2014-03-31 17:06:41 +00:00
ex - > flags | = RF_TRANSLUCENT ;
2004-08-23 00:15:46 +00:00
ex - > numframes = 19 ;
2014-05-16 01:34:58 +00:00
ex - > skinnum = - 1 ;
2004-08-23 00:15:46 +00:00
}
break ;
/*
ex = CL_AllocExplosion ( ) ;
VectorCopy ( pos , ex - > ent . origin ) ;
ex - > type = ex_poly ;
ex - > ent . flags = RF_FULLBRIGHT ;
ex - > start = cl . frame . servertime - 100 ;
ex - > light = 350 ;
ex - > lightcolor [ 0 ] = 1.0 ;
ex - > lightcolor [ 1 ] = 0.5 ;
ex - > lightcolor [ 2 ] = 0.5 ;
ex - > ent . model = cl_mod_explo4 ;
ex - > frames = 19 ;
ex - > baseframe = 30 ;
ex - > ent . angles [ 1 ] = rand ( ) % 360 ;
CL_ExplosionParticles ( pos ) ;
if ( type = = TE_GRENADE_EXPLOSION_WATER )
Q2S_StartSound ( pos , 0 , 0 , cl_sfx_watrexp , 1 , ATTN_NORM , 0 ) ;
else
Q2S_StartSound ( pos , 0 , 0 , cl_sfx_grenexp , 1 , ATTN_NORM , 0 ) ;
break ;
*/
// RAFAEL
case Q2TE_PLASMA_EXPLOSION :
MSG_ReadPos ( pos ) ;
/* ex = CL_AllocExplosion ();
VectorCopy ( pos , ex - > ent . origin ) ;
ex - > type = ex_poly ;
ex - > ent . flags = RF_FULLBRIGHT ;
ex - > start = cl . frame . servertime - 100 ;
ex - > light = 350 ;
2011-06-25 12:00:59 +00:00
ex - > lightcolor [ 0 ] = 1.0 ;
2004-08-23 00:15:46 +00:00
ex - > lightcolor [ 1 ] = 0.5 ;
ex - > lightcolor [ 2 ] = 0.5 ;
ex - > ent . angles [ 1 ] = rand ( ) % 360 ;
ex - > ent . model = cl_mod_explo4 ;
if ( frand ( ) < 0.5 )
ex - > baseframe = 15 ;
ex - > frames = 15 ;
CL_ExplosionParticles ( pos ) ;
Q2S_StartSound ( pos , 0 , 0 , cl_sfx_rockexp , 1 , ATTN_NORM , 0 ) ;
*/ break ;
case Q2TE_EXPLOSION1 :
case Q2TE_EXPLOSION1_BIG : // PMM
case Q2TE_ROCKET_EXPLOSION :
case Q2TE_ROCKET_EXPLOSION_WATER :
case Q2TE_EXPLOSION1_NP : // PMM
MSG_ReadPos ( pos ) ;
2005-03-15 22:51:01 +00:00
// particle effect
if ( type ! = Q2TE_EXPLOSION1_BIG & & type ! = Q2TE_EXPLOSION1_NP )
2005-10-08 22:35:20 +00:00
{
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_explosion ) )
P_RunParticleEffect ( pos , NULL , 0xe0 , 256 ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 1 , - 1 , - 1 , 100 ) ;
2005-10-08 22:35:20 +00:00
}
2004-08-23 00:15:46 +00:00
// light
2005-08-26 22:56:51 +00:00
if ( r_explosionlight . value )
{
2004-08-23 00:15:46 +00:00
dlight_t * dl ;
2005-07-20 08:04:46 +00:00
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
2006-04-21 05:23:51 +00:00
dl - > radius = 150 + r_explosionlight . value * 200 ;
2005-07-20 08:04:46 +00:00
dl - > die = cl . time + 0.5 ;
dl - > decay = 300 ;
2011-12-27 08:35:19 +00:00
dl - > color [ 0 ] = 1.0 ;
dl - > color [ 1 ] = 0.5 ;
dl - > color [ 2 ] = 0.4 ;
2005-09-04 05:48:26 +00:00
dl - > channelfade [ 0 ] = 0.36 ;
dl - > channelfade [ 1 ] = 0.19 ;
dl - > channelfade [ 2 ] = 0.19 ;
2004-08-23 00:15:46 +00:00
}
// sound
2005-03-15 22:51:01 +00:00
if ( type = = Q2TE_ROCKET_EXPLOSION_WATER )
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , S_PrecacheSound ( " weapons/xpld_wat.wav " ) , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-03-15 22:51:01 +00:00
else
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , S_PrecacheSound ( " weapons/rocklx1a.wav " ) , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
2011-06-25 12:00:59 +00:00
// sprite
2011-04-23 20:37:20 +00:00
// if (!R_ParticleExplosionHeart(pos))
2004-08-23 00:15:46 +00:00
{
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( pos ) ;
2004-08-23 00:15:46 +00:00
VectorClear ( ex - > angles ) ;
ex - > start = cl . time ;
2014-03-30 08:55:06 +00:00
ex - > model = Mod_ForName ( q2tentmodels [ q2cl_mod_explo4 ] . modelname , MLV_WARN ) ;
2014-03-31 17:06:41 +00:00
ex - > flags | = RF_TRANSLUCENT ;
2004-08-23 00:15:46 +00:00
if ( rand ( ) & 1 )
ex - > firstframe = 15 ;
else
ex - > firstframe = 0 ;
ex - > numframes = 15 ;
2014-05-16 01:34:58 +00:00
ex - > skinnum = - 1 ;
2011-04-23 20:37:20 +00:00
}
2004-08-23 00:15:46 +00:00
break ;
/*
ex = CL_AllocExplosion ( ) ;
VectorCopy ( pos , ex - > ent . origin ) ;
ex - > type = ex_poly ;
ex - > ent . flags = RF_FULLBRIGHT ;
ex - > start = cl . frame . servertime - 100 ;
ex - > light = 350 ;
ex - > lightcolor [ 0 ] = 1.0 ;
ex - > lightcolor [ 1 ] = 0.5 ;
ex - > lightcolor [ 2 ] = 0.5 ;
ex - > ent . angles [ 1 ] = rand ( ) % 360 ;
if ( type ! = TE_EXPLOSION1_BIG ) // PMM
ex - > ent . model = cl_mod_explo4 ; // PMM
else
ex - > ent . model = cl_mod_explo4_big ;
if ( frand ( ) < 0.5 )
ex - > baseframe = 15 ;
ex - > frames = 15 ;
if ( ( type ! = TE_EXPLOSION1_BIG ) & & ( type ! = TE_EXPLOSION1_NP ) ) // PMM
CL_ExplosionParticles ( pos ) ; // PMM
if ( type = = TE_ROCKET_EXPLOSION_WATER )
Q2S_StartSound ( pos , 0 , 0 , cl_sfx_watrexp , 1 , ATTN_NORM , 0 ) ;
else
Q2S_StartSound ( pos , 0 , 0 , cl_sfx_rockexp , 1 , ATTN_NORM , 0 ) ;
break ;
*/ case Q2TE_BFG_EXPLOSION :
MSG_ReadPos ( pos ) ;
/* ex = CL_AllocExplosion ();
VectorCopy ( pos , ex - > ent . origin ) ;
ex - > type = ex_poly ;
ex - > flags = RF_FULLBRIGHT ;
ex - > start = cl . q2frame . servertime - 100 ;
ex - > light = 350 ;
ex - > lightcolor [ 0 ] = 0.0 ;
ex - > lightcolor [ 1 ] = 1.0 ;
ex - > lightcolor [ 2 ] = 0.0 ;
ex - > model = cl_mod_bfg_explo ;
ex - > flags | = RF_TRANSLUCENT ;
ex - > alpha = 0.30 ;
ex - > frames = 4 ;
*/ break ;
case Q2TE_BFG_BIGEXPLOSION :
MSG_ReadPos ( pos ) ;
// CL_BFGExplosionParticles (pos);
2005-10-08 22:35:20 +00:00
if ( P_RunParticleEffectTypeString ( pos , dir , 1 , " te_bfg_bigexplosion " ) )
P_RunParticleEffect ( pos , dir , 0xd0 , 256 ) ; // TODO: x+(r%8) unstead of x&7+(r&7)
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_BFG_LASER :
MSG_ReadPos ( pos ) ;
MSG_ReadPos ( pos2 ) ;
2005-03-18 06:14:07 +00:00
CL_Laser ( pos , pos2 , 0xd0d1d2d3 ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_BUBBLETRAIL :
MSG_ReadPos ( pos ) ;
MSG_ReadPos ( pos2 ) ;
2015-12-12 19:25:15 +00:00
if ( P_ParticleTrail ( pos , pos2 , pt_q2 [ Q2TE_BUBBLETRAIL ] , 0 , NULL , NULL ) )
2005-10-08 22:35:20 +00:00
P_ParticleTrailIndex ( pos , pos2 , 4 , 8 , NULL ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_PARASITE_ATTACK :
case Q2TE_MEDIC_CABLE_ATTACK :
2015-12-12 19:25:15 +00:00
CL_ParseBeam ( BT_Q2PARASITE ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_BOSSTPORT : // boss teleporting to station
MSG_ReadPos ( pos ) ;
/* CL_BigTeleportParticles (pos);
*/ Q2S_StartSound ( pos , 0 , 0 , S_PrecacheSound ( " misc/bigtele.wav " ) , 1 , ATTN_NONE , 0 ) ;
break ;
case Q2TE_GRAPPLE_CABLE :
2015-12-12 19:25:15 +00:00
CL_ParseBeam ( BT_Q2GRAPPLE ) ;
2004-08-23 00:15:46 +00:00
MSG_ReadPos ( pos ) ;
break ;
// RAFAEL
case Q2TE_WELDING_SPARKS :
cnt = MSG_ReadByte ( ) ;
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
color = MSG_ReadByte ( ) ;
2005-10-08 22:35:20 +00:00
// TODO: fix to Q2's standards
P_RunParticleEffect ( pos , dir , color , cnt ) ;
2004-08-23 00:15:46 +00:00
/* CL_ParticleEffect2 (pos, dir, color, cnt);
ex = CL_AllocExplosion ( ) ;
VectorCopy ( pos , ex - > ent . origin ) ;
ex - > type = ex_flash ;
// note to self
// we need a better no draw flag
ex - > ent . flags = RF_BEAM ;
ex - > start = cl . frame . servertime - 0.1 ;
ex - > light = 100 + ( rand ( ) % 75 ) ;
ex - > lightcolor [ 0 ] = 1.0 ;
ex - > lightcolor [ 1 ] = 1.0 ;
ex - > lightcolor [ 2 ] = 0.3 ;
ex - > ent . model = cl_mod_flash ;
ex - > frames = 2 ;
*/ break ;
case Q2TE_GREENBLOOD :
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
2005-10-08 22:35:20 +00:00
if ( P_RunParticleEffectTypeString ( pos , dir , 1 , " te_greenblood " ) )
P_RunParticleEffect ( pos , dir , 0xdf , 30 ) ; // TODO: x+(r%8) unstead of x&7+(r&7)
2004-08-23 00:15:46 +00:00
// CL_ParticleEffect2 (pos, dir, 0xdf, 30);
break ;
// RAFAEL
case Q2TE_TUNNEL_SPARKS :
cnt = MSG_ReadByte ( ) ;
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
color = MSG_ReadByte ( ) ;
// CL_ParticleEffect3 (pos, dir, color, cnt);
break ;
//=============
//PGM
// PMM -following code integrated for flechette (different color)
case Q2TE_BLASTER2 : // green blaster hitting wall
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
2005-09-04 05:48:26 +00:00
2015-12-12 19:25:15 +00:00
if ( P_RunParticleEffectType ( pos , dir , 1 , pt_q2 [ Q2TE_BLASTER2 ] ) )
if ( P_RunParticleEffectType ( pos , dir , 1 , pt_q2 [ Q2TE_BLASTER ] ) )
2005-09-04 05:48:26 +00:00
P_RunParticleEffect ( pos , dir , 0xd0 , 40 ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , 0 , - 10 , 20 ) ;
2005-09-04 05:48:26 +00:00
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( pos ) ;
2005-09-04 05:48:26 +00:00
ex - > start = cl . time ;
2014-03-30 08:55:06 +00:00
ex - > model = Mod_ForName ( q2tentmodels [ q2cl_mod_explode ] . modelname , MLV_WARN ) ;
2005-09-04 05:48:26 +00:00
ex - > firstframe = 0 ;
ex - > numframes = 4 ;
2010-07-11 02:22:39 +00:00
ex - > flags = Q2RF_FULLBRIGHT | RF_NOSHADOW ;
2011-06-25 12:00:59 +00:00
2005-09-04 05:48:26 +00:00
ex - > angles [ 0 ] = acos ( dir [ 2 ] ) / M_PI * 180 ;
// PMM - fixed to correct for pitch of 0
if ( dir [ 0 ] )
ex - > angles [ 1 ] = atan2 ( dir [ 1 ] , dir [ 0 ] ) / M_PI * 180 ;
else if ( dir [ 1 ] > 0 )
ex - > angles [ 1 ] = 90 ;
else if ( dir [ 1 ] < 0 )
ex - > angles [ 1 ] = 270 ;
2004-08-23 00:15:46 +00:00
else
2005-09-04 05:48:26 +00:00
ex - > angles [ 1 ] = 0 ;
ex - > angles [ 0 ] * = - 1 ;
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , S_PrecacheSound ( " weapons/lashit.wav " ) , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2005-09-04 05:48:26 +00:00
// light
if ( r_explosionlight . value )
{
dlight_t * dl ;
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
2006-04-21 05:23:51 +00:00
dl - > radius = 150 * r_explosionlight . value ;
2005-09-04 05:48:26 +00:00
dl - > die = cl . time + 0.4 ;
dl - > decay = 400 ;
2011-12-27 08:35:19 +00:00
dl - > color [ 0 ] = 0.05 ;
dl - > color [ 1 ] = 1.0 ;
dl - > color [ 2 ] = 0.05 ;
2005-09-04 05:48:26 +00:00
dl - > channelfade [ 0 ] = 0.1 ;
dl - > channelfade [ 1 ] = 0.5 ;
dl - > channelfade [ 2 ] = 0.1 ;
}
break ;
case Q2TE_FLECHETTE : // blue blaster effect
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
2015-12-12 19:25:15 +00:00
if ( P_RunParticleEffectType ( pos , dir , 1 , pt_q2 [ Q2TE_FLECHETTE ] ) )
if ( P_RunParticleEffectType ( pos , dir , 1 , pt_q2 [ Q2TE_BLASTER ] ) )
2005-09-04 05:48:26 +00:00
P_RunParticleEffect ( pos , dir , 0x6f , 40 ) ;
2013-07-14 12:22:51 +00:00
if ( cl_legacystains . ival ) Surf_AddStain ( pos , - 10 , - 2 , 0 , 20 ) ;
2004-08-23 00:15:46 +00:00
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( pos ) ;
2005-09-04 05:48:26 +00:00
ex - > start = cl . time ;
2014-03-30 08:55:06 +00:00
ex - > model = Mod_ForName ( q2tentmodels [ q2cl_mod_explode ] . modelname , MLV_WARN ) ;
2005-09-04 05:48:26 +00:00
ex - > firstframe = 0 ;
ex - > numframes = 4 ;
2010-07-11 02:22:39 +00:00
ex - > flags = Q2RF_FULLBRIGHT | RF_NOSHADOW ;
2011-06-25 12:00:59 +00:00
2005-09-04 05:48:26 +00:00
ex - > angles [ 0 ] = acos ( dir [ 2 ] ) / M_PI * 180 ;
2004-08-23 00:15:46 +00:00
// PMM - fixed to correct for pitch of 0
if ( dir [ 0 ] )
2005-09-04 05:48:26 +00:00
ex - > angles [ 1 ] = atan2 ( dir [ 1 ] , dir [ 0 ] ) / M_PI * 180 ;
2004-08-23 00:15:46 +00:00
else if ( dir [ 1 ] > 0 )
2005-09-04 05:48:26 +00:00
ex - > angles [ 1 ] = 90 ;
2004-08-23 00:15:46 +00:00
else if ( dir [ 1 ] < 0 )
2005-09-04 05:48:26 +00:00
ex - > angles [ 1 ] = 270 ;
2004-08-23 00:15:46 +00:00
else
2005-09-04 05:48:26 +00:00
ex - > angles [ 1 ] = 0 ;
ex - > angles [ 0 ] * = - 1 ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
S_StartSound ( 0 , 0 , S_PrecacheSound ( " weapons/lashit.wav " ) , pos , NULL , 1 , 1 , 0 , 0 , 0 ) ;
2004-08-23 00:15:46 +00:00
2005-09-04 05:48:26 +00:00
// light
if ( r_explosionlight . value )
2004-08-23 00:15:46 +00:00
{
2005-09-04 05:48:26 +00:00
dlight_t * dl ;
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
2006-04-21 05:23:51 +00:00
dl - > radius = 150 * r_explosionlight . value ;
2005-09-04 05:48:26 +00:00
dl - > die = cl . time + 0.4 ;
dl - > decay = 400 ;
2011-12-27 08:35:19 +00:00
dl - > color [ 0 ] = 0.19 ;
dl - > color [ 1 ] = 0.41 ;
dl - > color [ 2 ] = 0.75 ;
2005-09-04 05:48:26 +00:00
dl - > channelfade [ 0 ] = 0.085 ;
dl - > channelfade [ 1 ] = 0.180 ;
dl - > channelfade [ 2 ] = 0.300 ;
2004-08-23 00:15:46 +00:00
}
2005-09-04 05:48:26 +00:00
break ;
2004-08-23 00:15:46 +00:00
2006-02-22 23:42:00 +00:00
2004-08-23 00:15:46 +00:00
case Q2TE_LIGHTNING :
2015-12-12 19:25:15 +00:00
CL_ParseBeam ( BT_Q1LIGHTNING1 ) ;
2006-02-22 23:42:00 +00:00
Q2S_StartSound ( pos , 0 , 0 , S_PrecacheSound ( " weapons/tesla.wav " ) , 1 , ATTN_NORM , 0 ) ;
2004-08-23 00:15:46 +00:00
break ;
2006-02-22 23:42:00 +00:00
2004-08-23 00:15:46 +00:00
case Q2TE_DEBUGTRAIL :
2005-03-28 00:11:59 +00:00
MSG_ReadPos ( pos ) ;
MSG_ReadPos ( pos2 ) ;
2014-10-05 20:04:11 +00:00
if ( P_ParticleTrail ( pos , pos2 , P_FindParticleType ( " te_debugtrail " ) , 0 , NULL , NULL ) )
2005-10-08 22:35:20 +00:00
P_ParticleTrailIndex ( pos , pos2 , 116 , 8 , NULL ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_PLAIN_EXPLOSION :
2005-03-28 00:11:59 +00:00
MSG_ReadPos ( pos ) ;
2004-08-23 00:15:46 +00:00
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( pos ) ;
2005-03-28 00:11:59 +00:00
// ex->type = ex_poly;
2010-07-11 02:22:39 +00:00
ex - > flags = Q2RF_FULLBRIGHT | RF_NOSHADOW ;
2005-03-28 00:11:59 +00:00
ex - > angles [ 1 ] = rand ( ) % 360 ;
2014-03-30 08:55:06 +00:00
ex - > model = Mod_ForName ( q2tentmodels [ q2cl_mod_explo4 ] . modelname , MLV_WARN ) ;
2005-03-28 00:11:59 +00:00
if ( rand ( ) < RAND_MAX / 2 )
ex - > firstframe = 15 ;
ex - > numframes = 15 ;
Q2S_StartSound ( pos , 0 , 0 , S_PrecacheSound ( " weapons/rocklx1a.wav " ) , 1 , ATTN_NORM , 0 ) ;
2005-09-04 05:48:26 +00:00
// light
if ( r_explosionlight . value )
{
dlight_t * dl ;
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
2006-04-21 05:23:51 +00:00
dl - > radius = 150 + r_explosionlight . value * 200 ;
2005-09-04 05:48:26 +00:00
dl - > die = cl . time + 0.5 ;
dl - > decay = 300 ;
2011-12-27 08:35:19 +00:00
dl - > color [ 0 ] = 1.0 ;
dl - > color [ 1 ] = 0.5 ;
dl - > color [ 2 ] = 0.4 ;
2005-09-04 05:48:26 +00:00
dl - > channelfade [ 0 ] = 0.36 ;
dl - > channelfade [ 1 ] = 0.19 ;
dl - > channelfade [ 2 ] = 0.19 ;
}
2004-08-23 00:15:46 +00:00
break ;
2005-03-28 00:11:59 +00:00
/*
2004-08-23 00:15:46 +00:00
case Q2TE_FLASHLIGHT :
MSG_ReadPos ( & net_message , pos ) ;
ent = MSG_ReadShort ( & net_message ) ;
CL_Flashlight ( ent , pos ) ;
break ;
case Q2TE_FORCEWALL :
MSG_ReadPos ( & net_message , pos ) ;
MSG_ReadPos ( & net_message , pos2 ) ;
color = MSG_ReadByte ( & net_message ) ;
CL_ForceWall ( pos , pos2 , color ) ;
break ;
2006-02-22 23:42:00 +00:00
*/
2004-08-23 00:15:46 +00:00
case Q2TE_HEATBEAM :
2006-02-22 23:42:00 +00:00
MSG_ReadPos ( pos ) ;
MSG_ReadPos ( pos2 ) ;
// ent = CL_ParsePlayerBeam (cl_mod_heatbeam);
2004-08-23 00:15:46 +00:00
break ;
2006-02-22 23:42:00 +00:00
/*
2004-08-23 00:15:46 +00:00
case Q2TE_MONSTER_HEATBEAM :
ent = CL_ParsePlayerBeam ( cl_mod_monster_heatbeam ) ;
break ;
case Q2TE_HEATBEAM_SPARKS :
// cnt = MSG_ReadByte (&net_message);
cnt = 50 ;
MSG_ReadPos ( & net_message , pos ) ;
MSG_ReadDir ( & net_message , dir ) ;
// r = MSG_ReadByte (&net_message);
// magnitude = MSG_ReadShort (&net_message);
r = 8 ;
magnitude = 60 ;
color = r & 0xff ;
CL_ParticleSteamEffect ( pos , dir , color , cnt , magnitude ) ;
S_StartSound ( pos , 0 , 0 , cl_sfx_lashit , 1 , ATTN_NORM , 0 ) ;
break ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
case Q2TE_HEATBEAM_STEAM :
// cnt = MSG_ReadByte (&net_message);
cnt = 20 ;
MSG_ReadPos ( & net_message , pos ) ;
MSG_ReadDir ( & net_message , dir ) ;
// r = MSG_ReadByte (&net_message);
// magnitude = MSG_ReadShort (&net_message);
// color = r & 0xff;
color = 0xe0 ;
magnitude = 60 ;
CL_ParticleSteamEffect ( pos , dir , color , cnt , magnitude ) ;
S_StartSound ( pos , 0 , 0 , cl_sfx_lashit , 1 , ATTN_NORM , 0 ) ;
break ;
case Q2TE_STEAM :
CL_ParseSteam ( ) ;
break ;
case Q2TE_BUBBLETRAIL2 :
// cnt = MSG_ReadByte (&net_message);
cnt = 8 ;
MSG_ReadPos ( & net_message , pos ) ;
MSG_ReadPos ( & net_message , pos2 ) ;
CL_BubbleTrail2 ( pos , pos2 , cnt ) ;
S_StartSound ( pos , 0 , 0 , cl_sfx_lashit , 1 , ATTN_NORM , 0 ) ;
break ;
2005-10-08 22:35:20 +00:00
*/
2004-08-23 00:15:46 +00:00
case Q2TE_MOREBLOOD :
2005-10-08 22:35:20 +00:00
MSG_ReadPos ( pos ) ;
MSG_ReadDir ( dir ) ;
if ( P_RunParticleEffectTypeString ( pos , dir , 1 , " te_moreblood " ) )
2008-11-09 22:29:28 +00:00
if ( P_RunParticleEffectType ( pos , dir , 4 , ptqw_blood ) )
2005-10-08 22:35:20 +00:00
P_RunParticleEffect ( pos , dir , 0xe8 , 250 ) ;
2004-08-23 00:15:46 +00:00
break ;
2005-10-08 22:35:20 +00:00
/*
2004-08-23 00:15:46 +00:00
case Q2TE_CHAINFIST_SMOKE :
dir [ 0 ] = 0 ; dir [ 1 ] = 0 ; dir [ 2 ] = 1 ;
MSG_ReadPos ( & net_message , pos ) ;
CL_ParticleSmokeEffect ( pos , dir , 0 , 20 , 20 ) ;
break ;
case Q2TE_ELECTRIC_SPARKS :
MSG_ReadPos ( & net_message , pos ) ;
MSG_ReadDir ( & net_message , dir ) ;
// CL_ParticleEffect (pos, dir, 109, 40);
CL_ParticleEffect ( pos , dir , 0x75 , 40 ) ;
//FIXME : replace or remove this sound
S_StartSound ( pos , 0 , 0 , cl_sfx_lashit , 1 , ATTN_NORM , 0 ) ;
break ;
2005-09-04 05:48:26 +00:00
*/
2004-08-23 00:15:46 +00:00
case Q2TE_TRACKER_EXPLOSION :
2005-09-04 05:48:26 +00:00
MSG_ReadPos ( pos ) ;
// effect
2005-10-08 22:35:20 +00:00
if ( P_RunParticleEffectTypeString ( pos , NULL , 1 , " te_tracker_explosion " ) )
P_RunParticleEffect ( pos , NULL , 0 , 128 ) ; // TODO: needs to be nonrandom instead of 0+r%8
2005-09-04 05:48:26 +00:00
// light
// light
if ( r_explosionlight . value )
{
dlight_t * dl ;
dl = CL_AllocDlight ( 0 ) ;
VectorCopy ( pos , dl - > origin ) ;
2006-04-21 05:23:51 +00:00
dl - > radius = 150 * r_explosionlight . value ;
2005-09-04 05:48:26 +00:00
dl - > die = cl . time + 0.1 ;
dl - > minlight = 250 ;
2011-12-27 08:35:19 +00:00
dl - > color [ 0 ] = - 1.0 ;
dl - > color [ 1 ] = - 1.0 ;
dl - > color [ 2 ] = - 1.0 ;
2005-09-04 05:48:26 +00:00
}
// sound
Q2S_StartSound ( pos , 0 , 0 , S_PrecacheSound ( " weapons/disrupthit.wav " ) , 1 , ATTN_NORM , 0 ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_TELEPORT_EFFECT :
case Q2TE_DBALL_GOAL :
2005-03-15 22:51:01 +00:00
MSG_ReadPos ( pos ) ;
if ( P_RunParticleEffectType ( pos , NULL , 1 , pt_teleportsplash ) )
2005-05-18 23:15:58 +00:00
P_RunParticleEffect ( pos , NULL , 8 , 768 ) ;
2005-03-15 22:51:01 +00:00
// This effect won't match ---
// Color should be 7+(rand()%8)
2005-05-18 23:15:58 +00:00
// not 8&~7+(rand()%8)
2004-08-23 00:15:46 +00:00
break ;
2006-04-08 06:43:42 +00:00
2004-08-23 00:15:46 +00:00
case Q2TE_WIDOWBEAMOUT :
2006-04-08 06:43:42 +00:00
// this one is really annoying, it's supposed to be a random choice
// between 2*8, 13*8, 21*8, 18*8, and it respreads every frame
// into a circle but it could be faked well enough, well except for
// the fact that these effects have ids associated with them
// sort of how beams have ents associated
2006-04-16 03:55:55 +00:00
MSG_ReadShort ( ) ; // id
2006-04-08 06:43:42 +00:00
if ( P_RunParticleEffectTypeString ( pos , NULL , 1 , " te_widowbeamout " ) )
2011-06-25 12:00:59 +00:00
P_RunParticleEffect ( pos , NULL , 13 * 8 , 300 ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_NUKEBLAST :
2006-04-08 06:43:42 +00:00
// same problem as te_widowbeamout, but colors are a bit easier to manage
// and there's no id to read in
MSG_ReadPos ( pos ) ;
if ( P_RunParticleEffectTypeString ( pos , NULL , 1 , " te_nukeblast " ) )
2011-06-25 12:00:59 +00:00
P_RunParticleEffect ( pos , NULL , 110 , 700 ) ;
2004-08-23 00:15:46 +00:00
break ;
case Q2TE_WIDOWSPLASH :
2006-04-08 06:43:42 +00:00
// there's the color issue like with te_widowbeamout, but the particles
// are spawned in an immediate circle and not substained, so it's much
// easier to manage
2005-10-08 22:35:20 +00:00
MSG_ReadPos ( pos ) ;
if ( P_RunParticleEffectTypeString ( pos , NULL , 1 , " te_widowsplash " ) )
2011-06-25 12:00:59 +00:00
P_RunParticleEffect ( pos , NULL , 13 * 8 , 256 ) ;
2004-08-23 00:15:46 +00:00
break ;
//PGM
//==============
2005-10-08 22:35:20 +00:00
2006-02-22 23:42:00 +00:00
case CRTE_LEADERBLASTER :
Host_EndGame ( " CLQ2_ParseTEnt: bad/non-implemented type %i " , type ) ;
case CRTE_BLASTER_MUZZLEFLASH :
MSG_ReadPos ( pos ) ;
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( pos ) ;
2010-07-11 02:22:39 +00:00
ex - > flags = Q2RF_FULLBRIGHT | RF_NOSHADOW ;
2006-02-22 23:42:00 +00:00
ex - > start = cl . q2frame . servertime - 100 ;
2015-10-11 11:34:58 +00:00
CL_NewDlight ( 0 , pos , 350 , 0.5 , 0.2 * 5 , 0.1 * 5 , 0 * 5 ) ;
2006-02-22 23:42:00 +00:00
P_RunParticleEffectTypeString ( pos , NULL , 1 , " te_muzzleflash " ) ;
break ;
case CRTE_BLUE_MUZZLEFLASH :
MSG_ReadPos ( pos ) ;
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( pos ) ;
2010-07-11 02:22:39 +00:00
ex - > flags = Q2RF_FULLBRIGHT | RF_NOSHADOW ;
2006-02-22 23:42:00 +00:00
ex - > start = cl . q2frame . servertime - 100 ;
2015-10-11 11:34:58 +00:00
CL_NewDlight ( 0 , pos , 350 , 0.5 , 0.2 * 5 , 0.1 * 5 , 0 * 5 ) ;
2006-02-22 23:42:00 +00:00
P_RunParticleEffectTypeString ( pos , NULL , 1 , " te_blue_muzzleflash " ) ;
break ;
case CRTE_SMART_MUZZLEFLASH :
MSG_ReadPos ( pos ) ;
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( pos ) ;
2010-07-11 02:22:39 +00:00
ex - > flags = Q2RF_FULLBRIGHT | RF_NOSHADOW ;
2006-02-22 23:42:00 +00:00
ex - > start = cl . q2frame . servertime - 100 ;
2015-10-11 11:34:58 +00:00
CL_NewDlight ( 0 , pos , 350 , 0.5 , 0.2 * 5 , 0 * 5 , 0.2 * 5 ) ;
2006-02-22 23:42:00 +00:00
P_RunParticleEffectTypeString ( pos , NULL , 1 , " te_smart_muzzleflash " ) ;
break ;
case CRTE_LEADERFIELD :
Host_EndGame ( " CLQ2_ParseTEnt: bad/non-implemented type %i " , type ) ;
case CRTE_DEATHFIELD :
MSG_ReadPos ( pos ) ;
2014-04-12 03:31:59 +00:00
ex = CL_AllocExplosion ( pos ) ;
2006-02-22 23:42:00 +00:00
VectorCopy ( pos , ex - > origin ) ;
2010-07-11 02:22:39 +00:00
ex - > flags = Q2RF_FULLBRIGHT | RF_NOSHADOW ;
2006-02-22 23:42:00 +00:00
ex - > start = cl . q2frame . servertime - 100 ;
2015-10-11 11:34:58 +00:00
CL_NewDlight ( 0 , pos , 350 , 0.5 , 0.2 * 5 , 0 * 5 , 0.2 * 5 ) ;
2006-02-22 23:42:00 +00:00
P_RunParticleEffectTypeString ( pos , NULL , 1 , " te_deathfield " ) ;
break ;
case CRTE_BLASTERBEAM :
MSG_ReadPos ( pos ) ;
MSG_ReadPos ( pos2 ) ;
2015-12-12 19:25:15 +00:00
P_ParticleTrail ( pos , pos2 , P_FindParticleType ( " q2part.TR_BLASTERTRAIL2 " ) , 0 , NULL , NULL ) ;
2006-02-22 23:42:00 +00:00
break ;
case CRTE_STAIN :
Host_EndGame ( " CLQ2_ParseTEnt: bad/non-implemented type %i " , type ) ;
case CRTE_FIRE :
Host_EndGame ( " CLQ2_ParseTEnt: bad/non-implemented type %i " , type ) ;
case CRTE_CABLEGUT :
Host_EndGame ( " CLQ2_ParseTEnt: bad/non-implemented type %i " , type ) ;
case CRTE_SMOKE :
Host_EndGame ( " CLQ2_ParseTEnt: bad/non-implemented type %i " , type ) ;
2004-08-23 00:15:46 +00:00
default :
Host_EndGame ( " CLQ2_ParseTEnt: bad/non-implemented type %i " , type ) ;
}
}
# endif
/*
= = = = = = = = = = = = = = = = =
CL_NewTempEntity
= = = = = = = = = = = = = = = = =
*/
entity_t * CL_NewTempEntity ( void )
{
entity_t * ent ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( cl_numvisedicts = = cl_maxvisedicts )
2004-08-23 00:15:46 +00:00
return NULL ;
ent = & cl_visedicts [ cl_numvisedicts ] ;
cl_numvisedicts + + ;
ent - > keynum = 0 ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
memset ( ent , 0 , sizeof ( * ent ) ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
ent - > playerindex = - 1 ;
ent - > topcolour = TOP_DEFAULT ;
ent - > bottomcolour = BOTTOM_DEFAULT ;
2004-08-23 00:15:46 +00:00
# ifdef PEXT_SCALE
ent - > scale = 1 ;
# endif
2006-02-27 00:42:25 +00:00
ent - > shaderRGBAf [ 0 ] = 1 ;
ent - > shaderRGBAf [ 1 ] = 1 ;
ent - > shaderRGBAf [ 2 ] = 1 ;
ent - > shaderRGBAf [ 3 ] = 1 ;
2004-08-23 00:15:46 +00:00
return ent ;
}
2014-10-05 20:04:11 +00:00
void CSQC_GetEntityOrigin ( unsigned int csqcent , float * out ) ;
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = =
CL_UpdateBeams
= = = = = = = = = = = = = = = = =
*/
void CL_UpdateBeams ( void )
{
2007-08-06 14:22:58 +00:00
int bnum ;
2005-08-27 23:28:39 +00:00
int i , j ;
2004-08-23 00:15:46 +00:00
beam_t * b ;
vec3_t dist , org ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
float * vieworg ;
2004-08-23 00:15:46 +00:00
float d ;
entity_t * ent ;
entity_state_t * st ;
float yaw , pitch ;
float forward , offset ;
2006-05-28 21:56:04 +00:00
int lastrunningbeam = - 1 ;
2015-07-14 14:47:00 +00:00
tentmodels_t * type ;
2004-08-23 00:15:46 +00:00
2005-01-13 16:29:20 +00:00
extern cvar_t cl_truelightning , v_viewheight ;
2004-10-10 06:32:29 +00:00
2004-08-23 00:15:46 +00:00
// update lightning
2007-08-06 14:22:58 +00:00
for ( bnum = 0 , b = cl_beams ; bnum < beams_running ; bnum + + , b + + )
2004-08-23 00:15:46 +00:00
{
2015-07-14 14:47:00 +00:00
type = b - > info ;
if ( ! type )
2004-08-23 00:15:46 +00:00
continue ;
2011-06-25 12:00:59 +00:00
2005-05-30 04:34:47 +00:00
if ( b - > endtime < cl . time )
{
2009-11-05 03:07:52 +00:00
if ( ! cl . paused )
2009-11-04 21:16:50 +00:00
{ /*don't let lightning decay while paused*/
P_DelinkTrailstate ( & b - > trailstate ) ;
P_DelinkTrailstate ( & b - > emitstate ) ;
2015-07-14 14:47:00 +00:00
b - > info = NULL ;
2009-11-04 21:16:50 +00:00
continue ;
}
2005-05-30 04:34:47 +00:00
}
2004-08-23 00:15:46 +00:00
2007-08-06 14:26:40 +00:00
lastrunningbeam = bnum ;
2006-05-28 21:56:04 +00:00
2004-08-23 00:15:46 +00:00
// if coming from the player, update the start position
2014-04-06 15:16:39 +00:00
if ( ( b - > bflags & 1 ) & & b - > entity > 0 & & b - > entity < = cl . allocated_client_slots )
2004-08-23 00:15:46 +00:00
{
2005-10-07 02:08:44 +00:00
for ( j = 0 ; j < cl . splitclients ; j + + )
2004-10-10 06:32:29 +00:00
{
2013-06-23 02:17:02 +00:00
playerview_t * pv = & cl . playerview [ j ] ;
2015-06-22 11:49:15 +00:00
if ( b - > entity = = ( ( pv - > cam_state = = CAM_EYECAM ) ? pv - > cam_spec_track + 1 : ( pv - > playernum + 1 ) ) )
2005-08-03 23:14:59 +00:00
{
2014-03-30 08:55:06 +00:00
// player_state_t *pl;
2005-08-27 23:28:39 +00:00
// VectorSubtract(cl.simorg, b->start, org);
// VectorAdd(b->end, org, b->end); //move the end point by simorg-start
2014-03-30 08:55:06 +00:00
// pl = &cl.inframes[cl.parsecount&UPDATE_MASK].playerstate[b->entity-1];
// if (pl->messagenum == cl.parsecount || cls.protocol == CP_NETQUAKE)
2005-08-27 23:28:39 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
vec3_t fwd , org , ang , viewang ;
2005-08-27 23:28:39 +00:00
float delta , f , len ;
2014-03-30 08:55:06 +00:00
// if (cl.spectator && pv->cam_auto)
// { //if we're tracking someone, use their origin explicitly.
// vieworg = pl->origin;
// }
// else
2016-01-18 05:22:07 +00:00
# ifdef Q2CLIENT
2015-12-12 19:25:15 +00:00
if ( cls . protocol = = CP_QUAKE2 )
2016-01-18 05:22:07 +00:00
vieworg = pv - > predicted_origin ;
2015-12-12 19:25:15 +00:00
else
2016-01-18 05:22:07 +00:00
# endif
2013-06-23 02:17:02 +00:00
vieworg = pv - > simorg ;
2012-11-27 03:23:19 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( cl_truelightning . ival > 1 & & cl . movesequence > cl_truelightning . ival )
2012-11-27 03:23:19 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
outframe_t * frame = & cl . outframes [ ( cl . movesequence - cl_truelightning . ival ) & UPDATE_MASK ] ;
viewang [ 0 ] = SHORT2ANGLE ( frame - > cmd [ j ] . angles [ 0 ] ) ;
viewang [ 1 ] = SHORT2ANGLE ( frame - > cmd [ j ] . angles [ 1 ] ) ;
viewang [ 2 ] = SHORT2ANGLE ( frame - > cmd [ j ] . angles [ 2 ] ) ;
2012-11-27 03:23:19 +00:00
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
else
VectorCopy ( pv - > simangles , viewang ) ;
2005-10-07 02:08:44 +00:00
VectorCopy ( vieworg , b - > start ) ;
2013-06-23 02:17:02 +00:00
b - > start [ 2 ] + = pv - > crouch + bound ( - 7 , v_viewheight . value , 4 ) ;
2005-08-27 23:28:39 +00:00
f = bound ( 0 , cl_truelightning . value , 1 ) ;
if ( ! f )
break ;
2005-10-07 02:08:44 +00:00
VectorSubtract ( playerbeam_end [ j ] , vieworg , org ) ;
2005-08-27 23:28:39 +00:00
len = VectorLength ( org ) ;
org [ 2 ] - = 22 ; // adjust for view height
2011-10-27 15:46:36 +00:00
VectorAngles ( org , NULL , ang ) ;
2005-08-27 23:28:39 +00:00
// lerp pitch
ang [ 0 ] = - ang [ 0 ] ;
if ( ang [ 0 ] < - 180 )
ang [ 0 ] + = 360 ;
2012-11-27 03:23:19 +00:00
ang [ 0 ] + = ( viewang [ 0 ] - ang [ 0 ] ) * f ;
2005-08-27 23:28:39 +00:00
// lerp yaw
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
delta = anglemod ( viewang [ 1 ] - ang [ 1 ] ) ;
2005-08-27 23:28:39 +00:00
if ( delta > 180 )
delta - = 360 ;
if ( delta < - 180 )
delta + = 360 ;
ang [ 1 ] + = delta * f ;
ang [ 2 ] = 0 ;
AngleVectors ( ang , fwd , ang , ang ) ;
VectorCopy ( fwd , ang ) ;
VectorScale ( fwd , len , fwd ) ;
2012-11-27 03:23:19 +00:00
VectorCopy ( vieworg , org ) ;
2005-08-27 23:28:39 +00:00
org [ 2 ] + = 16 ;
VectorAdd ( org , fwd , b - > end ) ;
2009-11-04 21:16:50 +00:00
if ( cl_beam_trace . ival )
2005-08-27 23:28:39 +00:00
{
vec3_t normal ;
VectorMA ( org , len + 4 , ang , fwd ) ;
2016-07-12 00:40:13 +00:00
if ( CL_TraceLine ( org , fwd , ang , normal , NULL ) < 1 )
2005-08-27 23:28:39 +00:00
VectorCopy ( ang , b - > end ) ;
}
break ;
}
2005-08-03 23:14:59 +00:00
}
2004-10-10 06:32:29 +00:00
}
2015-12-12 19:25:15 +00:00
VectorCopy ( b - > start , org ) ;
2004-08-23 00:15:46 +00:00
}
2014-10-05 20:04:11 +00:00
# ifdef CSQC_DAT
else if ( ( b - > bflags & 1 ) & & b - > entity > MAX_EDICTS )
{
2015-12-12 19:25:15 +00:00
CSQC_GetEntityOrigin ( b - > entity - MAX_EDICTS , org ) ;
VectorCopy ( b - > start , org ) ;
2014-10-05 20:04:11 +00:00
}
# endif
2014-04-06 15:16:39 +00:00
else if ( b - > bflags & STREAM_ATTACHED )
2004-08-23 00:15:46 +00:00
{
player_state_t * pl ;
st = CL_FindPacketEntity ( b - > entity ) ;
if ( st )
{
2015-12-12 19:25:15 +00:00
VectorCopy ( st - > origin , b - > start ) ;
2004-08-23 00:15:46 +00:00
}
2011-04-25 03:25:22 +00:00
else if ( b - > entity < = cl . allocated_client_slots & & b - > entity > 0 )
2004-08-23 00:15:46 +00:00
{
2013-03-12 22:53:23 +00:00
pl = & cl . inframes [ cl . parsecount & UPDATE_MASK ] . playerstate [ b - > entity - 1 ] ;
2015-12-12 19:25:15 +00:00
VectorCopy ( pl - > origin , b - > start ) ;
2004-08-23 00:15:46 +00:00
}
2015-12-12 19:25:15 +00:00
VectorCopy ( b - > start , org ) ;
2004-08-23 00:15:46 +00:00
}
2016-01-18 05:22:07 +00:00
else
VectorCopy ( b - > start , org ) ;
2015-12-12 19:25:15 +00:00
VectorAdd ( org , b - > offset , org ) ;
2004-08-23 00:15:46 +00:00
// calculate pitch and yaw
2015-12-12 19:25:15 +00:00
VectorSubtract ( b - > end , org , dist ) ;
2004-08-23 00:15:46 +00:00
if ( dist [ 1 ] = = 0 & & dist [ 0 ] = = 0 )
{
yaw = 0 ;
if ( dist [ 2 ] > 0 )
pitch = 90 ;
else
pitch = 270 ;
}
else
{
yaw = ( int ) ( atan2 ( dist [ 1 ] , dist [ 0 ] ) * 180 / M_PI ) ;
if ( yaw < 0 )
yaw + = 360 ;
2011-06-25 12:00:59 +00:00
2004-08-23 00:15:46 +00:00
forward = sqrt ( dist [ 0 ] * dist [ 0 ] + dist [ 1 ] * dist [ 1 ] ) ;
pitch = ( int ) ( atan2 ( dist [ 2 ] , forward ) * 180 / M_PI ) ;
if ( pitch < 0 )
pitch + = 360 ;
}
2015-07-14 14:47:00 +00:00
if ( ruleset_allow_particle_lightning . ival | | ! type - > modelname )
2015-12-12 19:25:15 +00:00
if ( type - > ef_beam > = 0 & & ! P_ParticleTrail ( org , b - > end , type - > ef_beam , b - > entity , NULL , & b - > trailstate ) )
2007-08-23 21:25:18 +00:00
continue ;
2015-07-14 14:47:00 +00:00
if ( ! type - > model )
{
type - > model = type - > modelname ? Mod_ForName ( type - > modelname , MLV_WARN ) : NULL ;
if ( ! type - > model )
continue ;
}
2004-10-19 16:10:14 +00:00
2004-08-23 00:15:46 +00:00
// add new entities for the lightning
d = VectorNormalize ( dist ) ;
2014-04-06 15:16:39 +00:00
if ( b - > bflags & 2 )
2004-08-23 00:15:46 +00:00
{
offset = ( int ) ( cl . time * 40 ) % 30 ;
for ( i = 0 ; i < 3 ; i + + )
{
org [ i ] + = dist [ i ] * offset ;
}
}
while ( d > 0 )
{
ent = CL_NewTempEntity ( ) ;
if ( ! ent )
return ;
VectorCopy ( org , ent - > origin ) ;
2015-07-14 14:47:00 +00:00
ent - > model = type - > model ;
2004-08-23 00:15:46 +00:00
ent - > drawflags | = MLS_ABSLIGHT ;
2013-03-12 23:10:12 +00:00
ent - > abslight = 64 + 128 * bound ( 0 , cl_shaftlight . value , 1 ) ;
2006-02-27 00:42:25 +00:00
ent - > shaderRGBAf [ 3 ] = b - > alpha ;
2014-04-06 15:16:39 +00:00
ent - > flags = b - > rflags ;
2004-11-17 18:10:46 +00:00
ent - > angles [ 0 ] = - pitch ;
2004-08-23 00:15:46 +00:00
ent - > angles [ 1 ] = yaw ;
2008-01-08 23:34:41 +00:00
ent - > angles [ 2 ] = rand ( ) % 360 ;
2004-11-17 18:10:46 +00:00
AngleVectors ( ent - > angles , ent - > axis [ 0 ] , ent - > axis [ 1 ] , ent - > axis [ 2 ] ) ;
ent - > angles [ 0 ] = pitch ;
2015-03-03 00:14:43 +00:00
ent - > framestate . g [ FS_REG ] . lerpweight [ 0 ] = 1 ;
ent - > framestate . g [ FS_REG ] . frame [ 0 ] = 0 ;
ent - > framestate . g [ FS_REG ] . frametime [ 0 ] = cl . time - ( b - > endtime - 0.2 ) ;
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 3 ; i + + )
org [ i ] + = dist [ i ] * 30 ;
d - = 30 ;
}
}
2011-06-25 12:00:59 +00:00
2006-05-28 21:56:04 +00:00
beams_running = lastrunningbeam + 1 ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = =
CL_UpdateExplosions
= = = = = = = = = = = = = = = = =
*/
void CL_UpdateExplosions ( void )
{
int i ;
float f ;
int of ;
int numframes ;
int firstframe ;
explosion_t * ex ;
entity_t * ent ;
2006-05-28 21:56:04 +00:00
int lastrunningexplosion = - 1 ;
2012-01-17 07:57:46 +00:00
vec3_t pos , norm ;
static float oldtime ;
2014-04-12 03:31:59 +00:00
float scale ;
2012-01-17 07:57:46 +00:00
float frametime = cl . time - oldtime ;
if ( frametime < 0 | | frametime > 100 )
frametime = 0 ;
oldtime = cl . time ;
2004-08-23 00:15:46 +00:00
2006-05-28 21:56:04 +00:00
for ( i = 0 , ex = cl_explosions ; i < explosions_running ; i + + , ex + + )
2004-08-23 00:15:46 +00:00
{
2015-12-28 17:41:39 +00:00
if ( ! ex - > model & & ! ( ex - > flags & Q2RF_BEAM ) )
2004-08-23 00:15:46 +00:00
continue ;
2006-05-28 21:56:04 +00:00
lastrunningexplosion = i ;
2016-01-18 05:22:07 +00:00
if ( ex - > model )
2015-12-28 17:41:39 +00:00
{
2016-01-18 05:22:07 +00:00
if ( ex - > model - > loadstate = = MLS_LOADING )
continue ;
if ( ex - > model - > loadstate ! = MLS_LOADED )
{
ex - > model = NULL ;
ex - > flags = 0 ;
P_DelinkTrailstate ( & ( ex - > trailstate ) ) ;
continue ;
}
2015-12-28 17:41:39 +00:00
}
2005-05-26 12:55:34 +00:00
f = ex - > framerate * ( cl . time - ex - > start ) ;
2015-12-28 17:41:39 +00:00
2004-08-23 00:15:46 +00:00
if ( ex - > firstframe > = 0 )
{
firstframe = ex - > firstframe ;
numframes = ex - > numframes ;
2015-12-28 17:41:39 +00:00
if ( ! numframes )
numframes = ex - > model - > numframes - firstframe ;
2004-08-23 00:15:46 +00:00
}
else
{
firstframe = 0 ;
numframes = ex - > model - > numframes ;
}
of = ( int ) f - 1 ;
2014-04-12 03:31:59 +00:00
if ( ex - > endalpha & & ( int ) f = = numframes )
{
scale = 1 - ( f - ( int ) f ) ; //if we have endalpha not 0, then there is a final 'bonus' frame where the model scales down to 0. use numframes+framerate to control how fast it fades.
f = of ; //clamp it to the old frame
}
else if ( ( int ) f > = numframes | | ( int ) f < 0 )
2004-08-23 00:15:46 +00:00
{
ex - > model = NULL ;
2010-07-11 02:22:39 +00:00
ex - > flags = 0 ;
2014-04-12 03:31:59 +00:00
P_DelinkTrailstate ( & ( ex - > trailstate ) ) ;
2004-08-23 00:15:46 +00:00
continue ;
}
2014-04-12 03:31:59 +00:00
else
scale = 1 ;
2004-08-23 00:15:46 +00:00
if ( of < 0 )
of = 0 ;
ent = CL_NewTempEntity ( ) ;
if ( ! ent )
return ;
2012-01-17 07:57:46 +00:00
if ( ex - > gravity )
{
VectorMA ( ex - > origin , frametime , ex - > velocity , pos ) ;
if ( ex - > velocity [ 0 ] | | ex - > velocity [ 1 ] | | ex - > velocity [ 2 ] )
{
VectorClear ( norm ) ;
2016-07-12 00:40:13 +00:00
if ( CL_TraceLine ( ex - > origin , pos , ent - > origin , norm , NULL ) < 1 )
2012-01-17 07:57:46 +00:00
{
float sc = DotProduct ( ex - > velocity , norm ) * - 1.5 ;
VectorMA ( ex - > velocity , sc , norm , ex - > velocity ) ;
VectorScale ( ex - > velocity , 0.9 , ex - > velocity ) ;
2016-07-12 00:40:13 +00:00
if ( norm [ 2 ] > 0.7 & & DotProduct ( ex - > velocity , ex - > velocity ) < 100 )
2012-01-17 07:57:46 +00:00
{
VectorClear ( ex - > velocity ) ;
VectorClear ( ex - > avel ) ;
}
}
else
ex - > velocity [ 2 ] - = ex - > gravity * frametime ;
VectorCopy ( ent - > origin , ex - > origin ) ;
}
else
VectorCopy ( ex - > origin , ent - > origin ) ;
}
else
{
VectorMA ( ex - > origin , f , ex - > velocity , ent - > origin ) ;
}
VectorMA ( ex - > angles , frametime , ex - > avel , ex - > angles ) ;
2005-03-18 06:14:07 +00:00
VectorCopy ( ex - > oldorigin , ent - > oldorigin ) ;
2004-08-23 00:15:46 +00:00
VectorCopy ( ex - > angles , ent - > angles ) ;
2005-03-18 06:14:07 +00:00
ent - > skinnum = ex - > skinnum ;
ent - > angles [ 0 ] * = - 1 ;
AngleVectors ( ent - > angles , ent - > axis [ 0 ] , ent - > axis [ 1 ] , ent - > axis [ 2 ] ) ;
VectorInverse ( ent - > axis [ 1 ] ) ;
2004-08-23 00:15:46 +00:00
ent - > model = ex - > model ;
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
ent - > framestate . g [ FS_REG ] . frame [ 1 ] = ( int ) f + firstframe ;
ent - > framestate . g [ FS_REG ] . frame [ 0 ] = of + firstframe ;
2015-02-02 08:01:53 +00:00
ent - > framestate . g [ FS_REG ] . lerpweight [ 1 ] = ( f - ( int ) f ) ;
ent - > framestate . g [ FS_REG ] . lerpweight [ 0 ] = 1 - ent - > framestate . g [ FS_REG ] . lerpweight [ 1 ] ;
2014-04-12 03:31:59 +00:00
ent - > shaderRGBAf [ 3 ] = ( 1.0 - f / ( numframes ) ) * ( ex - > startalpha - ex - > endalpha ) + ex - > endalpha ;
2005-03-18 06:14:07 +00:00
ent - > flags = ex - > flags ;
2016-07-12 00:40:13 +00:00
ent - > scale = scale * ex - > scale ;
2014-04-12 03:31:59 +00:00
ent - > drawflags = SCALE_ORIGIN_ORIGIN ;
2011-04-23 20:37:20 +00:00
2014-04-12 03:31:59 +00:00
if ( ex - > traileffect ! = P_INVALID )
2014-10-05 20:04:11 +00:00
pe - > ParticleTrail ( ent - > oldorigin , ent - > origin , ex - > traileffect , 0 , ent - > axis , & ( ex - > trailstate ) ) ;
2014-04-12 03:31:59 +00:00
if ( ! ( ex - > flags & Q2RF_BEAM ) )
VectorCopy ( ent - > origin , ex - > oldorigin ) ; //don't corrupt q2 beams
2011-04-23 20:37:20 +00:00
if ( ex - > flags & Q2RF_BEAM )
{
ent - > rtype = RT_BEAM ;
ent - > shaderRGBAf [ 0 ] = ( ( d_8to24rgbtable [ ex - > skinnum & 0xFF ] > > 0 ) & 0xFF ) / 255.0 ;
ent - > shaderRGBAf [ 1 ] = ( ( d_8to24rgbtable [ ex - > skinnum & 0xFF ] > > 8 ) & 0xFF ) / 255.0 ;
ent - > shaderRGBAf [ 2 ] = ( ( d_8to24rgbtable [ ex - > skinnum & 0xFF ] > > 16 ) & 0xFF ) / 255.0 ;
}
2012-01-17 07:57:46 +00:00
else if ( ex - > skinnum < 0 )
2011-04-23 20:37:20 +00:00
{
ent - > skinnum = 7 * f / ( numframes ) ;
}
2004-08-23 00:15:46 +00:00
}
2006-05-28 21:56:04 +00:00
explosions_running = lastrunningexplosion + 1 ;
2004-08-23 00:15:46 +00:00
}
entity_state_t * CL_FindPacketEntity ( int num ) ;
/*
= = = = = = = = = = = = = = = = =
CL_UpdateTEnts
= = = = = = = = = = = = = = = = =
*/
void CL_UpdateTEnts ( void )
{
CL_UpdateBeams ( ) ;
CL_UpdateExplosions ( ) ;
2012-11-29 13:37:48 +00:00
CL_RunPCustomTEnts ( ) ;
2004-08-23 00:15:46 +00:00
}