From e00838f66edb8bf76a139c7b0f510ca1171fd284 Mon Sep 17 00:00:00 2001 From: spog Date: Sun, 11 Jun 2006 11:28:42 +0000 Subject: [PATCH] minor refactoring git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@81 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- TODO | 2 ++ radiant/brushmanip.cpp | 10 +++++----- radiant/entityinspector.cpp | 3 ++- radiant/entitylist.cpp | 3 ++- radiant/mainframe.cpp | 3 ++- radiant/patchdialog.cpp | 6 ++++-- radiant/select.cpp | 11 +++++++---- radiant/selection.cpp | 4 ++-- radiant/surfacedialog.cpp | 8 +++++--- 9 files changed, 31 insertions(+), 19 deletions(-) diff --git a/TODO b/TODO index 43a22d7..8ff1cf8 100644 --- 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:
[arghrad] "[MapFile]"
+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). diff --git a/radiant/brushmanip.cpp b/radiant/brushmanip.cpp index 238a58e..cac0846 100644 --- a/radiant/brushmanip.cpp +++ b/radiant/brushmanip.cpp @@ -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"); diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index db64da1..da097e4 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -1693,7 +1693,8 @@ GtkWidget* EntityInspector_constructWindow(GtkWindow* toplevel) g_entityInspector_windowConstructed = true; EntityClassList_fill(); - GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1()); + typedef FreeCaller1 EntityInspectorSelectionChangedCaller; + GlobalSelectionSystem().addSelectionChangeCallback(EntityInspectorSelectionChangedCaller()); GlobalEntityCreator().setKeyValueChangedFunc(EntityInspector_keyValueChanged); // hack diff --git a/radiant/entitylist.cpp b/radiant/entitylist.cpp index c34d5b7..e6944a6 100644 --- a/radiant/entitylist.cpp +++ b/radiant/entitylist.cpp @@ -419,7 +419,8 @@ void EntityList_Construct() GlobalPreferenceSystem().registerPreference("EntityInfoDlg", WindowPositionTrackerImportStringCaller(getEntityList().m_positionTracker), WindowPositionTrackerExportStringCaller(getEntityList().m_positionTracker)); - GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1()); + typedef FreeCaller1 EntityListSelectionChangedCaller; + GlobalSelectionSystem().addSelectionChangeCallback(EntityListSelectionChangedCaller()); } void EntityList_Destroy() { diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index c3fea83..c7444c4 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -3452,7 +3452,8 @@ void MainFrame_Construct() Patch_registerCommands(); XYShow_registerCommands(); - GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1()); + typedef FreeCaller1 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)); diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index 04b2aed..6765cee 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -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()); - Patch_addTextureChangedCallback(FreeCaller()); + typedef FreeCaller1 PatchInspectorSelectionChangedCaller; + GlobalSelectionSystem().addSelectionChangeCallback(PatchInspectorSelectionChangedCaller()); + typedef FreeCaller PatchInspectorQueueDrawCaller; + Patch_addTextureChangedCallback(PatchInspectorQueueDrawCaller()); } void PatchInspector_Destroy() { diff --git a/radiant/select.cpp b/radiant/select.cpp index 09f0709..9709c17 100644 --- a/radiant/select.cpp +++ b/radiant/select.cpp @@ -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()); - GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1()); - Selection_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback(FreeCaller()); + typedef FreeCaller1 SceneSelectionChangeCaller; + GlobalSelectionSystem().addSelectionChangeCallback(SceneSelectionChangeCaller()); + typedef FreeCaller1 UpdateWorkzoneForSelectionChangedCaller; + GlobalSelectionSystem().addSelectionChangeCallback(UpdateWorkzoneForSelectionChangedCaller()); + typedef FreeCaller UpdateWorkzoneForSelectionCaller; + Selection_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback(UpdateWorkzoneForSelectionCaller()); } void Selection_destroy() diff --git a/radiant/selection.cpp b/radiant/selection.cpp index ed3e973..d399531 100644 --- a/radiant/selection.cpp +++ b/radiant/selection.cpp @@ -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 pivotChangedSelectionCaller; + typedef MemberCaller1 PivotChangedSelectionCaller; void SetMode(EMode mode) { diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 89785bb..6db9677 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -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()); - Brush_addTextureChangedCallback(FreeCaller()); - Patch_addTextureChangedCallback(FreeCaller()); + typedef FreeCaller1 SurfaceInspectorSelectionChangedCaller; + GlobalSelectionSystem().addSelectionChangeCallback(SurfaceInspectorSelectionChangedCaller()); + typedef FreeCaller SurfaceInspectorUpdateSelectionCaller; + Brush_addTextureChangedCallback(SurfaceInspectorUpdateSelectionCaller()); + Patch_addTextureChangedCallback(SurfaceInspectorUpdateSelectionCaller()); SurfaceInspector_registerPreferencesPage(); }