Skip to content

Commit c5e4fcb

Browse files
committed
Merge branch 'master' into for-0.56.0/sync
2 parents 4cd0997 + 13886d8 commit c5e4fcb

34 files changed

+1084
-1142
lines changed

src.cmake

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -139,67 +139,71 @@ set(RENDERERLIST
139139
)
140140

141141
set(GLSLSOURCELIST
142+
# Common shader libraries
142143
${ENGINE_DIR}/renderer/glsl_source/common.glsl
143144
${ENGINE_DIR}/renderer/glsl_source/common_cp.glsl
144145
${ENGINE_DIR}/renderer/glsl_source/shaderProfiler_vp.glsl
145146
${ENGINE_DIR}/renderer/glsl_source/shaderProfiler_fp.glsl
147+
148+
# Material system shaders
149+
${ENGINE_DIR}/renderer/glsl_source/material_cp.glsl
150+
${ENGINE_DIR}/renderer/glsl_source/material_vp.glsl
151+
${ENGINE_DIR}/renderer/glsl_source/material_fp.glsl
146152
${ENGINE_DIR}/renderer/glsl_source/clearSurfaces_cp.glsl
147153
${ENGINE_DIR}/renderer/glsl_source/cull_cp.glsl
148154
${ENGINE_DIR}/renderer/glsl_source/depthReduction_cp.glsl
149155
${ENGINE_DIR}/renderer/glsl_source/processSurfaces_cp.glsl
150-
${ENGINE_DIR}/renderer/glsl_source/material_cp.glsl
151-
${ENGINE_DIR}/renderer/glsl_source/material_vp.glsl
152-
${ENGINE_DIR}/renderer/glsl_source/material_fp.glsl
153-
${ENGINE_DIR}/renderer/glsl_source/skybox_vp.glsl
154-
${ENGINE_DIR}/renderer/glsl_source/ssao_fp.glsl
155-
${ENGINE_DIR}/renderer/glsl_source/ssao_vp.glsl
156-
${ENGINE_DIR}/renderer/glsl_source/vertexAnimation_vp.glsl
157-
${ENGINE_DIR}/renderer/glsl_source/vertexSimple_vp.glsl
158-
${ENGINE_DIR}/renderer/glsl_source/vertexSkinning_vp.glsl
156+
157+
# Screen-space shaders
158+
${ENGINE_DIR}/renderer/glsl_source/screenSpace_vp.glsl
159159
${ENGINE_DIR}/renderer/glsl_source/blur_fp.glsl
160-
${ENGINE_DIR}/renderer/glsl_source/blur_vp.glsl
161160
${ENGINE_DIR}/renderer/glsl_source/cameraEffects_fp.glsl
162-
${ENGINE_DIR}/renderer/glsl_source/cameraEffects_vp.glsl
163-
${ENGINE_DIR}/renderer/glsl_source/computeLight_fp.glsl
164161
${ENGINE_DIR}/renderer/glsl_source/contrast_fp.glsl
165-
${ENGINE_DIR}/renderer/glsl_source/contrast_vp.glsl
166-
${ENGINE_DIR}/renderer/glsl_source/debugShadowMap_fp.glsl
167-
${ENGINE_DIR}/renderer/glsl_source/debugShadowMap_vp.glsl
168-
${ENGINE_DIR}/renderer/glsl_source/deformVertexes_vp.glsl
169-
${ENGINE_DIR}/renderer/glsl_source/depthtile1_fp.glsl
162+
${ENGINE_DIR}/renderer/glsl_source/fogGlobal_fp.glsl
163+
${ENGINE_DIR}/renderer/glsl_source/fxaa_fp.glsl
164+
${ENGINE_DIR}/renderer/glsl_source/fxaa3_11_fp.glsl
165+
${ENGINE_DIR}/renderer/glsl_source/motionblur_fp.glsl
166+
${ENGINE_DIR}/renderer/glsl_source/ssao_fp.glsl
167+
168+
# Lighting shaders
170169
${ENGINE_DIR}/renderer/glsl_source/depthtile1_vp.glsl
170+
${ENGINE_DIR}/renderer/glsl_source/depthtile1_fp.glsl
171171
${ENGINE_DIR}/renderer/glsl_source/depthtile2_fp.glsl
172-
${ENGINE_DIR}/renderer/glsl_source/depthtile2_vp.glsl
173-
${ENGINE_DIR}/renderer/glsl_source/fogGlobal_fp.glsl
174-
${ENGINE_DIR}/renderer/glsl_source/fogGlobal_vp.glsl
175-
${ENGINE_DIR}/renderer/glsl_source/fogQuake3_fp.glsl
172+
${ENGINE_DIR}/renderer/glsl_source/lighttile_vp.glsl
173+
${ENGINE_DIR}/renderer/glsl_source/lighttile_fp.glsl
174+
${ENGINE_DIR}/renderer/glsl_source/computeLight_fp.glsl
175+
${ENGINE_DIR}/renderer/glsl_source/reliefMapping_fp.glsl
176+
177+
# Common vertex shader libraries
178+
${ENGINE_DIR}/renderer/glsl_source/deformVertexes_vp.glsl
179+
${ENGINE_DIR}/renderer/glsl_source/vertexAnimation_vp.glsl
180+
${ENGINE_DIR}/renderer/glsl_source/vertexSimple_vp.glsl
181+
${ENGINE_DIR}/renderer/glsl_source/vertexSkinning_vp.glsl
182+
183+
# Regular shaders
184+
${ENGINE_DIR}/renderer/glsl_source/debugShadowMap_vp.glsl
185+
${ENGINE_DIR}/renderer/glsl_source/debugShadowMap_fp.glsl
176186
${ENGINE_DIR}/renderer/glsl_source/fogQuake3_vp.glsl
177-
${ENGINE_DIR}/renderer/glsl_source/forwardLighting_fp.glsl
187+
${ENGINE_DIR}/renderer/glsl_source/fogQuake3_fp.glsl
178188
${ENGINE_DIR}/renderer/glsl_source/forwardLighting_vp.glsl
179-
${ENGINE_DIR}/renderer/glsl_source/fxaa_fp.glsl
180-
${ENGINE_DIR}/renderer/glsl_source/fxaa_vp.glsl
181-
${ENGINE_DIR}/renderer/glsl_source/fxaa3_11_fp.glsl
182-
${ENGINE_DIR}/renderer/glsl_source/generic_fp.glsl
189+
${ENGINE_DIR}/renderer/glsl_source/forwardLighting_fp.glsl
183190
${ENGINE_DIR}/renderer/glsl_source/generic_vp.glsl
184-
${ENGINE_DIR}/renderer/glsl_source/heatHaze_fp.glsl
191+
${ENGINE_DIR}/renderer/glsl_source/generic_fp.glsl
185192
${ENGINE_DIR}/renderer/glsl_source/heatHaze_vp.glsl
186-
${ENGINE_DIR}/renderer/glsl_source/lightMapping_fp.glsl
193+
${ENGINE_DIR}/renderer/glsl_source/heatHaze_fp.glsl
187194
${ENGINE_DIR}/renderer/glsl_source/lightMapping_vp.glsl
188-
${ENGINE_DIR}/renderer/glsl_source/lighttile_fp.glsl
189-
${ENGINE_DIR}/renderer/glsl_source/lighttile_vp.glsl
190-
${ENGINE_DIR}/renderer/glsl_source/liquid_fp.glsl
195+
${ENGINE_DIR}/renderer/glsl_source/lightMapping_fp.glsl
191196
${ENGINE_DIR}/renderer/glsl_source/liquid_vp.glsl
192-
${ENGINE_DIR}/renderer/glsl_source/motionblur_fp.glsl
193-
${ENGINE_DIR}/renderer/glsl_source/motionblur_vp.glsl
194-
${ENGINE_DIR}/renderer/glsl_source/portal_fp.glsl
197+
${ENGINE_DIR}/renderer/glsl_source/liquid_fp.glsl
195198
${ENGINE_DIR}/renderer/glsl_source/portal_vp.glsl
196-
${ENGINE_DIR}/renderer/glsl_source/reflection_CB_fp.glsl
199+
${ENGINE_DIR}/renderer/glsl_source/portal_fp.glsl
197200
${ENGINE_DIR}/renderer/glsl_source/reflection_CB_vp.glsl
198-
${ENGINE_DIR}/renderer/glsl_source/reliefMapping_fp.glsl
199-
${ENGINE_DIR}/renderer/glsl_source/screen_fp.glsl
201+
${ENGINE_DIR}/renderer/glsl_source/reflection_CB_fp.glsl
200202
${ENGINE_DIR}/renderer/glsl_source/screen_vp.glsl
201-
${ENGINE_DIR}/renderer/glsl_source/shadowFill_fp.glsl
203+
${ENGINE_DIR}/renderer/glsl_source/screen_fp.glsl
202204
${ENGINE_DIR}/renderer/glsl_source/shadowFill_vp.glsl
205+
${ENGINE_DIR}/renderer/glsl_source/shadowFill_fp.glsl
206+
${ENGINE_DIR}/renderer/glsl_source/skybox_vp.glsl
203207
${ENGINE_DIR}/renderer/glsl_source/skybox_fp.glsl
204208
)
205209

