]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit '839c9693774fdb0e420391f65b8066e8bd04c591' into master-merge
authorThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 02:25:25 +0000 (04:25 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 02:25:25 +0000 (04:25 +0200)
14 files changed:
1  2 
Makefile
libs/string/string.h
radiant/build.cpp
radiant/csg.cpp
radiant/environment.cpp
radiant/environment.h
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

diff --cc Makefile
Simple merge
Simple merge
Simple merge
diff --cc radiant/csg.cpp
index 069c5c012e2c065966f8e003f97d62ae958c632b,2b7d82be09393aa61933a59c37c0808761a19925..be01396d0fa3b75898f09effce1f61f8866b8575
@@@ -643,18 -656,23 +643,19 @@@ void post( const scene::Path& path, sce
                        else
                        {
                                ++m_before;
 -                              for ( brush_vector_t::const_iterator i = out.begin(); i != out.end(); ++i )
 -                              {
 +                              for ( Brush *b : out ) {
                                        ++m_after;
 -                                      ( *i )->removeEmptyFaces();
 -                                      if ( !( *i )->empty() ) {
 +                                      b->removeEmptyFaces();
 +                                      if ( !b->empty() ) {
                                                NodeSmartReference node( ( new BrushNode() )->node() );
 -                                              Node_getBrush( node )->copy( *( *i ) );
 -                                              delete ( *i );
 +                                              Node_getBrush( node )->copy( *b );
                                                Node_getTraversable( path.parent() )->insert( node );
                                        }
 -                                      else{
 -                                              delete ( *i );
 -                                      }
 +                                      delete b;
                                }
+                               scene::Node& parent = path.parent();
                                Path_deleteTop( path );
-                               if( Node_getTraversable( path.parent() )->empty() ){
+                               if( Node_getTraversable( parent )->empty() ){
                                        m_eraseParent = true;
                                }
                        }
index bd07533a6825ab1f06178d02ab57d606830f8194,a1a13b8686442e5faf01f6fdb7582ec56ae502cd..1e02a14153336f81fdb408ae11cc2b4d51b25b85
@@@ -335,8 -272,8 +349,9 @@@ void environment_init( int argc, char c
                Q_mkdir( home.c_str() );
                home_path = home.c_str();
        }
 +
        gamedetect();
+       cmdMap();
  }
  
  #elif GDEF_OS_WINDOWS
Simple merge
Simple merge
index 7c74d2b465005c909086e0f077b7493a8df8df81,4bd30a9561f140282d9028b0245b36ac3cb46c3f..dd18db7101188bd41e12623e6e07687f7fadfda4
@@@ -3099,19 -3013,9 +3101,9 @@@ void MainFrame::Create()
  #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;
  
                                }
                        }
                }
-               gtk_paned_set_position( GTK_PANED( m_vSplit ), g_layout_globals.nXYHeight );
-               if ( CurrentStyle() == eRegular ) {
-                       gtk_paned_set_position( GTK_PANED( m_hSplit ), g_layout_globals.nXYWidth );
-               }
-               else
-               {
-                       gtk_paned_set_position( GTK_PANED( m_hSplit ), g_layout_globals.nCamWidth );
-               }
-               gtk_paned_set_position( GTK_PANED( m_vSplit2 ), g_layout_globals.nCamHeight );
        }
 -      else if ( CurrentStyle() == eFloating ) {
 +      else if ( CurrentStyle() == eFloating )
 +      {
                {
                        ui::Window window = ui::Window(create_persistent_floating_window( "Camera", m_window ));
                        global_accel_connect_window( window );
@@@ -3397,7 -3270,9 +3396,9 @@@ 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_get_window(m_window ) );
  }
@@@ -3561,9 -3436,29 +3562,29 @@@ void Layout_registerPreferencesPage()
        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"
 +#include "transformpath/transformpath.h"
  
  void MainFrame_Construct(){
        GlobalCommands_insert( "OpenManual", makeCallbackF(OpenHelpURL), Accelerator( GDK_KEY_F1 ) );
diff --cc radiant/map.cpp
Simple merge
Simple merge
index db04b8805e2faf08bc61ec8993df13e5c09964d8,7769a0c5cc4650483bb621f1e7bba07261787c01..d48089540546de331b1ccfe57f76223445415f8f
@@@ -94,11 -94,13 +94,12 @@@ brush_t *AllocBrush( int numSides )
        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 );
 +      bb = safe_malloc0( c );
        if ( numthreads == 1 ) {
                numActiveBrushes++;
        }
Simple merge
index 1a7dd34e205e1a30b6679b46c6f24a11cc34cc81,f6296f1b72aae3412f8dcd4c90c175d1503195a8..720dec29053fc042f0541d74295b7e0cc0d053cf
@@@ -2064,7 -2036,7 +2064,6 @@@ Q_EXTERN float jitters[ MAX_JITTERS ]
  Q_EXTERN qboolean doingBSP Q_ASSIGN( qfalse );
  
  /* commandline arguments */
- Q_EXTERN qboolean nocmdline Q_ASSIGN( qfalse );
 -Q_EXTERN qboolean verbose;
  Q_EXTERN qboolean verboseEntities Q_ASSIGN( qfalse );
  Q_EXTERN qboolean force Q_ASSIGN( qfalse );
  Q_EXTERN qboolean infoMode Q_ASSIGN( qfalse );
@@@ -2618,15 -2587,12 +2618,15 @@@ Q_EXTERN qboolean compile_map
                if ( reqitem >= allocated )     \
                { \
                        if ( allocated == 0 ) { \
 -                              allocated = def; } \
 +                              allocated = def; \
 +                      } \
                        while ( reqitem >= allocated && allocated )     \
 +                      { \
                                allocated *= 2; \
 +                      } \
                        if ( !allocated || allocated > 2147483647 / (int)sizeof( *ptr ) ) \
                        { \
-                               Error( #ptr " over 2 GB" ); \
+                               Error( # ptr " over 2 GB" ); \
                        } \
                        ptr = realloc( ptr, sizeof( *ptr ) * allocated ); \
                        if ( !ptr ) { \
        } \
        while ( 0 )
  
- #define AUTOEXPAND_BY_REALLOC_BSP( suffix, def ) AUTOEXPAND_BY_REALLOC( bsp##suffix, numBSP##suffix, allocatedBSP##suffix, def )
 +#define AUTOEXPAND_BY_REALLOC( ptr, reqitem, allocated, def ) _AUTOEXPAND_BY_REALLOC( ptr, reqitem, allocated, def, qfalse )
 +
 +#define AUTOEXPAND_BY_REALLOC0( ptr, reqitem, allocated, def ) _AUTOEXPAND_BY_REALLOC( ptr, reqitem, allocated, def, qtrue )
 +
+ #define AUTOEXPAND_BY_REALLOC_BSP( suffix, def ) AUTOEXPAND_BY_REALLOC( bsp ## suffix, numBSP ## suffix, allocatedBSP ## suffix, def )
  
 +#define AUTOEXPAND_BY_REALLOC0_BSP( suffix, def ) AUTOEXPAND_BY_REALLOC0( bsp##suffix, numBSP##suffix, allocatedBSP##suffix, def )
 +
  #define Image_LinearFloatFromsRGBFloat( c ) ( ( ( c ) <= 0.04045f ) ? ( c ) * ( 1.0f / 12.92f ) : (float)pow( ( ( c ) + 0.055f ) * ( 1.0f / 1.055f ), 2.4f ) )
  #define Image_sRGBFloatFromLinearFloat( c ) ( ( ( c ) < 0.0031308f ) ? ( c ) * 12.92f : 1.055f * (float)pow( ( c ), 1.0f / 2.4f ) - 0.055f )