]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit 'a8192282200b4691a016c4f7757638cbb132f2dc' into master-merge
authorThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 04:32:59 +0000 (06:32 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 04:32:59 +0000 (06:32 +0200)
1  2 
radiant/brush.h
radiant/camwindow.cpp
radiant/camwindow.h
radiant/mainframe.cpp
radiant/mainframe.h
radiant/map.cpp
radiant/texwindow.cpp
radiant/xywindow.cpp
radiant/xywindow.h

diff --cc radiant/brush.h
Simple merge
Simple merge
Simple merge
index 9148ab0a3b80556119b64707573208736691420c,3f39db58f56627fcf85753493441a5640f6b514e..44888d86bd879b32aad63cf65d9203e1f610e6a9
@@@ -3707,9 -3579,13 +3715,13 @@@ void Maximize_View()
                g_maximizeview.toggle();
  }
  
 -
+ void FocusAllViews(){
+       XY_Centralize(); //using centralizing here, not focusing function
+       GlobalCamera_FocusOnSelected();
+ }
  #include "preferencesystem.h"
  #include "stringio.h"
 +#include "transformpath/transformpath.h"
  
  void MainFrame_Construct(){
        GlobalCommands_insert( "OpenManual", makeCallbackF(OpenHelpURL), Accelerator( GDK_KEY_F1 ) );
Simple merge
diff --cc radiant/map.cpp
Simple merge
index 11ea9cb8aefc372ea52446b24bb0aa6334903640,3ad553d6932311e6c960e8f14263bf30f2b119e0..07abbde524c3ea5e64ff64ebc4cc8750f4f819c4
@@@ -1179,13 -1123,11 +1178,13 @@@ void TextureBrowser_Tracking_MouseDown
                TextureBrowser_Tracking_MouseUp( textureBrowser );
        }
        textureBrowser.m_move_started = true;
 -      textureBrowser.m_freezePointer.freeze_pointer( textureBrowser.m_parent, textureBrowser.m_gl_widget, TextureBrowser_trackingDelta, &textureBrowser );
 +      /* NetRadiantCustom did this instead:
 +      textureBrowser.m_freezePointer.freeze_pointer( textureBrowser.m_parent, textureBrowser.m_gl_widget, TextureBrowser_trackingDelta, &textureBrowser ); */
 +      textureBrowser.m_freezePointer.freeze_pointer( textureBrowser.m_gl_widget, TextureBrowser_trackingDelta, &textureBrowser );
  }
  