src/engine/client/ClientApplication.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ extern SDL_Window *window;
4242
#endif
4343
#endif
4444

45+
static Cvar::Cvar<bool> client_errorPopup("client.errorPopup", "Enable the error popup window", Cvar::NONE, true);
46+
4547
namespace Application {
4648

4749
class ClientApplication : public Application {
@@ -126,7 +128,7 @@ class ClientApplication : public Application {
126128

127129
void Shutdown(bool error, Str::StringRef message) override {
128130
#if defined(_WIN32) || defined(BUILD_GRAPHICAL_CLIENT)
129-
if (error) {
131+
if (error && client_errorPopup.Get()) {
130132
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, PRODUCT_NAME, message.c_str(), window);
131133
}
132134
#endif

src/engine/client/cl_main.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ CGameVM cgvm;
151151
refexport_t re;
152152

153153
void CL_CheckForResend();
154-
void CL_ShowIP_f();
155154

156155
#if defined(USE_MUMBLE)
157156
static void CL_UpdateMumble()
@@ -2400,7 +2399,6 @@ void CL_Init()
24002399

24012400
Cmd_AddCommand( "ping", CL_Ping_f );
24022401
Cmd_AddCommand( "serverstatus", CL_ServerStatus_f );
2403-
Cmd_AddCommand( "showip", CL_ShowIP_f );
24042402

24052403
Cmd_AddCommand( "updatescreen", SCR_UpdateScreen );
24062404
// done.
@@ -2476,7 +2474,6 @@ void CL_Shutdown()
24762474
Cmd_RemoveCommand( "globalservers" );
24772475
Cmd_RemoveCommand( "ping" );
24782476
Cmd_RemoveCommand( "serverstatus" );
2479-
Cmd_RemoveCommand( "showip" );
24802477

24812478
CL_ClearKeyBinding();
24822479
CL_ClearInput();
@@ -2496,16 +2493,6 @@ void CL_Shutdown()
24962493

24972494
}
24982495

2499-
/*
2500-
==================
2501-
CL_ShowIP_f
2502-
==================
2503-
*/
2504-
void CL_ShowIP_f()
2505-
{
2506-
Sys_ShowIP();
2507-
}
2508-
25092496
/*
25102497
====================
25112498
CL_GetClipboardData

src/engine/qcommon/net_ip.cpp

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ struct nip_localaddr_t
170170
struct sockaddr_storage netmask;
171171
};
172172

173+
// Used to get local IP list. Saved here just to ensure /showip shows the same one that we used
174+
static char hostname[ 256 ];
175+
// Used for Sys_IsLANAddress
173176
static nip_localaddr_t localIP[ MAX_IPS ];
174177
static int numIP;
175178

@@ -887,30 +890,34 @@ bool Sys_IsLANAddress( const netadr_t& adr )
887890
return false;
888891
}
889892

890-
/*
891-
==================
892-
Sys_ShowIP
893-
==================
894-
*/
895-
void Sys_ShowIP()
893+
class ShowIPCommand : public Cmd::StaticCmd
896894
{
897-
int i;
898-
char addrbuf[ NET_ADDR_STR_MAX_LEN ];
895+
public:
896+
ShowIPCommand() : StaticCmd("showip", Cmd::SERVER, "show addresses of network interfaces") {}
899897

900-
for ( i = 0; i < numIP; i++ )
898+
void Run( const Cmd::Args & ) const override
901899
{
902-
Sys_SockaddrToString( addrbuf, sizeof( addrbuf ), ( struct sockaddr * ) &localIP[ i ].addr );
900+
Print( "Hostname: %s", hostname );
903901

904-
if ( localIP[ i ].type == netadrtype_t::NA_IP )
905-
{
906-
Log::Notice( "IP: %s", addrbuf );
907-
}
908-
else if ( localIP[ i ].type == netadrtype_t::NA_IP6 )
902+
int i;
903+
char addrbuf[ NET_ADDR_STR_MAX_LEN ];
904+
905+
for ( i = 0; i < numIP; i++ )
909906
{
910-
Log::Notice( "IP6: %s", addrbuf );
907+
Sys_SockaddrToString( addrbuf, sizeof( addrbuf ), ( struct sockaddr * ) &localIP[ i ].addr );
908+
909+
if ( localIP[ i ].type == netadrtype_t::NA_IP )
910+
{
911+
Print( "IP: %s", addrbuf );
912+
}
913+
else if ( localIP[ i ].type == netadrtype_t::NA_IP6 )
914+
{
915+
Print( "IP6: %s", addrbuf );
916+
}
911917
}
912918
}
913-
}
919+
};
920+
static ShowIPCommand showipRegistration;
914921

915922
//=============================================================================
916923

@@ -1507,28 +1514,24 @@ static void NET_GetLocalAddress()
15071514
}
15081515

15091516
freeifaddrs( ifap );
1510-
1511-
Sys_ShowIP();
15121517
}
15131518
}
15141519

