From: Thomas Debesse Date: Mon, 25 May 2020 19:33:45 +0000 (+0200) Subject: Merge commit 'e7c45da823515747a88569374d62717b72dcf078' into garux-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=839c9693774fdb0e420391f65b8066e8bd04c591;p=xonotic%2Fnetradiant.git Merge commit 'e7c45da823515747a88569374d62717b72dcf078' into garux-merge --- 839c9693774fdb0e420391f65b8066e8bd04c591 diff --cc Makefile index bf98684f,bcb1f6f6..8e63b813 --- a/Makefile +++ b/Makefile @@@ -489,9 -483,11 +489,11 @@@ endi %.o: %.c $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) | dependencies-check $(CC) $< $(CFLAGS) $(CFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ - $(INSTALLDIR)/q3map2.$(EXE): LDFLAGS_EXTRA := -Wl,--large-address-aware + ifeq ($(OS),Win32) + $(INSTALLDIR)/q3map2.$(EXE): LDFLAGS_EXTRA := -Wl,--large-address-aware,--stack,4194304 + endif -$(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_JPEG) $(LIBS_ZLIB) -$(INSTALLDIR)/q3map2.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) $(CPPFLAGS_JPEG) -Itools/quake3/common -Ilibs -Iinclude +$(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_JPEG) $(LIBS_WEBP) $(LIBS_ZLIB) +$(INSTALLDIR)/q3map2.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) $(CPPFLAGS_JPEG) $(CPPFLAGS_WEBP) -Itools/quake3/common -Ilibs -Iinclude $(INSTALLDIR)/q3map2.$(EXE): \ tools/quake3/common/cmdlib.o \ tools/quake3/common/imagelib.o \ diff --cc radiant/build.cpp index 5e86dc85,baa39568..3a524a76 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@@ -963,9 -997,10 +964,10 @@@ BuildMenuItem( const char* name, ui::Me : m_name( name ), m_item( item ){ } void run(){ + g_lastExecutedBuild = m_name; RunBSP( m_name ); } -typedef MemberCaller RunCaller; +typedef MemberCaller RunCaller; }; typedef std::list BuildMenuItems; diff --cc radiant/build.h index 4e494146,39024fad..f6cfe9c3 --- a/radiant/build.h +++ b/radiant/build.h @@@ -38,8 -36,10 +38,9 @@@ void DoBuildMenu() void BuildMenu_Construct(); void BuildMenu_Destroy(); -typedef struct _GtkMenu GtkMenu; -void Build_constructMenu( GtkMenu* menu ); -extern GtkMenu* g_bsp_menu; +void Build_constructMenu( ui::Menu menu ); +extern ui::Menu g_bsp_menu; + void Build_runRecentExecutedBuild(); #endif diff --cc radiant/environment.cpp index a84a7d42,ad0edd77..a1a13b86 --- a/radiant/environment.cpp +++ b/radiant/environment.cpp @@@ -188,7 -180,21 +188,21 @@@ bool portable_app_setup() return false; } + -char* openCmdMap; ++const char* openCmdMap; + + void cmdMap(){ + openCmdMap = NULL; + for ( int i = 1; i < g_argc; ++i ) + { + //if ( !stricmp( g_argv[i] + strlen(g_argv[i]) - 4, ".map" ) ){ + if( string_equal_suffix_nocase( g_argv[i], ".map" ) ){ + openCmdMap = g_argv[i]; + } + } + } + -#if defined( POSIX ) +#if GDEF_OS_POSIX #include #include @@@ -259,25 -265,14 +273,14 @@@ void environment_init( int argc, char c home_path = home.c_str(); } gamedetect(); + cmdMap(); } -#elif defined( WIN32 ) +#elif GDEF_OS_WINDOWS #include - char* openCmdMap; - - void cmdMap(){ - openCmdMap = NULL; - for ( int i = 1; i < g_argc; ++i ) - { - if ( !stricmp( g_argv[i] + strlen(g_argv[i]) - 4, ".map" ) ){ - openCmdMap = g_argv[i]; - } - } - } - -void environment_init( int argc, char* argv[] ){ +void environment_init( int argc, char const* argv[] ){ args_init( argc, argv ); { diff --cc radiant/environment.h index 98c33ab9,b5dc6c15..566a307e --- a/radiant/environment.h +++ b/radiant/environment.h @@@ -27,11 -27,9 +27,8 @@@ const char* environment_get_home_path() const char* environment_get_app_path(); extern int g_argc; -extern char** g_argv; - -extern char* openCmdMap; +extern char const** g_argv; - #if defined( WIN32 ) - extern char* openCmdMap; - #endif - ++extern const char* openCmdMap; #endif diff --cc radiant/main.cpp index 88cd0cad,d17db3d6..6093f879 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@@ -678,12 -655,6 +678,9 @@@ int main( int argc, char* argv[] ) if( openCmdMap && *openCmdMap ){ Map_LoadFile( openCmdMap ); } - else - #endif // WIN32 - if ( mapname != NULL ) { ++ else if ( mapname != NULL ) { + Map_LoadFile( mapname ); + } else if ( g_bLoadLastMap && !g_strLastMap.empty() ) { Map_LoadFile( g_strLastMap.c_str() ); } diff --cc radiant/mainframe.cpp index 16c23709,0bb43da6..4bd30a95 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@@ -2305,8 -2157,9 +2306,9 @@@ ui::MenuItem create_misc_menu() create_menu_item_with_mnemonic( menu, "Find brush...", "FindBrush" ); create_menu_item_with_mnemonic( menu, "Map Info...", "MapInfo" ); // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=394 -// create_menu_item_with_mnemonic(menu, "_Print XY View", FreeCaller()); - create_menu_item_with_mnemonic( menu, "_Background select", FreeCaller() ); +// create_menu_item_with_mnemonic(menu, "_Print XY View", FreeCaller()); + create_menu_item_with_mnemonic( menu, "_Background select", makeCallbackF(WXY_BackgroundSelect) ); + create_menu_item_with_mnemonic( menu, "Fullscreen", "Fullscreen" ); return misc_menu_item; } @@@ -3008,22 -2865,12 +3010,12 @@@ void MainFrame::Create() g_page_console = GroupDialog_addPage( "Console", Console_constructWindow( GroupDialog_getWindow() ), RawStringExportCaller( "Console" ) ); } -#ifdef WIN32 +#if GDEF_OS_WINDOWS if ( g_multimon_globals.m_bStartOnPrimMon ) { PositionWindowOnPrimaryScreen( g_layout_globals.m_position ); - window_set_position( window, g_layout_globals.m_position ); } - else #endif - if ( g_layout_globals.nState & GDK_WINDOW_STATE_MAXIMIZED ) { - gtk_window_maximize( window ); - WindowPosition default_position( -1, -1, 640, 480 ); - window_set_position( window, default_position ); - } - else - { - window_set_position( window, g_layout_globals.m_position ); - } + window_set_position( window, g_layout_globals.m_position ); m_window = window; @@@ -3031,53 -2878,47 +3023,53 @@@ if ( CurrentStyle() == eRegular || CurrentStyle() == eRegularLeft ) { { - GtkWidget* hsplit = gtk_hpaned_new(); + ui::Widget hsplit = ui::HPaned(ui::New); m_hSplit = hsplit; - gtk_box_pack_start( GTK_BOX( vbox ), hsplit, TRUE, TRUE, 0 ); - gtk_widget_show( hsplit ); + + vbox.pack_start( hsplit, TRUE, TRUE, 0 ); + hsplit.show(); + { - GtkWidget* vsplit = gtk_vpaned_new(); - gtk_widget_show( vsplit ); + ui::Widget vsplit = ui::VPaned(ui::New); + vsplit.show(); m_vSplit = vsplit; - GtkWidget* vsplit2 = gtk_vpaned_new(); - gtk_widget_show( vsplit2 ); + + ui::Widget vsplit2 = ui::VPaned(ui::New); + vsplit2.show(); m_vSplit2 = vsplit2; + if ( CurrentStyle() == eRegular ){ - gtk_paned_add1( GTK_PANED( hsplit ), vsplit ); - gtk_paned_add2( GTK_PANED( hsplit ), vsplit2 ); + gtk_paned_pack1( GTK_PANED( hsplit ), vsplit, TRUE, TRUE ); + gtk_paned_pack2( GTK_PANED( hsplit ), vsplit2, TRUE, TRUE ); } else{ - gtk_paned_add2( GTK_PANED( hsplit ), vsplit ); - gtk_paned_add1( GTK_PANED( hsplit ), vsplit2 ); + gtk_paned_pack2( GTK_PANED( hsplit ), vsplit, TRUE, TRUE ); + gtk_paned_pack1( GTK_PANED( hsplit ), vsplit2, TRUE, TRUE ); } + // console - GtkWidget* console_window = Console_constructWindow( window ); + ui::Widget console_window = Console_constructWindow( window ); - gtk_paned_pack2( GTK_PANED( vsplit ), console_window, FALSE, TRUE ); + gtk_paned_pack2( GTK_PANED( vsplit ), console_window, TRUE, TRUE ); - + // xy m_pXYWnd = new XYWnd(); m_pXYWnd->SetViewType( XY ); - GtkWidget* xy_window = GTK_WIDGET( create_framed_widget( m_pXYWnd->GetWidget() ) ); + ui::Widget xy_window = ui::Widget(create_framed_widget( m_pXYWnd->GetWidget( ) )); - gtk_paned_add1( GTK_PANED( vsplit ), xy_window ); + gtk_paned_pack1( GTK_PANED( vsplit ), xy_window, TRUE, TRUE ); + { // camera m_pCamWnd = NewCamWnd(); GlobalCamera_setCamWnd( *m_pCamWnd ); CamWnd_setParent( *m_pCamWnd, window ); - GtkFrame* camera_window = create_framed_widget( CamWnd_getWidget( *m_pCamWnd ) ); + auto camera_window = create_framed_widget( CamWnd_getWidget( *m_pCamWnd ) ); - gtk_paned_add1( GTK_PANED( vsplit2 ), camera_window ); - gtk_paned_pack1( GTK_PANED( vsplit2 ), GTK_WIDGET( camera_window ), TRUE, TRUE ); ++ gtk_paned_pack1( GTK_PANED( vsplit2 ), GTK_WIDGET( camera_window ) , TRUE, TRUE); // textures - GtkFrame* texture_window = create_framed_widget( TextureBrowser_constructWindow( window ) ); + auto texture_window = create_framed_widget( TextureBrowser_constructWindow( window ) ); - gtk_paned_add2( GTK_PANED( vsplit2 ), texture_window ); + gtk_paned_pack2( GTK_PANED( vsplit2 ), GTK_WIDGET( texture_window ), TRUE, TRUE ); } } } @@@ -3271,9 -3106,11 +3270,11 @@@ void MainFrame::SaveWindowInfo() g_layout_globals.nCamHeight = gtk_paned_get_position( GTK_PANED( m_vSplit2 ) ); } - g_layout_globals.m_position = m_position_tracker.getPosition(); + if( gdk_window_get_state( GTK_WIDGET( m_window )->window ) == 0 ){ + g_layout_globals.m_position = m_position_tracker.getPosition(); + } - g_layout_globals.nState = gdk_window_get_state( GTK_WIDGET( m_window )->window ); + g_layout_globals.nState = gdk_window_get_state( gtk_widget_get_window(m_window ) ); } void MainFrame::Shutdown(){ @@@ -3432,92 -3270,112 +3433,113 @@@ void Layout_constructPage( PreferenceGr } void Layout_registerPreferencesPage(){ - PreferencesDialog_addInterfacePage( FreeCaller1() ); + PreferencesDialog_addInterfacePage( makeCallbackF(Layout_constructPage) ); } + void MainFrame_toggleFullscreen(){ + GtkWindow* wnd = MainFrame_getWindow(); + if( gdk_window_get_state( GTK_WIDGET( wnd )->window ) & GDK_WINDOW_STATE_FULLSCREEN ){ + //some portion of buttsex, because gtk_window_unfullscreen doesn't work correctly after calling some modal window + bool maximize = ( gdk_window_get_state( GTK_WIDGET( wnd )->window ) & GDK_WINDOW_STATE_MAXIMIZED ); + gtk_window_unfullscreen( wnd ); + if( maximize ){ + gtk_window_unmaximize( wnd ); + gtk_window_maximize( wnd ); + } + else{ + gtk_window_move( wnd, g_layout_globals.m_position.x, g_layout_globals.m_position.y ); + gtk_window_resize( wnd, g_layout_globals.m_position.w, g_layout_globals.m_position.h ); + } + } + else{ + gtk_window_fullscreen( wnd ); + } + } + #include "preferencesystem.h" #include "stringio.h" void MainFrame_Construct(){ - GlobalCommands_insert( "OpenManual", FreeCaller(), Accelerator( GDK_F1 ) ); - - GlobalCommands_insert( "Sleep", FreeCaller(), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "NewMap", FreeCaller() ); - GlobalCommands_insert( "OpenMap", FreeCaller(), Accelerator( 'O', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "ImportMap", FreeCaller() ); - GlobalCommands_insert( "SaveMap", FreeCaller(), Accelerator( 'S', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "SaveMapAs", FreeCaller() ); - GlobalCommands_insert( "SaveSelected", FreeCaller() ); - GlobalCommands_insert( "SaveRegion", FreeCaller() ); - GlobalCommands_insert( "RefreshReferences", FreeCaller() ); - GlobalCommands_insert( "ProjectSettings", FreeCaller() ); - GlobalCommands_insert( "CheckForUpdate", FreeCaller() ); - GlobalCommands_insert( "Exit", FreeCaller() ); - - GlobalCommands_insert( "Undo", FreeCaller(), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "Redo", FreeCaller(), Accelerator( 'Y', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "Copy", FreeCaller(), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "Paste", FreeCaller(), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "PasteToCamera", FreeCaller(), Accelerator( 'V', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "CloneSelection", FreeCaller(), Accelerator( GDK_space ) ); - GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller(), Accelerator( GDK_space, (GdkModifierType)GDK_SHIFT_MASK ) ); -// GlobalCommands_insert( "DeleteSelection", FreeCaller(), Accelerator( GDK_BackSpace ) ); - GlobalCommands_insert( "DeleteSelection2", FreeCaller(), Accelerator( GDK_BackSpace ) ); - GlobalCommands_insert( "DeleteSelection", FreeCaller(), Accelerator( 'Z' ) ); - GlobalCommands_insert( "ParentSelection", FreeCaller() ); -// GlobalCommands_insert( "UnSelectSelection", FreeCaller(), Accelerator( GDK_Escape ) ); - GlobalCommands_insert( "UnSelectSelection2", FreeCaller(), Accelerator( GDK_Escape ) ); - GlobalCommands_insert( "UnSelectSelection", FreeCaller(), Accelerator( 'C' ) ); - GlobalCommands_insert( "InvertSelection", FreeCaller(), Accelerator( 'I' ) ); - GlobalCommands_insert( "SelectInside", FreeCaller() ); - GlobalCommands_insert( "SelectTouching", FreeCaller() ); - GlobalCommands_insert( "ExpandSelectionToEntities", FreeCaller(), Accelerator( 'E', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "Preferences", FreeCaller(), Accelerator( 'P' ) ); - - GlobalCommands_insert( "ToggleConsole", FreeCaller(), Accelerator( 'O' ) ); - GlobalCommands_insert( "ToggleEntityInspector", FreeCaller(), Accelerator( 'N' ) ); - GlobalCommands_insert( "EntityList", FreeCaller(), Accelerator( 'L' ) ); - - GlobalCommands_insert( "ShowHidden", FreeCaller(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "HideSelected", FreeCaller(), Accelerator( 'H' ) ); - - GlobalToggles_insert( "DragVertices", FreeCaller(), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) ); - GlobalToggles_insert( "DragEdges", FreeCaller(), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) ); - GlobalToggles_insert( "DragFaces", FreeCaller(), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) ); - - GlobalCommands_insert( "MirrorSelectionX", FreeCaller() ); - GlobalCommands_insert( "RotateSelectionX", FreeCaller() ); - GlobalCommands_insert( "MirrorSelectionY", FreeCaller() ); - GlobalCommands_insert( "RotateSelectionY", FreeCaller() ); - GlobalCommands_insert( "MirrorSelectionZ", FreeCaller() ); - GlobalCommands_insert( "RotateSelectionZ", FreeCaller() ); - - GlobalCommands_insert( "ArbitraryRotation", FreeCaller(), Accelerator( 'R', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "ArbitraryScale", FreeCaller(), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - - GlobalCommands_insert( "BuildMenuCustomize", FreeCaller() ); - GlobalCommands_insert( "Build_runRecentExecutedBuild", FreeCaller(), Accelerator( GDK_F5 ) ); - - GlobalCommands_insert( "FindBrush", FreeCaller() ); - - GlobalCommands_insert( "MapInfo", FreeCaller(), Accelerator( 'M' ) ); - - - GlobalToggles_insert( "ToggleClipper", FreeCaller(), ToggleItem::AddCallbackCaller( g_clipper_button ), Accelerator( 'X' ) ); - - GlobalToggles_insert( "MouseTranslate", FreeCaller(), ToggleItem::AddCallbackCaller( g_translatemode_button ), Accelerator( 'W' ) ); - GlobalToggles_insert( "MouseRotate", FreeCaller(), ToggleItem::AddCallbackCaller( g_rotatemode_button ), Accelerator( 'R' ) ); - GlobalToggles_insert( "MouseScale", FreeCaller(), ToggleItem::AddCallbackCaller( g_scalemode_button ) ); - GlobalToggles_insert( "MouseDrag", FreeCaller(), ToggleItem::AddCallbackCaller( g_dragmode_button ) ); - GlobalCommands_insert( "MouseRotateOrScale", FreeCaller() ); - GlobalCommands_insert( "MouseDragOrScale", FreeCaller(), Accelerator( 'Q' ) ); - - GlobalCommands_insert( "gtkThemeDlg", FreeCaller() ); - GlobalCommands_insert( "ColorSchemeOriginal", FreeCaller() ); - GlobalCommands_insert( "ColorSchemeQER", FreeCaller() ); - GlobalCommands_insert( "ColorSchemeBlackAndGreen", FreeCaller() ); - GlobalCommands_insert( "ColorSchemeYdnar", FreeCaller() ); + GlobalCommands_insert( "OpenManual", makeCallbackF(OpenHelpURL), Accelerator( GDK_KEY_F1 ) ); + + GlobalCommands_insert( "Sleep", makeCallbackF(thunk_OnSleep), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "NewMap", makeCallbackF(NewMap) ); + GlobalCommands_insert( "OpenMap", makeCallbackF(OpenMap), Accelerator( 'O', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "ImportMap", makeCallbackF(ImportMap) ); + GlobalCommands_insert( "SaveMap", makeCallbackF(SaveMap), Accelerator( 'S', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "SaveMapAs", makeCallbackF(SaveMapAs) ); + GlobalCommands_insert( "ExportSelected", makeCallbackF(ExportMap) ); + GlobalCommands_insert( "SaveRegion", makeCallbackF(SaveRegion) ); + GlobalCommands_insert( "RefreshReferences", makeCallbackF(VFS_Refresh) ); + GlobalCommands_insert( "ProjectSettings", makeCallbackF(DoProjectSettings) ); + GlobalCommands_insert( "Exit", makeCallbackF(Exit) ); + + GlobalCommands_insert( "Undo", makeCallbackF(Undo), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "Redo", makeCallbackF(Redo), Accelerator( 'Y', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "Copy", makeCallbackF(Copy), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "Paste", makeCallbackF(Paste), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "PasteToCamera", makeCallbackF(PasteToCamera), Accelerator( 'V', (GdkModifierType)GDK_MOD1_MASK ) ); + GlobalCommands_insert( "CloneSelection", makeCallbackF(Selection_Clone), Accelerator( GDK_KEY_space ) ); + GlobalCommands_insert( "CloneSelectionAndMakeUnique", makeCallbackF(Selection_Clone_MakeUnique), Accelerator( GDK_KEY_space, (GdkModifierType)GDK_SHIFT_MASK ) ); +// GlobalCommands_insert( "DeleteSelection", makeCallbackF(deleteSelection), Accelerator( GDK_KEY_BackSpace ) ); + GlobalCommands_insert( "DeleteSelection2", makeCallbackF(deleteSelection), Accelerator( GDK_KEY_BackSpace ) ); + GlobalCommands_insert( "DeleteSelection", makeCallbackF(deleteSelection), Accelerator( 'Z' ) ); + GlobalCommands_insert( "ParentSelection", makeCallbackF(Scene_parentSelected) ); +// GlobalCommands_insert( "UnSelectSelection", makeCallbackF(Selection_Deselect), Accelerator( GDK_KEY_Escape ) ); + GlobalCommands_insert( "UnSelectSelection2", makeCallbackF(Selection_Deselect), Accelerator( GDK_KEY_Escape ) ); + GlobalCommands_insert( "UnSelectSelection", makeCallbackF(Selection_Deselect), Accelerator( 'C' ) ); + GlobalCommands_insert( "InvertSelection", makeCallbackF(Select_Invert), Accelerator( 'I' ) ); + GlobalCommands_insert( "SelectInside", makeCallbackF(Select_Inside) ); + GlobalCommands_insert( "SelectTouching", makeCallbackF(Select_Touching) ); + GlobalCommands_insert( "ExpandSelectionToEntities", makeCallbackF(Scene_ExpandSelectionToEntities), Accelerator( 'E', (GdkModifierType)( GDK_MOD1_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "Preferences", makeCallbackF(PreferencesDialog_showDialog), Accelerator( 'P' ) ); + + GlobalCommands_insert( "ToggleConsole", makeCallbackF(Console_ToggleShow), Accelerator( 'O' ) ); + GlobalCommands_insert( "ToggleEntityInspector", makeCallbackF(EntityInspector_ToggleShow), Accelerator( 'N' ) ); + GlobalCommands_insert( "EntityList", makeCallbackF(EntityList_toggleShown), Accelerator( 'L' ) ); + + GlobalCommands_insert( "ShowHidden", makeCallbackF(Select_ShowAllHidden), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "HideSelected", makeCallbackF(HideSelected), Accelerator( 'H' ) ); + + GlobalToggles_insert( "DragVertices", makeCallbackF(SelectVertexMode), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) ); + GlobalToggles_insert( "DragEdges", makeCallbackF(SelectEdgeMode), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) ); + GlobalToggles_insert( "DragFaces", makeCallbackF(SelectFaceMode), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) ); + + GlobalCommands_insert( "MirrorSelectionX", makeCallbackF(Selection_Flipx) ); + GlobalCommands_insert( "RotateSelectionX", makeCallbackF(Selection_Rotatex) ); + GlobalCommands_insert( "MirrorSelectionY", makeCallbackF(Selection_Flipy) ); + GlobalCommands_insert( "RotateSelectionY", makeCallbackF(Selection_Rotatey) ); + GlobalCommands_insert( "MirrorSelectionZ", makeCallbackF(Selection_Flipz) ); + GlobalCommands_insert( "RotateSelectionZ", makeCallbackF(Selection_Rotatez) ); + + GlobalCommands_insert( "ArbitraryRotation", makeCallbackF(DoRotateDlg) ); + GlobalCommands_insert( "ArbitraryScale", makeCallbackF(DoScaleDlg) ); + + GlobalCommands_insert( "BuildMenuCustomize", makeCallbackF(DoBuildMenu) ); ++ GlobalCommands_insert( "Build_runRecentExecutedBuild", makeCallbackF(Build_runRecentExecutedBuild), Accelerator( GDK_F5 ) ); + + GlobalCommands_insert( "FindBrush", makeCallbackF(DoFind) ); + + GlobalCommands_insert( "MapInfo", makeCallbackF(DoMapInfo), Accelerator( 'M' ) ); + + + GlobalToggles_insert( "ToggleClipper", makeCallbackF(ClipperMode), ToggleItem::AddCallbackCaller( g_clipper_button ), Accelerator( 'X' ) ); + + GlobalToggles_insert( "MouseTranslate", makeCallbackF(TranslateMode), ToggleItem::AddCallbackCaller( g_translatemode_button ), Accelerator( 'W' ) ); + GlobalToggles_insert( "MouseRotate", makeCallbackF(RotateMode), ToggleItem::AddCallbackCaller( g_rotatemode_button ), Accelerator( 'R' ) ); + GlobalToggles_insert( "MouseScale", makeCallbackF(ScaleMode), ToggleItem::AddCallbackCaller( g_scalemode_button ) ); + GlobalToggles_insert( "MouseDrag", makeCallbackF(DragMode), ToggleItem::AddCallbackCaller( g_dragmode_button ) ); + GlobalCommands_insert( "MouseRotateOrScale", makeCallbackF(ToggleRotateScaleModes) ); + GlobalCommands_insert( "MouseDragOrScale", makeCallbackF(ToggleDragScaleModes), Accelerator( 'Q' ) ); + +#ifndef GARUX_DISABLE_GTKTHEME + GlobalCommands_insert( "gtkThemeDlg", makeCallbackF(gtkThemeDlg) ); +#endif + GlobalCommands_insert( "ColorSchemeOriginal", makeCallbackF(ColorScheme_Original) ); + GlobalCommands_insert( "ColorSchemeQER", makeCallbackF(ColorScheme_QER) ); + GlobalCommands_insert( "ColorSchemeBlackAndGreen", makeCallbackF(ColorScheme_Black) ); + GlobalCommands_insert( "ColorSchemeYdnar", makeCallbackF(ColorScheme_Ydnar) ); GlobalCommands_insert( "ChooseTextureBackgroundColor", makeCallback( g_ColoursMenu.m_textureback ) ); GlobalCommands_insert( "ChooseGridBackgroundColor", makeCallback( g_ColoursMenu.m_xyback ) ); GlobalCommands_insert( "ChooseGridMajorColor", makeCallback( g_ColoursMenu.m_gridmajor ) ); @@@ -3533,11 -3391,13 +3555,13 @@@ GlobalCommands_insert( "ChooseClipperColor", makeCallback( g_ColoursMenu.m_clipper ) ); GlobalCommands_insert( "ChooseOrthoViewNameColor", makeCallback( g_ColoursMenu.m_viewname ) ); - GlobalCommands_insert( "Fullscreen", FreeCaller(), Accelerator( GDK_F11 ) ); ++ GlobalCommands_insert( "Fullscreen", makeCallbackF( MainFrame_toggleFullscreen ), Accelerator( GDK_F11 ) ); + - GlobalCommands_insert( "CSGSubtract", FreeCaller(), Accelerator( 'U', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "CSGMerge", FreeCaller(), Accelerator( 'U', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "CSGroom", FreeCaller() ); - GlobalCommands_insert( "CSGTool", FreeCaller() ); + GlobalCommands_insert( "CSGSubtract", makeCallbackF(CSG_Subtract), Accelerator( 'U', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "CSGMerge", makeCallbackF(CSG_Merge), Accelerator( 'U', (GdkModifierType) GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "CSGRoom", makeCallbackF(CSG_MakeRoom) ); + GlobalCommands_insert( "CSGTool", makeCallbackF(CSG_Tool) ); Grid_registerCommands(); diff --cc radiant/server.cpp index 2a264e6d,aad08221..679e56bb --- a/radiant/server.cpp +++ b/radiant/server.cpp @@@ -144,8 -144,13 +144,12 @@@ FunctionPointer findSymbol( const char #include + #ifndef RTLD_DEEPBIND + #define RTLD_DEEPBIND 0 + #endif + -class DynamicLibrary -{ -void* m_library; +class DynamicLibrary { + void *m_library; public: typedef int ( *FunctionPointer )(); diff --cc tools/quake3/q3map2/brush.c index c6400cbc,e15d5612..7769a0c5 --- a/tools/quake3/q3map2/brush.c +++ b/tools/quake3/q3map2/brush.c @@@ -93,11 -93,13 +93,12 @@@ brush_t *AllocBrush( int numSides ) brush_t *bb; size_t c; - /* allocate and clear */ - if ( numSides <= 0 ) { + /*if ( numSides <= 0 ) { Error( "AllocBrush called with numsides = %d", numSides ); } - c = (size_t)&( ( (brush_t*) 0 )->sides[ numSides ] ); + c = (size_t)&( ( (brush_t*) 0 )->sides[ numSides ] );*/ + c = sizeof(*bb) + (numSides > 6 ? sizeof(side_t)*(numSides - 6) : 0); bb = safe_malloc( c ); memset( bb, 0, c ); if ( numthreads == 1 ) {