Example #1
0
/*
===================
CG_AddLocalEntities

===================
*/
void CG_AddLocalEntities( void ) {
	localEntity_t	*le, *next;

	// walk the list backwards, so any new local entities generated
	// (trails, marks, etc) will be present this frame
	le = cg_activeLocalEntities.prev;
	for ( ; le != &cg_activeLocalEntities ; le = next ) {
		// grab next now, so if the local entity is freed we
		// still have it
		next = le->prev;

		if ( cg.time >= le->endTime ) {
			CG_FreeLocalEntity( le );
			continue;
		}
		switch ( le->leType ) {
		default:
			trap->Error( ERR_DROP, "Bad leType: %i", le->leType );
			break;

		case LE_MARK:
			break;

		case LE_SPRITE_EXPLOSION:
			CG_AddSpriteExplosion( le );
			break;

		case LE_EXPLOSION:
			CG_AddExplosion( le );
			break;

		case LE_FADE_SCALE_MODEL:
			CG_AddFadeScaleModel( le );
			break;

		case LE_FRAGMENT:			// gibs and brass
			CG_AddFragment( le );
			break;

		case LE_PUFF:
			CG_AddPuff( le );
			break;

		case LE_MOVE_SCALE_FADE:		// water bubbles
			CG_AddMoveScaleFade( le );
			break;

		case LE_FADE_RGB:				// teleporters, railtrails
			CG_AddFadeRGB( le );
			break;

		case LE_FALL_SCALE_FADE: // gib blood trails
			CG_AddFallScaleFade( le );
			break;

		case LE_SCALE_FADE:		// rocket trails
			CG_AddScaleFade( le );
			break;

		case LE_SCOREPLUM:
			CG_AddScorePlum( le );
			break;

		case LE_OLINE:
			CG_AddOLine( le );
			break;

		case LE_SHOWREFENTITY:
			CG_AddRefEntity( le );
			break;

		case LE_LINE:					// oriented lines for FX
			CG_AddLine( le );
			break;
		}
	}
}
Example #2
0
/*
===================
CG_AddLocalEntities

===================
*/
void CG_AddLocalEntities( void ) {
	localEntity_t	*le, *next;
	qboolean forceOnlyMirror;

	// walk the list backwards, so any new local entities generated
	// (trails, marks, etc) will be present this frame
	le = cg_activeLocalEntities.prev;
	for ( ; le != &cg_activeLocalEntities ; le = next ) {
		// grab next now, so if the local entity is freed we
		// still have it
		next = le->prev;

		if ( cg.time >= le->endTime ) {
			CG_FreeLocalEntity( le );
			continue;
		}

		// Check if local entity should be rendered by this local client.
		if (le->localClients && !(le->localClients & (1<<cg.cur_localClientNum))) {
			continue;
		}

		forceOnlyMirror = (!(le->refEntity.renderfx & RF_ONLY_MIRROR) &&
				!cg.cur_lc->renderingThirdPerson &&
				cg.snap->pss[cg.cur_localClientNum].clientNum == le->firstPersonEntity);

		if ( forceOnlyMirror ) {
			le->refEntity.renderfx |= RF_ONLY_MIRROR;
		}

		switch ( le->leType ) {
		default:
			CG_Error( "Bad leType: %i", le->leType );
			break;

		case LE_MARK:
			break;

		case LE_SPRITE_EXPLOSION:
			CG_AddSpriteExplosion( le );
			break;

		case LE_EXPLOSION:
			CG_AddExplosion( le );
			break;

		case LE_FRAGMENT:			// gibs and brass
			CG_AddFragment( le );
			break;

		case LE_MOVE_SCALE_FADE:		// water bubbles
			CG_AddMoveScaleFade( le );
			break;

		case LE_FADE_RGB:				// teleporters, railtrails
			CG_AddFadeRGB( le );
			break;

		case LE_FALL_SCALE_FADE: // gib blood trails
			CG_AddFallScaleFade( le );
			break;

		case LE_SCALE_FADE:		// rocket trails
			CG_AddScaleFade( le );
			break;

		case LE_SCOREPLUM:
			CG_AddScorePlum( le );
			break;

#ifdef MISSIONPACK
		case LE_KAMIKAZE:
			CG_AddKamikaze( le );
			break;
		case LE_INVULIMPACT:
			CG_AddInvulnerabilityImpact( le );
			break;
		case LE_INVULJUICED:
			CG_AddInvulnerabilityJuiced( le );
			break;
		case LE_SHOWREFENTITY:
			CG_AddRefEntity( le );
			break;
#endif
		}

		if ( forceOnlyMirror ) {
			le->refEntity.renderfx &= ~RF_ONLY_MIRROR;
		}
	}
}
/*
===================
CG_AddLocalEntities

===================
*/
void CG_AddLocalEntities( void ) 
{
	localEntity_t	*le, *next;

	// walk the list backwards, so any new local entities generated
	// (trails, marks, etc) will be present this frame
	le = cg_activeLocalEntities.prev;
	for ( ; le != &cg_activeLocalEntities ; le = next ) {
		// grab next now, so if the local entity is freed we
		// still have it
		next = le->prev;

		if ( cg.time >= le->endTime ) {
			CG_FreeLocalEntity( le );
			continue;
		}
		switch ( le->leType ) {
		default:
			CG_Error( "Bad leType: %i", le->leType );
			break;

		case LE_MARK:
			break;

		case LE_FADE_MODEL:
			CG_AddFadeModel( le );
			break;

		case LE_FADE_SCALE_MODEL:
			CG_AddFadeScaleModel( le );
			break;

		case LE_FRAGMENT:
			CG_AddFragment( le );
			break;

		case LE_PUFF:
			CG_AddPuff( le );
			break;

		case LE_FADE_RGB:		// teleporters, railtrails
			CG_AddFadeRGB( le );
			break;

		case LE_LIGHT:
			CG_AddLocalLight( le );
			break;

		case LE_LINE:					// oriented lines for FX
			CG_AddLine( le );
			break;

		// Use for debug only
		case LE_QUAD:
			CG_AddQuad( le );
			break;

		case LE_SPRITE:
			CG_AddSprite( le );
		}
	}
}
Example #4
0
/*
===================
CG_AddLocalEntities

===================
*/
void CG_AddLocalEntities( void ) {
	localEntity_t	*le, *next;

	// walk the list backwards, so any new local entities generated
	// (trails, marks, etc) will be present this frame
	le = cg_activeLocalEntities.prev;
	for ( ; le != &cg_activeLocalEntities ; le = next ) {
		// grab next now, so if the local entity is freed we
		// still have it
		next = le->prev;

		if ( cg.time >= le->endTime ) {
			CG_FreeLocalEntity( le );
			continue;
		}
		switch ( le->leType ) {
		default:
			CG_Error( "Bad leType: %i", le->leType );
			break;

		// Ridah
		case LE_MOVING_TRACER:
			CG_AddMovingTracer( le );
			break;
		case LE_SPARK:
			CG_AddSparkElements( le );
			break;
		case LE_FUSE_SPARK:
			CG_AddFuseSparkElements( le );
			break;
		case LE_DEBRIS:
			CG_AddDebrisElements( le );
			break;
		case LE_BLOOD:
			CG_AddBloodElements( le );
			break;
		case LE_ZOMBIE_SPIRIT:
		case LE_ZOMBIE_BAT:
			CG_AddClientCritter( le );
			break;
		// done.

		case LE_MARK:
			break;

		case LE_SPRITE_EXPLOSION:
			CG_AddSpriteExplosion( le );
			break;

		case LE_EXPLOSION:
			CG_AddExplosion( le );
			break;

		case LE_FRAGMENT:			// gibs and brass
			CG_AddFragment( le );
			break;

		case LE_MOVE_SCALE_FADE:		// water bubbles
			CG_AddMoveScaleFade( le );
			break;

		case LE_FADE_RGB:				// teleporters, railtrails
			CG_AddFadeRGB( le );
			break;

		case LE_FALL_SCALE_FADE: // gib blood trails
			CG_AddFallScaleFade( le );
			break;

		case LE_SCALE_FADE:		// rocket trails
			CG_AddScaleFade( le );
			break;

		case LE_EMITTER:
			CG_AddEmitter(le);
			break;
		
		}
	}
}
Example #5
0
/*
===================
CG_AddLocalEntities

===================
*/
void CG_AddLocalEntities( void ) {
	localEntity_t	*le, *next;

	// walk the list backwards, so any new local entities generated
	// (trails, marks, etc) will be present this frame
	le = cg_activeLocalEntities.prev;
	for ( ; le != &cg_activeLocalEntities ; le = next ) {
		// grab next now, so if the local entity is freed we
		// still have it
		next = le->prev;

		if ( cg.time >= le->endTime ) {
			CG_FreeLocalEntity( le );
			continue;
		}
		switch ( le->leType ) {
		default:
			CG_Error( "Bad leType: %i", le->leType );
			break;

		case LE_MARK:
			break;

		case LE_SPRITE_EXPLOSION:
			CG_AddSpriteExplosion( le );
			break;

		case LE_EXPLOSION:
			CG_AddExplosion( le );
			break;

		case LE_FRAGMENT:			// gibs and brass
			CG_AddFragment( le );
			break;

		case LE_MOVE_SCALE_FADE:		// water bubbles
			CG_AddMoveScaleFade( le );
			break;

		case LE_FADE_RGB:				// teleporters, railtrails
			CG_AddFadeRGB( le );
			break;

		case LE_FALL_SCALE_FADE: // gib blood trails
			CG_AddFallScaleFade( le );
			break;

		case LE_SCALE_FADE:		// rocket trails
			CG_AddScaleFade( le );
			break;

		case LE_SCOREPLUM:
			CG_AddScorePlum( le );
			break;

#ifdef MISSIONPACK
		case LE_KAMIKAZE:
			CG_AddKamikaze( le );
			break;
		case LE_INVULIMPACT:
			CG_AddInvulnerabilityImpact( le );
			break;
		case LE_INVULJUICED:
			CG_AddInvulnerabilityJuiced( le );
			break;
		case LE_SHOWREFENTITY:
			CG_AddRefEntity( le );
			break;
#endif
		}
	}
}
Example #6
0
/*
===================
CG_AddLocalEntities

===================
*/
void CG_AddLocalEntities( void ) {
	localEntity_t	*le, *next;

	// walk the list backwards, so any new local entities generated
	// (trails, marks, etc) will be present this frame
	le = cg_activeLocalEntities.prev;
	for ( ; le != &cg_activeLocalEntities ; le = next ) {
		// grab next now, so if the local entity is freed we
		// still have it
		next = le->prev;

		if ( cg.time >= le->endTime ) {
			CG_FreeLocalEntity( le );
			continue;
		}

		if (le->leFlags & LEF_ONE_FRAME)
		{	// If this flag is set, only render one single frame, no more.
			if (le->leFlags & LEF_ONE_FRAME_DONE) 
			{
				CG_FreeLocalEntity( le );
				continue;
			}
			else
			{
				le->leFlags |= LEF_ONE_FRAME_DONE;
			}
		}

		switch ( le->leType ) {
		default:
			CG_Error( "Bad leType: %i", le->leType );
			break;

		case LE_MARK:
			break;

		case LE_SPRITE_EXPLOSION:
			CG_AddSpriteExplosion( le );
			break;

		case LE_EXPLOSION:
			CG_AddExplosion( le );
			break;

		case LE_MOVE_SCALE_FADE:		// water bubbles
			CG_AddMoveScaleFade( le );
			break;

		case LE_FADE_RGB:				// teleporters, railtrails
			CG_AddFadeRGB( le );
			break;

		case LE_FALL_SCALE_FADE: // gib blood trails
			CG_AddFallScaleFade( le );
			break;

		case LE_SCALE_FADE:		// rocket trails
			CG_AddScaleFade( le );
			break;

		case LE_SCALE_FADE_SPRITE:		// Trek type for oriented poly sprites.
			CG_AddScaleFadeSprite( le );
			break;

		case LE_LINE:					// Trek type for beams.
			CG_AddLine( le );
			break;

		case LE_LINE2:					// Trek type for beams, with taper support.
			CG_AddLine2( le );
			break;

		case LE_OLINE:					// Trek type for rectangles
			CG_AddOLine( le );
			break;

		case LE_TRAIL:					// Trek type for sparks.
			CG_AddTrail( le );
			break;

		case LE_VIEWSPRITE:				// Trek primitive for camera-facing sprites.
			CG_AddViewSprite( le );
			break;

		case LE_BEZIER:
			CG_AddBezier( le );
			break;

		case LE_QUAD:
			CG_AddQuad( le );
			break;

		case LE_CYLINDER:
			CG_AddCylinder(le);
			break;

		case LE_ELECTRICITY:
			CG_AddElectricity(le);
			break;

		case LE_PARTICLE:
			CG_AddParticle(le);
			break;

		case LE_SPAWNER:
			CG_AddSpawner(le);
			break;

		case LE_FRAGMENT:
			CG_AddFragment(le);
			break;

		case LE_STASISDOOR:
			if(le->refEntity.data.cylinder.wrap) {
				le->refEntity.shaderRGBA[3] = (1 - (le->endTime - cg.time)/1000) * 255;
			} else {
				le->refEntity.shaderRGBA[3] = ((le->endTime - cg.time)/1000) * 255;
			}
			trap_R_AddRefEntityToScene(&le->refEntity);
			break;
		}
	}
}
Example #7
0
/*
=======================================================================================================================================
CG_AddLocalEntities
=======================================================================================================================================
*/
void CG_AddLocalEntities(void) {
	localEntity_t *le, *next;
	int oldPhysicsTime;

	// have local entities interact with movers (submodels) at their render position
	oldPhysicsTime = cg.physicsTime;
	cg.physicsTime = cg.time;
	// walk the list backwards, so any new local entities generated (trails, marks, etc.) will be present this frame
	le = cg_activeLocalEntities.prev;

	for (; le != &cg_activeLocalEntities; le = next) {
		// grab next now, so if the local entity is freed we still have it
		next = le->prev;

		if (cg.time >= le->endTime) {
			CG_FreeLocalEntity(le);
			continue;
		}

		switch (le->leType) {
			default:
				CG_Error("Bad leType: %i", le->leType);
				break;
			case LE_SPRITE_EXPLOSION:
				CG_AddSpriteExplosion(le);
				break;
			case LE_EXPLOSION:
				CG_AddExplosion(le);
				break;
			case LE_KAMIKAZE:
				CG_AddKamikaze(le);
				break;
			case LE_MARK:
				break;
			case LE_FRAGMENT: // gibs and brass
				CG_AddFragment(le);
				break;
			case LE_SCALE_FADE: // rocket trails
				CG_AddScaleFade(le);
				break;
			case LE_FADE_RGB: // teleporters, railtrails
				CG_AddFadeRGB(le);
				break;
			case LE_FALL_SCALE_FADE: // gib blood trails
				CG_AddFallScaleFade(le);
				break;
			case LE_MOVE_SCALE_FADE: // water bubbles
				CG_AddMoveScaleFade(le);
				break;
			case LE_BUBBLE:
				CG_BubbleThink(le);
				break;
			case LE_SCOREPLUM:
				CG_AddScorePlum(le);
				break;
			case LE_SHOWREFENTITY:
				CG_AddRefEntity(le);
				break;
		}
	}

	cg.physicsTime = oldPhysicsTime;
}
Example #8
0
/*
===================
CG_AddLocalEntities

===================
*/
void CG_AddLocalEntities( void ) {
	localEntity_t	*le, *next;

	// walk the list backwards, so any new local entities generated
	// (trails, marks, etc) will be present this frame
	le = cg_activeLocalEntities.prev;
	for ( ; le != &cg_activeLocalEntities ; le = next ) {
		// grab next now, so if the local entity is freed we
		// still have it
		next = le->prev;

		if ( cg.time >= le->endTime ) {
			CG_FreeLocalEntity( le );
			continue;
		}
		switch ( le->leType ) {
		default:
			CG_Error( "Bad leType: %i", le->leType );
			break;

		case LE_MARK:
			break;

		case LE_SPRITE_EXPLOSION:
			CG_AddSpriteExplosion( le );
			break;

		case LE_EXPLOSION:
			CG_AddExplosion( le );
			break;

		case LE_FRAGMENT:			// gibs and brass
			CG_AddFragment( le );
			break;

		case LE_FRAGMENT_FIRE:			// explosion particles
			CG_AddFireFragment( le );
			break;

		case LE_FIRE_EFFECT:
			CG_AddFireEffect( le );
			break;

		case LE_MOVE_SCALE:				// various particles
			CG_AddMoveScale( le );
			break;

		case LE_MOVE_SCALE_FADE:		// water bubbles
			CG_AddMoveScaleFade( le );
			break;

		case LE_FADE_RGB:				// teleporters, railtrails
			CG_AddFadeRGB( le );
			break;

		case LE_FALL_SCALE_FADE: // gib blood trails
			CG_AddFallScaleFade( le );
			break;

		case LE_SCALE_FADE:		// rocket trails
			CG_AddScaleFade( le );
			break;

		case LE_SCOREPLUM:
			CG_AddScorePlum( le );
			break;

		case LE_MISSILE:
			CG_AddMissile( le );
			break;
		}
	}
}