Code for VM 0-09-00
Client-side
This commit is contained in:
Victor Chow 2001-08-18 20:01:21 +00:00
parent b3ce590831
commit 7a2a051932
6 changed files with 75 additions and 22 deletions

View file

@ -2832,6 +2832,28 @@ static void CG_DrawDamageBlend()
CG_FillRect(0,0, SCREEN_WIDTH, SCREEN_HEIGHT, damageColor);
}
/*
=====================
CG_DrawIRBlend
Elder: Small red tint
Note: This sucks - causes 10fps drop on my system so don't use it
=====================
*/
static void CG_DrawIRBlend()
{
vec4_t irColor;
if (bg_itemlist[cg.snap->ps.stats[STAT_HOLDABLE_ITEM]].giTag == HI_BANDOLIER
&& cg.rq3_irvision)
{
irColor[0] = 0;
irColor[1] = 1.0f;
irColor[2] = 0;
irColor[3] = 0.1f;
CG_FillRect(0,0,SCREEN_WIDTH, SCREEN_HEIGHT, irColor);
}
}
/*
@ -2893,6 +2915,7 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
// Elder: draw damage blend
CG_DrawDamageBlend();
//CG_DrawIRBlend();
// draw status bar and other floating elements
CG_Draw2D();

View file

@ -512,7 +512,6 @@ void CG_BleedSpray ( vec3_t start, vec3_t end, int entityNum, int numBursts )
// Check end point validity so it doesn't go through walls
// If it does go through wall, take the trace's endpoint
// ****************************** TEST ME!!!!!!! *******************
CG_Trace(&tr, start, NULL, NULL, trueEnd, entityNum, CONTENTS_SOLID);
if (tr.fraction != 1.0)
VectorCopy(tr.endpos, trueEnd);

View file

@ -1944,13 +1944,18 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_MISSILE_MISS:
DEBUGNAME("EV_MISSILE_MISS");
ByteToDir( es->eventParm, dir );
CG_MissileHitWall( es->weapon, 0, position, dir, IMPACTSOUND_DEFAULT );
CG_MissileHitWall( es->weapon, 0, position, dir, IMPACTSOUND_DEFAULT, 0 );
break;
case EV_MISSILE_MISS_METAL:
DEBUGNAME("EV_MISSILE_MISS_METAL");
ByteToDir( es->eventParm, dir );
CG_MissileHitWall( es->weapon, 0, position, dir, IMPACTSOUND_METAL );
CG_MissileHitWall( es->weapon, 0, position, dir, IMPACTSOUND_METAL, 0 );
break;
case EV_KNIFE_MISS:
DEBUGNAME("EV_KNIFE_MISS");
ByteToDir( es->eventParm, dir );
CG_MissileHitWall( es->weapon, 0, position, dir, IMPACTSOUND_DEFAULT, RQ3_WPMOD_KNIFESLASH );
break;
case EV_RAILTRAIL:
@ -1961,7 +1966,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
//CG_RailTrail( ci, es->origin2, es->pos.trBase );
if ( es->eventParm != 255 ) {
ByteToDir( es->eventParm, dir );
CG_MissileHitWall( es->weapon, es->clientNum, position, dir, IMPACTSOUND_DEFAULT );
CG_MissileHitWall( es->weapon, es->clientNum, position, dir, IMPACTSOUND_DEFAULT, 0 );
}
break;
@ -1987,6 +1992,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_JUMPKICK:
DEBUGNAME("EV_JUMPKICK");
ByteToDir( es->eventParm, dir );
// obviously not the pistol but oh well
CG_MissileHitPlayer( WP_PISTOL, position, dir, es->otherEntityNum );
CG_JumpKick( es );
break;

View file

@ -821,6 +821,9 @@ typedef struct {
qhandle_t holeMarkShader;
qhandle_t energyMarkShader;
// Elder: rq3 marks
qhandle_t slashMarkShader;
// powerup shaders
qhandle_t quadShader;
qhandle_t redQuadShader;
@ -1474,7 +1477,8 @@ void CG_RegisterItemVisuals( int itemNum );
void CG_FireWeapon( centity_t *cent, int weapModification );
void CG_ReloadWeapon( centity_t *cent, int reloadStage ); //Elder: added
void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, impactSound_t soundType );
void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
vec3_t dir, impactSound_t soundType, int weapModification ); //Elder: added weapMod
void CG_MissileHitPlayer( int weapon, vec3_t origin, vec3_t dir, int entityNum );
void CG_ShotgunFire( entityState_t *es, qboolean ism3 );
void CG_Bullet( vec3_t origin, int sourceEntityNum, vec3_t normal, qboolean flesh, int fleshEntityNum, qboolean armorPiercing );

View file

@ -1145,6 +1145,8 @@ static void CG_RegisterGraphics( void ) {
cgs.media.shadowMarkShader = trap_R_RegisterShader( "markShadow" );
cgs.media.wakeMarkShader = trap_R_RegisterShader( "wake" );
cgs.media.bloodMarkShader = trap_R_RegisterShader( "bloodMark" );
// Elder: added
cgs.media.slashMarkShader = trap_R_RegisterShader( "gfx/damage/slash_mrk" );
// register the inline models
cgs.numInlineModels = trap_CM_NumInlineModels();

View file

@ -745,6 +745,8 @@ void CG_RegisterWeapon( int weaponNum ) {
//Elder: if no _1st model, point to the weaponModel... this may get funky :)
if ( !weaponInfo->firstModel ) {
// Added warning message
CG_Printf(" ^3Warning: %s first-person model not found; using world model^7\n", weaponInfo->item->pickup_name);
weaponInfo->firstModel = weaponInfo->weaponModel;
}
@ -2224,7 +2226,7 @@ Caused by an EV_MISSILE_MISS event, or directly by local bullet tracing
=================
*/
void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
vec3_t dir, impactSound_t soundType ) {
vec3_t dir, impactSound_t soundType, int weapModification ) {
qhandle_t mod;
qhandle_t mark;
qhandle_t shader;
@ -2237,6 +2239,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
qboolean alphaFade;
qboolean isSprite;
int duration;
int angle;
//Elder: for impact smoke marks
localEntity_t *smokePuff;
@ -2356,12 +2359,20 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
isSprite = qtrue;
break;
*/
if (weapModification == RQ3_WPMOD_KNIFESLASH)
{
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
mark = cgs.media.bulletMarkShader;
mark = cgs.media.slashMarkShader;
sfx = cgs.media.knifeClankSound;
radius = 4;
radius = rand() % 4 + 6;
}
else
{
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
sfx = cgs.media.knifeClankSound;
}
break;
default:
break;
@ -2408,7 +2419,15 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
// color = cgs.clientinfo[clientNum].color;
// CG_ImpactMark( mark, origin, dir, random()*360, color[0],color[1], color[2],1, alphaFade, radius, qfalse );
//} else {
CG_ImpactMark( mark, origin, dir, random()*360, 1,1,1,1, alphaFade, radius, qfalse );
// Elder: Our knife slashes aren't vertical so don't go beyond 45 degrees
if (weapon == WP_KNIFE)
angle = random() * 90 + 45;
else
angle = random() * 360;
if ( mark )
CG_ImpactMark( mark, origin, dir, angle, 1,1,1,1, alphaFade, radius, qfalse );
//}
@ -2462,7 +2481,7 @@ void CG_MissileHitPlayer( int weapon, vec3_t origin, vec3_t dir, int entityNum )
case WP_CHAINGUN:
case WP_PROX_LAUNCHER:
#endif
CG_MissileHitWall( weapon, 0, origin, dir, IMPACTSOUND_FLESH );
CG_MissileHitWall( weapon, 0, origin, dir, IMPACTSOUND_FLESH, 0 );
break;
default:
break;
@ -2537,24 +2556,24 @@ static void CG_ShotgunPellet( vec3_t start, vec3_t end, int skipNum, int shellWe
{
//Blaze: Changed WP_SHOTGUN to WP_M3
if (shellWeapon == WP_M3)
CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_METAL );
CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_METAL, 0 );
else if (shellWeapon == WP_HANDCANNON && crandom() > 0.5)
{
//Elder: show only approximately every other impact mark
CG_MissileHitWall( WP_HANDCANNON, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_METAL );
CG_MissileHitWall( WP_HANDCANNON, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_METAL, 0 );
}
}
else
{
//Blaze: Changed WP_SHOTGUN to WP_M3
if (shellWeapon == WP_M3)
CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT );
CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT, 0 );
else if (shellWeapon == WP_HANDCANNON && crandom() > 0.5)
{
//Elder: show only approximately every other impact mark
CG_MissileHitWall( WP_HANDCANNON, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT );
CG_MissileHitWall( WP_HANDCANNON, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT, 0 );
}
//CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT );
//CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT, 0 );
}
}
}
@ -2860,7 +2879,7 @@ void CG_Bullet( vec3_t end, int sourceEntityNum, vec3_t normal,
CG_Bleed( end, fleshEntityNum );
} else {
//Blaze: Changed WP_MACHINEGUN to WP_PISTOL
CG_MissileHitWall( WP_PISTOL, 0, end, normal, IMPACTSOUND_DEFAULT );
CG_MissileHitWall( WP_PISTOL, 0, end, normal, IMPACTSOUND_DEFAULT, 0 );
}
}