From: Rudolf Polzer Date: Sun, 10 Oct 2010 08:26:46 +0000 (+0200) Subject: allow changing the "Alternate texture projection" mode at runtime (requires Map_New... X-Git-Tag: xonotic-v0.5.0~179 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=652a2d36fb6a2ca5836d4a952a93144c8f856390;p=xonotic%2Fnetradiant.git allow changing the "Alternate texture projection" mode at runtime (requires Map_New currently though) --- diff --git a/radiant/brushmodule.cpp b/radiant/brushmodule.cpp index 6b47e092..e8b605ca 100644 --- a/radiant/brushmodule.cpp +++ b/radiant/brushmodule.cpp @@ -90,6 +90,16 @@ void Brush_registerPreferencesPage() PreferencesDialog_addSettingsPage(FreeCaller1()); } +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) { diff --git a/radiant/brushmodule.h b/radiant/brushmodule.h index 20f73473..76e74b71 100644 --- a/radiant/brushmodule.h +++ b/radiant/brushmodule.h @@ -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 diff --git a/radiant/map.cpp b/radiant/map.cpp index 3e5e8128..0e401ea4 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -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