03 Sep 2017

This commit is contained in:
g-cont 2017-09-03 00:00:00 +03:00 committed by Alibek Omarov
parent e608c11e81
commit 8e6264beb1
14 changed files with 56 additions and 38 deletions

View File

@ -785,7 +785,7 @@ void CL_ParseServerData( sizebuf_t *msg )
sf->fadeEnd = title->holdtime + title->fadeout;
sf->fadeReset = title->fadeout;
}
else sf->fadeEnd = sf->fadeReset = 4.0f;
else sf->fadeEnd = sf->fadeReset = 5.0f;
sf->fadeFlags = FFADE_IN;
sf->fader = sf->fadeg = sf->fadeb = 0;
@ -1439,18 +1439,20 @@ void CL_ParseScreenFade( sizebuf_t *msg )
{
float duration, holdTime;
screenfade_t *sf = &clgame.fade;
float flScale;
duration = (float)(word)MSG_ReadShort( msg ) * (1.0f / (float)(1<<12));
holdTime = (float)(word)MSG_ReadShort( msg ) * (1.0f / (float)(1<<12));
duration = (float)MSG_ReadShort( msg );
holdTime = (float)MSG_ReadShort( msg );
sf->fadeFlags = MSG_ReadShort( msg );
flScale = ( sf->fadeFlags & FFADE_LONGFADE ) ? (1.0f / 256.0f) : (1.0f / 4096.0f);
sf->fader = MSG_ReadByte( msg );
sf->fadeg = MSG_ReadByte( msg );
sf->fadeb = MSG_ReadByte( msg );
sf->fadealpha = MSG_ReadByte( msg );
sf->fadeSpeed = 0.0f;
sf->fadeEnd = duration;
sf->fadeReset = holdTime;
sf->fadeEnd = duration * flScale;
sf->fadeReset = holdTime * flScale;
// calc fade speed
if( duration > 0 )

View File

@ -94,7 +94,7 @@ int CL_FxBlend( cl_entity_t *e )
break;
// JAY: HACK for now -- not time based
case kRenderFxFadeSlow:
if( tr.frametime )
if( RP_NORMALPASS( ))
{
if( e->curstate.renderamt > 0 )
e->curstate.renderamt -= 1;
@ -103,7 +103,7 @@ int CL_FxBlend( cl_entity_t *e )
blend = e->curstate.renderamt;
break;
case kRenderFxFadeFast:
if( tr.frametime )
if( RP_NORMALPASS( ))
{
if( e->curstate.renderamt > 3 )
e->curstate.renderamt -= 4;
@ -112,7 +112,7 @@ int CL_FxBlend( cl_entity_t *e )
blend = e->curstate.renderamt;
break;
case kRenderFxSolidSlow:
if( tr.frametime )
if( RP_NORMALPASS( ))
{
if( e->curstate.renderamt < 255 )
e->curstate.renderamt += 1;
@ -121,7 +121,7 @@ int CL_FxBlend( cl_entity_t *e )
blend = e->curstate.renderamt;
break;
case kRenderFxSolidFast:
if( tr.frametime )
if( RP_NORMALPASS( ))
{
if( e->curstate.renderamt < 252 )
e->curstate.renderamt += 4;
@ -867,7 +867,7 @@ void R_RocketFlare( const vec3_t pos )
pTemp->entity.curstate.frame = COM_RandomLong( 0, pTemp->frameMax );
pTemp->entity.curstate.scale = 1.0;
pTemp->die = cl.time + 0.01f; // when 100 fps die at next frame
pTemp->flags |= FTENT_SPRANIMATE;
pTemp->entity.curstate.effects = EF_NOINTERP;
}
/*

View File

@ -910,8 +910,6 @@ void DrawSurfaceDecals( msurface_t *fa, qboolean single, qboolean reverse )
pglEnable( GL_POLYGON_OFFSET_FILL );
pglPolygonOffset( -1.0f, -gl_polyoffset->value );
}
pglBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
}
if( FBitSet( fa->flags, SURF_TRANSPARENT ) && glState.stencilEnabled )
@ -1013,6 +1011,8 @@ void DrawSurfaceDecals( msurface_t *fa, qboolean single, qboolean reverse )
// restore blendfunc here
if( e->curstate.rendermode == kRenderTransAdd || e->curstate.rendermode == kRenderGlow )
pglBlendFunc( GL_SRC_ALPHA, GL_ONE );
pglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
}
}

View File

@ -142,6 +142,7 @@ typedef struct
float fogStart;
float fogEnd;
int cached_contents; // in water
int cached_waterlevel; // was in water
float skyMins[2][6];
float skyMaxs[2][6];

View File

@ -257,7 +257,7 @@ qboolean R_AddEntity( struct cl_entity_s *clent, int type )
if( clent->curstate.effects & EF_NODRAW )
return false; // done
if( clent->curstate.rendermode != kRenderNormal && clent->curstate.renderamt <= 0 )
if( clent->curstate.rendermode != kRenderNormal && CL_FxBlend( clent ) <= 0 )
return true; // invisible
if( type == ET_FRAGMENTED )
@ -715,13 +715,24 @@ static void R_CheckFog( void )
RI.fogEnabled = false;
if( RI.onlyClientDraw || cl.local.waterlevel < 2 || !RI.drawWorld || !RI.viewleaf )
{
if( RI.cached_waterlevel == 3 )
{
// in some cases waterlevel jumps from 3 to 1. Catch it
RI.cached_waterlevel = cl.local.waterlevel;
RI.cached_contents = CONTENTS_EMPTY;
pglDisable( GL_FOG );
}
return;
}
ent = CL_GetWaterEntity( RI.vieworg );
if( ent && ent->model && ent->model->type == mod_brush && ent->curstate.skin < 0 )
cnt = ent->curstate.skin;
else cnt = RI.viewleaf->contents;
RI.cached_waterlevel = cl.local.waterlevel;
if( IsLiquidContents( RI.cached_contents ) && !IsLiquidContents( cnt ))
{
RI.cached_contents = CONTENTS_EMPTY;
@ -773,13 +784,13 @@ static void R_CheckFog( void )
RI.fogColor[3] = 1.0f;
RI.fogCustom = false;
RI.fogEnabled = true;
RI.fogSkybox = false;
RI.fogSkybox = true;
}
else
{
RI.fogCustom = false;
RI.fogEnabled = true;
RI.fogSkybox = false;
RI.fogSkybox = true;
}
}

View File

@ -1032,9 +1032,7 @@ void R_RenderDetails( void )
pglEnable( GL_BLEND );
pglBlendFunc( GL_DST_COLOR, GL_SRC_COLOR );
pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL );
if( RI.currententity->curstate.rendermode == kRenderTransAlpha )
pglDepthFunc( GL_EQUAL );
pglDepthFunc( GL_EQUAL );
for( i = 1; i < MAX_TEXTURES; i++ )
{
@ -1056,9 +1054,7 @@ void R_RenderDetails( void )
pglDisable( GL_BLEND );
pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
if( RI.currententity->curstate.rendermode == kRenderTransAlpha )
pglDepthFunc( GL_LEQUAL );
pglDepthFunc( GL_LEQUAL );
draw_details = false;

View File

@ -2760,6 +2760,15 @@ static void R_StudioClientEvents( void )
if( g_studio.frametime == 0.0 )
return; // gamepaused
// fill attachments with interpolated origin
if( m_pStudioHeader->numattachments <= 0 )
{
Matrix3x4_OriginFromMatrix( g_studio.rotationmatrix, e->attachment[0] );
Matrix3x4_OriginFromMatrix( g_studio.rotationmatrix, e->attachment[1] );
Matrix3x4_OriginFromMatrix( g_studio.rotationmatrix, e->attachment[2] );
Matrix3x4_OriginFromMatrix( g_studio.rotationmatrix, e->attachment[3] );
}
if( FBitSet( e->curstate.effects, EF_MUZZLEFLASH ))
{
dlight_t *el = CL_AllocElight( 0 );

View File

@ -414,7 +414,9 @@ void R_DrawSkyBox( void )
if( RI.skyMins[0][i] >= RI.skyMaxs[0][i] || RI.skyMins[1][i] >= RI.skyMaxs[1][i] )
continue;
GL_Bind( GL_TEXTURE0, tr.skyboxTextures[r_skyTexOrder[i]] );
if( tr.skyboxTextures[r_skyTexOrder[i]] )
GL_Bind( GL_TEXTURE0, tr.skyboxTextures[r_skyTexOrder[i]] );
else GL_Bind( GL_TEXTURE0, tr.skyTexture ); // stub
pglBegin( GL_QUADS );
MakeSkyVec( RI.skyMins[0][i], RI.skyMins[1][i], i );

View File

@ -97,7 +97,7 @@ typedef enum
// PERFORMANCE INFO
#define MIN_FPS 20.0 // host minimum fps value for maxfps.
#define MAX_FPS 100.0 // upper limit for maxfps.
#define MAX_FPS 200.0 // upper limit for maxfps.
#define HOST_FPS 72.0 // multiplayer games typical fps
#define MAX_FRAMETIME 0.25

View File

@ -31,7 +31,7 @@ void BuildGammaTable( float lightgamma, float brightness )
float f, g, g1, g3;
lightgamma = bound( 1.8f, lightgamma, 3.0f );
brightness = bound( 0.0f, brightness, 3.0f );
brightness = bound( 0.0f, brightness, 10.0f );
if( brightness <= 0.0f )
g3 = 0.125f;

View File

@ -317,18 +317,15 @@ void Image_SetPalette( const byte *pal, uint *d_table )
}
break;
case LUMP_MASKED:
for( i = 0; i < 256; i++ )
for( i = 0; i < 255; i++ )
{
if( i != 255 )
{
rgba[0] = pal[i*3+0];
rgba[1] = pal[i*3+1];
rgba[2] = pal[i*3+2];
rgba[3] = 0xFF;
d_table[i] = *(uint *)rgba;
}
else d_table[i] = 0;
rgba[0] = pal[i*3+0];
rgba[1] = pal[i*3+1];
rgba[2] = pal[i*3+2];
rgba[3] = 0xFF;
d_table[i] = *(uint *)rgba;
}
d_table[255] = 0;
break;
case LUMP_EXTENDED:
for( i = 0; i < 256; i++ )

View File

@ -611,7 +611,7 @@ void Mod_Init( void )
{
com_studiocache = Mem_AllocPool( "Studio Cache" );
mod_studiocache = Cvar_Get( "r_studiocache", "1", FCVAR_ARCHIVE, "enables studio cache for speedup tracing hitboxes" );
r_wadtextures = Cvar_Get( "r_wadtextures", "1", FCVAR_ARCHIVE, "completely ignore textures in the wad-files if disabled" );
r_wadtextures = Cvar_Get( "r_wadtextures", "0", 0, "completely ignore textures in the wad-files if disabled" );
Cmd_AddCommand( "mapstats", Mod_PrintBSPFileSizes_f, "show stats for currently loaded map" );
Cmd_AddCommand( "modellist", Mod_Modellist_f, "display loaded models list" );

View File

@ -6,7 +6,7 @@
--------------------Configuration: engine - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\WINDOWS\TEMP\RSP75B3.bat" with contents
Creating temporary file "C:\WINDOWS\TEMP\RSP964B.bat" with contents
[
@echo off
copy \Xash3D\src_main\temp\engine\!release\xash.dll "D:\Xash3D\xash.dll"
@ -14,7 +14,7 @@ copy \Xash3D\src_main\temp\engine\!release\xash.dll "D:\Paranoia2\xash.dll"
copy \Xash3D\src_main\temp\engine\!release\xash.dll "D:\Area51\xash.dll"
copy \Xash3D\src_main\temp\engine\!release\xash.dll "D:\Quake\xash.dll"
]
Creating command line "C:\WINDOWS\TEMP\RSP75B3.bat"
Creating command line "C:\WINDOWS\TEMP\RSP964B.bat"
<h3>Output Window</h3>
Performing Custom Build Step on \Xash3D\src_main\temp\engine\!release\xash.dll
‘ª®¯¨à®¢ ­® ä ©«®¢: 1.

View File

@ -36,7 +36,7 @@ extern int gmsgFade;
#define FFADE_OUT 0x0001 // Fade out (not in)
#define FFADE_MODULATE 0x0002 // Modulate (don't blend)
#define FFADE_STAYOUT 0x0004 // ignores the duration, stays faded out until new ScreenFade message received
#define FFADE_LONGFADE 0x0008 // used to indicate the fade can be longer than 16 seconds (added for czero)
// This structure is sent over the net to describe a screen fade event
typedef struct