]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
allow changing the "Alternate texture projection" mode at runtime (requires Map_New...
authorRudolf Polzer <divverent@alientrap.org>
Sun, 10 Oct 2010 08:26:46 +0000 (10:26 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 10 Oct 2010 08:27:50 +0000 (10:27 +0200)
radiant/brushmodule.cpp
radiant/brushmodule.h
radiant/map.cpp

index 6b47e0926e6990d2ac228942b2165e2f5fbcddfd..e8b605ca7d4a8da202ff4b350610644035951b12 100644 (file)
@@ -90,6 +90,16 @@ void Brush_registerPreferencesPage()
   PreferencesDialog_addSettingsPage(FreeCaller1<PreferenceGroup&, Brush_constructPage>());
 }
 
+void Brush_unlatchPreferences()
+{
+       if(g_showAlternativeTextureProjectionOption)
+       {
+               g_useAlternativeTextureProjection.useLatched();
+               globalErrorStream() << "Unlatched g_useAlternativeTextureProjection (" << g_useAlternativeTextureProjection.m_value << ")\n";
+               Brush::destroyStatic();
+               Brush::constructStatic(g_useAlternativeTextureProjection.m_value ? eBrushTypeQuake3BP : eBrushTypeQuake3);
+       }
+}
 
 void Brush_Construct(EBrushType type)
 {
index 20f73473de2389bdd13f099ea6e504d3c5dd324a..76e74b7122231fe844c636f99807bc32bb5faad6 100644 (file)
@@ -23,5 +23,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define INCLUDED_BRUSHMODULE_H
 
 void Brush_clipperColourChanged();
+void Brush_unlatchPreferences();
 
 #endif
index 3e5e8128ab1d978d03a0f25a80dd6dfc13946cde..0e401ea41d98ba5bbbc3be6c910f5c5abfab2680 100644 (file)
@@ -83,6 +83,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "mru.h"
 #include "commands.h"
 #include "autosave.h"
+#include "brushmodule.h"
 
 class NameObserver
 {
@@ -463,6 +464,7 @@ void Map_Free()
   FlushReferences();
 
   g_currentMap = 0;
+  Brush_unlatchPreferences();
 }
 
 class EntityFindByClassname : public scene::Graph::Walker