]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit 'e7c45da823515747a88569374d62717b72dcf078' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 19:33:45 +0000 (21:33 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 19:33:45 +0000 (21:33 +0200)
17 files changed:
1  2 
Makefile
libs/string/string.h
radiant/build.cpp
radiant/build.h
radiant/csg.cpp
radiant/environment.cpp
radiant/environment.h
radiant/findtexturedialog.cpp
radiant/main.cpp
radiant/mainframe.cpp
radiant/map.cpp
radiant/server.cpp
tools/quake3/q3map2/brush.c
tools/quake3/q3map2/bspfile_abstract.c
tools/quake3/q3map2/main.c
tools/quake3/q3map2/q3map2.h
tools/quake3/q3map2/shaders.c

diff --cc Makefile
index bf98684f13c36c55cf4768731771b3e33714f9de,bcb1f6f601ff720c7658ecb26cf0d0c37e739f03..8e63b813c38f4833bd6890e3a71a4a6bb2d39632
+++ 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 \
Simple merge
index 5e86dc85037db67a52d44290298e23984dd1eb50,baa39568a68851be40f521accb150fd0d0d9a91b..3a524a76465f7fa727d966f19eab7f445b7a820f
@@@ -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<BuildMenuItem, &BuildMenuItem::run> RunCaller;
 +typedef MemberCaller<BuildMenuItem, void(), &BuildMenuItem::run> RunCaller;
  };
  
  typedef std::list<BuildMenuItem> BuildMenuItems;
diff --cc radiant/build.h
index 4e49414637fa0a292adc1521ce7040143ef7dcb5,39024fad1e21b91808f0a98ca7d051f5f3e00c49..f6cfe9c309231e28c74655a6c5e386d91fa1891c
@@@ -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/csg.cpp
Simple merge
index a84a7d42bc7ba0b10fc25b465aa2098fbff582ae,ad0edd774b526451f29458a48bdb9daf85533043..a1a13b8686442e5faf01f6fdb7582ec56ae502cd
@@@ -188,7 -180,21 +188,21 @@@ bool portable_app_setup()
        return false;
  }
  
 -char* openCmdMap;
 -#if defined( POSIX )
++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 GDEF_OS_POSIX
  
  #include <stdlib.h>
  #include <pwd.h>
@@@ -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 <windows.h>
  
- 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 );
  
        {
index 98c33ab94568a90d726896e0298ac94db8f97969,b5dc6c1523183aadb8651202eb680187b9c72b67..566a307e64874662845ce835551e689991f1495a
@@@ -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
Simple merge
index 88cd0cad4fd89e7a774ca8941be1a9fbd5b60144,d17db3d6aa4f619eb26aedfcaa02d5eac1a47ab3..6093f87971528835fb0898f467869efed8ddb52b
@@@ -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() );
        }
