diff --git a/radiant/brush.cpp b/radiant/brush.cpp index 4578b505..f06137a5 100644 --- a/radiant/brush.cpp +++ b/radiant/brush.cpp @@ -2381,7 +2381,7 @@ void Brush_RemoveFromList( brush_t *b ){ if NULL, ask for a default =============== */ -void SetFaceTexdef( face_t *f, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, IPluginTexdef* pPlugTexdef ) { +void SetFaceTexdef( face_t *f, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, IPluginTexdef* pPlugTexdef, bool bKeepSurf, bool bKeepContents ) { int oldFlags; int oldContents; @@ -2423,8 +2423,10 @@ void SetFaceTexdef( face_t *f, texdef_t *texdef, brushprimit_texdef_t *brushprim f->texdef = *texdef; } } - f->texdef.flags = ( f->texdef.flags & ~SURF_KEEP ) | ( oldFlags & SURF_KEEP ); - f->texdef.contents = ( f->texdef.contents & ~CONTENTS_KEEP ) | ( oldContents & CONTENTS_KEEP ); + if ( bKeepSurf ) + f->texdef.flags = (f->texdef.flags & ~SURF_KEEP) | (oldFlags & SURF_KEEP); + if ( bKeepContents ) + f->texdef.contents = (f->texdef.contents & ~CONTENTS_KEEP) | (oldContents & CONTENTS_KEEP); } void Brush_SetTexture( brush_t *b, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, IPluginTexdef* pTexdef ){ diff --git a/radiant/brush.h b/radiant/brush.h index 1d8869fc..ff0a0fdc 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -76,7 +76,7 @@ void Face_SetShader( face_t *face, IShader *shader ); void Face_MakePlane( face_t *f ); void Face_Draw( face_t *face ); void Face_TextureVectors( face_t * f, float STfromXYZ[2][4] ); -void SetFaceTexdef( face_t *f, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef* pPlugTexdef = NULL ); +void SetFaceTexdef( face_t *f, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef* pPlugTexdef = NULL, bool bKeepSurf = true, bool bKeepContents = true ); void Face_FitTexture( face_t * face, int nHeight, int nWidth ); void Brush_FitTexture( brush_t *b, int nHeight, int nWidth ); diff --git a/radiant/surfaceplugin.cpp b/radiant/surfaceplugin.cpp index fa973884..5fa99b34 100644 --- a/radiant/surfaceplugin.cpp +++ b/radiant/surfaceplugin.cpp @@ -195,11 +195,10 @@ void SI_SetTexdef_FaceList( texdef_to_face_t* texdef_face_list, bool b_SetUndoPo if ( selected_brushes.next != &selected_brushes ) { Undo_AddBrushList( &selected_brushes ); } - else{ + else { Undo_AddBrush( texdef_face_list->brush ); } - - } + } } for ( texdef_to_face = texdef_face_list; texdef_to_face; texdef_to_face = texdef_to_face->next ) @@ -207,7 +206,7 @@ void SI_SetTexdef_FaceList( texdef_to_face_t* texdef_face_list, bool b_SetUndoPo { brushprimit_texdef_t brushprimit_texdef; FakeTexCoordsToTexMat( texdef_to_face->texdef.shift, texdef_to_face->texdef.rotate, texdef_to_face->texdef.scale, brushprimit_texdef.coords ); - SetFaceTexdef( texdef_to_face->face, &texdef_to_face->texdef, &brushprimit_texdef, bFit_to_Scale ); + SetFaceTexdef( texdef_to_face->face, &texdef_to_face->texdef, &brushprimit_texdef, bFit_to_Scale, NULL, true, false ); } Brush_Build( texdef_to_face->brush ); if ( bFit_to_Scale ) {