15151520
#else
15161521
static void NET_GetLocalAddress()
15171522
{
1518-
char hostname[ 256 ];
15191523
struct addrinfo hint;
15201524

15211525
struct addrinfo *res = nullptr;
15221526

15231527
numIP = 0;
15241528

1525-
if ( gethostname( hostname, 256 ) == SOCKET_ERROR )
1529+
if ( gethostname( hostname, sizeof( hostname ) ) == SOCKET_ERROR )
15261530
{
1531+
*hostname = '\0';
15271532
return;
15281533
}
15291534

1530-
Log::Notice( "Hostname: %s", hostname );
1531-
15321535
memset( &hint, 0, sizeof( hint ) );
15331536

15341537
hint.ai_family = AF_UNSPEC;
@@ -1564,8 +1567,6 @@ static void NET_GetLocalAddress()
15641567
NET_AddLocalAddress( "", search->ai_addr, ( struct sockaddr * ) &mask6 );
15651568
}
15661569
}
1567-
1568-
Sys_ShowIP();
15691570
}
15701571

15711572
if ( res )

src/engine/qcommon/sys.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,5 @@ bool Sys_GetPacket(netadr_t *net_from, msg_t *net_message);
4343
bool Sys_StringToAdr(const char *s, netadr_t *a, netadrtype_t family);
4444

