From 4dc9b18f705b27bca0ed499d48c998ec3358b30e Mon Sep 17 00:00:00 2001 From: Garux Date: Fri, 21 Dec 2018 14:45:12 +0300 Subject: [PATCH] * fix brush shader names handling by bobtoolz (was writting empty shader name = crash on map save, at least "textures/" is expected) complain about patch and brush shader names harder --- contrib/bobtoolz/DPlane.cpp | 3 +++ radiant/brush.h | 2 +- radiant/patch.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/bobtoolz/DPlane.cpp b/contrib/bobtoolz/DPlane.cpp index cb1f9c9b..24624f1b 100644 --- a/contrib/bobtoolz/DPlane.cpp +++ b/contrib/bobtoolz/DPlane.cpp @@ -55,6 +55,8 @@ DPlane::DPlane( const vec3_t va, const vec3_t vb, const vec3_t vc, const _QERFac else{ FillDefaultTexture( &texInfo, points[0], points[1], points[2], "textures/common/caulk" ); } + + m_shader = texInfo.m_shader; } DPlane::~DPlane(){ @@ -262,6 +264,7 @@ DPlane::DPlane( const vec3_t va, const vec3_t vb, const vec3_t vc, const char* t m_bChkOk = true; FillDefaultTexture( &texInfo, points[0], points[1], points[2], textureName ); + m_shader = texInfo.m_shader; if ( bDetail ) { texInfo.contents |= FACE_DETAIL; } diff --git a/radiant/brush.h b/radiant/brush.h index 870b89c1..1dbeb457 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -270,7 +270,7 @@ inline bool check_plane_is_integer( const PlanePoints& planePoints ){ } inline void brush_check_shader( const char* name ){ - if ( !shader_valid( name ) ) { + if ( !texdef_name_valid( name ) ) { globalErrorStream() << "brush face has invalid texture name: '" << name << "'\n"; } } diff --git a/radiant/patch.h b/radiant/patch.h index be1c5c99..6df57ce0 100644 --- a/radiant/patch.h +++ b/radiant/patch.h @@ -994,7 +994,7 @@ void releaseShader(){ } void check_shader(){ - if ( !shader_valid( GetShader() ) ) { + if ( !texdef_name_valid( GetShader() ) ) { globalErrorStream() << "patch has invalid texture name: '" << GetShader() << "'\n"; } }