From f7b7c67b97a777cf6a1ddd7cb4e165d8ebf41bd0 Mon Sep 17 00:00:00 2001 From: g-cont Date: Fri, 14 Jun 2019 00:00:00 +0300 Subject: [PATCH] 14 Jun 2019 --- change.log | 10 +++++ engine/client/gl_backend.c | 7 +--- engine/client/gl_image.c | 3 +- engine/client/gl_local.h | 1 + engine/client/gl_rmain.c | 66 ++++++++++++++++---------------- engine/client/vgui/vgui_surf.cpp | 2 +- engine/common/build.c | 4 +- engine/common/soundlib/snd_wav.c | 2 +- engine/server/sv_cmds.c | 2 + 9 files changed, 54 insertions(+), 43 deletions(-) diff --git a/change.log b/change.log index 7e78986b..b6b1166d 100644 --- a/change.log +++ b/change.log @@ -16,6 +16,16 @@ VGUI: - a VGUI implementation code in xash.dll Memory: - a memory manager in xash.dll Physic: - a server physics code in xash.dll +build 4511 + +Engine: some expansion of RenderAPI (with keep compatibility of course) +Render: fixup screen clearing while SCR_BeginLoadingPlaque is called +Engine: cl_testlights now supports custom rendering +Render: fixup cubemap rendering code, reset gamma +Console: allow to drawing progress-bar in console without carriage return call +Engine: small fix for system logging +ImageLib: ignore to process emboss-filter with scale <= 0 + build 4483 Engine: implementation of improved line trace that can be collided with solid-pixels on grates or fences. (see features.h for details) diff --git a/engine/client/gl_backend.c b/engine/client/gl_backend.c index cd33d87f..753cbf21 100644 --- a/engine/client/gl_backend.c +++ b/engine/client/gl_backend.c @@ -570,9 +570,6 @@ qboolean VID_CubemapShot( const char *base, uint size, const float *vieworg, qbo if( size > glState.width || size > glState.height ) return false; - // setup refdef - RI.params |= RP_ENVVIEW; // do not render non-bmodel entities - // alloc space temp = Mem_Malloc( r_temppool, size * size * 3 ); buffer = Mem_Malloc( r_temppool, size * size * 3 * 6 ); @@ -582,6 +579,8 @@ qboolean VID_CubemapShot( const char *base, uint size, const float *vieworg, qbo // use client vieworg if( !vieworg ) vieworg = RI.vieworg; + R_CheckGamma(); + for( i = 0; i < 6; i++ ) { // go into 3d mode @@ -609,8 +608,6 @@ qboolean VID_CubemapShot( const char *base, uint size, const float *vieworg, qbo memcpy( buffer + (size * size * 3 * i), r_side->buffer, size * size * 3 ); } - RI.params &= ~RP_ENVVIEW; - r_shot->flags = IMAGE_HAS_COLOR; r_shot->flags |= (skyshot) ? IMAGE_SKYBOX : IMAGE_CUBEMAP; r_shot->width = size; diff --git a/engine/client/gl_image.c b/engine/client/gl_image.c index b319a362..876d91d2 100644 --- a/engine/client/gl_image.c +++ b/engine/client/gl_image.c @@ -75,7 +75,8 @@ void GL_Bind( GLint tmu, GLenum texnum ) // missed or invalid texture? if( texnum <= 0 || texnum >= MAX_TEXTURES ) { - Con_DPrintf( S_ERROR "GL_Bind: invalid texturenum %d\n", texnum ); + if( texnum != 0 ) + Con_DPrintf( S_ERROR "GL_Bind: invalid texturenum %d\n", texnum ); texnum = tr.defaultTexture; } if( tmu != GL_KEEP_UNIT ) diff --git a/engine/client/gl_local.h b/engine/client/gl_local.h index 1fe4bd54..7d7e735e 100644 --- a/engine/client/gl_local.h +++ b/engine/client/gl_local.h @@ -365,6 +365,7 @@ qboolean R_InitRenderAPI( void ); void R_AllowFog( int allowed ); void R_SetupFrustum( void ); void R_FindViewLeaf( void ); +void R_CheckGamma( void ); void R_PushScene( void ); void R_PopScene( void ); void R_DrawFog( void ); diff --git a/engine/client/gl_rmain.c b/engine/client/gl_rmain.c index 5cfcbf56..120abf46 100644 --- a/engine/client/gl_rmain.c +++ b/engine/client/gl_rmain.c @@ -985,30 +985,41 @@ some type of screenshots */ qboolean R_DoResetGamma( void ) { - // FIXME: this looks ugly. apply the backward gamma changes to the output image - return false; - switch( cls.scrshot_action ) { - case scrshot_normal: - if( CL_IsDevOverviewMode( )) - return true; - return false; - case scrshot_snapshot: - if( CL_IsDevOverviewMode( )) - return true; - return false; - case scrshot_plaque: - case scrshot_savegame: case scrshot_envshot: case scrshot_skyshot: - case scrshot_mapshot: return true; default: return false; } } +/* +=============== +R_CheckGamma +=============== +*/ +void R_CheckGamma( void ) +{ + if( R_DoResetGamma( )) + { + // paranoia cubemaps uses this + BuildGammaTable( 1.8f, 0.0f ); + + // paranoia cubemap rendering + if( clgame.drawFuncs.GL_BuildLightmaps ) + clgame.drawFuncs.GL_BuildLightmaps( ); + } + else if( FBitSet( vid_gamma->flags, FCVAR_CHANGED ) || FBitSet( vid_brightness->flags, FCVAR_CHANGED )) + { + BuildGammaTable( vid_gamma->value, vid_brightness->value ); + glConfig.softwareGammaUpdate = true; + GL_RebuildLightmaps(); + glConfig.softwareGammaUpdate = false; + } +} + /* =============== R_BeginFrame @@ -1023,24 +1034,7 @@ void R_BeginFrame( qboolean clearScene ) pglClear( GL_COLOR_BUFFER_BIT ); } - if( R_DoResetGamma( )) - { - BuildGammaTable( 1.8f, 0.0f ); - glConfig.softwareGammaUpdate = true; - GL_RebuildLightmaps(); - glConfig.softwareGammaUpdate = false; - - // next frame will be restored gamma - SetBits( vid_brightness->flags, FCVAR_CHANGED ); - SetBits( vid_gamma->flags, FCVAR_CHANGED ); - } - else if( FBitSet( vid_gamma->flags, FCVAR_CHANGED ) || FBitSet( vid_brightness->flags, FCVAR_CHANGED )) - { - BuildGammaTable( vid_gamma->value, vid_brightness->value ); - glConfig.softwareGammaUpdate = true; - GL_RebuildLightmaps(); - glConfig.softwareGammaUpdate = false; - } + R_CheckGamma(); R_Set2DMode( true ); @@ -1072,8 +1066,14 @@ void R_SetupRefParams( const ref_viewpass_t *rvp ) RI.farClip = 0; if( !FBitSet( rvp->flags, RF_DRAW_CUBEMAP )) + { RI.drawOrtho = FBitSet( rvp->flags, RF_DRAW_OVERVIEW ); - else RI.drawOrtho = false; + } + else + { + SetBits( RI.params, RP_ENVVIEW ); + RI.drawOrtho = false; + } // setup viewport RI.viewport[0] = rvp->viewport[0]; diff --git a/engine/client/vgui/vgui_surf.cpp b/engine/client/vgui/vgui_surf.cpp index d1c91bd5..a68b0aab 100644 --- a/engine/client/vgui/vgui_surf.cpp +++ b/engine/client/vgui/vgui_surf.cpp @@ -306,7 +306,7 @@ void CEngineSurface :: drawPrintChar( int x, int y, int wide, int tall, float s0 if( !ClipRect( ul, lr, &clippedRect[0], &clippedRect[1] )) return; -#if 0 +#if 1 // TESTTEST: needs to be more tested addCharToBuffer( &clippedRect[0], &clippedRect[1], color ); #else diff --git a/engine/common/build.c b/engine/common/build.c index a35442a9..7cf69c78 100644 --- a/engine/common/build.c +++ b/engine/common/build.c @@ -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 4260; + return 4511; #endif } \ No newline at end of file diff --git a/engine/common/soundlib/snd_wav.c b/engine/common/soundlib/snd_wav.c index 82dcbf62..ef311367 100644 --- a/engine/common/soundlib/snd_wav.c +++ b/engine/common/soundlib/snd_wav.c @@ -254,7 +254,7 @@ qboolean Sound_LoadWAV( const char *name, const byte *buffer, size_t filesize ) if( sound.samples <= 0 ) { - Con_DPrintf( S_ERROR "Sound_LoadWAV: file with %i samples (%s)\n", sound.samples, name ); + Con_Reportf( S_ERROR "Sound_LoadWAV: file with %i samples (%s)\n", sound.samples, name ); return false; } diff --git a/engine/server/sv_cmds.c b/engine/server/sv_cmds.c index fddade99..66bebd18 100644 --- a/engine/server/sv_cmds.c +++ b/engine/server/sv_cmds.c @@ -285,6 +285,8 @@ void SV_NextMap_f( void ) search_t *t; t = FS_Search( "maps\\*.bsp", true, CVAR_TO_BOOL( con_gamemaps )); // only in gamedir + if( !t ) t = FS_Search( "maps/*.bsp", true, CVAR_TO_BOOL( con_gamemaps )); // only in gamedir + if( !t ) { Con_Printf( "next map can't be found\n" );