From cdc2dbff32259155d417c8aa08b5e46a246e8021 Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Thu, 15 Sep 2016 16:27:55 -0400 Subject: [PATCH 1/4] More texture suffix checks for DarkPlaces effect texture names. --- radiant/texwindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index ec20e357..4e459065 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -780,7 +780,11 @@ void Texture_ShowDirectory(){ g_str_has_suffix( name, "_h" ) || g_str_has_suffix( name, "_local" ) || g_str_has_suffix( name, "_nm" ) || - g_str_has_suffix( name, "_s" )) { + g_str_has_suffix( name, "_s" ) || + g_str_has_suffix( name, "_bump" ) || + g_str_has_suffix( name, "_gloss" ) || + g_str_has_suffix( name, "_luma" ) || + g_str_has_suffix( name, "_norm" ) ) { continue; } From b529282159f1ed1f752279d5873e7f9a1615b354 Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Sat, 31 Dec 2016 15:44:18 -0500 Subject: [PATCH 2/4] Fix compilation on OS X. How is this working elsewhere? --- libs/picomodel/picointernal.h | 2 +- libs/picomodel/picomodel.vcproj | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/picomodel/picointernal.h b/libs/picomodel/picointernal.h index 8e9bba25..853809ee 100644 --- a/libs/picomodel/picointernal.h +++ b/libs/picomodel/picointernal.h @@ -132,7 +132,7 @@ void _pico_printf( int level, const char *format, ... ); char *_pico_stristr( char *str, const char *substr ); void _pico_unixify( char *path ); int _pico_nofname( const char *path, char *dest, int destSize ); -char *_pico_nopath( const char *path ); +const char *_pico_nopath( const char *path ); char *_pico_setfext( char *path, const char *ext ); int _pico_getline( char *buf, int bufsize, char *dest, int destsize ); char *_pico_strlwr( char *str ); diff --git a/libs/picomodel/picomodel.vcproj b/libs/picomodel/picomodel.vcproj index 1cfa803c..0ef3325f 100644 --- a/libs/picomodel/picomodel.vcproj +++ b/libs/picomodel/picomodel.vcproj @@ -192,6 +192,10 @@ RelativePath=".\pm_obj.c" > + + Date: Sat, 31 Dec 2016 15:55:29 -0500 Subject: [PATCH 3/4] This generates a different warning now, and is just wrong anyway. --- libs/picomodel/pm_terrain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/picomodel/pm_terrain.c b/libs/picomodel/pm_terrain.c index d0d54653..f5d16423 100644 --- a/libs/picomodel/pm_terrain.c +++ b/libs/picomodel/pm_terrain.c @@ -303,7 +303,7 @@ static int _terrain_canload( PM_PARAMS_CANLOAD ) { /* keep the friggin compiler happy */ - *fileName = *fileName; + /**fileName = *fileName*/; /* create pico parser */ p = _pico_new_parser( (picoByte_t*) buffer, bufSize ); @@ -356,7 +356,7 @@ static picoModel_t *_terrain_load( PM_PARAMS_LOAD ) { /* keep the friggin compiler happy */ - *fileName = *fileName; + /**fileName = *fileName*/; /* create pico parser */ p = _pico_new_parser( (picoByte_t*) buffer, bufSize ); From 5938d4e49f1832ba10d5aa0f8c6ba09dd98cddcd Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Sat, 31 Dec 2016 16:02:08 -0500 Subject: [PATCH 4/4] Fix a handful of compiler warnings. --- libs/picomodel/picointernal.c | 2 +- radiant/brush.cpp | 14 ++++++-------- tools/quake2/extra/bsp/qbsp3/map.c | 2 -- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/libs/picomodel/picointernal.c b/libs/picomodel/picointernal.c index c6f396ce..d9eeb656 100644 --- a/libs/picomodel/picointernal.c +++ b/libs/picomodel/picointernal.c @@ -272,7 +272,7 @@ void _pico_first_token( char *str ) { return; } while (*str && !isspace(*str)) - *str++; + str++; *str = '\0'; } diff --git a/radiant/brush.cpp b/radiant/brush.cpp index 2d07acad..cb98600d 100644 --- a/radiant/brush.cpp +++ b/radiant/brush.cpp @@ -26,7 +26,6 @@ #include "filters.h" extern MainFrame* g_pParentWnd; -extern void MemFile_fprintf( MemStream* pMemFile, const char* pText, ... ); // globals @@ -130,7 +129,6 @@ float lightaxis[3] = {0.6f, 0.8f, 1.0f}; improve recognition ================ */ -extern float ShadeForNormal( vec3_t normal ); float SetShadeForPlane( plane_t *p ){ //return ShadeForNormal(p->normal); @@ -2292,7 +2290,7 @@ face_t *Brush_Ray( vec3_t origin, vec3_t dir, brush_t *b, float *dist, int nFlag // see Brush_Draw // do some last minute filtering - if ( firstface && nFlags & SF_CAMERA ) { + if ( firstface && ( nFlags & SF_CAMERA ) ) { if ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_CAULK ) { if ( strstr( firstface->texdef.GetName(), "caulk" ) ) { *dist = 0; @@ -3060,7 +3058,7 @@ void Brush_FaceDraw( face_t *face, int nGLState ){ if ( w == NULL ) { return; } - if ( nGLState & DRAW_GL_LIGHTING && g_PrefsDlg.m_bGLLighting ) { + if ( ( nGLState & DRAW_GL_LIGHTING ) && g_PrefsDlg.m_bGLLighting ) { qglNormal3fv( face->plane.normal ); } /* @@ -3137,7 +3135,7 @@ void Brush_Draw( brush_t *b ){ if ( bTrans && !( nGLState & DRAW_GL_BLEND ) ) { continue; } - if ( !bTrans && nGLState & DRAW_GL_BLEND ) { + if ( !bTrans && ( nGLState & DRAW_GL_BLEND ) ) { continue; } @@ -3163,17 +3161,17 @@ void Brush_Draw( brush_t *b ){ } } - if ( nGLState & DRAW_GL_TEXTURE_2D && face->d_texture->name[0] == '(' ) { + if ( ( nGLState & DRAW_GL_TEXTURE_2D ) && face->d_texture->name[0] == '(' ) { prev = NULL; qglDisable( GL_TEXTURE_2D ); } - else if ( nGLState & DRAW_GL_TEXTURE_2D && ( nDrawMode == cd_texture || nDrawMode == cd_light ) && face->d_texture != prev ) { + else if ( ( nGLState & DRAW_GL_TEXTURE_2D ) && ( nDrawMode == cd_texture || nDrawMode == cd_light ) && face->d_texture != prev ) { // set the texture for this face prev = face->d_texture; qglBindTexture( GL_TEXTURE_2D, face->d_texture->texture_number ); } - if ( nGLState & DRAW_GL_LIGHTING && !g_PrefsDlg.m_bGLLighting ) { + if ( ( nGLState & DRAW_GL_LIGHTING ) && !g_PrefsDlg.m_bGLLighting ) { if ( !b->owner->eclass->fixedsize ) { material[3] = transVal; } diff --git a/tools/quake2/extra/bsp/qbsp3/map.c b/tools/quake2/extra/bsp/qbsp3/map.c index 232979c7..2af52057 100644 --- a/tools/quake2/extra/bsp/qbsp3/map.c +++ b/tools/quake2/extra/bsp/qbsp3/map.c @@ -22,8 +22,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "qbsp.h" -extern qboolean onlyents; - int nummapbrushes; mapbrush_t mapbrushes[MAX_MAP_BRUSHES];