24 Apr 2014

This commit is contained in:
g-cont 2014-04-24 00:00:00 +04:00 committed by Alibek Omarov
parent a3d2270329
commit d2c9605cb9
9 changed files with 81 additions and 64 deletions

View File

@ -101,20 +101,20 @@ typedef enum
TF_UNCOMPRESSED = (1<<5), // don't compress texture in video memory
TF_CUBEMAP = (1<<6), // it's cubemap texture
TF_DEPTHMAP = (1<<7), // custom texture filter used
TF_INTENSITY = (1<<8),
TF_INTENSITY = (1<<8), // monochrome intensity image
TF_LUMINANCE = (1<<9), // force image to grayscale
TF_SKYSIDE = (1<<10),
TF_CLAMP = (1<<11),
TF_NOMIPMAP = (1<<12),
TF_SKYSIDE = (1<<10), // this is a part of skybox
TF_CLAMP = (1<<11), // clamp texcoords to [0..1] range
TF_NOMIPMAP = (1<<12), // don't build mips for this image
TF_HAS_LUMA = (1<<13), // sets by GL_UploadTexture
TF_MAKELUMA = (1<<14), // create luma from quake texture
TF_MAKELUMA = (1<<14), // create luma from quake texture (only q1 textures contain luma-pixels)
TF_NORMALMAP = (1<<15), // is a normalmap
TF_HAS_ALPHA = (1<<16), // image has alpha (used only for GL_CreateTexture)
TF_FORCE_COLOR = (1<<17), // force upload monochrome textures as RGB (detail textures)
TF_TEXTURE_1D = (1<<18), // this is GL_TEXTURE_1D
TF_BORDER = (1<<19), // zero clamp for projected textures
TF_TEXTURE_3D = (1<<20), // this is GL_TEXTURE_3D
TF_STATIC = (1<<21), // a marker for purge mechanism
TF_STATIC = (1<<21), // a marker for purge mechanism (not used by engine)
TF_TEXTURE_RECTANGLE= (1<<22), // this is GL_TEXTURE_RECTANGLE
TF_ALPHA_BORDER = (1<<23), // clamp to (0,0,0,255) (probably no difference)
TF_IMAGE_PROGRAM = (1<<24), // enable image program support like in Doom3
@ -249,7 +249,7 @@ typedef struct render_interface_s
// replace with built-in R_DrawCubemapView for make skyshots or envshots
qboolean (*R_DrawCubemapView)( const float *origin, const float *angles, int size );
// alloc or destroy studiomodel custom data
void (*Mod_ProcessUserData)( model_t *mod, qboolean create );
void (*Mod_ProcessUserData)( struct model_s *mod, qboolean create );
} render_interface_t;
#endif//RENDER_API_H

View File

@ -66,6 +66,20 @@ FRAME PARSING
*/
void CL_UpdateEntityFields( cl_entity_t *ent )
{
// parametric rockets code
if( ent->curstate.starttime != 0.0f && ent->curstate.impacttime != 0.0f )
{
float lerp = ( cl.time - ent->curstate.starttime ) / ( ent->curstate.impacttime - ent->curstate.starttime );
vec3_t dir;
lerp = bound( 0.0f, lerp, 1.0f );
// first we need to calc actual origin
VectorLerp( ent->curstate.startpos, lerp, ent->curstate.endpos, ent->curstate.origin );
VectorSubtract( ent->curstate.endpos, ent->curstate.startpos, dir );
VectorAngles( dir, ent->curstate.angles ); // re-aim projectile
}
VectorCopy( ent->curstate.origin, ent->origin );
VectorCopy( ent->curstate.angles, ent->angles );

View File

@ -310,7 +310,7 @@ void CL_CreateCmd( void )
V_ProcessOverviewCmds( &cmd );
V_ProcessShowTexturesCmds( &cmd );
if( cl.background || gl_overview->integer )
if( cl.background || gl_overview->integer || cls.changelevel )
{
VectorCopy( angles, cl.refdef.cl_viewangles );
VectorCopy( angles, cmd.viewangles );

View File

@ -263,7 +263,8 @@ void SCR_DrawPlaque( void )
GL_SetRenderMode( kRenderNormal );
R_DrawStretchPic( 0, 0, scr_width->integer, scr_height->integer, 0, 0, 1, 1, levelshot );
CL_DrawHUD( CL_LOADING );
if( !Cvar_VariableInteger( "sv_background" ))
CL_DrawHUD( CL_LOADING );
}
}
@ -281,7 +282,7 @@ void SCR_BeginLoadingPlaque( qboolean is_background )
if( cls.state == ca_disconnected ) return; // if at console, don't bring up the plaque
if( cls.key_dest == key_console ) return;
cls.draw_changelevel = true;
cls.draw_changelevel = is_background ? false : true;
SCR_UpdateScreen();
cls.disable_screen = host.realtime;
cls.disable_servercount = cl.servercount;
@ -295,7 +296,7 @@ SCR_EndLoadingPlaque
*/
void SCR_EndLoadingPlaque( void )
{
cls.disable_screen = 0;
cls.disable_screen = 0.0f;
Con_ClearNotify();
}

