]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
minor refactoring
authorspog <spog@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Sun, 11 Jun 2006 11:28:42 +0000 (11:28 +0000)
committerspog <spog@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Sun, 11 Jun 2006 11:28:42 +0000 (11:28 +0000)
git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk@81 8a3a26a2-13c4-0310-b231-cf6edde360e5

TODO
radiant/brushmanip.cpp
radiant/entityinspector.cpp
radiant/entitylist.cpp
radiant/mainframe.cpp
radiant/patchdialog.cpp
radiant/select.cpp
radiant/selection.cpp
radiant/surfacedialog.cpp

diff --git a/TODO b/TODO
index 43a22d7e2a362f798b58e9ad79355a3c6ee908da..8ff1cf8368447cece668488ee74e35c7ce1cc745 100644 (file)
--- a/TODO
+++ b/TODO
@@ -39,6 +39,8 @@ At the moment you can only create custom variables by editing the XML file. A cu
 This variable could then be used in a command like this:
 <pre>[arghrad] "[MapFile]"</pre>
 
+Entity: option to filter non-world entities (e.g. not func_group or func_static)
+Rotate Tool: if more than one object is selected, with different local orientations, use parent-space rotation pivot instead of local-space
 Texture Browser: add a way to make large texture sets more manageable - shaderlist.txt was previously used this way
 Brush: MMB+ctrl to paint texture on whole brush/patch.
 Camera: add alternative highlighting styles (used to be J).
index 238a58e923119ebb4f70a89b7f54d77b2acb9bba..cac0846a84d2a5714428aecb80b1ad90cff5ac5b 100644 (file)
@@ -843,16 +843,16 @@ public:
   }
 };
 
-class filter_face_shader_substring : public FaceFilter
+class filter_face_shader_prefix : public FaceFilter
 {
-  const char* m_shader;
+  const char* m_prefix;
 public:
-  filter_face_shader_substring(const char* shader) : m_shader(shader)
+  filter_face_shader_prefix(const char* prefix) : m_prefix(prefix)
   {
   }
   bool filter(const Face& face) const
   {
-    return shader_equal_n(face.GetShader(), m_shader, strlen(m_shader));
+    return shader_equal_n(face.GetShader(), m_prefix, strlen(m_prefix));
   }
 };
 
@@ -969,7 +969,7 @@ filter_brush_all_faces g_filter_brush_caulk(&g_filter_face_caulk);
 filter_face_shader g_filter_face_caulk_ja("textures/system/caulk");
 filter_brush_all_faces g_filter_brush_caulk_ja(&g_filter_face_caulk_ja);
 
-filter_face_shader_substring g_filter_face_liquids("textures/liquids/");
+filter_face_shader_prefix g_filter_face_liquids("textures/liquids/");
 filter_brush_any_face g_filter_brush_liquids(&g_filter_face_liquids);
 
 filter_face_shader g_filter_face_hint("textures/common/hint");
index db64da1dbd94fbfa92e8b5cb4baf45fcfbbf859b..da097e465e8f82e0c4411a813f80deb6c0ba9727 100644 (file)
@@ -1693,7 +1693,8 @@ GtkWidget* EntityInspector_constructWindow(GtkWindow* toplevel)
   g_entityInspector_windowConstructed = true;
   EntityClassList_fill();
 
-  GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1<const Selectable&, EntityInspector_selectionChanged>());
+  typedef FreeCaller1<const Selectable&, EntityInspector_selectionChanged> EntityInspectorSelectionChangedCaller;
+  GlobalSelectionSystem().addSelectionChangeCallback(EntityInspectorSelectionChangedCaller());
   GlobalEntityCreator().setKeyValueChangedFunc(EntityInspector_keyValueChanged);
 
   // hack
index c34d5b749b7ac52b6bf6e154c9382055a0676a8b..e6944a6d1d13a0193867b3514c5508620236b733 100644 (file)
@@ -419,7 +419,8 @@ void EntityList_Construct()
 
   GlobalPreferenceSystem().registerPreference("EntityInfoDlg", WindowPositionTrackerImportStringCaller(getEntityList().m_positionTracker), WindowPositionTrackerExportStringCaller(getEntityList().m_positionTracker));
 
-  GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1<const Selectable&, EntityList_SelectionChanged>());
+  typedef FreeCaller1<const Selectable&, EntityList_SelectionChanged> EntityListSelectionChangedCaller;
+  GlobalSelectionSystem().addSelectionChangeCallback(EntityListSelectionChangedCaller());
 }
 void EntityList_Destroy()
 {
index c3fea8364efb51a922f98c52c11b9a0b6706ded1..c7444c4925a460befabb6f81c6d852fa82d3e180 100644 (file)
@@ -3452,7 +3452,8 @@ void MainFrame_Construct()
   Patch_registerCommands();
   XYShow_registerCommands();
 
-  GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1<const Selectable&, ComponentMode_SelectionChanged>());
+  typedef FreeCaller1<const Selectable&, ComponentMode_SelectionChanged> ComponentModeSelectionChangedCaller;
+  GlobalSelectionSystem().addSelectionChangeCallback(ComponentModeSelectionChangedCaller());
 
   GlobalPreferenceSystem().registerPreference("DetachableMenus", BoolImportStringCaller(g_Layout_enableDetachableMenus.m_latched), BoolExportStringCaller(g_Layout_enableDetachableMenus.m_latched));
   GlobalPreferenceSystem().registerPreference("PatchToolBar", BoolImportStringCaller(g_Layout_enablePatchToolbar.m_latched), BoolExportStringCaller(g_Layout_enablePatchToolbar.m_latched));
