]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Radiant:
authorGarux <garux@mail.ru>
Tue, 1 Aug 2017 11:25:41 +0000 (14:25 +0300)
committerGarux <garux@mail.ru>
Tue, 1 Aug 2017 11:25:41 +0000 (14:25 +0300)
misc...
* made shaderplug msg to look not like error (but barely noticeable)
* removed Texdef_FitTexture copypasted code
* ctrl+shift+mouse strafe mode: moving mouse forward moves camera forward, back - back
* add map to recent ones on SaveMap (instead of doing that in 'open by cmd line': spoils the list)
* fix: spin buttons alignment in patch inspector
* fix: patch inspector window pos save/restore during run time
* removed console, texbro buttons in regular layout
* ent inspector: saving window splits pos in non regular layouts
* ent inspector: saving lower split pos aswell
* ent inspector: fix of: minimizing part behind middle to 0
* saving find/replace wnd pos; bringing ontop, if is (present + called)
* moved 'find unique name for' output to _DEBUG
* fix of 'GLib-CRITICAL **: Source ID was not found when attempting to remove it' in buid monitor timer
* fix: build menu customizing: command field is reachable right after creating new entry

19 files changed:
libs/uniquenames.h
radiant/brush.h
radiant/brush_primit.cpp
radiant/brush_primit.h
radiant/brushmanip.cpp
radiant/brushmanip.h
radiant/build.cpp
radiant/camwindow.cpp
radiant/entityinspector.cpp
radiant/findtexturedialog.cpp
radiant/gtkdlgs.cpp
radiant/mainframe.cpp
radiant/map.cpp
radiant/patchdialog.cpp
radiant/select.cpp
radiant/select.h
radiant/surfacedialog.cpp
radiant/texwindow.cpp
radiant/watchbsp.cpp

