]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit 'fe73dd74d0e40a33c090993390e4d5721a1f9e05' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 11 Feb 2019 14:17:16 +0000 (15:17 +0100)
committerThomas Debesse <dev@illwieckz.net>
Mon, 11 Feb 2019 14:17:16 +0000 (15:17 +0100)
1  2 
radiant/environment.cpp
radiant/mainframe.cpp
radiant/map.cpp
radiant/texwindow.cpp
tools/quake3/q3map2/bspfile_abstract.c
tools/quake3/q3map2/light_bounce.c
tools/quake3/q3map2/lightmaps_ydnar.c
tools/quake3/q3map2/q3map2.h
tools/quake3/q3map2/shaders.c
tools/quake3/q3map2/surface_meta.c

index 484258d79f73d1a04d3b2f078a3528c7da9317de,74de78b64e825171756cfd650984f8635237b6b1..38c93c41006b978dc44b9530af6cb105d77bc7dd
@@@ -110,10 -104,10 +110,11 @@@ bool gamedetect_check_game( char const 
  void gamedetect(){
        // if we're inside a Nexuiz install
        // default to nexuiz.game (unless the user used an option to inhibit this)
-       bool nogamedetect = false;
+       //bool nogamedetect = false;
+       bool nogamedetect = true;
        int i;
        for ( i = 1; i < g_argc - 1; ++i )
 +      {
                if ( g_argv[i][0] == '-' ) {
                        if ( !strcmp( g_argv[i], "-gamedetect" ) ) {
                                nogamedetect = !strcmp( g_argv[i + 1], "false" );
index 50101b3feb2e8df4f8fa5b56b2ceeaf11dc8aeb5,310e7d970be1e690ffcf3ce1b13006c0480626b8..6f377579f484b3015ce5876c606a19e35b1e3023
@@@ -3491,38 -3343,41 +3493,41 @@@ void MainFrame_Construct()
        Patch_registerCommands();
        XYShow_registerCommands();
  
 -      typedef FreeCaller1<const Selectable&, ComponentMode_SelectionChanged> ComponentModeSelectionChangedCaller;
 +      typedef FreeCaller<void(const Selectable&), ComponentMode_SelectionChanged> ComponentModeSelectionChangedCaller;
        GlobalSelectionSystem().addSelectionChangeCallback( ComponentModeSelectionChangedCaller() );
  
 -      GlobalPreferenceSystem().registerPreference( "DetachableMenus", BoolImportStringCaller( g_Layout_enableDetachableMenus.m_latched ), BoolExportStringCaller( g_Layout_enableDetachableMenus.m_latched ) );
 -      GlobalPreferenceSystem().registerPreference( "PatchToolBar", BoolImportStringCaller( g_Layout_enablePatchToolbar.m_latched ), BoolExportStringCaller( g_Layout_enablePatchToolbar.m_latched ) );
 -      GlobalPreferenceSystem().registerPreference( "PluginToolBar", BoolImportStringCaller( g_Layout_enablePluginToolbar.m_latched ), BoolExportStringCaller( g_Layout_enablePluginToolbar.m_latched ) );
 -      GlobalPreferenceSystem().registerPreference( "FilterToolBar", BoolImportStringCaller( g_Layout_enableFilterToolbar.m_latched ), BoolExportStringCaller( g_Layout_enableFilterToolbar.m_latched ) );
 -      GlobalPreferenceSystem().registerPreference( "QE4StyleWindows", IntImportStringCaller( g_Layout_viewStyle.m_latched ), IntExportStringCaller( g_Layout_viewStyle.m_latched ) );
 -      GlobalPreferenceSystem().registerPreference( "XYHeight", IntImportStringCaller( g_layout_globals.nXYHeight ), IntExportStringCaller( g_layout_globals.nXYHeight ) );
 -      GlobalPreferenceSystem().registerPreference( "XYWidth", IntImportStringCaller( g_layout_globals.nXYWidth ), IntExportStringCaller( g_layout_globals.nXYWidth ) );
 -      GlobalPreferenceSystem().registerPreference( "CamWidth", IntImportStringCaller( g_layout_globals.nCamWidth ), IntExportStringCaller( g_layout_globals.nCamWidth ) );
 -      GlobalPreferenceSystem().registerPreference( "CamHeight", IntImportStringCaller( g_layout_globals.nCamHeight ), IntExportStringCaller( g_layout_globals.nCamHeight ) );
 -
 -      GlobalPreferenceSystem().registerPreference( "State", IntImportStringCaller( g_layout_globals.nState ), IntExportStringCaller( g_layout_globals.nState ) );
 -      GlobalPreferenceSystem().registerPreference( "PositionX", IntImportStringCaller( g_layout_globals.m_position.x ), IntExportStringCaller( g_layout_globals.m_position.x ) );
 -      GlobalPreferenceSystem().registerPreference( "PositionY", IntImportStringCaller( g_layout_globals.m_position.y ), IntExportStringCaller( g_layout_globals.m_position.y ) );
 -      GlobalPreferenceSystem().registerPreference( "Width", IntImportStringCaller( g_layout_globals.m_position.w ), IntExportStringCaller( g_layout_globals.m_position.w ) );
 -      GlobalPreferenceSystem().registerPreference( "Height", IntImportStringCaller( g_layout_globals.m_position.h ), IntExportStringCaller( g_layout_globals.m_position.h ) );
 -
 -      GlobalPreferenceSystem().registerPreference( "CamWnd", WindowPositionTrackerImportStringCaller( g_posCamWnd ), WindowPositionTrackerExportStringCaller( g_posCamWnd ) );
 -      GlobalPreferenceSystem().registerPreference( "XYWnd", WindowPositionTrackerImportStringCaller( g_posXYWnd ), WindowPositionTrackerExportStringCaller( g_posXYWnd ) );
 -      GlobalPreferenceSystem().registerPreference( "YZWnd", WindowPositionTrackerImportStringCaller( g_posYZWnd ), WindowPositionTrackerExportStringCaller( g_posYZWnd ) );
 -      GlobalPreferenceSystem().registerPreference( "XZWnd", WindowPositionTrackerImportStringCaller( g_posXZWnd ), WindowPositionTrackerExportStringCaller( g_posXZWnd ) );
 -
 -      GlobalPreferenceSystem().registerPreference( "EnginePath", CopiedStringImportStringCaller( g_strEnginePath ), CopiedStringExportStringCaller( g_strEnginePath ) );
 +      GlobalPreferenceSystem().registerPreference( "DetachableMenus", make_property_string( g_Layout_enableDetachableMenus.m_latched ) );
 +      GlobalPreferenceSystem().registerPreference( "PatchToolBar", make_property_string( g_Layout_enablePatchToolbar.m_latched ) );
 +      GlobalPreferenceSystem().registerPreference( "PluginToolBar", make_property_string( g_Layout_enablePluginToolbar.m_latched ) );
 +      GlobalPreferenceSystem().registerPreference( "FilterToolBar", make_property_string( g_Layout_enableFilterToolbar.m_latched ) );
 +      GlobalPreferenceSystem().registerPreference( "QE4StyleWindows", make_property_string( g_Layout_viewStyle.m_latched ) );
 +      GlobalPreferenceSystem().registerPreference( "XYHeight", make_property_string( g_layout_globals.nXYHeight ) );
 +      GlobalPreferenceSystem().registerPreference( "XYWidth", make_property_string( g_layout_globals.nXYWidth ) );
 +      GlobalPreferenceSystem().registerPreference( "CamWidth", make_property_string( g_layout_globals.nCamWidth ) );
 +      GlobalPreferenceSystem().registerPreference( "CamHeight", make_property_string( g_layout_globals.nCamHeight ) );
 +
 +      GlobalPreferenceSystem().registerPreference( "State", make_property_string( g_layout_globals.nState ) );
 +      GlobalPreferenceSystem().registerPreference( "PositionX", make_property_string( g_layout_globals.m_position.x ) );
 +      GlobalPreferenceSystem().registerPreference( "PositionY", make_property_string( g_layout_globals.m_position.y ) );
 +      GlobalPreferenceSystem().registerPreference( "Width", make_property_string( g_layout_globals.m_position.w ) );
 +      GlobalPreferenceSystem().registerPreference( "Height", make_property_string( g_layout_globals.m_position.h ) );
 +
 +      GlobalPreferenceSystem().registerPreference( "CamWnd", make_property<WindowPositionTracker_String>(g_posCamWnd) );
 +      GlobalPreferenceSystem().registerPreference( "XYWnd", make_property<WindowPositionTracker_String>(g_posXYWnd) );
 +      GlobalPreferenceSystem().registerPreference( "YZWnd", make_property<WindowPositionTracker_String>(g_posYZWnd) );
 +      GlobalPreferenceSystem().registerPreference( "XZWnd", make_property<WindowPositionTracker_String>(g_posXZWnd) );
 +
++      GlobalPreferenceSystem().registerPreference( "EnginePath", make_property_string( g_strEnginePath ) );
+       if ( g_strEnginePath.empty() )
        {
+               g_strEnginePath_was_empty_1st_start = true;
                const char* ENGINEPATH_ATTRIBUTE =
 -#if defined( WIN32 )
 +#if GDEF_OS_WINDOWS
                        "enginepath_win32"
 -#elif defined( __linux__ ) || defined ( __FreeBSD__ )
 -                      "enginepath_linux"
 -#elif defined( __APPLE__ )
 +#elif GDEF_OS_MACOS
                        "enginepath_macos"
 +#elif GDEF_OS_LINUX || GDEF_OS_BSD
 +                      "enginepath_linux"
  #else
  #error "unknown platform"
  #endif
                StringOutputStream path( 256 );
                path << DirectoryCleaned( g_pGameDescription->getRequiredKeyValue( ENGINEPATH_ATTRIBUTE ) );
                g_strEnginePath = path.c_str();
 -              GlobalPreferenceSystem().registerPreference( "EnginePath", CopiedStringImportStringCaller( g_strEnginePath ), CopiedStringExportStringCaller( g_strEnginePath ) );
++              GlobalPreferenceSystem().registerPreference( "EnginePath", make_property_string( g_strEnginePath ) );
        }
  
-       GlobalPreferenceSystem().registerPreference( "EnginePath", make_property_string( g_strEnginePath ) );
 +      GlobalPreferenceSystem().registerPreference( "DisableEnginePath", make_property_string( g_disableEnginePath ) );
 +      GlobalPreferenceSystem().registerPreference( "DisableHomePath", make_property_string( g_disableHomePath ) );
  
 +      for ( int i = 0; i < g_pakPathCount; i++ ) {
 +              std::string label = "PakPath" + std::to_string( i );
 +              GlobalPreferenceSystem().registerPreference( label.c_str(), make_property_string( g_strPakPath[i] ) );
 +      }
  
        g_Layout_viewStyle.useLatched();
        g_Layout_enableDetachableMenus.useLatched();
diff --cc radiant/map.cpp
index 6603279f17112f72e295a502a3aa6b8c99bb0a5c,4706a0c6b89f62aa2c6b8ed4175fff0d43b32f06..a192231e30e63b02a911a9dd8af3d19425087cb7
@@@ -1675,39 -1595,40 +1675,42 @@@ bool Map_SaveSelected( const char* file
        return MapResource_saveFile( MapFormat_forFile( filename ), GlobalSceneGraph().root(), Map_Traverse_Selected, filename );
  }
  
  class ParentSelectedBrushesToEntityWalker : public scene::Graph::Walker
  {
- scene::Node& m_parent;
+       scene::Node& m_parent;
+       mutable bool m_emptyOldParent;
  public:
- ParentSelectedBrushesToEntityWalker( scene::Node& parent ) : m_parent( parent ){
+ ParentSelectedBrushesToEntityWalker( scene::Node& parent ) : m_parent( parent ), m_emptyOldParent( false ){
  }
 +
  bool pre( const scene::Path& path, scene::Instance& instance ) const {
-       if ( path.top().get_pointer() != &m_parent
-                && Node_isPrimitive( path.top() ) ) {
+       if ( path.top().get_pointer() != &m_parent && ( Node_isPrimitive( path.top() ) || m_emptyOldParent ) ) {
                Selectable* selectable = Instance_getSelectable( instance );
-               if ( selectable != 0
-                        && selectable->isSelected()
-                        && path.size() > 1 ) {
+               if ( selectable && selectable->isSelected() && path.size() > 1 ) {
                        return false;
                }
        }
        return true;
  }
 +
  void post( const scene::Path& path, scene::Instance& instance ) const {
-       if ( path.top().get_pointer() != &m_parent
-                && Node_isPrimitive( path.top() ) ) {
+       if ( path.top().get_pointer() == &m_parent )
+               return;
+       if ( Node_isPrimitive( path.top() ) ){
+               m_emptyOldParent = false;
                Selectable* selectable = Instance_getSelectable( instance );
-               if ( selectable != 0
-                        && selectable->isSelected()
-                        && path.size() > 1 ) {
+               if ( selectable && selectable->isSelected() && path.size() > 1 ){
                        scene::Node& parent = path.parent();
-                       if ( &parent != &m_parent ) {
+                       if ( &parent != &m_parent ){
                                NodeSmartReference node( path.top().get() );
-                               Node_getTraversable( parent )->erase( node );
+                               scene::Traversable* traversable_parent = Node_getTraversable( parent );
+                               traversable_parent->erase( node );
                                Node_getTraversable( m_parent )->insert( node );
+                               if ( traversable_parent->empty() )
+                                       m_emptyOldParent = true;
                        }
                }
        }
index 45c684b200ed2d42eff9a801dc9128ae00123c38,14dfab422bafd618d75be502b46402e47cdb8cbd..2b4ad1843dce5bd505e1653fe074a85936775a9e
@@@ -366,16 -304,13 +366,14 @@@ int m_uniformTextureMinSize
                }
        }
  }
 +
  */
- void getTextureWH( qtexture_t* tex, int *width, int *height ){
+ void getTextureWH( qtexture_t* tex, int &W, int &H ){
                // Don't use uniform size
-               *width = (int)( tex->width * ( (float)m_textureScale / 100 ) );
-               *height = (int)( tex->height * ( (float)m_textureScale / 100 ) );
+               W = (int)( tex->width * ( (float)m_textureScale / 100 ) );
+               H = (int)( tex->height * ( (float)m_textureScale / 100 ) );
  
        if ( g_TextureBrowser_fixedSize ){
-               int W = *width;
-               int H = *height;
                if      ( W >= H ) {
                        // Texture is square, or wider than it is tall
                        if ( W >= m_uniformTextureSize ){
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge