]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Fixes by Dunk
authornamespace <namespace@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Thu, 28 Jun 2007 17:55:42 +0000 (17:55 +0000)
committernamespace <namespace@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Thu, 28 Jun 2007 17:55:42 +0000 (17:55 +0000)
git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk@173 8a3a26a2-13c4-0310-b231-cf6edde360e5

CHANGES
SConstruct
install.py
radiant/brush.h
radiant/brushmanip.cpp
radiant/brushmodule.cpp
radiant/findtexturedialog.cpp
radiant/mru.cpp
radiant/xywindow.cpp

diff --git a/CHANGES b/CHANGES
index ae398ab3075cd4fd663da384f73bef48c34045d8..47deae20680129192a64a81f837d10a48afe87f3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,12 @@
 This is the changelog for developers, != changelog for the end user 
 that we distribute with the binaries. (see changelog)
 
+28/06/2007 (dunkfordyce@gmail.com)
+- fixed mnemonics for MRU list
+- fixed find functionality
+- added option to always use caulk texture for new brushes
+- fixed(?) a small bug in install.py that was trying to copy msvc files on linux
+
 28/06/2007
 - Added material-support to brushexport-plugin (Shaderman)
 
index db5d1fd672b6c70573b240a775fd87175e242270..418a60023a2631598b9c6adf31d417ea9d2c57b3 100644 (file)
@@ -36,7 +36,7 @@ JOBS
 
 BUILD
        Use debug/release to select build settings
