mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-09 19:41:04 +00:00
Fixes by Dunk
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@173 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
0c07d03e26
commit
70fe5a7feb
9 changed files with 94 additions and 16 deletions
6
CHANGES
6
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)
|
||||
|
||||
|
|
|
@ -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
|
||||
"""
|
||||
)
|
||||
|
||||
|
|
|
@ -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(".")
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue