26 Apr 2012

This commit is contained in:
g-cont 2012-04-26 00:00:00 +04:00 committed by Alibek Omarov
parent 5de0b03454
commit 93d3aecc01
15 changed files with 56 additions and 12 deletions

View File

@ -1,4 +1,4 @@
build ????
build 1905
Physic: fix trace bug when model is missing
Client: implement function TriScreenToWorld
@ -13,6 +13,10 @@ Render: fix a little bug with engine mirrors
Sound: implement separate volume controls for background track and game sounds
Sound: fix wrong position for dynamic sounds in case parent entity never has updates on the client
Client: first implementation of extended engineinterface.
Server: fix bug with update movevars after the server initialization.
Input: cancel mouse movement while switches between menu\console and game
Render: added function R_EntityRemoveDecals into RendererInterface
Render: fixed bug with crash engine on custom resolutions while makes a screenshot (e.g. 1366x768)
build 1850

View File

@ -163,6 +163,9 @@ typedef struct render_api_s
void (*GL_TexMatrixIdentity)( void );
void (*GL_CleanUpTextureUnits)( int last ); // pass 0 for clear all the texture units
void (*GL_TexGen)( unsigned int coord, unsigned int mode );
// ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 26
void (*R_EntityRemoveDecals)( model_t *mod ); // remove all the decals from specified entity (BSP only)
} render_api_t;
// render callbacks

View File

@ -418,6 +418,9 @@ void CL_UpdateStudioVars( cl_entity_t *ent, entity_state_t *newstate, qboolean n
ent->syncbase = -0.01f; // back up to get 0'th frame animations
}
if( !ent->curstate.frame )
ent->syncbase = -0.01f; // back up to get 0'th frame animations
if( newstate->animtime != ent->curstate.animtime )
{
// client got new packet, shuffle animtimes

View File

@ -421,8 +421,8 @@ qboolean VID_ScreenShot( const char *filename, int shot_type )
qboolean result;
r_shot = Mem_Alloc( r_temppool, sizeof( rgbdata_t ));
r_shot->width = glState.width;
r_shot->height = glState.height;
r_shot->width = (glState.width + 3) & ~3;
r_shot->height = (glState.height + 3) & ~3;
r_shot->flags = IMAGE_HAS_COLOR;
r_shot->type = PF_RGB_24;
r_shot->size = r_shot->width * r_shot->height * PFDesc[r_shot->type].bpp;
@ -430,7 +430,7 @@ qboolean VID_ScreenShot( const char *filename, int shot_type )
r_shot->buffer = Mem_Alloc( r_temppool, r_shot->size );
// get screen frame
pglReadPixels( 0, 0, glState.width, glState.height, GL_RGB, GL_UNSIGNED_BYTE, r_shot->buffer );
pglReadPixels( 0, 0, r_shot->width, r_shot->height, GL_RGB, GL_UNSIGNED_BYTE, r_shot->buffer );
switch( shot_type )
{

View File

@ -1106,4 +1106,28 @@ void R_DecalRemoveAll( int textureIndex )
if( !textureIndex || pdecal->texture == textureIndex )
R_DecalUnlink( pdecal );
}
}
/*
===============
R_EntityRemoveDecals
remove all decals from specified entity
===============
*/
void R_EntityRemoveDecals( model_t *mod )
{
msurface_t *psurf;
decal_t *p;
int i;
if( !mod || mod->type != mod_brush )
return;
psurf = &mod->surfaces[mod->firstmodelsurface];
for( i = 0; i < mod->nummodelsurfaces; i++, psurf++ )
{
for( p = psurf->pdecals; p; p = p->pnext )
R_DecalUnlink( p );
}
}

View File

@ -1372,7 +1372,8 @@ void GL_FreeTexture( GLenum texnum )
if( !image->name[0] )
{
Msg( "Trying to free unnamed texture with texnum %i\n", image->texnum );
if( image->texnum != 0 )
MsgDev( D_ERROR, "trying to free unnamed texture with texnum %i\n", image->texnum );
return;
}

View File

@ -285,6 +285,7 @@ qboolean R_CullSurface( msurface_t *surf, uint clipflags );
//
void DrawSurfaceDecals( msurface_t *fa );
void DrawSingleDecal( decal_t *pDecal, msurface_t *fa );
void R_EntityRemoveDecals( model_t *mod );
void R_ClearDecals( void );
//

View File

@ -1501,6 +1501,7 @@ static render_api_t gRenderAPI =
GL_LoadIdentityTexMatrix,
GL_CleanUpTextureUnits,
GL_TexGen,
R_EntityRemoveDecals,
};
/*

View File

@ -23,7 +23,7 @@ static char mond[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int Q_buildnum( void )
{
// do not touch this! Only author of Xash3D can increase buildnumbers!
#if 1
#if 0
int m = 0, d = 0, y = 0;
static int b = 0;
@ -48,6 +48,6 @@ int Q_buildnum( void )
return b;
#else
return 1613;
return 1905;
#endif
}

View File

@ -178,6 +178,8 @@ void IN_ToggleClientMouse( int newstate, int oldstate )
}
else if( newstate == key_game )
{
// reset mouse pos, so cancel effect in game
SetCursorPos( host.window_center_x, host.window_center_y );
clgame.dllFuncs.IN_ActivateMouse();
}

View File

@ -403,7 +403,7 @@ extern convar_t *physinfo;
//
void SV_FinalMessage( char *message, qboolean reconnect );
void SV_DropClient( sv_client_t *drop );
void SV_UpdateMovevars( qboolean initialize );
int SV_ModelIndex( const char *name );
int SV_SoundIndex( const char *name );
int SV_EventIndex( const char *name );

View File

@ -647,6 +647,9 @@ void SV_InitGame( void )
svs.clients[i].edict = ent;
}
// get actual movevars
SV_UpdateMovevars( true );
svgame.numEntities = svgame.globals->maxClients + 1; // clients + world
svs.initialized = true;
}

View File

@ -196,9 +196,10 @@ check movevars for changes every frame
send updates to client if changed
===================
*/
void SV_UpdateMovevars( void )
void SV_UpdateMovevars( qboolean initialize )
{
if( !physinfo->modified ) return;
if( !initialize && !physinfo->modified )
return;
// check range
if( sv_zmax->value < 256.0f ) Cvar_SetFloat( "sv_zmax", 256.0f );
@ -235,6 +236,8 @@ void SV_UpdateMovevars( void )
svgame.movevars.skyangle = sv_skyangle->value;
svgame.movevars.wateralpha = sv_wateralpha->value;
if( initialize ) return;
if( MSG_WriteDeltaMovevars( &sv.reliable_datagram, &svgame.oldmovevars, &svgame.movevars ))
Q_memcpy( &svgame.oldmovevars, &svgame.movevars, sizeof( movevars_t )); // oldstate changed
@ -543,7 +546,7 @@ void Host_ServerFrame( void )
SV_UpdateServerInfo ();
// refresh physic movevars on the client side
SV_UpdateMovevars ();
SV_UpdateMovevars ( false );
// let everything in the world think and move
SV_RunGameFrame ();

View File

@ -175,7 +175,6 @@ qboolean SV_MoveStep( edict_t *ent, vec3_t move, qboolean relink )
}
else
{
dz = svgame.movevars.stepsize;
neworg[2] += dz;
VectorCopy( neworg, end );

Binary file not shown.