26 Dec 2010

This commit is contained in:
g-cont 2010-12-26 00:00:00 +03:00 committed by Alibek Omarov
parent 8a73b2a3de
commit 0a5a5bb302
30 changed files with 279 additions and 324 deletions

View File

@ -1,4 +1,4 @@
build ????
build 1418
Tools: move all tools into launch.dll
Sound: moving snd_dx.dll into engine.dll
@ -11,6 +11,7 @@ FS: recode wad resource management (now support lumps from wads with same name)
Engine: trigger_camera is now correctly saved and restored
Render: add sorting for translucent surfaces
Render: make support for 'static' models (any opaque non-moving brushes engine automatically make as part of world)
Render: correct serialization for decals on bmodels
build 1338

View File

@ -106,36 +106,22 @@ typedef struct mnode_s
typedef struct msurface_s msurface_t;
typedef struct decal_s decal_t;
#if 0 // Original decal struct is temporare disabled
// JAY: Compress this as much as possible
struct decal_s
{
decal_t *pnext; // linked list for each surface
msurface_t *psurface; // Surface id for persistence / unlinking
short dx; // Offsets into surface texture
short dy; // (in texture coordinates, so we don't need floats)
float dx; // Offsets into surface texture
float dy; // (in world coordinates. FIXME: make shorts ?)
short texture; // Decal texture
byte scale; // Pixel scale
byte flags; // Decal flags
byte flags; // Decal flags FDECAL_*
short entityIndex; // Entity this is attached to
};
#else
struct decal_s
{
struct decal_s *pnext; // linked list for each surface
struct msurface_s *psurface; // surface id for persistence / unlinking
short texture; // decal image
vec3_t position; // location of the decal center in world space.
vec3_t worldPos; // untransformed position, keep for serialization
vec3_t saxis; // direction of the s axis in world space
float dx, dy; // Offsets into surface texture
float scale; // pixel scale
short flags; // decal flags FDECAL_*
short entityIndex; // entity this is attached to
};
#endif
typedef struct mleaf_s
{

View File

@ -1,47 +0,0 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
#ifndef PLAYERINFO_H
#define PLAYERINFO_H
#define MAX_SCOREBOARDNAME 32
#define MAX_INFO_STRING 256
typedef struct player_info_s
{
int userid; // User id on server
char userinfo[MAX_INFO_STRING]; // User info string
char name[MAX_SCOREBOARDNAME]; // Name (extracted from userinfo)
int spectator; // Spectator or not, unused
int ping;
int packet_loss;
// skin information
char model[64];
int topcolor;
int bottomcolor;
// last frame rendered
int renderframe;
// Gait frame estimation
int gaitsequence;
float gaitframe;
float gaityaw;
vec3_t prevgaitorigin;
} player_info_t;
#endif//PLAYERINFO_H

View File

@ -146,7 +146,6 @@ void CL_WriteDemoHeader( const char *name )
Mem_Set( &nullstate, 0, sizeof( nullstate ));
Mem_Set( &nullmovevars, 0, sizeof( nullmovevars ));
// FIXME: use clgame.numEntities instead ?
for( i = 0; i < clgame.maxEntities; i++ )
{
state = &clgame.entities[i].baseline;

View File

@ -7,7 +7,9 @@
#include "client.h"
#include "net_encode.h"
#include "entity_types.h"
#include "pm_local.h"
#include "cl_tent.h"
#include "studio.h"
#include "dlight.h"
#include "input.h"
@ -38,6 +40,90 @@ void CL_UpdateEntityFields( cl_entity_t *ent )
// apply scale to studiomodels and sprites only
if( ent->model && ent->model->type != mod_brush && !ent->curstate.scale )
ent->curstate.scale = 1.0f;
// make me lerp
if( ent->curstate.eflags & EFLAG_SLERP )
{
float d, f = 0.0f;
cl_entity_t *m_pGround;
int i;
// don't do it if the goalstarttime hasn't updated in a while.
// NOTE: Because we need to interpolate multiplayer characters, the interpolation time limit
// was increased to 1.0 s., which is 2x the max lag we are accounting for.
if(( cl.time < ent->curstate.animtime + 1.0f ) && ( ent->curstate.animtime != ent->latched.prevanimtime ))
f = ( cl.time - ent->curstate.animtime ) / ( ent->curstate.animtime - ent->latched.prevanimtime );
f = f - 1.0f;
if( ent->curstate.movetype == MOVETYPE_FLY )
{
ent->origin[0] += ( ent->curstate.origin[0] - ent->latched.prevorigin[0] ) * f;
ent->origin[1] += ( ent->curstate.origin[1] - ent->latched.prevorigin[1] ) * f;
ent->origin[2] += ( ent->curstate.origin[2] - ent->latched.prevorigin[2] ) * f;
for( i = 0; i < 3; i++ )
{
float ang1, ang2;
ang1 = ent->curstate.angles[i];
ang2 = ent->latched.prevangles[i];
d = ang1 - ang2;
if( d > 180 ) d -= 360;
else if( d < -180 ) d += 360;
ent->angles[i] += d * f;
}
}
else if( ent->curstate.movetype == MOVETYPE_STEP )
{
vec3_t vecSrc, vecEnd;
pmtrace_t trace;
VectorSet( vecSrc, ent->origin[0], ent->origin[1], ent->origin[2] + ent->model->maxs[2] );
VectorSet( vecEnd, vecSrc[0], vecSrc[1], vecSrc[2] - ent->model->mins[2] );
trace = PM_PlayerTrace( clgame.pmove, vecSrc, vecEnd, PM_STUDIO_IGNORE, 0, -1, NULL );
m_pGround = CL_GetEntityByIndex( pfnIndexFromTrace( &trace ));
if( m_pGround && m_pGround->curstate.movetype == MOVETYPE_PUSH )
{
studiohdr_t *phdr;
mstudioseqdesc_t *pseqdesc;
qboolean applyVel, applyAvel;
d = 1.0f - cl.lerpFrac; // use backlerp to interpolate pusher position
phdr = (studiohdr_t *)Mod_Extradata( ent->model );
ASSERT( phdr != NULL );
pseqdesc = (mstudioseqdesc_t *)((byte *)phdr + phdr->seqindex) + ent->curstate.sequence;
d = d - 1.0f;
applyVel = !VectorCompare( m_pGround->curstate.origin, m_pGround->prevstate.origin );
applyAvel = !VectorCompare( m_pGround->curstate.angles, m_pGround->prevstate.angles );
if( applyVel || applyAvel )
{
ent->origin[0] += ( m_pGround->curstate.origin[0] - m_pGround->latched.prevorigin[0] ) * d;
ent->origin[1] += ( m_pGround->curstate.origin[1] - m_pGround->latched.prevorigin[1] ) * d;
ent->origin[2] += ( m_pGround->curstate.origin[2] - m_pGround->latched.prevorigin[2] ) * d;
}
if( applyAvel )
{
for( i = 0; i < 3; i++ )
{
float ang1, ang2;
ang1 = m_pGround->curstate.angles[i];
ang2 = m_pGround->latched.prevangles[i];
f = ang1 - ang2;
if( d > 180 ) f -= 360;
else if( d < -180 ) f += 360;
ent->curstate.angles[i] += d * f;
}
}
}
}
}
}
qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType )
@ -192,11 +278,11 @@ CL_UpdateStudioVars
Update studio latched vars so interpolation work properly
==================
*/
void CL_UpdateStudioVars( cl_entity_t *ent, entity_state_t *newstate )
void CL_UpdateStudioVars( cl_entity_t *ent, entity_state_t *newstate, qboolean noInterp )
{
int i;
if( newstate->effects & EF_NOINTERP )
if( newstate->effects & EF_NOINTERP || noInterp )
{
ent->latched.sequencetime = 0.0f; // no lerping between sequences
ent->latched.prevsequence = newstate->sequence; // keep an actual
@ -212,8 +298,6 @@ void CL_UpdateStudioVars( cl_entity_t *ent, entity_state_t *newstate )
// copy blends
for( i = 0; i < 4; i++ )
ent->latched.prevblending[i] = newstate->blending[i];
newstate->effects &= ~EF_NOINTERP;
return;
}
@ -265,58 +349,42 @@ void CL_DeltaEntity( sizebuf_t *msg, frame_t *frame, int newnum, entity_state_t
cl_entity_t *ent;
entity_state_t *state;
qboolean newent = (old) ? false : true;
qboolean noInterp = false;
int result = 1;
qboolean result = true;
ent = EDICT_NUM( newnum );
state = &cls.packet_entities[cls.next_client_entities % cls.num_client_entities];
ent->index = newnum;
if( newent ) old = &ent->baseline;
if( unchanged )
{
*state = *old;
}
else
{
result = MSG_ReadDeltaEntity( msg, old, state, newnum, CL_IsPlayerIndex( newnum ), sv_time( ));
}
if( unchanged ) *state = *old;
else result = MSG_ReadDeltaEntity( msg, old, state, newnum, CL_IsPlayerIndex( newnum ), cl.mtime[0] );
if( !result )
{
if( newent ) Host_Error( "Cl_DeltaEntity: tried to release new entity\n" );
if( state->number == -1 )
{
// Msg( "Entity %s was removed from server\n", ent->curstate.classname );
CL_FreeEntity( ent );
}
else
{
// Msg( "Entity %s was removed from delta-message\n", ent->curstate.classname );
ent->curstate.effects |= EF_NODRAW; // don't rendering
CL_KillDeadBeams( ent ); // release dead beams
}
CL_KillDeadBeams( ent ); // release dead beams
// FIXME: waiting for static entity implimentation
// if( state->number == -1 )
// R_RemoveEfrags( ent );
// entity was delta removed
return;
}
// entity present in currentframe
// entity is present in newframe
state->messagenum = cl.parsecount;
state->msg_time = cl.mtime[0];
cls.next_client_entities++;
frame->num_entities++;
if( !ent->index )
{
CL_InitEntity( ent );
noInterp = true;
}
// set player state
ent->player = CL_IsPlayerIndex( ent->index );
if( state->effects & EF_NOINTERP || noInterp )
if( state->effects & EF_NOINTERP || newent )
{
// duplicate the current state so lerping doesn't hurt anything
ent->prevstate = *state;
@ -329,7 +397,16 @@ void CL_DeltaEntity( sizebuf_t *msg, frame_t *frame, int newnum, entity_state_t
// NOTE: always check modelindex for new state not current
if( Mod_GetType( state->modelindex ) == mod_studio )
CL_UpdateStudioVars( ent, state );
{
CL_UpdateStudioVars( ent, state, newent );
}
else if( Mod_GetType( state->modelindex ) == mod_brush )
{
if( !VectorCompare( state->origin, ent->curstate.origin ))
VectorCopy( ent->curstate.origin, ent->latched.prevorigin );
if( !VectorCompare( state->angles, ent->curstate.angles ))
VectorCopy( ent->curstate.angles, ent->latched.prevangles );
}
// set right current state
ent->curstate = *state;
@ -371,9 +448,6 @@ void CL_FlushEntityPacket( sizebuf_t *msg )
if( BF_CheckOverflow( msg ))
Host_Error( "CL_FlushEntityPacket: read overflow\n" );
while( newnum >= clgame.numEntities )
clgame.numEntities++;
MSG_ReadDeltaEntity( msg, &from, &to, newnum, CL_IsPlayerIndex( newnum ), sv_time( ));
}
}
@ -490,9 +564,6 @@ void CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
if( BF_CheckOverflow( msg ))
Host_Error( "CL_ParsePacketEntities: read overflow\n" );
while( newnum >= clgame.numEntities )
clgame.numEntities++;
while( oldnum < newnum )
{
// one or more entities from the old packet are unchanged
@ -599,10 +670,7 @@ CL_AddPacketEntities
void CL_AddPacketEntities( frame_t *frame )
{
cl_entity_t *ent, *clent;
int e, entityType;
// now recalc actual entcount
for( ; !EDICT_NUM( clgame.numEntities - 1 )->index; clgame.numEntities-- );
int i, e, entityType;
clent = CL_GetLocalPlayer();
if( !clent ) return;
@ -610,13 +678,11 @@ void CL_AddPacketEntities( frame_t *frame )
// update client vars
clgame.dllFuncs.pfnTxferLocalOverrides( &clent->curstate, &cl.frame.local.client );
for( e = 1; e < clgame.numEntities; e++ )
for( i = 0; i < cl.frame.num_entities; i++ )
{
e = cls.packet_entities[(cl.frame.first_entity + i) % cls.num_client_entities].number;
ent = CL_GetEntityByIndex( e );
if( !ent || !ent->index ) continue;
// entity not visible for this client
if( ent->curstate.effects & EF_NODRAW )
if( !ent || ent == clgame.entities )
continue;
CL_UpdateEntityFields( ent );
@ -662,53 +728,24 @@ void CL_AddEntities( void )
qboolean CL_GetEntitySpatialization( int entnum, vec3_t origin, vec3_t velocity )
{
cl_entity_t *ent;
qboolean from_baseline = false;
qboolean valid_origin;
if( entnum < 0 || entnum > clgame.numEntities )
return false;
valid_origin = VectorIsNull( origin ) ? false : true;
ent = CL_GetEntityByIndex( entnum );
if( !ent || !ent->index ) return valid_origin;
ent = EDICT_NUM( entnum );
// setup origin and velocity
if( origin ) VectorCopy( ent->curstate.origin, origin );
if( velocity ) VectorCopy( ent->curstate.velocity, velocity );
if( !ent->index || ent->curstate.number != entnum )
// if a brush model, offset the origin
if( origin && Mod_GetType( ent->curstate.modelindex ) == mod_brush )
{
// this entity isn't visible but maybe it have baseline ?
if( ent->baseline.number != entnum )
return false;
from_baseline = true;
}
vec3_t mins, maxs, midPoint;
if( from_baseline )
{
// setup origin and velocity
if( origin ) VectorCopy( ent->baseline.origin, origin );
if( velocity ) VectorCopy( ent->baseline.velocity, velocity );
// if a brush model, offset the origin
if( origin && Mod_GetType( ent->baseline.modelindex ) == mod_brush )
{
vec3_t mins, maxs, midPoint;
Mod_GetBounds( ent->baseline.modelindex, mins, maxs );
VectorAverage( mins, maxs, midPoint );
VectorAdd( origin, midPoint, origin );
}
}
else
{
// setup origin and velocity
if( origin ) VectorCopy( ent->origin, origin );
if( velocity ) VectorCopy( ent->curstate.velocity, velocity );
// if a brush model, offset the origin
if( origin && Mod_GetType( ent->curstate.modelindex ) == mod_brush )
{
vec3_t mins, maxs, midPoint;
Mod_GetBounds( ent->curstate.modelindex, mins, maxs );
VectorAverage( mins, maxs, midPoint );
VectorAdd( origin, midPoint, origin );
}
Mod_GetBounds( ent->curstate.modelindex, mins, maxs );
VectorAverage( mins, maxs, midPoint );
VectorAdd( origin, midPoint, origin );
}
return true;
}

View File

@ -89,11 +89,9 @@ cl_entity_t *CL_GetEntityByIndex( int index )
if( index < 0 )
return clgame.dllFuncs.pfnGetUserEntity( abs( index ));
if( index >= clgame.numEntities )
if( index >= clgame.maxEntities )
return NULL;
if( !EDICT_NUM( index )->index )
return NULL;
return EDICT_NUM( index );
}
@ -1253,23 +1251,11 @@ void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, floa
CL_QueueEvent( flags, eventindex, delay, &args );
}
void CL_InitEntity( cl_entity_t *pEdict )
{
ASSERT( pEdict );
pEdict->index = NUM_FOR_EDICT( pEdict );
}
void CL_FreeEntity( cl_entity_t *pEdict )
{
ASSERT( pEdict );
// already freed ?
if( !pEdict->index ) return;
R_RemoveEfrags( pEdict );
CL_KillDeadBeams( pEdict );
pEdict->index = 0; // freed
}
void CL_ClearWorld( void )
@ -1292,35 +1278,19 @@ void CL_InitEdicts( void )
cls.num_client_entities = CL_UPDATE_BACKUP * 64;
cls.packet_entities = Z_Realloc( cls.packet_entities, sizeof( entity_state_t ) * cls.num_client_entities );
clgame.entities = Mem_Alloc( clgame.mempool, sizeof( cl_entity_t ) * clgame.maxEntities );
clgame.numEntities = 1;
}
void CL_FreeEdicts( void )
{
int i;
cl_entity_t *ent;
if( clgame.entities )
{
for( i = 0; i < clgame.maxEntities; i++ )
{
ent = EDICT_NUM( i );
if( ent->index <= 0 ) continue;
CL_FreeEntity( ent );
}
Mem_Free( clgame.entities );
}
clgame.entities = NULL;
if( cls.packet_entities )
{
Z_Free( cls.packet_entities );
cls.packet_entities = NULL;
cls.num_client_entities = 0;
cls.next_client_entities = 0;
}
clgame.numEntities = 0;
clgame.entities = NULL;
cls.packet_entities = NULL;
cls.num_client_entities = 0;
cls.next_client_entities = 0;
}
/*
@ -1481,7 +1451,9 @@ pfnSPR_Draw
*/
static void pfnSPR_Draw( int frame, int x, int y, const wrect_t *prc )
{
GL_SetRenderMode( kRenderNormal );
GL_SetState( GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE_MINUS_SRC_ALPHA );
GL_TexEnv( GL_MODULATE );
SPR_DrawGeneric( frame, x, y, -1, -1, prc );
}

View File

@ -1005,7 +1005,7 @@ void CL_PrepSound( void )
if( entry->looping && entry->entnum != -1 )
{
MsgDev( D_NOTE, "Restarting sound %s...\n", entry->name );
S_AmbientSound( entry->origin, entry->entnum, entry->entchannel,
S_AmbientSound( entry->origin, entry->entnum,
S_RegisterSound( entry->name ), entry->volume, entry->attenuation,
entry->pitch, 0 );
}
@ -1111,7 +1111,7 @@ void CL_PrepVideo( void )
if( entry->looping && entry->entnum != -1 )
{
MsgDev( D_NOTE, "Restarting sound %s...\n", entry->name );
S_AmbientSound( entry->origin, entry->entnum, entry->entchannel,
S_AmbientSound( entry->origin, entry->entnum,
S_RegisterSound( entry->name ), entry->volume, entry->attenuation,
entry->pitch, 0 );
}

View File

@ -380,7 +380,7 @@ void CL_ParseSoundPacket( sizebuf_t *msg, qboolean is_ambient )
if( is_ambient )
{
S_AmbientSound( pos, entnum, chan, handle, volume, attn, pitch, flags );
S_AmbientSound( pos, entnum, handle, volume, attn, pitch, flags );
}
else
{
@ -721,12 +721,9 @@ void CL_ParseBaseline( sizebuf_t *msg )
if( newnum < 0 ) Host_Error( "CL_SpawnEdict: invalid number %i\n", newnum );
if( newnum > clgame.maxEntities ) Host_Error( "CL_AllocEdict: no free edicts\n" );
// increase edicts
while( newnum >= clgame.numEntities )
clgame.numEntities++;
ent = EDICT_NUM( newnum );
Mem_Set( &ent->prevstate, 0, sizeof( ent->prevstate ));
ent->index = newnum;
if( cls.state == ca_active )
timebase = sv_time();

View File

@ -97,11 +97,11 @@ apply pre-calculated values
void V_AddViewModel( void )
{
// add viewmodel only at firstperson pass when game not paused
if( cl.refdef.nextView || cl.refdef.paused || cl.thirdperson )
if( cl.refdef.nextView || cl.refdef.paused || cl.thirdperson || cl.refdef.health <= 0 )
return;
// make sure what frame is valid and viewmodel is set
if( !cl.frame.valid || !clgame.viewent.model )
if( !cl.frame.valid || !clgame.viewent.model || cl.refdef.viewentity != ( cl.playernum + 1 ))
return;
CL_AddVisibleEntity( &clgame.viewent, ET_NORMAL );

View File

@ -327,7 +327,6 @@ typedef struct
cl_entity_t *entities; // dynamically allocated entity array
int numEntities; // actual ents count
int maxEntities;
// movement values from server
@ -563,12 +562,12 @@ void CL_DrawHUD( int state );
void CL_InitEdicts( void );
void CL_FreeEdicts( void );
void CL_ClearWorld( void );
void CL_InitEntity( cl_entity_t *pEdict );
void CL_FreeEntity( cl_entity_t *pEdict );
void CL_CenterPrint( const char *text, float y );
void CL_SetEventIndex( const char *szEvName, int ev_index );
void CL_TextMessageParse( byte *pMemFile, int fileSize );
int pfnDecalIndexFromName( const char *szDecalName );
int pfnIndexFromTrace( struct pmtrace_s *pTrace );
int CL_FindModelIndex( const char *m );
HSPRITE pfnSPR_Load( const char *szPicName );
@ -634,7 +633,6 @@ qboolean CL_InitStudioAPI( void );
//
void CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta );
qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType );
void CL_UpdateStudioVars( cl_entity_t *ent, entity_state_t *newstate );
qboolean CL_GetEntitySpatialization( int ent, vec3_t origin, vec3_t velocity );
qboolean CL_IsPlayerIndex( int idx );
@ -700,7 +698,7 @@ void S_BeginRegistration( void );
sound_t S_RegisterSound( const char *sample );
void S_EndRegistration( void );
void S_StartSound( const vec3_t pos, int ent, int chan, sound_t sfx, float vol, float attn, int pitch, int flags );
void S_AmbientSound( const vec3_t pos, int ent, int chan, sound_t handle, float fvol, float attn, int pitch, int flags );
void S_AmbientSound( const vec3_t pos, int ent, sound_t handle, float fvol, float attn, int pitch, int flags );
void S_FadeClientVolume( float fadePercent, float fadeOutSeconds, float holdTime, float fadeInSeconds );
void S_StartLocalSound( const char *name );
void S_RenderFrame( struct ref_params_s *fd );

View File

@ -433,8 +433,8 @@ void GL_SetRenderMode( int mode )
texEnv = GL_REPLACE;
break;
case kRenderTransColor:
state = GLSTATE_SRCBLEND_DST_COLOR|GLSTATE_DSTBLEND_SRC_COLOR|GLSTATE_DEPTHWRITE;
texEnv = GL_MODULATE;
state = GLSTATE_SRCBLEND_ZERO|GLSTATE_DSTBLEND_SRC_COLOR|GLSTATE_DEPTHWRITE;
texEnv = GL_DECAL;
break;
case kRenderTransAlpha:
state = GLSTATE_AFUNC_GE128|GLSTATE_DEPTHWRITE;

View File

@ -58,7 +58,6 @@ static void Intersect( decal_clip_t clipFunc, decalvert_t *one, decalvert_t *two
typedef struct
{
vec3_t m_Position; // world coordinates of the decal center
vec3_t m_BasePosition; // untransformed world pos for right serialize
vec3_t m_SAxis; // the s axis for the decal in world coordinates
model_t* m_pModel; // the model the decal is going to be applied in
int m_iTexture; // The decal material
@ -235,8 +234,8 @@ void R_SetupDecalTextureSpaceBasis( decal_t *pDecal, msurface_t *surf, int textu
// world height of decal = ptexture->height / pDecal->scale
// scale is inverse, scales world space to decal u/v space [0,1]
// OPTIMIZE: Get rid of these divides
decalWorldScale[0] = pDecal->scale / width;
decalWorldScale[1] = pDecal->scale / height;
decalWorldScale[0] = (float)pDecal->scale / width;
decalWorldScale[1] = (float)pDecal->scale / height;
VectorScale( textureSpaceBasis[0], decalWorldScale[0], textureSpaceBasis[0] );
VectorScale( textureSpaceBasis[1], decalWorldScale[1], textureSpaceBasis[1] );
@ -562,7 +561,6 @@ static void R_DecalCreate( decalinfo_t *decalinfo, msurface_t *surf, float x, fl
pdecal->flags = decalinfo->m_Flags;
VectorCopy( decalinfo->m_Position, pdecal->position );
VectorCopy( decalinfo->m_BasePosition, pdecal->worldPos );
if( pdecal->flags & FDECAL_USESAXIS )
VectorCopy( decalinfo->m_SAxis, pdecal->saxis );
@ -718,7 +716,6 @@ static void R_DecalNode( model_t *model, mnode_t *node, decalinfo_t *decalinfo )
void R_DecalShoot( int textureIndex, int entityIndex, int modelIndex, vec3_t pos, int flags, vec3_t saxis )
{
decalinfo_t decalInfo;
vec3_t pos_l;
hull_t *hull;
cl_entity_t *ent = NULL;
model_t *model = NULL;
@ -734,8 +731,8 @@ void R_DecalShoot( int textureIndex, int entityIndex, int modelIndex, vec3_t pos
{
ent = CL_GetEntityByIndex( entityIndex );
if( ent != NULL ) model = CM_ClipHandleToModel( ent->curstate.modelindex );
else if( modelIndex > 0 ) model = CM_ClipHandleToModel( modelIndex );
if( modelIndex > 0 ) model = CM_ClipHandleToModel( modelIndex );
else if( ent != NULL ) model = CM_ClipHandleToModel( ent->curstate.modelindex );
else
{
Msg( "ent = NULL, model = NULL on entity %i, model %i\n", entityIndex, modelIndex );
@ -755,10 +752,10 @@ void R_DecalShoot( int textureIndex, int entityIndex, int modelIndex, vec3_t pos
decalInfo.m_pModel = model;
hull = &model->hulls[0]; // always use #0 hull
VectorCopy( pos, decalInfo.m_BasePosition );
if( ent )
{
vec3_t pos_l;
// transform decal position in local bmodel space
if( !VectorIsNull( ent->angles ))
{
@ -857,17 +854,21 @@ void DrawSingleDecal( decal_t *pDecal, msurface_t *fa )
void DrawSurfaceDecals( msurface_t *fa )
{
decal_t *p;
int oldState;
int oldTexEnv;
if( !fa->pdecals ) return;
oldState = glState.flags;
oldTexEnv = glState.currentEnvModes[glState.activeTMU];
GL_SetState( GLSTATE_SRCBLEND_SRC_ALPHA|GLSTATE_DSTBLEND_ONE_MINUS_SRC_ALPHA|GLSTATE_OFFSET_FILL );
GL_TexEnv( GL_REPLACE );
for( p = fa->pdecals; p; p = p->pnext )
DrawSingleDecal( p, fa );
GL_TexEnv( GL_REPLACE );
GL_SetState( GLSTATE_DEPTHWRITE );
GL_SetState( oldState );
GL_TexEnv( oldTexEnv );
}
/*
@ -877,7 +878,7 @@ void DrawSurfaceDecals( msurface_t *fa )
=============================================================
*/
static qboolean R_DecalUnProject( decal_t *pdecal, decallist_t *entry, qboolean changelevel )
static qboolean R_DecalUnProject( decal_t *pdecal, decallist_t *entry )
{
cl_entity_t *ent;
@ -886,7 +887,7 @@ static qboolean R_DecalUnProject( decal_t *pdecal, decallist_t *entry, qboolean
ent = CL_GetEntityByIndex( pdecal->entityIndex );
if( ent && (!VectorIsNull( ent->origin ) || !VectorIsNull( ent->angles )))
if( ent && !VectorIsNull( ent->angles ))
{
// transform decal position back into world space
matrix4x4 decalMatrix, entityMatrix, world;
@ -910,9 +911,6 @@ static qboolean R_DecalUnProject( decal_t *pdecal, decallist_t *entry, qboolean
VectorCopy( pdecal->position, entry->position );
}
// NOTE: return original decal position for world or bmodel
// if( changelevel ) VectorCopy( pdecal->worldPos, entry->position );
entry->entityIndex = pdecal->entityIndex;
// Grab surface plane equation
@ -1008,7 +1006,7 @@ int R_CreateDecalList( decallist_t *pList, qboolean changelevel )
pList[total].depth = depth;
pList[total].flags = decal->flags;
R_DecalUnProject( decal, &pList[total], changelevel );
R_DecalUnProject( decal, &pList[total] );
com.strncpy( pList[total].name, R_GetTexture( decal->texture )->name, sizeof( pList[total].name ));
// check to see if the decal should be added

View File

@ -165,7 +165,6 @@ void R_StoreEfrags( efrag_t **ppefrag )
cl_entity_t *pent;
model_t *clmodel;
efrag_t *pefrag;
int entityType;
while(( pefrag = *ppefrag ) != NULL )
{
@ -182,12 +181,7 @@ void R_StoreEfrags( efrag_t **ppefrag )
if( pent->visframe != tr.framecount )
{
if( pent->player ) entityType = ET_PLAYER;
else if( pent->curstate.entityType == ENTITY_BEAM )
entityType = ET_BEAM;
else entityType = ET_NORMAL;
if( R_AddEntity( pent, entityType ))
if( R_AddEntity( pent, ET_FRAGMENTED ))
{
// mark that we've recorded this entity for this frame
pent->visframe = tr.framecount;

View File

@ -7,6 +7,7 @@
#include "client.h"
#include "mathlib.h"
#include "gl_local.h"
#include "pm_local.h"
#include "studio.h"
/*
@ -290,7 +291,7 @@ static qboolean R_RecursiveLightPoint( model_t *model, mnode_t *node, const vec3
{
tex = surf->texinfo;
if( surf->flags & SURF_DRAWTILED )
if( surf->flags & ( SURF_DRAWSKY|SURF_DRAWTURB ))
continue; // no lightmaps
s = DotProduct( mid, tex->vecs[0] ) + tex->vecs[0][3] - surf->texturemins[0];
@ -334,13 +335,16 @@ R_LightForPoint
*/
void R_LightForPoint( const vec3_t point, color24 *ambientLight, qboolean invLight, float radius )
{
dlight_t *dl;
vec3_t end, dir;
float dist, add;
int lnum;
dlight_t *dl;
pmtrace_t trace;
cl_entity_t *m_pGround;
vec3_t end, dir;
float dist, add;
model_t *pmodel;
mnode_t *pnodes;
int lnum;
// set to full bright if no light data
if( !cl.worldmodel || !cl.worldmodel->lightdata )
if( !RI.refdef.movevars )
{
ambientLight->r = 255;
ambientLight->g = 255;
@ -348,17 +352,53 @@ void R_LightForPoint( const vec3_t point, color24 *ambientLight, qboolean invLig
return;
}
// set to full bright if no light data
if( !cl.worldmodel || !cl.worldmodel->lightdata )
{
ambientLight->r = RI.refdef.movevars->skycolor_r;
ambientLight->g = RI.refdef.movevars->skycolor_g;
ambientLight->b = RI.refdef.movevars->skycolor_b;
return;
}
// Get lighting at this point
VectorCopy( point, end );
if( invLight ) end[2] = point[2] + 8192;
else end[2] = point[2] - 8192;
VectorSet( r_pointColor, 255, 255, 255 );
R_RecursiveLightPoint( cl.worldmodel, cl.worldmodel->nodes, point, end );
// always have valid model
pmodel = cl.worldmodel;
pnodes = pmodel->nodes;
m_pGround = NULL;
ambientLight->r = min((r_pointColor[0] >> 7), 255 );
ambientLight->g = min((r_pointColor[1] >> 7), 255 );
ambientLight->b = min((r_pointColor[2] >> 7), 255 );
if( gl_test->integer )
{
trace = PM_PlayerTrace( clgame.pmove, (float *)point, end, PM_STUDIO_IGNORE, 0, -1, NULL );
m_pGround = CL_GetEntityByIndex( pfnIndexFromTrace( &trace ));
}
if( m_pGround && m_pGround->model && VectorIsNull( m_pGround->origin ) && VectorIsNull( m_pGround->angles ))
{
pmodel = m_pGround->model;
pnodes = &pmodel->nodes[pmodel->hulls[0].firstclipnode];
}
r_pointColor[0] = RI.refdef.movevars->skycolor_r;
r_pointColor[1] = RI.refdef.movevars->skycolor_g;
r_pointColor[2] = RI.refdef.movevars->skycolor_b;
if( R_RecursiveLightPoint( pmodel, pnodes, point, end ))
{
ambientLight->r = min((r_pointColor[0] >> 7), 255 );
ambientLight->g = min((r_pointColor[1] >> 7), 255 );
ambientLight->b = min((r_pointColor[2] >> 7), 255 );
}
else
{
ambientLight->r = RI.refdef.movevars->skycolor_r;
ambientLight->g = RI.refdef.movevars->skycolor_g;
ambientLight->b = RI.refdef.movevars->skycolor_b;
}
// add dynamic lights
if( radius && r_dynamic->integer )

View File

@ -500,7 +500,7 @@ void R_RotateForEntity( cl_entity_t *e )
{
float scale = 1.0f;
if( e == clgame.entities || R_StaticEntity( e ) || gl_test->integer )
if( e == clgame.entities || R_StaticEntity( e ))
{
R_LoadIdentity();
return;
@ -525,7 +525,7 @@ void R_TranslateForEntity( cl_entity_t *e )
{
float scale = 1.0f;
if( e == clgame.entities || R_StaticEntity( e ) || gl_test->integer )
if( e == clgame.entities || R_StaticEntity( e ))
{
R_LoadIdentity();
return;

View File

@ -212,6 +212,9 @@ void GL_BuildPolygonFromSurface( msurface_t *fa )
// already created
if( fa->polys ) return;
if( !fa->texinfo || !fa->texinfo->texture )
return; // bad polygon ?
// reconstruct the polygon
pedges = loadmodel->edges;
lnumverts = fa->numedges;

View File

@ -450,10 +450,9 @@ void R_StudioSetUpTransform( cl_entity_t *e )
VectorCopy( e->angles, angles );
// interpolate monsters position
if( e->curstate.movetype == MOVETYPE_STEP || e->curstate.movetype == MOVETYPE_FLY )
if( e->curstate.movetype == MOVETYPE_STEP )
{
float d, f = 0.0f;
cl_entity_t *m_pGroundEntity;
int i;
// don't do it if the goalstarttime hasn't updated in a while.
@ -472,35 +471,9 @@ void R_StudioSetUpTransform( cl_entity_t *e )
f = f - 1.0f;
}
m_pGroundEntity = CL_GetEntityByIndex( e->curstate.onground );
if( m_pGroundEntity && m_pGroundEntity->curstate.movetype == MOVETYPE_PUSH && !VectorIsNull( m_pGroundEntity->curstate.velocity ))
{
mstudioseqdesc_t *pseqdesc;
pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + e->curstate.sequence;
d = RI.lerpFrac;
origin[0] += ( e->origin[0] - e->prevstate.origin[0] ) * d;
origin[1] += ( e->origin[1] - e->prevstate.origin[1] ) * d;
origin[2] += ( e->origin[2] - e->prevstate.origin[2] ) * d;
d = f - d;
// monster walking on moving platform
if( pseqdesc->motiontype & STUDIO_LX )
{
origin[0] += ( e->curstate.origin[0] - e->latched.prevorigin[0] ) * d;
origin[1] += ( e->curstate.origin[1] - e->latched.prevorigin[1] ) * d;
origin[2] += ( e->curstate.origin[2] - e->latched.prevorigin[2] ) * d;
}
}
else
{
origin[0] += ( e->curstate.origin[0] - e->latched.prevorigin[0] ) * f;
origin[1] += ( e->curstate.origin[1] - e->latched.prevorigin[1] ) * f;
origin[2] += ( e->curstate.origin[2] - e->latched.prevorigin[2] ) * f;
}
origin[0] += ( e->curstate.origin[0] - e->latched.prevorigin[0] ) * f;
origin[1] += ( e->curstate.origin[1] - e->latched.prevorigin[1] ) * f;
origin[2] += ( e->curstate.origin[2] - e->latched.prevorigin[2] ) * f;
for( i = 0; i < 3; i++ )
{
@ -516,9 +489,6 @@ void R_StudioSetUpTransform( cl_entity_t *e )
angles[i] += d * f;
}
// update it so attachments always have right pos
if( !RI.refdef.paused ) VectorCopy( origin, e->origin );
}
// stupid Half-Life bug

View File

@ -430,7 +430,9 @@ void S_StartSound( const vec3_t pos, int ent, int chan, sound_t handle, float fv
if( !pos ) pos = vec3_origin;
// pick a channel to play on
target_chan = SND_PickDynamicChannel( ent, chan, sfx );
if( chan == CHAN_STATIC ) target_chan = SND_PickStaticChannel( ent, sfx );
else target_chan = SND_PickDynamicChannel( ent, chan, sfx );
if( !target_chan )
{
MsgDev( D_ERROR, "dropped sound \"sound/%s\"\n", sfx->name );
@ -529,7 +531,7 @@ Pitch changes playback pitch of wave by % above or below 100. Ignored if pitch
NOTE: volume is 0.0 - 1.0 and attenuation is 0.0 - 1.0 when passed in.
=================
*/
void S_AmbientSound( const vec3_t pos, int ent, int chan, sound_t handle, float fvol, float attn, int pitch, int flags )
void S_AmbientSound( const vec3_t pos, int ent, sound_t handle, float fvol, float attn, int pitch, int flags )
{
channel_t *ch;
wavdata_t *pSource = NULL;
@ -546,7 +548,7 @@ void S_AmbientSound( const vec3_t pos, int ent, int chan, sound_t handle, float
if( flags & (SND_STOP|SND_CHANGE_VOL|SND_CHANGE_PITCH))
{
if( S_AlterChannel( ent, chan, sfx, vol, pitch, flags ))
if( S_AlterChannel( ent, CHAN_STATIC, sfx, vol, pitch, flags ))
return;
if( flags & SND_STOP ) return;
}
@ -562,7 +564,7 @@ void S_AmbientSound( const vec3_t pos, int ent, int chan, sound_t handle, float
if( ent != 0 ) CL_GetEntitySpatialization( ent, origin, NULL );
// pick a channel to play on from the static area
ch = SND_PickStaticChannel( ent, sfx ); // autolooping sounds are always fixed origin(?)
ch = SND_PickStaticChannel( ent, sfx );
if( !ch ) return;
if( S_TestSoundChar( sfx->name, '!' ))
@ -600,9 +602,9 @@ void S_AmbientSound( const vec3_t pos, int ent, int chan, sound_t handle, float
ch->localsound = (flags & SND_LOCALSOUND) ? true : false;
ch->master_vol = vol;
ch->dist_mult = (attn / SND_CLIP_DISTANCE);
ch->entchannel = CHAN_STATIC;
ch->basePitch = pitch;
ch->entnum = ent;
ch->entchannel = chan;
SND_Spatialize( ch );
}
@ -629,7 +631,7 @@ S_GetCurrentStaticSounds
grab all static sounds playing at current channel
==================
*/
int S_GetCurrentStaticSounds( soundlist_t *pout, int size, int entchannel )
int S_GetCurrentStaticSounds( soundlist_t *pout, int size )
{
int sounds_left = size;
int i;
@ -639,11 +641,10 @@ int S_GetCurrentStaticSounds( soundlist_t *pout, int size, int entchannel )
for( i = MAX_DYNAMIC_CHANNELS; i < total_channels && sounds_left; i++ )
{
if(( !entchannel || channels[i].entchannel == entchannel ) && channels[i].sfx )
if( channels[i].entchannel == CHAN_STATIC && channels[i].sfx )
{
com.strncpy( pout->name, channels[i].sfx->name, sizeof( pout->name ));
pout->entnum = channels[i].entnum;
pout->entchannel = channels[i].entchannel;
VectorCopy( channels[i].origin, pout->origin );
pout->volume = (float)channels[i].master_vol / 255.0f;
pout->attenuation = channels[i].dist_mult * SND_CLIP_DISTANCE;

View File

@ -240,7 +240,7 @@ void S_SoundInfo_f( void );
channel_t *SND_PickDynamicChannel( int entnum, int channel, sfx_t *sfx );
channel_t *SND_PickStaticChannel( int entnum, sfx_t *sfx );
int S_GetCurrentStaticSounds( soundlist_t *pout, int size, int entchannel );
int S_GetCurrentStaticSounds( soundlist_t *pout, int size );
sfx_t *S_GetSfxByHandle( sound_t handle );
void S_StopSound( int entnum, int channel, const char *soundname );
void S_StopAllSounds( void );

View File

@ -98,7 +98,6 @@ typedef struct
{
string name;
int entnum;
int entchannel;
vec3_t origin;
float volume;
float attenuation;

View File

@ -334,7 +334,7 @@ qboolean S_Init( void );
void S_Shutdown( void );
void S_Activate( qboolean active, void *hInst );
void S_StopSound( int entnum, int channel, const char *soundname );
int S_GetCurrentStaticSounds( soundlist_t *pout, int size, int entchannel );
int S_GetCurrentStaticSounds( soundlist_t *pout, int size );
void S_StopAllSounds( void );
#endif//COMMON_H

View File

@ -354,13 +354,13 @@ void Host_RestartAmbientSounds( void )
if( !SV_Active( )) return;
nSounds = S_GetCurrentStaticSounds( soundInfo, 100, CHAN_STATIC );
nSounds = S_GetCurrentStaticSounds( soundInfo, 100 );
for( i = 0; i < nSounds; i++)
{
if( soundInfo[i].looping && soundInfo[i].entnum != -1 )
{
S_StopSound( soundInfo[i].entnum, soundInfo[i].entchannel, soundInfo[i].name );
S_StopSound( soundInfo[i].entnum, CHAN_STATIC, soundInfo[i].name );
// FIXME: replace with SV_StartAmbientSound
SV_StartSound( pfnPEntityOfEntIndex( soundInfo[i].entnum ), CHAN_STATIC,

View File

@ -414,7 +414,7 @@ qboolean PM_TraceModel( physent_t *pe, const vec3_t start, vec3_t mins, vec3_t m
ptr->ent = -1;
// completely ignore studiomodels (same as MOVE_NOMONSTERS)
if( pe->studiomodel && flags & PM_STUDIO_IGNORE )
if( pe->studiomodel && ( flags & PM_STUDIO_IGNORE ))
return hitEnt;
if( pe->movetype == MOVETYPE_PUSH || pe->solid == SOLID_BSP )

View File

@ -115,12 +115,10 @@
// decal flags
#define FDECAL_PERMANENT 0x01 // This decal should not be removed in favor of any new decals
#define FDECAL_CUSTOM 0x02 // This is a custom clan logo and should not be saved/restored
#define FDECAL_DYNAMIC 0x04 // Indicates the decal is dynamic
#define FDECAL_DONTSAVE 0x08 // Decal was loaded from adjacent level, don't save it for this level
#define FDECAL_CLIPTEST 0x10 // Decal needs to be clip-tested
#define FDECAL_NOCLIP 0x20 // Decal is not clipped by containing polygon
#define FDECAL_USESAXIS 0x40 // Uses the s axis field to determine orientation (footprints)
#define FDECAL_ANIMATED 0x80 // this is decal has multiple frames
#define FDECAL_DONTSAVE 0x04 // Decal was loaded from adjacent level, don't save it for this level
#define FDECAL_CLIPTEST 0x08 // Decal needs to be clip-tested
#define FDECAL_NOCLIP 0x10 // Decal is not clipped by containing polygon
#define FDECAL_USESAXIS 0x20 // Uses the s axis field to determine orientation (footprints)
// Max number of history commands to send ( 2 by default ) in case of dropped packets
#define NUM_BACKUP_COMMAND_BITS 3

View File

@ -319,9 +319,7 @@ void SV_CreateDecal( const float *origin, int decalIndex, int entityIndex, int m
// this can happens if serialized map contain 4096 static decals...
if(( BF_GetNumBytesWritten( &sv.signon ) + 20 ) >= BF_GetMaxBytes( &sv.signon ))
{
return;
}
// static decals are posters, it's always reliable
BF_WriteByte( &sv.signon, svc_bspdecal );
@ -1120,6 +1118,7 @@ edict_t* pfnFindEntityByString( edict_t *pStartEdict, const char *pszField, cons
ed = EDICT_NUM( e );
if( !SV_IsValidEdict( ed )) continue;
if( ed->v.flags & FL_KILLME ) continue;
switch( desc->fieldType )
{
@ -1176,7 +1175,7 @@ edict_t* pfnFindEntityInSphere( edict_t *pStartEdict, const float *org, float fl
{
ent = EDICT_NUM( e );
if( !SV_IsValidEdict( ent )) continue;
if( !ent->pvPrivateData ) continue;
if( ent->v.flags & FL_KILLME ) continue;
distSquared = 0;
for( j = 0; j < 3 && distSquared <= flRadius; j++ )
@ -1283,7 +1282,8 @@ edict_t *pfnEntitiesInPVS( edict_t *pplayer )
pEdict = EDICT_NUM( i );
if( !SV_IsValidEdict( pEdict )) continue;
if( pEdict->v.flags & FL_KILLME ) continue;
if( Mod_GetType( pEdict->v.modelindex ) == mod_brush )
result = SV_BoxInPVS( pplayer->v.origin, pEdict->v.absmin, pEdict->v.absmax );
else result = SV_OriginIn( DVIS_PVS, pplayer->v.origin, pEdict->v.origin );
@ -1317,6 +1317,7 @@ edict_t *pfnEntitiesInPHS( edict_t *pplayer )
pEdict = EDICT_NUM( i );
if( !SV_IsValidEdict( pEdict )) continue;
if( pEdict->v.flags & FL_KILLME ) continue;
if( Mod_GetType( pEdict->v.modelindex ) == mod_brush )
VectorAverage( pEdict->v.absmin, pEdict->v.absmax, checkPos );
@ -1339,6 +1340,7 @@ pfnMakeVectors
*/
void pfnMakeVectors( const float *rgflVector )
{
ASSERT( rgflVector != NULL );
AngleVectors( rgflVector, svgame.globals->v_forward, svgame.globals->v_right, svgame.globals->v_up );
}
@ -1670,10 +1672,11 @@ void SV_StartSound( edict_t *ent, int chan, const char *sample, float vol, float
if( vol != VOL_NORM ) flags |= SND_VOLUME;
if( attn != ATTN_NONE ) flags |= SND_ATTENUATION;
if( pitch != PITCH_NORM ) flags |= SND_PITCH;
if( sv.state == ss_loading ) flags |= SND_SPAWNING;
// can't track this entity on the client.
// write static sound
if( !ent->v.modelindex || !ent->v.model )
// if( !ent->v.modelindex || !ent->v.model )
flags |= SND_FIXED_ORIGIN;
// ultimate method for detect bsp models with invalid solidity (e.g. func_pushable)
@ -1684,6 +1687,7 @@ void SV_StartSound( edict_t *ent, int chan, const char *sample, float vol, float
if( flags & SND_SPAWNING )
{
msg_dest = MSG_INIT;
flags |= SND_FIXED_ORIGIN; // first-time spatialize
}
else
{
@ -1698,7 +1702,10 @@ void SV_StartSound( edict_t *ent, int chan, const char *sample, float vol, float
VectorAdd( origin, ent->v.origin, origin );
if( flags & SND_SPAWNING )
{
msg_dest = MSG_INIT;
flags |= SND_FIXED_ORIGIN; // first-time spatialize
}
else msg_dest = MSG_PAS_R;
}
@ -1717,9 +1724,7 @@ void SV_StartSound( edict_t *ent, int chan, const char *sample, float vol, float
sound_idx = SV_SoundIndex( sample );
}
if( !ent->v.modelindex || !ent->v.model )
entityIndex = 0;
else if( SV_IsValidEdict( ent->v.aiment ))
if( SV_IsValidEdict( ent->v.aiment ))
entityIndex = ent->v.aiment->serialnumber;
else entityIndex = ent->serialnumber;
@ -4272,7 +4277,8 @@ qboolean SV_ParseEdict( script_t *script, edict_t *ent )
// keynames with a leading underscore are used for utility comments,
// and are immediately discarded by engine
if( keyname[0] == '_' ) continue;
if( world.version == Q1BSP_VERSION && keyname[0] == '_' )
continue;
if( anglehack )
{

View File

@ -241,9 +241,14 @@ void SV_ActivateServer( void )
}
}
// run two frames to allow everything to settle
for( i = 0; !sv.loadgame && i < 2; i++ )
SV_Physics();
// FIXME: test this for correct
// sv.frametime = 0.1f;
if( !sv.loadgame || svgame.globals->changelevel )
{
// run two frames to allow everything to settle
for( i = 0; i < 2; i++ ) SV_Physics();
}
// invoke to refresh all movevars
Mem_Set( &svgame.oldmovevars, 0, sizeof( movevars_t ));

View File

@ -917,7 +917,7 @@ void SV_Physics_Pusher( edict_t *ent )
// otherwise, just stay in place until the obstacle is gone
if( pBlocker )
{
Msg( "%s is blocked by %s\n", SV_ClassName( ent ), SV_ClassName( pBlocker ));
MsgDev( D_INFO, "%s is blocked by %s\n", SV_ClassName( ent ), SV_ClassName( pBlocker ));
svgame.dllFuncs.pfnBlocked( ent, pBlocker );
}
@ -928,7 +928,7 @@ void SV_Physics_Pusher( edict_t *ent )
svgame.dllFuncs.pfnThink( ent );
if( ent->free ) return;
}
else if( ent->v.flags & FL_ALWAYSTHINK || ( sv.state == ss_loading && !sv.loadgame ))
else if( ent->v.flags & FL_ALWAYSTHINK )
{
ent->v.nextthink = 0.0f;
svgame.globals->time = sv.time;

View File

@ -409,8 +409,7 @@ void ReapplyDecal( SAVERESTOREDATA *pSaveData, decallist_t *entry, qboolean adja
if( dot >= 0.95f )
{
entityIndex = pfnIndexOfEdict( tr.ent );
if( entityIndex > 0 )
modelIndex = tr.ent->v.modelindex;
if( entityIndex > 0 ) modelIndex = tr.ent->v.modelindex;
// FIXME: probably some rotating or moving objects can't receive decal properly
SV_CreateDecal( tr.endpos, decalIndex, entityIndex, modelIndex, flags );
@ -419,9 +418,8 @@ void ReapplyDecal( SAVERESTOREDATA *pSaveData, decallist_t *entry, qboolean adja
}
else
{
edict_t *pEdict = pfnPEntityOfEntIndex( entry->entityIndex );
if( pEdict != NULL )
modelIndex = pEdict->v.modelindex;
edict_t *pEdict = pSaveData->pTable[entry->entityIndex].pent;
if( pEdict != NULL ) modelIndex = pEdict->v.modelindex;
SV_CreateDecal( entry->position, decalIndex, entry->entityIndex, modelIndex, flags );
}
@ -918,7 +916,7 @@ void SV_SaveClientState( SAVERESTOREDATA *pSaveData, const char *level )
FS_Write( pFile, &id, sizeof( int ));
FS_Write( pFile, &version, sizeof( int ));
decalList = (decallist_t *)Z_Malloc(sizeof( decallist_t ) * MAX_RENDER_DECALS );
decalList = (decallist_t *)Z_Malloc( sizeof( decallist_t ) * MAX_RENDER_DECALS );
decalCount = R_CreateDecalList( decalList, svgame.globals->changelevel );
FS_Write( pFile, &decalCount, sizeof( int ));

View File

@ -19,7 +19,7 @@
#define LAUNCH_DLL // ignore alias names
#include "launch_api.h"
#define XASH_VERSION 0.73f // current version will be shared across gameinfo struct
#define XASH_VERSION 0.74f // current version will be shared across gameinfo struct
#define MAX_NUM_ARGVS 128
#define MAX_CMD_TOKENS 80

View File

@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PLATFORM_EXPORTS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "./" /I "../common" /I "../pm_shared" /I "../engine" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "./" /I "../common" /I "../pm_shared" /I "../engine" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32