4545
bool Sys_IsLANAddress(const netadr_t& adr);
46-
void Sys_ShowIP();
4746

4847
#endif // ENGINE_QCOMMON_SYS_H_

src/engine/renderer/Material.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ void UpdateSurfaceDataGeneric3D( uint32_t* materials, shaderStage_t* pStage, boo
148148
alphaGen_t alphaGen = SetAlphaGen( pStage );
149149

150150
const bool styleLightMap = pStage->type == stageType_t::ST_STYLELIGHTMAP || pStage->type == stageType_t::ST_STYLECOLORMAP;
151-
gl_genericShaderMaterial->SetUniform_ColorModulateColorGen( rgbGen, alphaGen, mayUseVertexOverbright, styleLightMap );
151+
gl_genericShaderMaterial->SetUniform_ColorModulateColorGen_Uint( rgbGen, alphaGen, mayUseVertexOverbright, styleLightMap );
152152

153153
Tess_ComputeColor( pStage );
154-
gl_genericShaderMaterial->SetUniform_Color( tess.svars.color );
154+
gl_genericShaderMaterial->SetUniform_Color_Uint( tess.svars.color );
155155

156156
bool hasDepthFade = pStage->hasDepthFade;
157157
if ( hasDepthFade ) {
@@ -178,10 +178,10 @@ void UpdateSurfaceDataLightMapping( uint32_t* materials, shaderStage_t* pStage,
178178
}
179179

180180
// u_ColorModulate
181-
gl_lightMappingShaderMaterial->SetUniform_ColorModulateColorGen( rgbGen, alphaGen, false, !fullbright );
181+
gl_lightMappingShaderMaterial->SetUniform_ColorModulateColorGen_Uint( rgbGen, alphaGen, false, !fullbright );
182182

183183
// u_Color
184-
gl_lightMappingShaderMaterial->SetUniform_Color( tess.svars.color );
184+
gl_lightMappingShaderMaterial->SetUniform_Color_Uint( tess.svars.color );
185185

186186
// u_AlphaThreshold
187187
gl_lightMappingShaderMaterial->SetUniform_AlphaTest( pStage->stateBits );
@@ -1054,7 +1054,7 @@ void BindShaderFog( Material* material ) {
10541054
gl_fogQuake3ShaderMaterial->SetUniform_FogDepthVector( fogDepthVector );
10551055
gl_fogQuake3ShaderMaterial->SetUniform_FogEyeT( eyeT );
10561056

1057-
gl_fogQuake3ShaderMaterial->SetUniform_ColorGlobal( fog->color );
1057+
gl_fogQuake3ShaderMaterial->SetUniform_ColorGlobal_Uint( fog->color );
10581058

10591059
gl_fogQuake3ShaderMaterial->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
10601060
gl_fogQuake3ShaderMaterial->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[glState.stackIndex] );

0 commit comments

Comments
 (0)