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;
}
}
Q_mkdir( home.c_str() );
home_path = home.c_str();
}
+
gamedetect();
+ cmdMap();
}
#elif GDEF_OS_WINDOWS
#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 );
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 ) );
}
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 ) );
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++;
}
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 );
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 )