View File

@ -631,6 +631,7 @@ static void R_SetupProjectionMatrix( const ref_params_t *fd, matrix4x4 m )
{
ref_overview_t *ov = &clgame.overView;
Matrix4x4_CreateOrtho( m, ov->xLeft, ov->xRight, ov->xTop, ov->xBottom, ov->zNear, ov->zFar );
RI.clipFlags = 0;
return;
}

View File

@ -85,7 +85,7 @@ typedef enum
#include "com_model.h"
#include "crtlib.h"
#define XASH_VERSION 0.95f // engine current version
#define XASH_VERSION 0.96f // engine current version
// PERFORMANCE INFO
#define MIN_FPS 15.0 // host minimum fps value for maxfps.

View File

@ -591,6 +591,7 @@ void Key_Event( int key, qboolean down )
if( cls.key_dest == key_game && ( key != K_ESCAPE ))
clgame.dllFuncs.pfnKey_Event( down, key, kb );
Key_AddKeyUpCommands( key, kb );
return;
}
@ -607,50 +608,50 @@ void Key_Event( int key, qboolean down )
// send the bound action
kb = keys[key].binding;
if( !kb )
{
if( key >= 200 )
Msg( "%s is unbound, use controls menu to set.\n", Key_KeynumToString( key ));
}
else if( !clgame.dllFuncs.pfnKey_Event( down, key, keys[key].binding ))
if( !clgame.dllFuncs.pfnKey_Event( down, key, keys[key].binding ))
{
// handled in client.dll
}
else if( kb[0] == '+' )
{
int i;
char button[1024], *buttonPtr;
for( i = 0, buttonPtr = button; ; i++ )
{
if( kb[i] == ';' || !kb[i] )
{
*buttonPtr = '\0';
if( button[0] == '+' )
{
Q_sprintf( cmd, "%s %i\n", button, key );
Cbuf_AddText( cmd );
}
else
{
// down-only command
Cbuf_AddText( button );
Cbuf_AddText( "\n" );
}
buttonPtr = button;
while (( kb[i] <= ' ' || kb[i] == ';' ) && kb[i] != 0 )
i++;
}
*buttonPtr++ = kb[i];
if( !kb[i] ) break;
}
}
else
else if( kb != NULL )
{
// down-only command
Cbuf_AddText( kb );
Cbuf_AddText( "\n" );
if( kb[0] == '+' )
{
int i;
char button[1024], *buttonPtr;
for( i = 0, buttonPtr = button; ; i++ )
{
if( kb[i] == ';' || !kb[i] )
{
*buttonPtr = '\0';
if( button[0] == '+' )
{
Q_sprintf( cmd, "%s %i\n", button, key );
Cbuf_AddText( cmd );
}
else
{
// down-only command
Cbuf_AddText( button );
Cbuf_AddText( "\n" );
}
buttonPtr = button;
while (( kb[i] <= ' ' || kb[i] == ';' ) && kb[i] != 0 )
i++;
}
*buttonPtr++ = kb[i];
if( !kb[i] ) break;
}
}
else
{
// down-only command
Cbuf_AddText( kb );
Cbuf_AddText( "\n" );
}
}
}
else if( cls.key_dest == key_console )

View File