index 16c237096b357275218e0c0176e45148472d179a,0bb43da61d022752d524ed978b0e3f79d243572d..4bd30a9561f140282d9028b0245b36ac3cb46c3f
@@@ -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<WXY_Print>());
 -      create_menu_item_with_mnemonic( menu, "_Background select", FreeCaller<WXY_BackgroundSelect>() );
 +//  create_menu_item_with_mnemonic(menu, "_Print XY View", FreeCaller<void(), WXY_Print>());
 +      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;
  
  
        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<PreferenceGroup&, Layout_constructPage>() );
 +      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<OpenHelpURL>(), Accelerator( GDK_F1 ) );
 -
 -      GlobalCommands_insert( "Sleep", FreeCaller<thunk_OnSleep>(), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
 -      GlobalCommands_insert( "NewMap", FreeCaller<NewMap>() );
 -      GlobalCommands_insert( "OpenMap", FreeCaller<OpenMap>(), Accelerator( 'O', (GdkModifierType)GDK_CONTROL_MASK ) );
 -      GlobalCommands_insert( "ImportMap", FreeCaller<ImportMap>() );
 -      GlobalCommands_insert( "SaveMap", FreeCaller<SaveMap>(), Accelerator( 'S', (GdkModifierType)GDK_CONTROL_MASK ) );
 -      GlobalCommands_insert( "SaveMapAs", FreeCaller<SaveMapAs>() );
 -      GlobalCommands_insert( "SaveSelected", FreeCaller<ExportMap>() );
 -      GlobalCommands_insert( "SaveRegion", FreeCaller<SaveRegion>() );
 -      GlobalCommands_insert( "RefreshReferences", FreeCaller<RefreshReferences>() );
 -      GlobalCommands_insert( "ProjectSettings", FreeCaller<DoProjectSettings>() );
 -      GlobalCommands_insert( "CheckForUpdate", FreeCaller<OpenUpdateURL>() );
 -      GlobalCommands_insert( "Exit", FreeCaller<Exit>() );
 -
 -      GlobalCommands_insert( "Undo", FreeCaller<Undo>(), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) );
 -      GlobalCommands_insert( "Redo", FreeCaller<Redo>(), Accelerator( 'Y', (GdkModifierType)GDK_CONTROL_MASK ) );
 -      GlobalCommands_insert( "Copy", FreeCaller<Copy>(), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) );
 -      GlobalCommands_insert( "Paste", FreeCaller<Paste>(), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) );
 -      GlobalCommands_insert( "PasteToCamera", FreeCaller<PasteToCamera>(), Accelerator( 'V', (GdkModifierType)GDK_SHIFT_MASK ) );
 -      GlobalCommands_insert( "CloneSelection", FreeCaller<Selection_Clone>(), Accelerator( GDK_space ) );
 -      GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller<Selection_Clone_MakeUnique>(), Accelerator( GDK_space, (GdkModifierType)GDK_SHIFT_MASK ) );
 -//    GlobalCommands_insert( "DeleteSelection", FreeCaller<deleteSelection>(), Accelerator( GDK_BackSpace ) );
 -      GlobalCommands_insert( "DeleteSelection2", FreeCaller<deleteSelection>(), Accelerator( GDK_BackSpace ) );
 -      GlobalCommands_insert( "DeleteSelection", FreeCaller<deleteSelection>(), Accelerator( 'Z' ) );
 -      GlobalCommands_insert( "ParentSelection", FreeCaller<Scene_parentSelected>() );
 -//    GlobalCommands_insert( "UnSelectSelection", FreeCaller<Selection_Deselect>(), Accelerator( GDK_Escape ) );
 -      GlobalCommands_insert( "UnSelectSelection2", FreeCaller<Selection_Deselect>(), Accelerator( GDK_Escape ) );
 -      GlobalCommands_insert( "UnSelectSelection", FreeCaller<Selection_Deselect>(), Accelerator( 'C' ) );
 -      GlobalCommands_insert( "InvertSelection", FreeCaller<Select_Invert>(), Accelerator( 'I' ) );
 -      GlobalCommands_insert( "SelectInside", FreeCaller<Select_Inside>() );
 -      GlobalCommands_insert( "SelectTouching", FreeCaller<Select_Touching>() );
 -      GlobalCommands_insert( "ExpandSelectionToEntities", FreeCaller<Scene_ExpandSelectionToEntities>(), Accelerator( 'E', (GdkModifierType)GDK_SHIFT_MASK ) );
 -      GlobalCommands_insert( "Preferences", FreeCaller<PreferencesDialog_showDialog>(), Accelerator( 'P' ) );
 -
 -      GlobalCommands_insert( "ToggleConsole", FreeCaller<Console_ToggleShow>(), Accelerator( 'O' ) );
 -      GlobalCommands_insert( "ToggleEntityInspector", FreeCaller<EntityInspector_ToggleShow>(), Accelerator( 'N' ) );
 -      GlobalCommands_insert( "EntityList", FreeCaller<EntityList_toggleShown>(), Accelerator( 'L' ) );
 -
 -      GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
 -      GlobalCommands_insert( "HideSelected", FreeCaller<HideSelected>(), Accelerator( 'H' ) );
 -
 -      GlobalToggles_insert( "DragVertices", FreeCaller<SelectVertexMode>(), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) );
 -      GlobalToggles_insert( "DragEdges", FreeCaller<SelectEdgeMode>(), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) );
 -      GlobalToggles_insert( "DragFaces", FreeCaller<SelectFaceMode>(), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) );
 -
 -      GlobalCommands_insert( "MirrorSelectionX", FreeCaller<Selection_Flipx>() );
 -      GlobalCommands_insert( "RotateSelectionX", FreeCaller<Selection_Rotatex>() );
 -      GlobalCommands_insert( "MirrorSelectionY", FreeCaller<Selection_Flipy>() );
 -      GlobalCommands_insert( "RotateSelectionY", FreeCaller<Selection_Rotatey>() );
 -      GlobalCommands_insert( "MirrorSelectionZ", FreeCaller<Selection_Flipz>() );
 -      GlobalCommands_insert( "RotateSelectionZ", FreeCaller<Selection_Rotatez>() );
 -
 -      GlobalCommands_insert( "ArbitraryRotation", FreeCaller<DoRotateDlg>(), Accelerator( 'R', (GdkModifierType)GDK_SHIFT_MASK ) );
 -      GlobalCommands_insert( "ArbitraryScale", FreeCaller<DoScaleDlg>(), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
 -
 -      GlobalCommands_insert( "BuildMenuCustomize", FreeCaller<DoBuildMenu>() );
 -      GlobalCommands_insert( "Build_runRecentExecutedBuild", FreeCaller<Build_runRecentExecutedBuild>(), Accelerator( GDK_F5 ) );
 -
 -      GlobalCommands_insert( "FindBrush", FreeCaller<DoFind>() );
 -
 -      GlobalCommands_insert( "MapInfo", FreeCaller<DoMapInfo>(), Accelerator( 'M' ) );
 -
 -
 -      GlobalToggles_insert( "ToggleClipper", FreeCaller<ClipperMode>(), ToggleItem::AddCallbackCaller( g_clipper_button ), Accelerator( 'X' ) );
 -
 -      GlobalToggles_insert( "MouseTranslate", FreeCaller<TranslateMode>(), ToggleItem::AddCallbackCaller( g_translatemode_button ), Accelerator( 'W' ) );
 -      GlobalToggles_insert( "MouseRotate", FreeCaller<RotateMode>(), ToggleItem::AddCallbackCaller( g_rotatemode_button ), Accelerator( 'R' ) );
 -      GlobalToggles_insert( "MouseScale", FreeCaller<ScaleMode>(), ToggleItem::AddCallbackCaller( g_scalemode_button ) );
 -      GlobalToggles_insert( "MouseDrag", FreeCaller<DragMode>(), ToggleItem::AddCallbackCaller( g_dragmode_button ) );
 -      GlobalCommands_insert( "MouseRotateOrScale", FreeCaller<ToggleRotateScaleModes>() );
 -      GlobalCommands_insert( "MouseDragOrScale", FreeCaller<ToggleDragScaleModes>(), Accelerator( 'Q' ) );
 -
 -      GlobalCommands_insert( "gtkThemeDlg", FreeCaller<gtkThemeDlg>() );
 -      GlobalCommands_insert( "ColorSchemeOriginal", FreeCaller<ColorScheme_Original>() );
 -      GlobalCommands_insert( "ColorSchemeQER", FreeCaller<ColorScheme_QER>() );
 -      GlobalCommands_insert( "ColorSchemeBlackAndGreen", FreeCaller<ColorScheme_Black>() );
 -      GlobalCommands_insert( "ColorSchemeYdnar", FreeCaller<ColorScheme_Ydnar>() );
 +      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 ) );
        GlobalCommands_insert( "ChooseClipperColor", makeCallback( g_ColoursMenu.m_clipper ) );
        GlobalCommands_insert( "ChooseOrthoViewNameColor", makeCallback( g_ColoursMenu.m_viewname ) );
  
 -      GlobalCommands_insert( "Fullscreen", FreeCaller<MainFrame_toggleFullscreen>(), Accelerator( GDK_F11 ) );
