From: Thomas Debesse Date: Tue, 21 Jun 2022 02:25:25 +0000 (+0200) Subject: Merge commit '839c9693774fdb0e420391f65b8066e8bd04c591' into master-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5f72a1053d72cdbfe38d97e5b1fd9688316ceb40;p=xonotic%2Fnetradiant.git Merge commit '839c9693774fdb0e420391f65b8066e8bd04c591' into master-merge --- 5f72a1053d72cdbfe38d97e5b1fd9688316ceb40 diff --cc radiant/csg.cpp index 069c5c01,2b7d82be..be01396d --- a/radiant/csg.cpp +++ b/radiant/csg.cpp @@@ -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; } } diff --cc radiant/environment.cpp index bd07533a,a1a13b86..1e02a141 --- a/radiant/environment.cpp +++ b/radiant/environment.cpp @@@ -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 diff --cc radiant/mainframe.cpp index 7c74d2b4,4bd30a95..dd18db71 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@@ -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; @@@ -3170,21 -3073,8 +3162,9 @@@ } } } - - 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 ) ); } + if( gdk_window_get_state( GTK_WIDGET( m_window )->window ) == 0 ){ - g_layout_globals.m_position = m_position_tracker.getPosition(); + 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 tools/quake3/q3map2/brush.c index db04b880,7769a0c5..d4808954 --- a/tools/quake3/q3map2/brush.c +++ b/tools/quake3/q3map2/brush.c @@@ -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++; } diff --cc tools/quake3/q3map2/q3map2.h index 1a7dd34e,f6296f1b..720dec29 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@@ -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 ) { \ @@@ -2640,14 -2601,8 +2640,14 @@@ } \ while ( 0 ) +#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_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 )