@ -810,9 +810,9 @@ void Delta_Init( void )
Delta_AddField( "movevars_t", "footsteps", DT_INTEGER, 1, 1.0f, 1.0f );
Delta_AddField( "movevars_t", "rollangle", DT_FLOAT|DT_SIGNED, 16, 32.0f, 1.0f );
Delta_AddField( "movevars_t", "rollspeed", DT_FLOAT|DT_SIGNED, 16, 8.0f, 1.0f );
Delta_AddField( "movevars_t", "skycolor_r", DT_FLOAT|DT_SIGNED, 9, 1.0f, 1.0f ); // 0 - 264
Delta_AddField( "movevars_t", "skycolor_g", DT_FLOAT|DT_SIGNED, 9, 1.0f, 1.0f );
Delta_AddField( "movevars_t", "skycolor_b", DT_FLOAT|DT_SIGNED, 9, 1.0f, 1.0f );
Delta_AddField( "movevars_t", "skycolor_r", DT_FLOAT|DT_SIGNED, 12, 1.0f, 1.0f ); // 0 - 264
Delta_AddField( "movevars_t", "skycolor_g", DT_FLOAT|DT_SIGNED, 12, 1.0f, 1.0f );
Delta_AddField( "movevars_t", "skycolor_b", DT_FLOAT|DT_SIGNED, 12, 1.0f, 1.0f );
Delta_AddField( "movevars_t", "skyvec_x", DT_FLOAT|DT_SIGNED, 16, 32.0f, 1.0f ); // 0 - 1
Delta_AddField( "movevars_t", "skyvec_y", DT_FLOAT|DT_SIGNED, 16, 32.0f, 1.0f );
Delta_AddField( "movevars_t", "skyvec_z", DT_FLOAT|DT_SIGNED, 16, 32.0f, 1.0f );
@ -1133,7 +1133,7 @@ qboolean Delta_WriteField( sizebuf_t *msg, delta_t *pField, void *from, void *to
else if( pField->flags & DT_TIMEWINDOW_BIG )
{
flValue = *(float *)((byte *)to + pField->offset );
flTime = (timebase * 1000.0f) - (flValue * 1000.0f);
flTime = (flValue * 1000.0f) - (timebase * 1000.0f);
iValue = (uint)flTime;
BF_WriteBitLong( msg, iValue, pField->bits, bSigned );
@ -1237,7 +1237,7 @@ qboolean Delta_ReadField( sizebuf_t *msg, delta_t *pField, void *from, void *to,
if( bChanged )
{
iValue = BF_ReadBitLong( msg, pField->bits, bSigned );
flValue = (float)((int)(iValue * 0.01f ));
flValue = (float)(iValue * 0.01f);
flTime = timebase + flValue;
}
else
@ -1251,7 +1251,7 @@ qboolean Delta_ReadField( sizebuf_t *msg, delta_t *pField, void *from, void *to,
if( bChanged )
{
iValue = BF_ReadBitLong( msg, pField->bits, bSigned );
flValue = (float)((int)(iValue * 0.001f ));
flValue = (float)(iValue * 0.001f);
flTime = timebase + flValue;
}
else

View File

@ -488,9 +488,9 @@ void Sys_InitLog( void )
s_wcd.logfile = fopen( s_wcd.log_path, mode );
if( !s_wcd.logfile ) MsgDev( D_ERROR, "Sys_InitLog: can't create log file %s\n", s_wcd.log_path );
fprintf( s_wcd.logfile, "=======================================================================\n" );
fprintf( s_wcd.logfile, "\t%s started at %s\n", s_wcd.title, Q_timestamp( TIME_FULL ));
fprintf( s_wcd.logfile, "=======================================================================\n" );
fprintf( s_wcd.logfile, "=================================================================================\n" );
fprintf( s_wcd.logfile, "\t%s (build %i) started at %s\n", s_wcd.title, Q_buildnum(), Q_timestamp( TIME_FULL ));
fprintf( s_wcd.logfile, "=================================================================================\n" );
}
}
@ -516,9 +516,9 @@ void Sys_CloseLog( void )
if( s_wcd.logfile )
{
fprintf( s_wcd.logfile, "\n");
fprintf( s_wcd.logfile, "=======================================================================");
fprintf( s_wcd.logfile, "\n\t%s %s at %s\n", s_wcd.title, event_name, Q_timestamp( TIME_FULL ));
fprintf( s_wcd.logfile, "=======================================================================");
fprintf( s_wcd.logfile, "=================================================================================");
fprintf( s_wcd.logfile, "\n\t%s (build %i) %s at %s\n", s_wcd.title, Q_buildnum(), event_name, Q_timestamp( TIME_FULL ));
fprintf( s_wcd.logfile, "=================================================================================");
if( host.change_game ) fprintf( s_wcd.logfile, "\n" ); // just for tabulate
fclose( s_wcd.logfile );