Added 'Always use Caulk for new brushes' to preferences

This commit is contained in:
Chris Brooke 2013-07-25 23:55:21 +01:00
parent 60a0f49052
commit 449340a95e
3 changed files with 26 additions and 1 deletions

View file

@ -131,6 +131,7 @@
#define DOSLEEP_KEY "SleepMode"
#define SUBDIVISIONS_KEY "Subdivisions"
#define DEFAULTTEXURESCALE_KEY "DefaultTextureScale"
#define CAULKNEWBRUSHES_KEY "CaulkNewBrushes"
#define CLIPCAULK_KEY "ClipCaulk"
#define PATCHSHOWBOUNDS_KEY "PatchShowBounds"
#define NATIVEGUI_KEY "NativeGUI"
@ -2582,6 +2583,14 @@ void PrefsDlg::BuildDialog(){
(GtkAttachOptions) ( 0 ), 0, 0 );
AddDialogData( entry, &m_fDefTextureScale, DLG_ENTRY_FLOAT );
// caulk new brushes
check = gtk_check_button_new_with_label( _( "Always use caulk for new brushes" ) );
gtk_widget_show( check );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
g_object_set_data( G_OBJECT( dialog ), "check_caulkbrush", check );
AddDialogData( check, &m_bCaulkNewBrushes, DLG_CHECK_BOOL );
// Add the page to the notebook
gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
@ -3045,6 +3054,7 @@ void PrefsDlg::LoadPrefs(){
mLocalPrefs.GetPref( SELECTMODELS_KEY, &m_bSelectModels, TRUE );
mLocalPrefs.GetPref( SHADERLISTONLY_KEY, &m_bTexturesShaderlistOnly, FALSE );
mLocalPrefs.GetPref( DEFAULTTEXURESCALE_KEY, &m_fDefTextureScale, g_pGameDescription->mTextureDefaultScale );
mLocalPrefs.GetPref( CAULKNEWBRUSHES_KEY, &m_bCaulkNewBrushes, TRUE );
mLocalPrefs.GetPref( SUBDIVISIONS_KEY, &m_nSubdivisions, SUBDIVISIONS_DEF );
mLocalPrefs.GetPref( CLIPCAULK_KEY, &m_bClipCaulk, FALSE );
mLocalPrefs.GetPref( SNAPTTOGRID_KEY, &m_bSnapTToGrid, FALSE );

View file

@ -641,6 +641,7 @@ bool m_bGLLighting;
bool m_bTexturesShaderlistOnly;
int m_nSubdivisions;
float m_fDefTextureScale;
bool m_bCaulkNewBrushes;
bool m_bFloatingZ;
bool m_bLatchedFloatingZ;
// Gef: Kyro GL_POINT workaround

View file

@ -1596,7 +1596,21 @@ void XYWnd::NewBrushDrag( int x, int y ){
}
}
n = Brush_Create( mins, maxs, &g_qeglobals.d_texturewin.texdef );
// Caulk the new brush
if ( g_PrefsDlg.m_bCaulkNewBrushes == TRUE ) {
texdef_t tex;
IShader *shad = QERApp_Shader_ForName( "textures/common/caulk" );
tex.SetName( shad->getName() );
tex.scale[0] = g_PrefsDlg.m_fDefTextureScale;
tex.scale[1] = g_PrefsDlg.m_fDefTextureScale;
tex.flags = shad->getFlags();
n = Brush_Create( mins, maxs, &tex );
} else {
n = Brush_Create( mins, maxs, &g_qeglobals.d_texturewin.texdef );
}
if ( !n ) {
return;
}