index 04b2aed098357f09c681d61372a59ce340b4c3c3..6765ceeb2df68c7ec0adeab70aa428d658e08222 100644 (file)
@@ -1208,8 +1208,10 @@ void PatchInspector_Construct()
   GlobalPreferenceSystem().registerPreference("SI_PatchTexdef_Shift2", FloatImportStringCaller(g_pi_globals.shift[1]), FloatExportStringCaller(g_pi_globals.shift[1]));
   GlobalPreferenceSystem().registerPreference("SI_PatchTexdef_Rotate", FloatImportStringCaller(g_pi_globals.rotate), FloatExportStringCaller(g_pi_globals.rotate));
 
-  GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1<const Selectable&, PatchInspector_SelectionChanged>());
-  Patch_addTextureChangedCallback(FreeCaller<PatchInspector_queueDraw>());
+  typedef FreeCaller1<const Selectable&, PatchInspector_SelectionChanged> PatchInspectorSelectionChangedCaller;
+  GlobalSelectionSystem().addSelectionChangeCallback(PatchInspectorSelectionChangedCaller());
+  typedef FreeCaller<PatchInspector_queueDraw> PatchInspectorQueueDrawCaller;
+  Patch_addTextureChangedCallback(PatchInspectorQueueDrawCaller());
 }
 void PatchInspector_Destroy()
 {
index 09f0709c83007a13d186a757f422d439c589ddf5..9709c179d6f035b64970a1032c5c10e1354402c5 100644 (file)
@@ -228,7 +228,7 @@ void UpdateWorkzone_ForSelection()
 }
 
 // update the workzone to the current selection
-void UpdateWorkzone_ForSelection(const Selectable& selectable)
+void UpdateWorkzone_ForSelectionChanged(const Selectable& selectable)
 {
   if(selectable.isSelected())
   {
@@ -735,9 +735,12 @@ SignalHandlerId Selection_boundsChanged;
 
 void Selection_construct()
 {
-  GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1<const Selectable&, SceneSelectionChange>());
-  GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1<const Selectable&, UpdateWorkzone_ForSelection>());
-  Selection_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback(FreeCaller<UpdateWorkzone_ForSelection>());
+  typedef FreeCaller1<const Selectable&, SceneSelectionChange> SceneSelectionChangeCaller;
+  GlobalSelectionSystem().addSelectionChangeCallback(SceneSelectionChangeCaller());
+  typedef FreeCaller1<const Selectable&, UpdateWorkzone_ForSelectionChanged> UpdateWorkzoneForSelectionChangedCaller;
+  GlobalSelectionSystem().addSelectionChangeCallback(UpdateWorkzoneForSelectionChangedCaller());
+  typedef FreeCaller<UpdateWorkzone_ForSelection> UpdateWorkzoneForSelectionCaller;
+  Selection_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback(UpdateWorkzoneForSelectionCaller());
 }
 
 void Selection_destroy()
index ed3e973dbb0b2c4ab7bffe2fa9e77fd7d88aa02c..d3995312ceb72c04e0df69bf6d367f82bff172d5 100644 (file)
@@ -2833,7 +2833,7 @@ public:
   {
     SetManipulatorMode(eTranslate);
     pivotChanged();
-    addSelectionChangeCallback(pivotChangedSelectionCaller(*this));
+    addSelectionChangeCallback(PivotChangedSelectionCaller(*this));
     AddGridChangeCallback(PivotChangedCaller(*this));
   }
   void pivotChanged() const
@@ -2846,7 +2846,7 @@ public:
   {
     pivotChanged();
   }
-  typedef MemberCaller1<RadiantSelectionSystem, const Selectable&, &RadiantSelectionSystem::pivotChangedSelection> pivotChangedSelectionCaller;
+  typedef MemberCaller1<RadiantSelectionSystem, const Selectable&, &RadiantSelectionSystem::pivotChangedSelection> PivotChangedSelectionCaller;
 
   void SetMode(EMode mode)
   {
index 89785bb7df1c7f04f3321c53a4cce7c16cfdf005..6db967704540b66f07f1be12cb361e1927cd9da8 100644 (file)
@@ -1594,9 +1594,11 @@ void SurfaceInspector_Construct()
   GlobalPreferenceSystem().registerPreference("SI_SurfaceTexdef_Rotate", FloatImportStringCaller(g_si_globals.rotate), FloatExportStringCaller(g_si_globals.rotate));
   GlobalPreferenceSystem().registerPreference("SnapTToGrid", BoolImportStringCaller(g_si_globals.m_bSnapTToGrid), BoolExportStringCaller(g_si_globals.m_bSnapTToGrid));
 
-  GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1<const Selectable&, SurfaceInspector_SelectionChanged>());
-  Brush_addTextureChangedCallback(FreeCaller<SurfaceInspector_updateSelection>());
-  Patch_addTextureChangedCallback(FreeCaller<SurfaceInspector_updateSelection>());
+  typedef FreeCaller1<const Selectable&, SurfaceInspector_SelectionChanged> SurfaceInspectorSelectionChangedCaller;
+  GlobalSelectionSystem().addSelectionChangeCallback(SurfaceInspectorSelectionChangedCaller());
+  typedef FreeCaller<SurfaceInspector_updateSelection> SurfaceInspectorUpdateSelectionCaller;
+  Brush_addTextureChangedCallback(SurfaceInspectorUpdateSelectionCaller());
+  Patch_addTextureChangedCallback(SurfaceInspectorUpdateSelectionCaller());
 
   SurfaceInspector_registerPreferencesPage();
 }