]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/brushmodule.cpp
clean up toggleProjection code
[xonotic/netradiant.git] / radiant / brushmodule.cpp
index d5853f07248b744c4894ddc1ec4a6b29d9e3786f..da508c038abbc1e8d2a52f5ac4b84b789e7e77e2 100644 (file)
@@ -91,25 +91,25 @@ void Brush_registerPreferencesPage()
 }
 
 void Brush_unlatchPreferences()
+{
+       Brush_toggleProjection(0);
+}
+
+void Brush_toggleProjection(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_toggleProjectionCount()
 {
        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)