]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit '0d5ebb17b29d4263ec4f1634af24a27620ab47a4' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 19:21:11 +0000 (21:21 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 19:21:11 +0000 (21:21 +0200)
13 files changed:
1  2 
include/iselection.h
libs/gtkutil/cursor.cpp
libs/gtkutil/cursor.h
libs/stringio.h
radiant/camwindow.cpp
radiant/mainframe.cpp
radiant/selection.cpp
radiant/texwindow.cpp
radiant/xywindow.cpp
radiant/xywindow.h
tools/quake3/common/vfs.c
tools/quake3/common/vfs.h
tools/quake3/q3map2/main.c

Simple merge
index 58d68c95e1604d210f10ffcb9b47426f41ae408a,ae19afe03d6866b58d093b48bb5af1bbb56507d8..8f38722032b0a292f283598cc5f64afccc9d4076
@@@ -53,91 -65,3 +53,100 @@@ void Sys_SetCursorPos( ui::Window windo
        gdk_display_get_pointer( gdk_display_get_default(), &screen, 0, 0, 0 );
        gdk_display_warp_pointer( gdk_display_get_default(), screen, x, y );
  }
-       weedjet = widget;
 +
 +gboolean DeferredMotion::gtk_motion(ui::Widget widget, GdkEventMotion *event, DeferredMotion *self)
 +{
 +    self->motion( event->x, event->y, event->state );
 +    return FALSE;
 +}
 +
 +gboolean FreezePointer::motion_delta(ui::Window widget, GdkEventMotion *event, FreezePointer *self)
 +{
 +      int current_x, current_y;
 +      Sys_GetCursorPos( widget, &current_x, &current_y );
 +      int dx = current_x - self->last_x;
 +      int dy = current_y - self->last_y;
 +      int ddx = current_x - self->center_x;
 +      int ddy = current_y - self->center_y;
 +      self->last_x = current_x;
 +      self->last_y = current_y;
 +      if ( dx != 0 || dy != 0 ) {
 +              //globalOutputStream() << "motion x: " << dx << ", y: " << dy << "\n";
 +              if (ddx < -32 || ddx > 32 || ddy < -32 || ddy > 32) {
 +                      Sys_SetCursorPos( widget, self->center_x, self->center_y );
 +                      self->last_x = self->center_x;
 +                      self->last_y = self->center_y;
 +              }
 +              self->m_function( dx, dy, event->state, self->m_data );
 +      }
 +      return FALSE;
 +}
 +
 +void FreezePointer::freeze_pointer(ui::Window window, ui::Widget widget, FreezePointer::MotionDeltaFunction function, void *data)
 +{
 +      ASSERT_MESSAGE( m_function == 0, "can't freeze pointer" );
 +
 +      const GdkEventMask mask = static_cast<GdkEventMask>( GDK_POINTER_MOTION_MASK
 +                                                                                                               | GDK_POINTER_MOTION_HINT_MASK
 +                                                                                                               | GDK_BUTTON_MOTION_MASK
 +                                                                                                               | GDK_BUTTON1_MOTION_MASK
 +                                                                                                               | GDK_BUTTON2_MOTION_MASK
 +                                                                                                               | GDK_BUTTON3_MOTION_MASK
 +                                                                                                               | GDK_BUTTON_PRESS_MASK
 +                                                                                                               | GDK_BUTTON_RELEASE_MASK
 +                                                                                                               | GDK_VISIBILITY_NOTIFY_MASK );
 +
 +      //GdkCursor* cursor = create_blank_cursor();
 +      GdkCursor* cursor = gdk_cursor_new( GDK_BLANK_CURSOR );
 +      //GdkGrabStatus status =
 +      /*      fixes cursor runaways during srsly quick drags in camera
 +      drags with pressed buttons have no problem at all w/o this      */
 +      gdk_pointer_grab( gtk_widget_get_window(window), TRUE, mask, 0, cursor, GDK_CURRENT_TIME );
 +      //gdk_window_set_cursor ( GTK_WIDGET( window )->window, cursor );
 +      /*      is needed to fix activating neighbour widgets, that happens, if using upper one */
 +      gtk_grab_add( widget );
- void FreezePointer::unfreeze_pointer(ui::Window window)
++      m_weedjet = widget;
 +
 +      gdk_cursor_unref( cursor );
 +
 +      Sys_GetCursorPos( window, &recorded_x, &recorded_y );
 +
 +      /*      using center for tracking for max safety        */
 +      gdk_window_get_origin( GTK_WIDGET( widget )->window, &center_x, &center_y );
 +      auto allocation = widget.dimensions();
 +      center_y += allocation.height / 2;
 +      center_x += allocation.width / 2;
 +
 +      Sys_SetCursorPos( window, center_x, center_y );
 +
 +      last_x = center_x;
 +      last_y = center_y;
 +
 +      m_function = function;
 +      m_data = data;
 +
 +      handle_motion = window.connect( "motion_notify_event", G_CALLBACK( motion_delta ), this );
 +}
 +
-       Sys_SetCursorPos( window, recorded_x, recorded_y );
++void FreezePointer::unfreeze_pointer(ui::Window window, bool centerize )
 +{
 +      g_signal_handler_disconnect( G_OBJECT( window ), handle_motion );
 +
 +      m_function = 0;
 +      m_data = 0;
 +
-       gtk_grab_remove( weedjet );
++      if ( centerize ){
++              Sys_SetCursorPos( window, center_x, center_y );
++      }
++      else{
++              Sys_SetCursorPos( window, recorded_x, recorded_y );
++      }
 +
 +//    gdk_window_set_cursor( GTK_WIDGET( window )->window, 0 );
 +      gdk_pointer_ungrab( GDK_CURRENT_TIME );
++
++      if ( m_weedjet )
++      {
++              gtk_grab_remove( m_weedjet );
++      }
 +}
index 81767d2e591900fa4b258c3b0d473c363c5ca022,b08c7428db459651345bb34ba7e2ea30e104ce4d..89c6f72b4703911b3a2d9cb1954cc5f02a0d8808
@@@ -110,18 -118,95 +110,18 @@@ class FreezePointe
  {
  unsigned int handle_motion;
  int recorded_x, recorded_y, last_x, last_y, center_x, center_y;
- ui::Widget weedjet{ui::null};
 -GtkWidget* m_weedjet;
++ui::Widget m_weedjet{ui::null};
  typedef void ( *MotionDeltaFunction )( int x, int y, unsigned int state, void* data );
  MotionDeltaFunction m_function;
  void* m_data;
  public:
  FreezePointer() : handle_motion( 0 ), m_function( 0 ), m_data( 0 ){
  }
 -static gboolean motion_delta( GtkWidget *widget, GdkEventMotion *event, FreezePointer* self ){
 -      int current_x, current_y;
 -      Sys_GetCursorPos( GTK_WINDOW( widget ), &current_x, &current_y );
 -      int dx = current_x - self->last_x;
 -      int dy = current_y - self->last_y;
 -      int ddx = current_x - self->center_x;
 -      int ddy = current_y - self->center_y;
 -      self->last_x = current_x;
 -      self->last_y = current_y;
 -      if ( dx != 0 || dy != 0 ) {
 -              //globalOutputStream() << "motion x: " << dx << ", y: " << dy << "\n";
 -              if (ddx < -32 || ddx > 32 || ddy < -32 || ddy > 32) {
 -                      Sys_SetCursorPos( GTK_WINDOW( widget ), self->center_x, self->center_y );
 -                      self->last_x = self->center_x;
 -                      self->last_y = self->center_y;
 -              }
 -              self->m_function( dx, dy, event->state, self->m_data );
 -      }
 -      return FALSE;
 -}
 -
 -void freeze_pointer( GtkWindow* window, GtkWidget* widget, MotionDeltaFunction function, void* data ){
 -      ASSERT_MESSAGE( m_function == 0, "can't freeze pointer" );
 -
 -      const GdkEventMask mask = static_cast<GdkEventMask>( GDK_POINTER_MOTION_MASK
 -                                                                                                               | GDK_POINTER_MOTION_HINT_MASK
 -                                                                                                               | GDK_BUTTON_MOTION_MASK
 -                                                                                                               | GDK_BUTTON1_MOTION_MASK
 -                                                                                                               | GDK_BUTTON2_MOTION_MASK
 -                                                                                                               | GDK_BUTTON3_MOTION_MASK
 -                                                                                                               | GDK_BUTTON_PRESS_MASK
 -                                                                                                               | GDK_BUTTON_RELEASE_MASK
 -                                                                                                               | GDK_VISIBILITY_NOTIFY_MASK );
 -
 -      GdkCursor* cursor = gdk_cursor_new( GDK_BLANK_CURSOR );
 -      //GdkCursor* cursor = create_blank_cursor();
 -      //GdkGrabStatus status =
 -      /*      fixes cursor runaways during srsly quick drags in camera
 -      drags with pressed buttons have no problem at all w/o this      */
 -      gdk_pointer_grab( GTK_WIDGET( window )->window, TRUE, mask, 0, cursor, GDK_CURRENT_TIME );
 -      //gdk_window_set_cursor ( GTK_WIDGET( window )->window, cursor );
 -      /*      is needed to fix activating neighbour widgets, that happens, if using upper one */
 -      gtk_grab_add( widget );
 -      m_weedjet = widget;
 -
 -      gdk_cursor_unref( cursor );
 -
 -      Sys_GetCursorPos( window, &recorded_x, &recorded_y );
 -
 -      /*      using center for tracking for max safety        */
 -      gdk_window_get_origin( widget->window, &center_x, &center_y );
 -      center_y += widget->allocation.height / 2;
 -      center_x += widget->allocation.width / 2;
 -
 -      Sys_SetCursorPos( window, center_x, center_y );
 -
 -      last_x = center_x;
 -      last_y = center_y;
 -
 -      m_function = function;
 -      m_data = data;
 -
 -      handle_motion = g_signal_connect( G_OBJECT( window ), "motion_notify_event", G_CALLBACK( motion_delta ), this );
 -}
 -
 -void unfreeze_pointer( GtkWindow* window, bool centerize ){
 -      g_signal_handler_disconnect( G_OBJECT( window ), handle_motion );
 +static gboolean motion_delta( ui::Window widget, GdkEventMotion *event, FreezePointer* self );
  
 -      m_function = 0;
 -      m_data = 0;
 +void freeze_pointer( ui::Window window, ui::Widget widget, MotionDeltaFunction function, void* data );
  
- void unfreeze_pointer( ui::Window window );
 -      if( centerize ){
 -              Sys_SetCursorPos( window, center_x, center_y );
 -      }
 -      else{
 -              Sys_SetCursorPos( window, recorded_x, recorded_y );
 -      }
 -//    gdk_window_set_cursor( GTK_WIDGET( window )->window, 0 );
 -      gdk_pointer_ungrab( GDK_CURRENT_TIME );
 -      if( m_weedjet )
 -              gtk_grab_remove( m_weedjet );
 -}
++void unfreeze_pointer( ui::Window window, bool centerize );
  };
  
  #endif
diff --cc libs/stringio.h
index 9003bca8dc030b6477201f8cfd0450fe83858945,658e0ace0f476dd103b355bed31eac7b1f3fc2f4..227927291ebbe8b8ebf37e1f6cc93631da26dbf1
@@@ -235,10 -234,7 +235,10 @@@ inline bool Tokeniser_getFloat( Tokenis
        //fallback for 1.#IND 1.#INF 1.#QNAN cases, happening sometimes after rotating & often scaling with tex lock in BP mode
        else if ( token != 0 && strstr( token, ".#" ) ) {
                globalErrorStream() << "Warning: " << Unsigned( tokeniser.getLine() ) << ":" << Unsigned( tokeniser.getColumn() ) << ": expected parse problem at '" << token << "': wanted '#number'\nProcessing anyway\n";
-               *strstr( token, ".#" ) = '\0';
 +      #define GARUX_DISABLE_QNAN_FALLBACK
 +      #ifndef GARUX_DISABLE_QNAN_FALLBACK
+ //            *strstr( token, ".#" ) = '\0';
 +      #endif
                return true;
        }
        Tokeniser_unexpectedError( tokeniser, token, "#number" );
Simple merge
index eb6561027c6d38df771204ae5d216edd7baa6f77,9054117abade7d5be53c500a504400d0a1c73af3..16c237096b357275218e0c0176e45148472d179a
@@@ -2450,9 -2327,10 +2476,10 @@@ void register_shortcuts()
  //    SnapToGrid_registerShortcuts();
  //    SelectByType_registerShortcuts();
        TexBro_registerShortcuts();
+       Misc_registerShortcuts();
  }
  
 -void File_constructToolbar( GtkToolbar* toolbar ){
 +void File_constructToolbar( ui::Toolbar toolbar ){
        toolbar_append_button( toolbar, "Open an existing map (CTRL + O)", "file_open.png", "OpenMap" );
        toolbar_append_button( toolbar, "Save the active map (CTRL + S)", "file_save.png", "SaveMap" );
  }
@@@ -2498,10 -2376,10 +2525,10 @@@ void XYWnd_constructToolbar( ui::Toolba
        toolbar_append_button( toolbar, "Change views (CTRL + TAB)", "view_change.png", "NextView" );
  }
  
 -void Manipulators_constructToolbar( GtkToolbar* toolbar ){
 +void Manipulators_constructToolbar( ui::Toolbar toolbar ){
        toolbar_append_toggle_button( toolbar, "Translate (W)", "select_mousetranslate.png", "MouseTranslate" );
        toolbar_append_toggle_button( toolbar, "Rotate (R)", "select_mouserotate.png", "MouseRotate" );
-       toolbar_append_toggle_button( toolbar, "Scale", "select_mousescale.png", "MouseScale" );
+       toolbar_append_toggle_button( toolbar, "Scale (Q)", "select_mousescale.png", "MouseScale" );
        toolbar_append_toggle_button( toolbar, "Resize (Q)", "select_mouseresize.png", "MouseDrag" );
  
        Clipper_constructToolbar( toolbar );
@@@ -3413,82 -3277,83 +3440,84 @@@ void Layout_registerPreferencesPage()
  #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( "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( "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 ), Accelerator( 'Q' ) );
++      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 ) );
Simple merge
index 416d31789184d02b77e4c610fdbd282296918f86,ba6c59e4ddfa832455904cf80e8ca7d7a7aae95d..240901552b29e914328346df32ef78c75c98486a
@@@ -1500,10 -1399,9 +1500,11 @@@ gboolean TextureBrowser_button_press( u
                }
        }
        else if ( event->type == GDK_2BUTTON_PRESS && event->button == 1 ) {
 +              #define GARUX_DISABLE_2BUTTON
 +              #ifndef GARUX_DISABLE_2BUTTON
                CopiedString texName = textureBrowser->shader;
-               const char* sh = textureBrowser->shader.c_str();
+               //const char* sh = texName.c_str();
+               char* sh = const_cast<char*>( texName.c_str() );
                char* dir = strrchr( sh, '/' );
                if( dir != NULL ){
                        *(dir + 1) = '\0';
index f1cb57fdbf8a47203516ebe0294d1bf850f1b915,af6467e34932021e26953676b7910ac95c6ac24f..1a176bfd242bf86bce78ab84abe83f48a77e79fd
@@@ -1229,7 -1240,7 +1245,7 @@@ void XYWnd::Move_Begin()
  
  void XYWnd::Move_End(){
        m_move_started = false;
-       g_xywnd_freezePointer.unfreeze_pointer( m_parent ? m_parent : MainFrame_getWindow() );
 -      g_xywnd_freezePointer.unfreeze_pointer( m_parent != 0 ? m_parent : MainFrame_getWindow(), false );
++      g_xywnd_freezePointer.unfreeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), false );
        g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_move_focusOut );
  }
  
@@@ -1274,7 -1285,7 +1290,7 @@@ void XYWnd::Zoom_Begin()
  
  void XYWnd::Zoom_End(){
        m_zoom_started = false;
-       g_xywnd_freezePointer.unfreeze_pointer( m_parent ? m_parent : MainFrame_getWindow() );
 -      g_xywnd_freezePointer.unfreeze_pointer( m_parent != 0 ? m_parent : MainFrame_getWindow(), false );
++      g_xywnd_freezePointer.unfreeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), false );
        g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_zoom_focusOut );
  }
  
Simple merge
index 48a1f86fbde046b5b81b411cb15f18167991125e,2b1b61bc379a0781ab495dd89ddbcd5027e0dd43..e8648e813fd25b95b0b95bff8ef85eff35244ddb
@@@ -581,7 -565,42 +581,49 @@@ qboolean vfsPackFile( const char *filen
        }
  
        return qfalse;
 +#else
 +              Error( "Disabled because of miniz issue" );
 +#endif
  }
+ qboolean vfsPackFile_Absolute_Path( const char *filepath, const char *filename, const char *packname, const int compLevel ){
++#ifndef GARUX_DISABLE_BAD_MINIZ
+       char tmp[NAME_MAX];
+       strcpy( tmp, filepath );
+       if ( access( tmp, R_OK ) == 0 ) {
+               if ( access( packname, R_OK ) == 0 ) {
+                       mz_zip_archive zip;
+                       memset( &zip, 0, sizeof(zip) );
+                       mz_zip_reader_init_file( &zip, packname, 0 );
+                       mz_zip_writer_init_from_reader( &zip, packname );
+                       mz_bool success = MZ_TRUE;
+                       success &= mz_zip_writer_add_file( &zip, filename, tmp, 0, 0, compLevel );
+                       if ( !success || !mz_zip_writer_finalize_archive( &zip ) ){
+                               Error( "Failed creating zip archive \"%s\"!\n", packname );
+                       }
+                       mz_zip_reader_end( &zip);
+                       mz_zip_writer_end( &zip );
+               }
+               else{
+                       mz_zip_archive zip;
+                       memset( &zip, 0, sizeof(zip) );
+                       if( !mz_zip_writer_init_file( &zip, packname, 0 ) ){
+                               Error( "Failed creating zip archive \"%s\"!\n", packname );
+                       }
+                       mz_bool success = MZ_TRUE;
+                       success &= mz_zip_writer_add_file( &zip, filename, tmp, 0, 0, compLevel );
+                       if ( !success || !mz_zip_writer_finalize_archive( &zip ) ){
+                               Error( "Failed creating zip archive \"%s\"!\n", packname );
+                       }
+                       mz_zip_writer_end( &zip );
+               }
+               return qtrue;
+       }
+       return qfalse;
++#else
++              Error( "Disabled because of miniz issue" );
++#endif
+ }
Simple merge
Simple merge