++      GlobalCommands_insert( "Fullscreen", makeCallbackF( MainFrame_toggleFullscreen ), Accelerator( GDK_F11 ) );
  
 -      GlobalCommands_insert( "CSGSubtract", FreeCaller<CSG_Subtract>(), Accelerator( 'U', (GdkModifierType)GDK_SHIFT_MASK ) );
 -      GlobalCommands_insert( "CSGMerge", FreeCaller<CSG_Merge>(), Accelerator( 'U', (GdkModifierType)GDK_CONTROL_MASK ) );
 -      GlobalCommands_insert( "CSGroom", FreeCaller<CSG_MakeRoom>() );
 -      GlobalCommands_insert( "CSGTool", FreeCaller<CSG_Tool>() );
 +      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/map.cpp
Simple merge
index 2a264e6dcd14ede2803c2ee7e3789f5dff3aa416,aad08221da63c23ff317a02b491387a7ff6e873f..679e56bbd626250ef74722d506d25c6b917d5553
@@@ -144,8 -144,13 +144,12 @@@ FunctionPointer findSymbol( const char
  
  #include <dlfcn.h>
  
 -class DynamicLibrary
 -{
 -void* m_library;
+ #ifndef RTLD_DEEPBIND
+ #define RTLD_DEEPBIND 0
+ #endif
 +class DynamicLibrary {
 +      void *m_library;
  public:
  typedef int ( *FunctionPointer )();
  
index c6400cbc1ac3fc4859e2e917a34b3516b7c754bb,e15d5612cf2ec303080ba83a524a28d4966b0ac1..7769a0c5cc4650483bb621f1e7bba07261787c01
@@@ -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 ) {
Simple merge
Simple merge
Simple merge