-       ex: BUILD="release" - default is debug
+       ex: BUILD="release" - default is release
 """
 )
 
index 601ef6b49e3d48b36bc7e4e7bc1a2d75438717b9..0d44ceb9506817ba5a157f4b90bc7655fed75946 100644 (file)
@@ -113,11 +113,10 @@ copyFileIfExists(libxml2, installRoot)
 libmhash = os.path.normpath(os.path.join(thisDir, "../mhash-0.9/win32/libmhash/Release/libmhash.dll"))
 copyFileIfExists(libmhash, installRoot)
 
-copySvn("../msvc_redist", installRoot)
-
 if sys.platform[:3] == "win" :
-       dbghelp = os.path.normpath(os.path.join(thisDir, "../msvc_redist/dbghelp.dll"))
-       copyFileIfExists(dbghelp, installRoot)
+  copySvn("../msvc_redist", installRoot)
+  dbghelp = os.path.normpath(os.path.join(thisDir, "../msvc_redist/dbghelp.dll"))
+  copyFileIfExists(dbghelp, installRoot)
 
 # create version files
 version = open(os.path.join(thisDir, "include/version.default"), "rt").readline().split(".")
index 04d3d1ff4d4ac5193995c1be38820f70e8fbfbc7..851a9836524270ede2f6ce02c58a0251a38ac44b 100644 (file)
@@ -4170,6 +4170,14 @@ inline const Functor& Scene_ForEachBrush_ForEachFace(scene::Graph& graph, const
   return functor;
 }
 
+// d1223m
+template<typename Functor>
+inline const Functor& Scene_ForEachBrush_ForEachFaceInstance(scene::Graph& graph, const Functor& functor)
+{
+  Scene_forEachBrush(graph, BrushForEachFace(FaceInstanceVisitAll<Functor>(functor)));
+  return functor;
+}
+
 template<typename Functor>
 inline const Functor& Scene_ForEachSelectedBrush_ForEachFace(scene::Graph& graph, const Functor& functor)
 {
index b2acc1faeda76e52de8817f12e15140969fc3da5..441f099d05f98df26ee096c8aa8752dca125718e 100644 (file)
@@ -550,19 +550,66 @@ public:
   }
 };
 
+class FaceFindShader
+{
+  const char* m_find;
+  const char* m_replace;
+public:
+  FaceFindShader(const char* find) : m_find(find)
+  {
+  }
+  void operator()(FaceInstance& faceinst) const
+  {
+    if(shader_equal(faceinst.getFace().GetShader(), m_find))
+    {
+      faceinst.setSelected(SelectionSystem::eFace, true);
+    }
+  }
+};
+
+bool DoingSearch(const char *repl)
+{
+    return (repl == NULL || (strcmp("textures/", repl)==0));
+}
+
 void Scene_BrushFindReplaceShader(scene::Graph& graph, const char* find, const char* replace)
 {
-  Scene_ForEachBrush_ForEachFace(graph, FaceFindReplaceShader(find, replace));
+  if (DoingSearch(replace))
+  {
+      Scene_ForEachBrush_ForEachFaceInstance(graph, FaceFindShader(find));
+  } 
+  else 
+  {
+      Scene_ForEachBrush_ForEachFace(graph, FaceFindReplaceShader(find, replace));
+  }
 }
 
 void Scene_BrushFindReplaceShader_Selected(scene::Graph& graph, const char* find, const char* replace)
 {
-  Scene_ForEachSelectedBrush_ForEachFace(graph, FaceFindReplaceShader(find, replace));
+  if (DoingSearch(replace)) 
+  {
+    Scene_ForEachSelectedBrush_ForEachFaceInstance(graph, 
+                    FaceFindShader(find));
+  }
+  else
+  {
+    Scene_ForEachSelectedBrush_ForEachFace(graph, 
+                  FaceFindReplaceShader(find, replace));
+  }
 }
 
+// TODO: find for components 
+// d1223m: dont even know what they are...
 void Scene_BrushFindReplaceShader_Component_Selected(scene::Graph& graph, const char* find, const char* replace)
 {
-  Scene_ForEachSelectedBrushFace(graph, FaceFindReplaceShader(find, replace));
+  if (DoingSearch(replace))
+  {
+      
+  }
+  else
+  {
+    Scene_ForEachSelectedBrushFace(graph, FaceFindReplaceShader(find, replace));
+  }
 }
 
 
@@ -678,6 +725,7 @@ public:
   }
   void operator()(FaceInstance& face) const
   {
+    printf("checking %s = %s\n", face.getFace().GetShader(), m_name);
     if(shader_equal(face.getFace().GetShader(), m_name))
     {
       face.setSelected(SelectionSystem::eFace, true);
index 66e7a3109062a758e79cf71719d4ad8d942259d9..6b47e0926e6990d2ac228942b2165e2f5fbcddfd 100644 (file)
@@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 LatchedBool g_useAlternativeTextureProjection(false, "Use alternative texture-projection");
 bool g_showAlternativeTextureProjectionOption = false;
+bool g_brush_always_caulk;
 
 bool getTextureLockEnabled()
 {
@@ -73,6 +74,11 @@ void Brush_constructPreferences(PreferencesPage& page)
       BoolExportCaller(g_useAlternativeTextureProjection.m_latched)
     );
   }
+  // d1223m
+  page.appendCheckBox("", 
+    "Always use caulk for new brushes",
+    g_brush_always_caulk
+  );
 }
 void Brush_constructPage(PreferenceGroup& group)
 {
@@ -102,6 +108,12 @@ void Brush_Construct(EBrushType type)
     {
       type = eBrushTypeQuake3BP;
     }
+    
+    // d1223m
+    GlobalPreferenceSystem().registerPreference(
+      "BrushAlwaysCaulk", 
+      BoolImportStringCaller(g_brush_always_caulk), 
+      BoolExportStringCaller(g_brush_always_caulk));
   }
 
   Brush_registerCommands();
index 80491d81c0b50d261a9cde2592e2005e92101401..52891d808c77fc4cb5df2089ad43f2fa1faaeb13 100644 (file)
@@ -91,8 +91,9 @@ namespace
   void FindTextureDialog_apply()
   {
     StringOutputStream find(256);
-    find << "textures/" << g_FindTextureDialog.m_strFind.c_str();
     StringOutputStream replace(256);
+
+    find << "textures/" << g_FindTextureDialog.m_strFind.c_str();
     replace << "textures/" << g_FindTextureDialog.m_strReplace.c_str();
     FindReplaceTextures(find.c_str(), replace.c_str(), g_FindTextureDialog.m_bSelectedOnly);
   }
index 5815aa08de77fdbb1eac10daf890e34a0e29c7e3..7f3fbeebf4ced43eba311b44f683e541e70254d6 100644 (file)
@@ -90,7 +90,6 @@ inline EscapedMnemonic& operator<<(EscapedMnemonic& ostream, const T& t)
 void MRU_updateWidget(std::size_t index, const char *filename)
 {
   EscapedMnemonic mnemonic(64);
-  mnemonic.push_back('_');
   mnemonic << Unsigned(index + 1) << "- " << ConvertLocaleToUTF8(filename);
   gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(MRU_items[index]))), mnemonic.c_str());
 }
@@ -214,22 +213,22 @@ LoadMRU g_load_mru4(4);
 void MRU_constructMenu(GtkMenu* menu)
 {
   {
-    GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "Recent Files", LoadMRUCaller(g_load_mru1));
+    GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "_1", LoadMRUCaller(g_load_mru1));
     gtk_widget_set_sensitive(GTK_WIDGET(item), FALSE);
     MRU_AddWidget(item, 0);
   }
   {
-    GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "2", LoadMRUCaller(g_load_mru2));
+    GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "_2", LoadMRUCaller(g_load_mru2));
     gtk_widget_hide(GTK_WIDGET(item));
     MRU_AddWidget(item, 1);
   }
   {
-    GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "3", LoadMRUCaller(g_load_mru3));
+    GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "_3", LoadMRUCaller(g_load_mru3));
     gtk_widget_hide(GTK_WIDGET(item));
     MRU_AddWidget(item, 2);
   }
   {
-    GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "4", LoadMRUCaller(g_load_mru4));
+    GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "_4", LoadMRUCaller(g_load_mru4));
     gtk_widget_hide(GTK_WIDGET(item));
     MRU_AddWidget(item, 3);
   }
index 4fcdf9361fbed585c00400835bdbca87e34fa104..4f545cb5fd291622f76d793fdce7c1367fffd71f 100644 (file)
@@ -66,7 +66,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "windowobservers.h"
 
 
-
+// d1223m
+extern bool g_brush_always_caulk;
 
 //!\todo Rewrite.
 class ClipPoint
@@ -1109,7 +1110,11 @@ void XYWnd::NewBrushDrag(int x, int y)
     m_NewBrushDrag = node.get_pointer();
   }
 
-  Scene_BrushResize_Selected(GlobalSceneGraph(), aabb_for_minmax(mins, maxs), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()));
+  // d1223m
+  //Scene_BrushResize_Selected(GlobalSceneGraph(), aabb_for_minmax(mins, maxs), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()));
+  Scene_BrushResize_Selected(GlobalSceneGraph(), aabb_for_minmax(mins, maxs), 
+        g_brush_always_caulk ? 
+            "textures/common/caulk" : TextureBrowser_GetSelectedShader(GlobalTextureBrowser()));
 }
 
 void entitycreate_activated(GtkWidget* item)