]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/brushmodule.cpp
Fixes by Dunk
[xonotic/netradiant.git] / radiant / brushmodule.cpp
index e289f3ccb1e161f1bfa58be1f61043f99170b42d..6b47e0926e6990d2ac228942b2165e2f5fbcddfd 100644 (file)
@@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 LatchedBool g_useAlternativeTextureProjection(false, "Use alternative texture-projection");
 bool g_showAlternativeTextureProjectionOption = false;
+bool g_brush_always_caulk;
 
 bool getTextureLockEnabled()
 {
@@ -73,6 +74,11 @@ void Brush_constructPreferences(PreferencesPage& page)
       BoolExportCaller(g_useAlternativeTextureProjection.m_latched)
     );
   }
+  // d1223m
+  page.appendCheckBox("", 
+    "Always use caulk for new brushes",
+    g_brush_always_caulk
+  );
 }
 void Brush_constructPage(PreferenceGroup& group)
 {
@@ -102,6 +108,12 @@ void Brush_Construct(EBrushType type)
     {
       type = eBrushTypeQuake3BP;
     }
+    
+    // d1223m
+    GlobalPreferenceSystem().registerPreference(
+      "BrushAlwaysCaulk", 
+      BoolImportStringCaller(g_brush_always_caulk), 
+      BoolExportStringCaller(g_brush_always_caulk));
   }
 
   Brush_registerCommands();
@@ -131,8 +143,6 @@ void Brush_Construct(EBrushType type)
     }
   }
 
-  FaceTextureClipboard_setDefault();
-
   GlobalPreferenceSystem().registerPreference("TextureLock", BoolImportStringCaller(g_brush_texturelock_enabled), BoolExportStringCaller(g_brush_texturelock_enabled));
   GlobalPreferenceSystem().registerPreference("BrushSnapPlanes", makeBoolStringImportCallback(FaceImportSnapPlanesCaller()), makeBoolStringExportCallback(FaceExportSnapPlanesCaller()));
   GlobalPreferenceSystem().registerPreference("TexdefDefaultScale", FloatImportStringCaller(g_texdef_default_scale), FloatExportStringCaller(g_texdef_default_scale));
@@ -184,12 +194,13 @@ public:
   {
     return g_useAlternativeTextureProjection.m_value;
   }
-  void forEachBrushFace(scene::Node& brush, const BrushFaceDataCallback& callback)
+  void Brush_forEachFace(scene::Node& brush, const BrushFaceDataCallback& callback)
   {
-    Brush_forEachFace(*Node_getBrush(brush), FaceCallback(BrushFaceDataFromFaceCaller(callback)));
+    ::Brush_forEachFace(*Node_getBrush(brush), FaceCallback(BrushFaceDataFromFaceCaller(callback)));
   }
-  bool addBrushFace(scene::Node& brush, const _QERFaceData& faceData)
+  bool Brush_addFace(scene::Node& brush, const _QERFaceData& faceData)
   {
+    Node_getBrush(brush)->undoSave();
     return Node_getBrush(brush)->addPlane(faceData.m_p0, faceData.m_p1, faceData.m_p2, faceData.m_shader, TextureProjection(faceData.m_texdef, brushprimit_texdef_t(), Vector3(0, 0, 0), Vector3(0, 0, 0))) != 0;
   }
 };