]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/brushmodule.cpp
totally unlimit entities
[xonotic/netradiant.git] / radiant / brushmodule.cpp
index d5853f07248b744c4894ddc1ec4a6b29d9e3786f..3cdf77a829a04b2f8aac9bb7208b688d5b22e3d5 100644 (file)
@@ -91,25 +91,25 @@ void Brush_registerPreferencesPage()
 }
 
 void Brush_unlatchPreferences()
+{
+       Brush_toggleFormat(0);
+}
+
+void Brush_toggleFormat(int i)
 {
        if(g_showAlternativeTextureProjectionOption)
        {
-               g_useAlternativeTextureProjection.useLatched();
-               globalErrorStream() << "Unlatched g_useAlternativeTextureProjection (" << g_useAlternativeTextureProjection.m_value << ")\n";
+               g_useAlternativeTextureProjection.m_value = g_useAlternativeTextureProjection.m_latched ^ i;
                Brush::destroyStatic();
                Brush::constructStatic(g_useAlternativeTextureProjection.m_value ? eBrushTypeQuake3BP : eBrushTypeQuake3);
        }
 }
 
-void Brush_toggleProjection()
+int Brush_toggleFormatCount()
 {
        if(g_showAlternativeTextureProjectionOption)
-       {
-               g_useAlternativeTextureProjection.m_value = !g_useAlternativeTextureProjection.m_value;
-               globalErrorStream() << "Toggled g_useAlternativeTextureProjection (" << g_useAlternativeTextureProjection.m_value << ")\n";
-               Brush::destroyStatic();
-               Brush::constructStatic(g_useAlternativeTextureProjection.m_value ? eBrushTypeQuake3BP : eBrushTypeQuake3);
-       }
+               return 2;
+       return 1;
 }
 
 void Brush_Construct(EBrushType type)
@@ -118,6 +118,10 @@ void Brush_Construct(EBrushType type)
   {
     g_showAlternativeTextureProjectionOption = true;
 
+    const char *value = g_pGameDescription->getKeyValue("brush_primit");
+    if(!string_empty(value))
+      g_useAlternativeTextureProjection.m_latched = atoi(value);
+
     GlobalPreferenceSystem().registerPreference(
       "AlternativeTextureProjection",
       BoolImportStringCaller(g_useAlternativeTextureProjection.m_latched),