index 8ff67f15b55150829fa103413b03593d4e3f1992..9f89ba4556bdc2352517946c3eadf3f6b8d1a04c 100644 (file)
@@ -187,17 +187,25 @@ name_t make_unique( const name_t& name ) const {
        char buf[80];
        name_t r( "","" );
        name_write( buf, name );
+       #ifdef _DEBUG
        globalErrorStream() << "find unique name for " << buf << "\n";
        globalErrorStream() << "> currently registered names:\n";
+       #endif
        for ( names_t::const_iterator i = m_names.begin(); i != m_names.end(); ++i )
        {
+               #ifdef _DEBUG
                globalErrorStream() << ">> " << i->first.c_str() << ": ";
+               #endif
                for ( PostFixes::postfixes_t::const_iterator j = i->second.m_postfixes.begin(); j != i->second.m_postfixes.end(); ++j )
                {
                        j->first.write( buf );
+                       #ifdef _DEBUG
                        globalErrorStream() << " '" << buf << "'";
+                       #endif
                }
+               #ifdef _DEBUG
                globalErrorStream() << "\n";
+               #endif
        }
        names_t::const_iterator i = m_names.find( name.first );
        if ( i == m_names.end() ) {
@@ -208,7 +216,9 @@ name_t make_unique( const name_t& name ) const {
                r = name_t( name.first, ( *i ).second.make_unique( name.second ) );
        }
        name_write( buf, r );
+       #ifdef _DEBUG
        globalErrorStream() << "> unique name is " << buf << "\n";
+       #endif
        return r;
 }
 
index 5504f954a5531a76005f844128e457a8e424e414..0fb6ffe225c2b0d3dbe45d0a8b3d5fb08a07079f 100644 (file)
@@ -598,14 +598,6 @@ void fit( const Vector3& normal, const Winding& winding, float s_repeat, float t
        Texdef_FitTexture( m_projection, m_shader.width(), m_shader.height(), normal, winding, s_repeat, t_repeat );
 }
 
-void fitW( const Vector3& normal, const Winding& winding, float s_repeat, float t_repeat ){
-       Texdef_FitTextureW( m_projection, m_shader.width(), m_shader.height(), normal, winding, s_repeat, t_repeat );
-}
-
-void fitH( const Vector3& normal, const Winding& winding, float s_repeat, float t_repeat ){
-       Texdef_FitTextureH( m_projection, m_shader.width(), m_shader.height(), normal, winding, s_repeat, t_repeat );
-}
-
 void emitTextureCoordinates( Winding& winding, const Vector3& normal, const Matrix4& localToWorld ){
        Texdef_EmitTextureCoordinates( m_projection, m_shader.width(), m_shader.height(), winding, normal, localToWorld );
 }
@@ -1207,18 +1199,6 @@ void FitTexture( float s_repeat, float t_repeat ){
        texdefChanged();
 }
 
-void FitTextureW( float s_repeat, float t_repeat ){
-       undoSave();
-       m_texdef.fitW( m_plane.plane3().normal(), m_winding, s_repeat, t_repeat );
-       texdefChanged();
-}
-
-void FitTextureH( float s_repeat, float t_repeat ){
-       undoSave();
-       m_texdef.fitH( m_plane.plane3().normal(), m_winding, s_repeat, t_repeat );
-       texdefChanged();
-}
-
 void EmitTextureCoordinates(){
        Texdef_EmitTextureCoordinates( m_texdefTransformed, m_shader.width(), m_shader.height(), m_winding, plane3().normal(), g_matrix4_identity );
 }
index 85ee1e46ebbb95de2502733ad8aad23efba94ae8..3e7e47752aec46069598b08949dc5760e169855a 100644 (file)
@@ -1108,90 +1108,28 @@ void Texdef_FitTexture( TextureProjection& projection, std::size_t width, std::s
        bounds.extents.z() = 1;
 
        // the bounds of a perfectly fitted texture transform
-       AABB perfect( Vector3( s_repeat * 0.5, t_repeat * 0.5, 0 ), Vector3( s_repeat * 0.5, t_repeat * 0.5, 1 ) );
-
-       // the difference between the current texture transform and the perfectly fitted transform
-       Matrix4 matrix( matrix4_translation_for_vec3( bounds.origin - perfect.origin ) );
-       matrix4_pivoted_scale_by_vec3( matrix, bounds.extents / perfect.extents, perfect.origin );
-       matrix4_affine_invert( matrix );
-
-       // apply the difference to the current texture transform
-       matrix4_premultiply_by_matrix4( st2tex, matrix );
-
-       Texdef_fromTransform( projection, (float)width, (float)height, st2tex );
-       Texdef_normalise( projection, (float)width, (float)height );
-}
-
-void Texdef_FitTextureW( TextureProjection& projection, std::size_t width, std::size_t height, const Vector3& normal, const Winding& w, float s_repeat, float t_repeat ){
-       if ( w.numpoints < 3 ) {
-               return;
+       AABB perfect;
+       if( t_repeat == 0 && s_repeat == 0 ){
+               //bad user's input
+               t_repeat = s_repeat = 1;
+               perfect.origin = Vector3( s_repeat * 0.5, t_repeat * 0.5, 0 );
+               perfect.extents = Vector3( s_repeat * 0.5, t_repeat * 0.5, 1 );
+       }
+       if( t_repeat == 0 ){
+               //fit width
+               perfect.origin = Vector3( s_repeat * 0.5, s_repeat * 0.5 * bounds.extents.y() / bounds.extents.x(), 0 );
+               perfect.extents = Vector3( s_repeat * 0.5, s_repeat * 0.5 * bounds.extents.y() / bounds.extents.x(), 1 );
+       }
+       else if( s_repeat == 0 ){
+               //fit height
+               perfect.origin = Vector3( t_repeat * 0.5 * bounds.extents.x() / bounds.extents.y(), t_repeat * 0.5, 0 );
+               perfect.extents = Vector3( t_repeat * 0.5 * bounds.extents.x() / bounds.extents.y(), t_repeat * 0.5, 1 );
+       }
+       else{
+               perfect.origin = Vector3( s_repeat * 0.5, t_repeat * 0.5, 0 );
+               perfect.extents = Vector3( s_repeat * 0.5, t_repeat * 0.5, 1 );
        }
 
-       Matrix4 st2tex;
-       Texdef_toTransform( projection, (float)width, (float)height, st2tex );
-
-       // the current texture transform
-       Matrix4 local2tex = st2tex;
-       {
-               Matrix4 xyz2st;
-               Texdef_basisForNormal( projection, normal, xyz2st );
-               matrix4_multiply_by_matrix4( local2tex, xyz2st );
-       }
-
-       // the bounds of the current texture transform
-       AABB bounds;
-       for ( Winding::const_iterator i = w.begin(); i != w.end(); ++i )
-       {
-               Vector3 texcoord = matrix4_transformed_point( local2tex, ( *i ).vertex );
-               aabb_extend_by_point_safe( bounds, texcoord );
-       }
-       bounds.origin.z() = 0;
-       bounds.extents.z() = 1;
-
-       // the bounds of a perfectly fitted texture transform
-       AABB perfect( Vector3( s_repeat * 0.5, s_repeat * 0.5 * bounds.extents.y() / bounds.extents.x(), 0 ), Vector3( s_repeat * 0.5, s_repeat * 0.5 * bounds.extents.y() / bounds.extents.x(), 1 ) );
-
-       // the difference between the current texture transform and the perfectly fitted transform
-       Matrix4 matrix( matrix4_translation_for_vec3( bounds.origin - perfect.origin ) );
-       matrix4_pivoted_scale_by_vec3( matrix, bounds.extents / perfect.extents, perfect.origin );
-       matrix4_affine_invert( matrix );
-
-       // apply the difference to the current texture transform
-       matrix4_premultiply_by_matrix4( st2tex, matrix );
-
-       Texdef_fromTransform( projection, (float)width, (float)height, st2tex );
-       Texdef_normalise( projection, (float)width, (float)height );
-}
-
-void Texdef_FitTextureH( TextureProjection& projection, std::size_t width, std::size_t height, const Vector3& normal, const Winding& w, float s_repeat, float t_repeat ){
-       if ( w.numpoints < 3 ) {
-               return;
-       }
-
-       Matrix4 st2tex;
-       Texdef_toTransform( projection, (float)width, (float)height, st2tex );
-
-       // the current texture transform
-       Matrix4 local2tex = st2tex;
-       {
-               Matrix4 xyz2st;
-               Texdef_basisForNormal( projection, normal, xyz2st );
-               matrix4_multiply_by_matrix4( local2tex, xyz2st );
-       }
-
-       // the bounds of the current texture transform
-       AABB bounds;
-       for ( Winding::const_iterator i = w.begin(); i != w.end(); ++i )
-       {
-               Vector3 texcoord = matrix4_transformed_point( local2tex, ( *i ).vertex );
-               aabb_extend_by_point_safe( bounds, texcoord );
-       }
-       bounds.origin.z() = 0;
-       bounds.extents.z() = 1;
-
-       // the bounds of a perfectly fitted texture transform
-       AABB perfect( Vector3( t_repeat * 0.5 * bounds.extents.x() / bounds.extents.y(), t_repeat * 0.5, 0 ), Vector3( t_repeat * 0.5 * bounds.extents.x() / bounds.extents.y(), t_repeat * 0.5, 1 ) );
-
        // the difference between the current texture transform and the perfectly fitted transform
        Matrix4 matrix( matrix4_translation_for_vec3( bounds.origin - perfect.origin ) );
        matrix4_pivoted_scale_by_vec3( matrix, bounds.extents / perfect.extents, perfect.origin );
index 5e68c1463e8c4c62c08759fdee7c74659158285e..79d27f3e98c188e0be76d9da19bca09bd115d859 100644 (file)
@@ -106,8 +106,6 @@ void Texdef_Shift( TextureProjection& projection, float s, float t );
 void Texdef_Scale( TextureProjection& projection, float s, float t );
 void Texdef_Rotate( TextureProjection& projection, float angle );
 void Texdef_FitTexture( TextureProjection& projection, std::size_t width, std::size_t height, const Vector3& normal, const Winding& w, float s_repeat, float t_repeat );
-void Texdef_FitTextureW( TextureProjection& projection, std::size_t width, std::size_t height, const Vector3& normal, const Winding& w, float s_repeat, float t_repeat );
-void Texdef_FitTextureH( TextureProjection& projection, std::size_t width, std::size_t height, const Vector3& normal, const Winding& w, float s_repeat, float t_repeat );
 void Texdef_EmitTextureCoordinates( const TextureProjection& projection, std::size_t width, std::size_t height, Winding& w, const Vector3& normal, const Matrix4& localToWorld );
 
 void ShiftScaleRotate_fromFace( texdef_t& shiftScaleRotate, const TextureProjection& projection );
index 0502e988ec77d7041bbe14902161e6bdb0429c15..090ab4cf832b2eb5c5ed6321721122761af8e1a7 100644 (file)
@@ -631,28 +631,6 @@ void operator()( Face& face ) const {
 }
 };
 
-class FaceFitTextureW
-{
-float m_s_repeat, m_t_repeat;
-public:
-FaceFitTextureW( float s_repeat, float t_repeat ) : m_s_repeat( s_repeat ), m_t_repeat( t_repeat ){
-}
-void operator()( Face& face ) const {
-       face.FitTextureW( m_s_repeat, m_t_repeat );
-}
-};
-
-class FaceFitTextureH
-{
-float m_s_repeat, m_t_repeat;
-public:
-FaceFitTextureH( float s_repeat, float t_repeat ) : m_s_repeat( s_repeat ), m_t_repeat( t_repeat ){
-}
-void operator()( Face& face ) const {
-       face.FitTextureH( m_s_repeat, m_t_repeat );
-}
-};
-
 void Scene_BrushFitTexture_Selected( scene::Graph& graph, float s_repeat, float t_repeat ){
        Scene_ForEachSelectedBrush_ForEachFace( graph, FaceFitTexture( s_repeat, t_repeat ) );
        SceneChangeNotify();
@@ -663,26 +641,6 @@ void Scene_BrushFitTexture_Component_Selected( scene::Graph& graph, float s_repe
        SceneChangeNotify();
 }
 
-void Scene_BrushFitTexture_SelectedW( scene::Graph& graph, float s_repeat, float t_repeat ){
-       Scene_ForEachSelectedBrush_ForEachFace( graph, FaceFitTextureW( s_repeat, t_repeat ) );
-       SceneChangeNotify();
-}
-
-void Scene_BrushFitTexture_Component_SelectedW( scene::Graph& graph, float s_repeat, float t_repeat ){
-       Scene_ForEachSelectedBrushFace( graph, FaceFitTextureW( s_repeat, t_repeat ) );
-       SceneChangeNotify();
-}
-
-void Scene_BrushFitTexture_SelectedH( scene::Graph& graph, float s_repeat, float t_repeat ){
-       Scene_ForEachSelectedBrush_ForEachFace( graph, FaceFitTextureH( s_repeat, t_repeat ) );
-       SceneChangeNotify();
-}
-
-void Scene_BrushFitTexture_Component_SelectedH( scene::Graph& graph, float s_repeat, float t_repeat ){
-       Scene_ForEachSelectedBrushFace( graph, FaceFitTextureH( s_repeat, t_repeat ) );
-       SceneChangeNotify();
-}
-
 TextureProjection g_defaultTextureProjection;
 const TextureProjection& TextureTransform_getDefault(){
        TexDef_Construct_Default( g_defaultTextureProjection );
index f26e68abb4cd0c79509dd3e90205a070929cc960..06f672710fd1f193b35497d2fb311f40f034e4ac 100644 (file)
@@ -70,10 +70,6 @@ void Scene_BrushSelectByShader( scene::Graph& graph, const char* name );
 void Scene_BrushSelectByShader_Component( scene::Graph& graph, const char* name );
 void Scene_BrushFitTexture_Selected( scene::Graph& graph, float s_repeat, float t_repeat );
 void Scene_BrushFitTexture_Component_Selected( scene::Graph& graph, float s_repeat, float t_repeat );
-void Scene_BrushFitTexture_SelectedW( scene::Graph& graph, float s_repeat, float t_repeat );
-void Scene_BrushFitTexture_Component_SelectedW( scene::Graph& graph, float s_repeat, float t_repeat );
-void Scene_BrushFitTexture_SelectedH( scene::Graph& graph, float s_repeat, float t_repeat );
-void Scene_BrushFitTexture_Component_SelectedH( scene::Graph& graph, float s_repeat, float t_repeat );
 
 typedef struct _GtkMenu GtkMenu;
 void Brush_constructMenu( GtkMenu* menu );
index 073e0ddf12049b467afdb4b7b32a0cbec375e8b5..793ab5a55ddce6ab9ef57acee19358065a7e9454 100644 (file)
@@ -671,6 +671,7 @@ class ProjectList
 public:
 Project& m_project;
 GtkListStore* m_store;
+GtkWidget* m_buildView;
 bool m_changed;
 ProjectList( Project& project ) : m_project( project ), m_changed( false ){
 }
@@ -706,6 +707,8 @@ gboolean project_cell_edited( GtkCellRendererText* cell, gchar* path_string, gch
                gtk_list_store_set( projectList->m_store, &iter, 0, new_text, -1 );
                GtkTreeIter lastIter;
                gtk_list_store_append( projectList->m_store, &lastIter );
+               //make command field activatable
+               g_signal_emit_by_name( G_OBJECT( gtk_tree_view_get_selection( GTK_TREE_VIEW( projectList->m_buildView ) ) ), "changed" );
        }
 
        gtk_tree_path_free( path );
@@ -894,6 +897,7 @@ GtkWindow* BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                        gtk_widget_show( view );
 
                                        buildView = view;
+                                       projectList.m_buildView = buildView;
                                        projectList.m_store = store;
                                        gtk_container_add( GTK_CONTAINER( scr ), view );
 
index 9a9e6bf25ec825b5f1b2321f6b9f796cc5d42c8c..462812959e0a256af15109c1893c7c2357687f23 100644 (file)
@@ -280,7 +280,7 @@ void Camera_FreeMove( camera_t& camera, int dx, int dy ){
 
                camera.origin -= camera.vright * strafespeed * dx;
                if ( camera.m_strafe_forward ) {
-                       camera.origin += camera.vpn * strafespeed * dy;
+                       camera.origin -= camera.vpn * strafespeed * dy;
                }
                else{
                        camera.origin += camera.vup * strafespeed * dy;
index 407aaa1a000a76503b4dfd1aebcef777af252940..e187d8030fd8158ab64b713c52745c53ef9ac029 100644 (file)
@@ -715,8 +715,10 @@ typedef MemberCaller<ListAttribute, &ListAttribute::update> UpdateCaller;
 
 namespace
 {
+GtkWidget* g_entity_split0 = 0;
 GtkWidget* g_entity_split1 = 0;
 GtkWidget* g_entity_split2 = 0;
+int g_entitysplit0_position;
 int g_entitysplit1_position;
 int g_entitysplit2_position;
 
@@ -1322,18 +1324,18 @@ static gint EntityEntry_keypress( GtkEntry* widget, GdkEventKey* event, gpointer
 }
 
 void EntityInspector_destroyWindow( GtkWidget* widget, gpointer data ){
+       g_entitysplit0_position = gtk_paned_get_position( GTK_PANED( g_entity_split0 ) );
        g_entitysplit1_position = gtk_paned_get_position( GTK_PANED( g_entity_split1 ) );
        g_entitysplit2_position = gtk_paned_get_position( GTK_PANED( g_entity_split2 ) );
-
        g_entityInspector_windowConstructed = false;
        GlobalEntityAttributes_clear();
 }
 
-static gint EntityInspector_destroyWindowKB( GtkWidget* widget, GdkEventKey* event, gpointer data ){
+static gint EntityInspector_hideWindowKB( GtkWidget* widget, GdkEventKey* event, gpointer data ){
        //if ( event->keyval == GDK_Escape && GTK_WIDGET_VISIBLE( GTK_WIDGET( widget ) ) ) {
        if ( event->keyval == GDK_Escape  ) {
-               //globalErrorStream() << "Doom3Light_getBounds: failed to parse default light radius\n";
-               GroupDialog_showPage( g_page_entity );
+               //GroupDialog_showPage( g_page_entity );
+               gtk_widget_hide( GTK_WIDGET( GroupDialog_getWindow() ) );
                return TRUE;
        }
        if ( event->keyval == GDK_Tab  ) {
@@ -1348,7 +1350,7 @@ GtkWidget* EntityInspector_constructWindow( GtkWindow* toplevel ){
        gtk_widget_show( vbox );
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 2 );
 
-       g_signal_connect( G_OBJECT( toplevel ), "key_press_event", G_CALLBACK( EntityInspector_destroyWindowKB ), 0 );
+       g_signal_connect( G_OBJECT( toplevel ), "key_press_event", G_CALLBACK( EntityInspector_hideWindowKB ), 0 );
        g_signal_connect( G_OBJECT( vbox ), "destroy", G_CALLBACK( EntityInspector_destroyWindow ), 0 );
 
        {
@@ -1360,7 +1362,8 @@ GtkWidget* EntityInspector_constructWindow( GtkWindow* toplevel ){
 
                {
                        GtkWidget* split2 = gtk_vpaned_new();
-                       gtk_paned_add1( GTK_PANED( split1 ), split2 );
+                       //gtk_paned_add1( GTK_PANED( split1 ), split2 );
+                       gtk_paned_pack1( GTK_PANED( split1 ), split2, FALSE, FALSE );
                        gtk_widget_show( split2 );
 
                        g_entity_split2 = split2;
@@ -1369,7 +1372,8 @@ GtkWidget* EntityInspector_constructWindow( GtkWindow* toplevel ){
                                // class list
                                GtkWidget* scr = gtk_scrolled_window_new( 0, 0 );
                                gtk_widget_show( scr );
-                               gtk_paned_add1( GTK_PANED( split2 ), scr );
+                               //gtk_paned_add1( GTK_PANED( split2 ), scr );
+                               gtk_paned_pack1( GTK_PANED( split2 ), scr, FALSE, FALSE );
                                gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );
                                gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
 
@@ -1406,7 +1410,8 @@ GtkWidget* EntityInspector_constructWindow( GtkWindow* toplevel ){
                        {
                                GtkWidget* scr = gtk_scrolled_window_new( 0, 0 );
                                gtk_widget_show( scr );
-                               gtk_paned_add2( GTK_PANED( split2 ), scr );
+                               //gtk_paned_add2( GTK_PANED( split2 ), scr );
+                               gtk_paned_pack2( GTK_PANED( split2 ), scr, FALSE, FALSE );
                                gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );
                                gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
 
@@ -1423,14 +1428,16 @@ GtkWidget* EntityInspector_constructWindow( GtkWindow* toplevel ){
                }
 
                {
-                       GtkWidget* split2 = gtk_vpaned_new();
-                       gtk_paned_add2( GTK_PANED( split1 ), split2 );
-                       gtk_widget_show( split2 );
+                       GtkWidget* split0 = gtk_vpaned_new();
+                       //gtk_paned_add2( GTK_PANED( split1 ), split0 );
+                       gtk_paned_pack2( GTK_PANED( split1 ), split0, FALSE, FALSE );
+                       gtk_widget_show( split0 );
+                       g_entity_split0 = split0;
 
                        {
                                GtkWidget* vbox2 = gtk_vbox_new( FALSE, 2 );
                                gtk_widget_show( vbox2 );
-                               gtk_paned_pack1( GTK_PANED( split2 ), vbox2, FALSE, FALSE );
+                               gtk_paned_pack1( GTK_PANED( split0 ), vbox2, FALSE, FALSE );
 
                                {
                                        // Spawnflags (4 colums wide max, or window gets too wide.)
@@ -1575,27 +1582,23 @@ GtkWidget* EntityInspector_constructWindow( GtkWindow* toplevel ){
 
                                gtk_container_add( GTK_CONTAINER( viewport ), GTK_WIDGET( g_attributeBox ) );
                                gtk_container_add( GTK_CONTAINER( scr ), viewport );
-                               gtk_paned_pack2( GTK_PANED( split2 ), scr, FALSE, FALSE );
+                               gtk_paned_pack2( GTK_PANED( split0 ), scr, FALSE, FALSE );
                        }
                }
        }
 
 
        {
-               // show the sliders in any case
-               if ( g_entitysplit2_position > 22 ) {
-                       gtk_paned_set_position( GTK_PANED( g_entity_split2 ), g_entitysplit2_position );
-               }
-               else {
+               // show the sliders in any case //no need, gtk can care
+               /*if ( g_entitysplit2_position < 22 ) {
                        g_entitysplit2_position = 22;
-                       gtk_paned_set_position( GTK_PANED( g_entity_split2 ), 22 );
-               }
-               if ( ( g_entitysplit1_position - g_entitysplit2_position ) > 27 ) {
-                       gtk_paned_set_position( GTK_PANED( g_entity_split1 ), g_entitysplit1_position );
-               }
-               else {
-                       gtk_paned_set_position( GTK_PANED( g_entity_split1 ), g_entitysplit2_position + 27 );
-               }
+               }*/
+               gtk_paned_set_position( GTK_PANED( g_entity_split2 ), g_entitysplit2_position );
+               /*if ( ( g_entitysplit1_position - g_entitysplit2_position ) < 27 ) {
+                       g_entitysplit1_position = g_entitysplit2_position + 27;
+               }*/
+               gtk_paned_set_position( GTK_PANED( g_entity_split1 ), g_entitysplit1_position );
+               gtk_paned_set_position( GTK_PANED( g_entity_split0 ), g_entitysplit0_position );
        }
 
        g_entityInspector_windowConstructed = true;
@@ -1643,6 +1646,7 @@ EntityInspector g_EntityInspector;
 void EntityInspector_construct(){
        GlobalEntityClassManager().attach( g_EntityInspector );
 
+       GlobalPreferenceSystem().registerPreference( "EntitySplit0", IntImportStringCaller( g_entitysplit0_position ), IntExportStringCaller( g_entitysplit0_position ) );
        GlobalPreferenceSystem().registerPreference( "EntitySplit1", IntImportStringCaller( g_entitysplit1_position ), IntExportStringCaller( g_entitysplit1_position ) );
        GlobalPreferenceSystem().registerPreference( "EntitySplit2", IntImportStringCaller( g_entitysplit2_position ), IntExportStringCaller( g_entitysplit2_position ) );
 
index 5fd58f7c426a7a1f0a001e3fdee569497918f3e6..37379c57834cf4cc06c3822c3ba2bf7e03bbc31c 100644 (file)
@@ -56,6 +56,7 @@
 class FindTextureDialog : public Dialog
 {
 public:
+WindowPositionTracker m_position_tracker;
 static void setReplaceStr( const char* name );
 static void setFindStr( const char* name );
 static bool isOpen();
@@ -132,6 +133,7 @@ static gint replace_focus_in( GtkWidget* widget, GdkEventFocus *event, gpointer
 
 FindTextureDialog::FindTextureDialog(){
        m_bSelectedOnly = FALSE;
+       //m_position_tracker.setPosition( c_default_window_pos );
 }
 
 FindTextureDialog::~FindTextureDialog(){
@@ -143,6 +145,8 @@ GtkWindow* FindTextureDialog::BuildDialog(){
 
        GtkWindow* dlg = create_floating_window( "Find / Replace Texture(s)", m_parent );
 
+       m_position_tracker.connect( dlg );
+
        hbox = gtk_hbox_new( FALSE, 5 );
        gtk_widget_show( hbox );
        gtk_container_add( GTK_CONTAINER( dlg ), GTK_WIDGET( hbox ) );
@@ -247,7 +251,10 @@ void FindTextureDialog::setReplaceStr( const char* name ){
 }
 
 void FindTextureDialog::show(){
+       // workaround for strange gtk behaviour - modifying the contents of a window while it is not visible causes the window position to change without sending a configure_event
+       g_FindTextureDialog.m_position_tracker.sync( g_FindTextureDialog.GetWidget() );
        g_FindTextureDialog.ShowDlg();
+       gtk_window_present( g_FindTextureDialog.GetWidget() );
 }
 
 
@@ -267,8 +274,11 @@ void FindTextureDialog_selectTexture( const char* name ){
        g_FindTextureDialog.updateTextures( name );
 }
 
+#include "preferencesystem.h"
+
 void FindTextureDialog_Construct(){
        GlobalCommands_insert( "FindReplaceTextures", FindTextureDialog::ShowCaller() );
+       GlobalPreferenceSystem().registerPreference( "FindReplacehWnd", WindowPositionTrackerImportStringCaller( g_FindTextureDialog.m_position_tracker ), WindowPositionTrackerExportStringCaller( g_FindTextureDialog.m_position_tracker ) );
 }
 
 void FindTextureDialog_Destroy(){
index 8cc7aeb6282e2f02f8844148304d0f491b74acd6..8f841e5fdacd0a6634686ad9854a141a4062e8cd 100644 (file)
@@ -500,10 +500,12 @@ void DoAbout(){
                                {
                                        GtkButton* button = create_dialog_button( "Credits", G_CALLBACK( about_button_credits ), 0 );
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
+                                       gtk_widget_set_sensitive( GTK_WIDGET( button ), FALSE);
                                }
                                {
                                        GtkButton* button = create_dialog_button( "Changelog", G_CALLBACK( about_button_changelog ), 0 );
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
+                                       gtk_widget_set_sensitive( GTK_WIDGET( button ), FALSE);
                                }
                        }
                }
index 2758e8ee719399a735c36d3e5fd67fa551a10163..c801ccd937ec294ae4c20b81fb390f4e543237bb 100644 (file)
@@ -2338,7 +2338,7 @@ void Clipper_constructToolbar( GtkToolbar* toolbar ){
 }
 
 void XYWnd_constructToolbar( GtkToolbar* toolbar ){
-       toolbar_append_button( toolbar, "Change views", "view_change.png", "NextView" );
+       toolbar_append_button( toolbar, "Change views (CTRL + TAB)", "view_change.png", "NextView" );
 }
 
 void Manipulators_constructToolbar( GtkToolbar* toolbar ){
@@ -2379,7 +2379,7 @@ GtkToolbar* create_main_toolbar( MainFrame::EViewStyle style ){
 
        ComponentModes_constructToolbar( toolbar );
 
-       if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft || style == MainFrame::eFloating ) {
+       if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft ) {
                gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
 
                XYWnd_constructToolbar( toolbar );
@@ -2406,21 +2406,18 @@ GtkToolbar* create_main_toolbar( MainFrame::EViewStyle style ){
        gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
 
        GtkButton* g_view_entities_button = toolbar_append_button( toolbar, "Entities (N)", "entities.png", "ToggleEntityInspector" );
-       GtkButton* g_view_console_button = toolbar_append_button( toolbar, "Console (O)", "console.png", "ToggleConsole" );
-       GtkButton* g_view_textures_button = toolbar_append_button( toolbar, "Texture Browser (T)", "texture_browser.png", "ToggleTextures" );
+       // disable the console and texture button in the regular layouts
+       if ( style != MainFrame::eRegular && style != MainFrame::eRegularLeft ) {
+               GtkButton* g_view_console_button = toolbar_append_button( toolbar, "Console (O)", "console.png", "ToggleConsole" );
+               GtkButton* g_view_textures_button = toolbar_append_button( toolbar, "Texture Browser (T)", "texture_browser.png", "ToggleTextures" );
+       }
+
        // TODO: call light inspector
        //GtkButton* g_view_lightinspector_button = toolbar_append_button(toolbar, "Light Inspector", "lightinspector.png", "ToggleLightInspector");
 
        gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
        GtkButton* g_refresh_models_button = toolbar_append_button( toolbar, "Refresh Models", "refresh_models.png", "RefreshReferences" );
 
-
-       // disable the console and texture button in the regular layouts
-       if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft ) {
-               gtk_widget_set_sensitive( GTK_WIDGET( g_view_console_button ), FALSE );
-               gtk_widget_set_sensitive( GTK_WIDGET( g_view_textures_button ), FALSE );
-       }
-
        return toolbar;
 }
 
@@ -2820,6 +2817,10 @@ void MainFrame::Create(){
        gtk_box_pack_end( GTK_BOX( vbox ), main_statusbar, FALSE, TRUE, 2 );
 
        GroupDialog_constructWindow( window );
+
+       /* want to realize it immediately; otherwise gtk paned splits positions wont be set correctly for floating group dlg */
+       gtk_widget_realize ( GTK_WIDGET( GroupDialog_getWindow() ) );
+
        g_page_entity = GroupDialog_addPage( "Entities", EntityInspector_constructWindow( GroupDialog_getWindow() ), RawStringExportCaller( "Entities" ) );
 
        if ( FloatingGroupDialog() ) {
index e664667bb0860f50478a41593a14323c19b775aa..a66229b73435b69dba3893e911c061f7068135a4 100644 (file)
@@ -1842,6 +1842,9 @@ void SaveMap(){
        }
        else if ( Map_Modified( g_map ) ) {
                Map_Save();
+#ifdef WIN32
+               MRU_AddFile( g_map.m_name.c_str() );    //add on saving, but not opening via cmd line: spoils the list
+#endif
        }
 }
 
index 62822dc2cf702e422893d8955afb0bd8d70d25ea..7ce797e7c0a8f6acd426c017db10af7ee73cf57d 100644 (file)
@@ -301,6 +301,8 @@ void PatchInspector_queueDraw(){
 void DoPatchInspector(){
        g_PatchInspector.GetPatchInfo();
        if ( !g_PatchInspector.visible() ) {
+               // workaround for strange gtk behaviour - modifying the contents of a window while it is not visible causes the window position to change without sending a configure_event
+               g_PatchInspector.m_position_tracker.sync( g_PatchInspector.GetWidget() );
                g_PatchInspector.ShowDlg();
        }
 }
@@ -907,7 +909,7 @@ GtkWindow* PatchInspector::BuildDialog(){
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
+                                                       gtk_widget_set_usize( GTK_WIDGET( spin ), 16, -2 );
                                                        GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
                                                }
                                                {
@@ -928,7 +930,7 @@ GtkWindow* PatchInspector::BuildDialog(){
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
+                                                       gtk_widget_set_usize( GTK_WIDGET( spin ), 16, -2 );
                                                        GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
                                                }
                                                {
@@ -949,7 +951,7 @@ GtkWindow* PatchInspector::BuildDialog(){
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
+                                                       gtk_widget_set_usize( GTK_WIDGET( spin ), 16, -2 );
                                                        GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
                                                }
                                                {
@@ -970,7 +972,7 @@ GtkWindow* PatchInspector::BuildDialog(){
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 3, 4,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
+                                                       gtk_widget_set_usize( GTK_WIDGET( spin ), 16, -2 );
                                                        GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
                                                }
                                                {
@@ -991,7 +993,7 @@ GtkWindow* PatchInspector::BuildDialog(){
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 4, 5,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
+                                                       gtk_widget_set_usize( GTK_WIDGET( spin ), 16, -2 );
                                                        GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
                                                }
                                        }
index 4c9b30f9bdd6ae019e8183ec95c45767d95ee95a..175af349eed067fd706e985384f6e41a2a798d0a 100644 (file)
@@ -692,24 +692,6 @@ void Select_FitTexture( float horizontal, float vertical ){
        SceneChangeNotify();
 }
 
-void Select_FitTextureW( float horizontal, float vertical ){
-       if ( GlobalSelectionSystem().Mode() != SelectionSystem::eComponent ) {
-               Scene_BrushFitTexture_SelectedW( GlobalSceneGraph(), horizontal, vertical );
-       }
-       Scene_BrushFitTexture_Component_SelectedW( GlobalSceneGraph(), horizontal, vertical );
-
-       SceneChangeNotify();
-}
-
-void Select_FitTextureH( float horizontal, float vertical ){
-       if ( GlobalSelectionSystem().Mode() != SelectionSystem::eComponent ) {
-               Scene_BrushFitTexture_SelectedH( GlobalSceneGraph(), horizontal, vertical );
-       }
-       Scene_BrushFitTexture_Component_SelectedH( GlobalSceneGraph(), horizontal, vertical );
-
-       SceneChangeNotify();
-}
-
 inline void hide_node( scene::Node& node, bool hide ){
        hide
        ? node.enable( scene::Node::eHidden )
index cc5660e748f863bd165042be9b9b3f12a0745398..4a158fd41d86994e629d507ccd15ba2f8a693741 100644 (file)
@@ -62,8 +62,6 @@ void Select_RotateTexture( float amt );
 void Select_ScaleTexture( float x, float y );
 void Select_ShiftTexture( float x, float y );
 void Select_FitTexture( float horizontal = 1, float vertical = 1 );
-void Select_FitTextureW( float horizontal = 1, float vertical = 1 );
-void Select_FitTextureH( float horizontal = 1, float vertical = 1 );
 void FindReplaceTextures( const char* pFind, const char* pReplace, bool bSelected );
 
 void HideSelected();
index 55946cfe2704ee72148319766f3e3c59b50f86b5..d0ff4c1c719719da656c5b2312b3b608a53cc3d3 100644 (file)
@@ -422,7 +422,7 @@ void DoSurface( void ){
 
        }
        getSurfaceInspector().Update();
-       getSurfaceInspector().importData();
+       //getSurfaceInspector().importData(); //happens in .ShowDlg() anyway
        getSurfaceInspector().ShowDlg();
 }
 
@@ -443,12 +443,12 @@ void SurfaceInspector_FitTexture(){
 
 void SurfaceInspector_FitTextureW(){
        UndoableCommand undo( "textureAutoFitW" );
-       Select_FitTextureW( getSurfaceInspector().m_fitHorizontal, getSurfaceInspector().m_fitVertical );
+       Select_FitTexture( getSurfaceInspector().m_fitHorizontal, 0 );
 }
 
 void SurfaceInspector_FitTextureH(){
        UndoableCommand undo( "textureAutoFitH" );
-       Select_FitTextureH( getSurfaceInspector().m_fitHorizontal, getSurfaceInspector().m_fitVertical );
+       Select_FitTexture( 0, getSurfaceInspector().m_fitVertical );
 }
 
 static void OnBtnPatchdetails( GtkWidget *widget, gpointer data ){
index 36d6eb84cc14c31629a14f09510064492b427364..afdba8111c61a50da39f79cc87858570775ccd14 100644 (file)
@@ -2019,7 +2019,7 @@ void TextureBrowser_checkTagFile(){
                }
                else
                {
-                       globalErrorStream() << "Unable to find default tag file " << default_filename.c_str() << ". No tag support.\n";
+                       globalOutputStream() << "Unable to find default tag file " << default_filename.c_str() << ". No tag support. Plugins -> ShaderPlug -> Create tag file: to start using tags\n";
                }
        }
 }
index a598ff51c3a17205f676bd60209fed5a0ca1d87e..7934825770af0c2e0928304bab1ffa948d7818bf 100644 (file)
@@ -467,7 +467,7 @@ static xmlSAXHandler saxParser = {
 // ------------------------------------------------------------------------------------------------
 
 
-guint s_routine_id;
+guint s_routine_id = 0;
 static gint watchbsp_routine( gpointer data ){
        reinterpret_cast<CWatchBSP*>( data )->RoutineProcessing();
        return TRUE;
@@ -487,8 +487,9 @@ void CWatchBSP::Reset(){
                m_xmlInputBuffer = NULL;
        }
        m_eState = EIdle;
-       if ( s_routine_id ) {
+       if ( s_routine_id != 0 ) {
                gtk_timeout_remove( s_routine_id );
+               s_routine_id = 0;
        }
 }