- void TextureBrowser_Selection_MouseDown( TextureBrowser& textureBrowser, guint32 flags, int pointx, int pointy ){
-       SelectTexture( textureBrowser, pointx, textureBrowser.height - 1 - pointy, flags );
+ void TextureBrowser_Selection_MouseDown( TextureBrowser& textureBrowser, guint32 flags, int pointx, int pointy, bool texturizeSelection ){
+       SelectTexture( textureBrowser, pointx, textureBrowser.height - 1 - pointy, flags, texturizeSelection );
  }
  
  void TextureBrowser_Selection_MouseUp( TextureBrowser& textureBrowser, guint32 flags, int pointx, int pointy ){
@@@ -1538,9 -1479,9 +1537,9 @@@ gboolean TextureBrowser_button_press( u
        if ( event->type == GDK_BUTTON_PRESS ) {
                gtk_widget_grab_focus( widget );
                if ( event->button == 3 ) {
 -                      if ( GlobalTextureBrowser().m_tags ) {
 +                      if ( textureBrowser->m_tags ) {
                                textureBrowser->m_rmbSelected = true;
-                               TextureBrowser_Selection_MouseDown( *textureBrowser, event->state, static_cast<int>( event->x ), static_cast<int>( event->y ) );
+                               TextureBrowser_Selection_MouseDown( *textureBrowser, event->state, static_cast<int>( event->x ), static_cast<int>( event->y ), false );
  
                                BuildStoreAssignedTags( textureBrowser->m_assigned_store, textureBrowser->shader.c_str(), textureBrowser );
                                BuildStoreAvailableTags( textureBrowser->m_available_store, textureBrowser->m_assigned_store, textureBrowser->m_all_tags, textureBrowser );
                                TextureBrowser_Tracking_MouseDown( *textureBrowser );
                        }
                }
-               else if ( event->button == 1 ) {
-                       TextureBrowser_Selection_MouseDown( *textureBrowser, event->state, static_cast<int>( event->x ), static_cast<int>( event->y ) );
+               else if ( event->button == 1 || event->button == 2 ) {
+                       TextureBrowser_Selection_MouseDown( *textureBrowser, event->state, static_cast<int>( event->x ), static_cast<int>( event->y ), event->button == 2 );
  
 -                      if ( GlobalTextureBrowser().m_tags ) {
 +                      if ( textureBrowser->m_tags ) {
                                textureBrowser->m_rmbSelected = false;
                                textureBrowser->m_tag_frame.hide();
                        }
@@@ -2151,12 -2065,13 +2149,13 @@@ void TextureBrowser_searchTags()
                                TextureDirectory_loadTexture( path.c_str(), name.c_str() );
                        }
                }
 -              TextureBrowser_SetHideUnused( g_TextureBrowser, false );
 -              g_TextureBrowser.m_searchedTags = true;
++              TextureBrowser_SetHideUnused( textureBrowser, false );
 +              textureBrowser.m_searchedTags = true;
                g_TextureBrowser_currentDirectory = tags_searched;
  
 -              g_TextureBrowser.m_nTotalHeight = 0;
 -              TextureBrowser_setOriginY( g_TextureBrowser, 0 );
 -              TextureBrowser_heightChanged( g_TextureBrowser );
 +              textureBrowser.m_nTotalHeight = 0;
 +              TextureBrowser_setOriginY( textureBrowser, 0 );
 +              TextureBrowser_heightChanged( textureBrowser );
                TextureBrowser_updateTitle();
        }
        g_slist_free( selected );
index c7d1d6cbf1560f01c7637493c3e88c46eceb3bc0,c597b2e9505b9f5630fdf8da73b75660da2a19f1..742e33264987ca394d05b9d06c26ea99b62852aa
@@@ -558,19 -557,20 +558,33 @@@ void XYWnd::ZoomInWithMouse( int pointx
        }
  }
  
 +void XYWnd::Redraw() {
 +      if ( glwidget_make_current( m_gl_widget ) != FALSE ) {
 +              if ( Map_Valid( g_map ) && ScreenUpdates_Enabled() ) {
 +                      GlobalOpenGL_debugAssertNoErrors();
 +                      XY_Draw();
 +                      GlobalOpenGL_debugAssertNoErrors();
 +
 +                      m_XORRectangle.set( rectangle_t() );
 +              }
 +              glwidget_swap_buffers( m_gl_widget );
 +      }
 +}
 +
+ void XYWnd::FocusOnBounds( AABB& bounds ){
+       SetOrigin( bounds.origin );
+       int nDim1 = ( m_viewType == YZ ) ? 1 : 0;
+       int nDim2 = ( m_viewType == XY ) ? 1 : 2;
+       if( bounds.extents[ nDim1 ] < 128.f )
+               bounds.extents[ nDim1 ] = 128.f;
+       if( bounds.extents[ nDim2 ] < 128.f )
+               bounds.extents[ nDim2 ] = 128.f;
+       float scale1 = Width() / ( 3.f * bounds.extents[ nDim1 ] );
+       float scale2 = Height() / ( 3.f * bounds.extents[ nDim2 ] );
+       SetScale( MIN( scale1, scale2 ) );
+ }
  VIEWTYPE GlobalXYWnd_getCurrentViewType(){
        ASSERT_NOTNULL( g_pParentWnd );
        ASSERT_NOTNULL( g_pParentWnd->ActiveXY() );
index 07db53ece29caa2e8141576fb1be77e395dfd8fd,4eb6cf55f1f40fbd8a9739deaf6c5470c5c76012..e23b4bd79280f24332ef74993cb0bbda61e205a4
@@@ -127,11 -127,9 +127,12 @@@ guint m_zoom_focusOut
  void ZoomIn();
  void ZoomOut();
  void ZoomInWithMouse( int pointx, int pointy );
+ void FocusOnBounds( AABB& bounds );
  
 +void Redraw();
 +
  void RenderActive();
 +
  void SetActive( bool b ){
        m_bActive = b;
        RenderActive();