]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit '23d2497f12fe91a5eb0e14b71095cbb1c2ec80cb' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Tue, 12 Feb 2019 00:43:30 +0000 (01:43 +0100)
committerThomas Debesse <dev@illwieckz.net>
Tue, 12 Feb 2019 00:43:47 +0000 (01:43 +0100)
1  2 
radiant/mainframe.cpp
radiant/plugintoolbar.cpp
radiant/plugintoolbar.h
radiant/texwindow.cpp

index 23632f4c061af653f54b1594ee4e204ea5a174f2,45348b98a24b403bdc84b026bc63799c1fdbb744..93edac9ae9e6f9d95112a37bbd80a0e48d77cfac
@@@ -2922,51 -2775,70 +2922,63 @@@ void MainFrame::Create()
  
        register_shortcuts();
  
 -      GtkMenuBar* main_menu = create_main_menu( CurrentStyle() );
 -      gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( main_menu ), FALSE, FALSE, 0 );
 -
 -      GtkToolbar* main_toolbar = create_main_toolbar( CurrentStyle() );
 -      gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( main_toolbar ), FALSE, FALSE, 0 );
 -
 -
 +    auto main_menu = create_main_menu( CurrentStyle() );
 +      vbox.pack_start( main_menu, FALSE, FALSE, 0 );
  
 +    auto main_toolbar = create_main_toolbar( CurrentStyle() );
 +      vbox.pack_start( main_toolbar, FALSE, FALSE, 0 );
  
-       auto plugin_toolbar = create_plugin_toolbar();
-       if ( !g_Layout_enablePluginToolbar.m_value ) {
-               plugin_toolbar.hide();
-       }
-       if ( g_Layout_enableFilterToolbar.m_value ) {
-               auto space = [&]() {
-                       auto btn = gtk_separator_tool_item_new();
-                               gtk_widget_show(GTK_WIDGET(btn));
-                               gtk_container_add(GTK_CONTAINER(plugin_toolbar), GTK_WIDGET(btn));
-               };
-               space();
-               toolbar_append_toggle_button( plugin_toolbar, "World (ALT + 1)", "f-world.bmp", "FilterWorldBrushes" );
-               toolbar_append_toggle_button( plugin_toolbar, "Details (CTRL + D)", "f-details.bmp", "FilterDetails" );
-               toolbar_append_toggle_button( plugin_toolbar, "Structural (CTRL + SHIFT + D)", "f-structural.bmp", "FilterStructural" );
-               toolbar_append_toggle_button( plugin_toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" );
-               space();
-               toolbar_append_toggle_button( plugin_toolbar, "Areaportals (ALT + 3)", "f-areaportal.bmp", "FilterAreaportals" );
-               toolbar_append_toggle_button( plugin_toolbar, "Translucent (ALT + 4)", "f-translucent.bmp", "FilterTranslucent" );
-               toolbar_append_toggle_button( plugin_toolbar, "Liquids (ALT + 5)", "f-liquids.bmp", "FilterLiquids" );
-               toolbar_append_toggle_button( plugin_toolbar, "Caulk (ALT + 6)", "f-caulk.bmp", "FilterCaulk" );
-               toolbar_append_toggle_button( plugin_toolbar, "Clips (ALT + 7)", "f-clip.bmp", "FilterClips" );
-               toolbar_append_toggle_button( plugin_toolbar, "HintsSkips (CTRL + H)", "f-hint.bmp", "FilterHintsSkips" );
-               //toolbar_append_toggle_button( plugin_toolbar, "Paths (ALT + 8)", "texture_lock.bmp", "FilterPaths" );
-               space();
-               toolbar_append_toggle_button( plugin_toolbar, "Entities (ALT + 2)", "f-entities.bmp", "FilterEntities" );
-               toolbar_append_toggle_button( plugin_toolbar, "Lights (ALT + 0)", "lightinspector.png", "FilterLights" );
-               toolbar_append_toggle_button( plugin_toolbar, "Models (SHIFT + M)", "f-models.bmp", "FilterModels" );
-               toolbar_append_toggle_button( plugin_toolbar, "Triggers (CTRL + SHIFT + T)", "f-triggers.bmp", "FilterTriggers" );
- //            toolbar_append_toggle_button( plugin_toolbar, "Decals (SHIFT + D)", "f-decals.bmp", "FilterDecals" );
-               space();
-               toolbar_append_button( plugin_toolbar, "InvertFilters", "f-invert.bmp", "InvertFilters" );
-               toolbar_append_button( plugin_toolbar, "ResetFilters", "f-reset.bmp", "ResetFilters" );
+       if ( g_Layout_enablePluginToolbar.m_value || g_Layout_enableFilterToolbar.m_value ){
 -              GtkWidget* PFbox = gtk_hbox_new( FALSE, 3 );
 -              gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( PFbox ), FALSE, FALSE, 0 );
 -              gtk_widget_show( PFbox );
++              auto PFbox = ui::HBox( FALSE, 3 );
++              vbox.pack_start( PFbox, FALSE, FALSE, 0 );
++              PFbox.show();
+               if ( g_Layout_enablePluginToolbar.m_value ){
 -                      GtkToolbar* plugin_toolbar = create_plugin_toolbar();
++                      auto plugin_toolbar = create_plugin_toolbar();
+                       if ( g_Layout_enableFilterToolbar.m_value ){
 -                              gtk_box_pack_start( GTK_BOX( PFbox ), GTK_WIDGET( plugin_toolbar ), FALSE, FALSE, 0 );
++                              PFbox.pack_start( plugin_toolbar, FALSE, FALSE, 0 );
+                       }
+                       else{
 -                              gtk_box_pack_start( GTK_BOX( PFbox ), GTK_WIDGET( plugin_toolbar ), TRUE, TRUE, 0 );
++                              PFbox.pack_start( plugin_toolbar, TRUE, TRUE, 0 );
+                       }
+               }
+               if ( g_Layout_enableFilterToolbar.m_value ){
 -                      GtkToolbar* filter_toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
 -                      gtk_widget_show( GTK_WIDGET( filter_toolbar ) );
++                      auto filter_toolbar = create_filter_toolbar();
++                      filter_toolbar.show();
++
++                      auto space = [&]() {
++                              auto btn = gtk_separator_tool_item_new();
++                                      gtk_widget_show(GTK_WIDGET(btn));
++                                      gtk_container_add(GTK_CONTAINER(filter_toolbar), GTK_WIDGET(btn));
++                      };
+                       toolbar_append_toggle_button( filter_toolbar, "World (ALT + 1)", "f-world.bmp", "FilterWorldBrushes" );
+                       toolbar_append_toggle_button( filter_toolbar, "Details (CTRL + D)", "f-details.bmp", "FilterDetails" );
+                       toolbar_append_toggle_button( filter_toolbar, "Structural (CTRL + SHIFT + D)", "f-structural.bmp", "FilterStructural" );
 -                      toolbar_append_toggle_button( filter_toolbar, "Patches (CTRL + P)", "patch_wireframe.bmp", "FilterPatches" );
 -                      gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
++                      toolbar_append_toggle_button( filter_toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" );
++                      space();
+                       toolbar_append_toggle_button( filter_toolbar, "Areaportals (ALT + 3)", "f-areaportal.bmp", "FilterAreaportals" );
+                       toolbar_append_toggle_button( filter_toolbar, "Translucent (ALT + 4)", "f-translucent.bmp", "FilterTranslucent" );
+                       toolbar_append_toggle_button( filter_toolbar, "Liquids (ALT + 5)", "f-liquids.bmp", "FilterLiquids" );
+                       toolbar_append_toggle_button( filter_toolbar, "Caulk (ALT + 6)", "f-caulk.bmp", "FilterCaulk" );
+                       toolbar_append_toggle_button( filter_toolbar, "Clips (ALT + 7)", "f-clip.bmp", "FilterClips" );
+                       toolbar_append_toggle_button( filter_toolbar, "HintsSkips (CTRL + H)", "f-hint.bmp", "FilterHintsSkips" );
+                       //toolbar_append_toggle_button( filter_toolbar, "Paths (ALT + 8)", "texture_lock.bmp", "FilterPaths" );
 -                      gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
++                      space();
+                       toolbar_append_toggle_button( filter_toolbar, "Entities (ALT + 2)", "f-entities.bmp", "FilterEntities" );
 -                      toolbar_append_toggle_button( filter_toolbar, "Lights (ALT + 0)", "lightinspector.bmp", "FilterLights" );
++                      toolbar_append_toggle_button( filter_toolbar, "Lights (ALT + 0)", "lightinspector.png", "FilterLights" );
+                       toolbar_append_toggle_button( filter_toolbar, "Models (SHIFT + M)", "f-models.bmp", "FilterModels" );
+                       toolbar_append_toggle_button( filter_toolbar, "Triggers (CTRL + SHIFT + T)", "f-triggers.bmp", "FilterTriggers" );
+                       //toolbar_append_toggle_button( filter_toolbar, "Decals (SHIFT + D)", "f-decals.bmp", "FilterDecals" );
 -                      gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
++                      space();
+                       toolbar_append_button( filter_toolbar, "InvertFilters", "f-invert.bmp", "InvertFilters" );
+                       toolbar_append_button( filter_toolbar, "ResetFilters", "f-reset.bmp", "ResetFilters" );
 -                      gtk_box_pack_start( GTK_BOX( PFbox ), GTK_WIDGET( filter_toolbar ), TRUE, TRUE, 0 );
++                      PFbox.pack_start( filter_toolbar, FALSE, FALSE, 0 );
+               }
        }
-       vbox.pack_start( plugin_toolbar, FALSE, FALSE, 0 );
  
 -      /*GtkToolbar* plugin_toolbar = create_plugin_toolbar();
 -      if ( !g_Layout_enablePluginToolbar.m_value ) {
 -              gtk_widget_hide( GTK_WIDGET( plugin_toolbar ) );
 -      }*/
 -      if ( g_Layout_enableFilterToolbar.m_value ) {
 -      }
 -
 -
 -
 -
 -      GtkWidget* main_statusbar = create_main_statusbar( m_pStatusLabel );
 -      gtk_box_pack_end( GTK_BOX( vbox ), main_statusbar, FALSE, TRUE, 2 );
 +      ui::Widget main_statusbar = create_main_statusbar(reinterpret_cast<ui::Widget *>(m_pStatusLabel));
 +      vbox.pack_end(main_statusbar, FALSE, TRUE, 2);
  
        GroupDialog_constructWindow( window );
        g_page_entity = GroupDialog_addPage( "Entities", EntityInspector_constructWindow( GroupDialog_getWindow() ), RawStringExportCaller( "Entities" ) );
index aea1b321b837528586c445ff417f1724b8afde58,03ef2074b659455dbf2c73683be05d57787b4bf7..61f2f4a45e2a0da3d39f3f3ff6c96ee474d70623
@@@ -115,19 -117,20 +115,33 @@@ public
  }
  
  void PluginToolbar_clear(){
 -      container_remove_all( GTK_CONTAINER( g_plugin_toolbar ) );
 +      container_remove_all( g_plugin_toolbar );
 +}
 +
 +ui::Toolbar create_plugin_toolbar(){
 +
 +      auto toolbar = ui::Toolbar::from( gtk_toolbar_new() );
 +      gtk_orientable_set_orientation( GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL );
 +      gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS );
 +      toolbar.show();
 +
 +      g_plugin_toolbar = toolbar;
 +
 +      PluginToolbar_populate();
 +
 +      return toolbar;
  }
 -GtkToolbar* create_plugin_toolbar(){
 -      GtkToolbar *toolbar;
 -      toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
 -      gtk_toolbar_set_orientation( toolbar, GTK_ORIENTATION_HORIZONTAL );
++ui::Toolbar create_filter_toolbar(){
 -      gtk_widget_show( GTK_WIDGET( toolbar ) );
++      auto toolbar = ui::Toolbar::from( gtk_toolbar_new() );
++      gtk_orientable_set_orientation( GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL );
+       gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS );
++      toolbar.show();
+       g_plugin_toolbar = toolbar;
+       PluginToolbar_populate();
+       return toolbar;
+ }
index ca35b1bc4266b2fb700429a6a07f0d20b244cebc,7621cfd2585be7eed7db072fb86baa53fffa822f..97c637f274980950eec8e0a34535bf60b05508c8
@@@ -24,7 -22,8 +24,9 @@@
  #if !defined( INCLUDED_PLUGINTOOLBAR_H )
  #define INCLUDED_PLUGINTOOLBAR_H
  
 -typedef struct _GtkToolbar GtkToolbar;
 -GtkToolbar* create_plugin_toolbar();
 +ui::Toolbar create_plugin_toolbar();
++ui::Toolbar create_filter_toolbar();
++
  void PluginToolbar_populate();
  void PluginToolbar_clear();
  
index 2b4ad1843dce5bd505e1653fe074a85936775a9e,24e71a38cc3795453f89b550de671683ebabd7a5..ef0fc6f900b029be6dd48f7e127d63d4f2791d66
@@@ -234,33 -189,26 +234,37 @@@ enum StartupShader
        STARTUPSHADERS_COMMON,
  };
  
 -void TextureBrowser_hideUnusedExport( const BoolImportCallback& importer );
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
 +void TextureBrowser_hideUnusedExport( const Callback<void(bool)> & importer );
 +
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
 +
 +void TextureBrowser_showShadersExport( const Callback<void(bool)> & importer );
 +
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
 +
++void TextureBrowser_showTexturesExport( const Callback<void(bool)> & importer );
 -void TextureBrowser_showShadersExport( const BoolImportCallback& importer );
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
++typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showTexturesExport> TextureBrowserShowTexturesExport;
 -void TextureBrowser_showTexturesExport( const BoolImportCallback& importer );
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showTexturesExport> TextureBrowserShowTexturesExport;
 +void TextureBrowser_showShaderlistOnly( const Callback<void(bool)> & importer );
  
 -void TextureBrowser_showShaderlistOnly( const BoolImportCallback& importer );
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
  
 -void TextureBrowser_fixedSize( const BoolImportCallback& importer );
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_fixedSize> TextureBrowserFixedSizeExport;
 +void TextureBrowser_fixedSize( const Callback<void(bool)> & importer );
  
 -void TextureBrowser_filterNotex( const BoolImportCallback& importer );
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_filterNotex> TextureBrowserFilterNotexExport;
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_fixedSize> TextureBrowserFixedSizeExport;
  
 -void TextureBrowser_enableAlpha( const BoolImportCallback& importer );
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_enableAlpha> TextureBrowserEnableAlphaExport;
 +void TextureBrowser_filterMissing( const Callback<void(bool)> & importer );
 +
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_filterMissing> TextureBrowserFilterMissingExport;
 +
 +void TextureBrowser_filterFallback( const Callback<void(bool)> & importer );
 +
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_filterFallback> TextureBrowserFilterFallbackExport;
 +
 +void TextureBrowser_enableAlpha( const Callback<void(bool)> & importer );
 +
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_enableAlpha> TextureBrowserEnableAlphaExport;
  
  class TextureBrowser
  {
@@@ -293,8 -241,8 +297,9 @@@ std::vector<CopiedString> m_copied_tags
  std::set<CopiedString> m_found_shaders;
  
  ToggleItem m_hideunused_item;
 +ToggleItem m_hidenotex_item;
  ToggleItem m_showshaders_item;
+ ToggleItem m_showtextures_item;
  ToggleItem m_showshaderlistonly_item;
  ToggleItem m_fixedsize_item;
  ToggleItem m_filternotex_item;
@@@ -400,13 -347,13 +406,14 @@@ void getTextureWH( qtexture_t* tex, in
  }
  
  TextureBrowser() :
 -      m_texture_scroll( 0 ),
 +      m_texture_scroll( ui::null ),
        m_hideunused_item( TextureBrowserHideUnusedExport() ),
 +      m_hidenotex_item( TextureBrowserFilterFallbackExport() ),
        m_showshaders_item( TextureBrowserShowShadersExport() ),
+       m_showtextures_item( TextureBrowserShowTexturesExport() ),
        m_showshaderlistonly_item( TextureBrowserShowShaderlistOnlyExport() ),
        m_fixedsize_item( TextureBrowserFixedSizeExport() ),
 -      m_filternotex_item( TextureBrowserFilterNotexExport() ),
 +      m_filternotex_item( TextureBrowserFilterMissingExport() ),
        m_enablealpha_item( TextureBrowserEnableAlphaExport() ),
        m_heightChanged( true ),
        m_originInvalid( true ),
@@@ -559,23 -507,14 +567,23 @@@ bool TextureSearch_IsShown( const char
        }
  }
  
 -CopiedString g_notex;
 -CopiedString g_shadernotex;
 -
  // if texture_showinuse jump over non in-use textures
- bool Texture_IsShown( IShader* shader, bool show_shaders, bool hideUnused ){
+ bool Texture_IsShown( IShader* shader, bool show_shaders, bool show_textures, bool hideUnused ){
 -      // filter notex / shadernotex images
 -      if ( g_TextureBrowser_filterNotex && ( string_equal( g_notex.c_str(), shader->getTexture()->name ) || string_equal( g_shadernotex.c_str(), shader->getTexture()->name ) ) ) {
 -              return false;
 +      // filter missing shaders
 +      // ugly: filter on built-in fallback name after substitution
 +      if ( g_TextureBrowser_filterMissing ) {
 +              if ( isMissing( shader->getTexture()->name ) ) {
 +                      return false;
 +              }
 +      }
 +      // filter the fallback (notex/shadernotex) for missing shaders or editor image
 +      if ( g_TextureBrowser_filterFallback ) {
 +              if ( isNotex( shader->getName() ) ) {
 +                      return false;
 +              }
 +              if ( isNotex( shader->getTexture()->name ) ) {
 +                      return false;
 +              }
        }
  
        if ( g_TextureBrowser_currentDirectory == "Untagged" ) {
@@@ -702,12 -645,11 +714,13 @@@ Signal0 m_realiseCallbacks
  public:
  void realise(){
        m_realiseCallbacks();
+       /* texturebrowser tree update on vfs restart */
        TextureBrowser_constructTreeStore();
  }
 +
  void unrealise(){
  }
 +
  void insert( const SignalHandler& handler ){
        m_realiseCallbacks.connectLast( handler );
  }
@@@ -941,47 -863,40 +954,53 @@@ void TextureBrowser_ShowTagSearchResult
  
  bool TextureBrowser_hideUnused();
  
 -void TextureBrowser_hideUnusedExport( const BoolImportCallback& importer ){
 +void TextureBrowser_hideUnusedExport( const Callback<void(bool)> & importer ){
        importer( TextureBrowser_hideUnused() );
  }
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
  
 -void TextureBrowser_showShadersExport( const BoolImportCallback& importer ){
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
 +
 +void TextureBrowser_showShadersExport( const Callback<void(bool)> & importer ){
        importer( GlobalTextureBrowser().m_showShaders );
  }
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
  
 -void TextureBrowser_showTexturesExport( const BoolImportCallback& importer ){
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
 +
++void TextureBrowser_showTexturesExport( const Callback<void(bool)> & importer ){
+       importer( GlobalTextureBrowser().m_showTextures );
+ }
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showTexturesExport> TextureBrowserShowTexturesExport;
 -void TextureBrowser_showShaderlistOnly( const BoolImportCallback& importer ){
++typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showTexturesExport> TextureBrowserShowTexturesExport;
++
 +void TextureBrowser_showShaderlistOnly( const Callback<void(bool)> & importer ){
        importer( g_TextureBrowser_shaderlistOnly );
  }
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
  
 -void TextureBrowser_fixedSize( const BoolImportCallback& importer ){
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
 +
 +void TextureBrowser_fixedSize( const Callback<void(bool)> & importer ){
        importer( g_TextureBrowser_fixedSize );
  }
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_fixedSize> TextureBrowser_FixedSizeExport;
  
 -void TextureBrowser_filterNotex( const BoolImportCallback& importer ){
 -      importer( g_TextureBrowser_filterNotex );
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_fixedSize> TextureBrowser_FixedSizeExport;
 +
 +void TextureBrowser_filterMissing( const Callback<void(bool)> & importer ){
 +      importer( g_TextureBrowser_filterMissing );
  }
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_filterNotex> TextureBrowser_filterNotexExport;
  
 -void TextureBrowser_enableAlpha( const BoolImportCallback& importer ){
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_filterMissing> TextureBrowser_filterMissingExport;
 +
 +void TextureBrowser_filterFallback( const Callback<void(bool)> & importer ){
 +      importer( g_TextureBrowser_filterFallback );
 +}
 +
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_filterFallback> TextureBrowser_filterFallbackExport;
 +
 +void TextureBrowser_enableAlpha( const Callback<void(bool)> & importer ){
        importer( g_TextureBrowser_enableAlpha );
  }
 -typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_enableAlpha> TextureBrowser_enableAlphaExport;
 +
 +typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_enableAlpha> TextureBrowser_enableAlphaExport;
  
  void TextureBrowser_SetHideUnused( TextureBrowser& textureBrowser, bool hideUnused ){
        if ( hideUnused ) {
@@@ -1176,6 -1091,7 +1195,8 @@@ void Texture_Draw( TextureBrowser& text
  
        glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
        glDisable( GL_DEPTH_TEST );
++
+       //glDisable( GL_BLEND );
        if ( g_TextureBrowser_enableAlpha ) {
                glEnable( GL_BLEND );
                glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@@ -1753,16 -1726,9 +1824,15 @@@ ui::MenuItem TextureBrowser_constructVi
        }
  
        create_check_menu_item_with_mnemonic( menu, "Hide _Unused", "ShowInUse" );
 -      create_menu_item_with_mnemonic( menu, "Show All", "ShowAllTextures" );
 +      if ( string_empty( g_pGameDescription->getKeyValue( "show_wads" ) ) ) {
 +              create_check_menu_item_with_mnemonic( menu, "Hide Image Missing", "FilterMissing" );
 +      }
 +
 +      // hide notex and shadernotex on texture browser: no one wants to apply them
 +      create_check_menu_item_with_mnemonic( menu, "Hide Fallback", "FilterFallback" );
 +
        menu_separator( menu );
  
-       create_menu_item_with_mnemonic( menu, "Show All", "ShowAllTextures" );
  
        // we always want to show shaders but don't want a "Show Shaders" menu for doom3 and .wad file games
        if ( g_pGameDescription->mGameType == "doom3" || !string_empty( g_pGameDescription->getKeyValue( "show_wads" ) ) ) {
        if ( g_TextureBrowser.m_tags ) {
                create_menu_item_with_mnemonic( menu, "Show Untagged", "ShowUntagged" );
        }
 -      if ( string_empty( g_pGameDescription->getKeyValue( "show_wads" ) ) ) {
 -              create_check_menu_item_with_mnemonic( menu, "Hide Image Missing", "FilterNotex" );
 -              menu_separator( menu );
 -      }
+       if ( g_pGameDescription->mGameType != "doom3" && string_empty( g_pGameDescription->getKeyValue( "show_wads" ) ) ) {
+               create_check_menu_item_with_mnemonic( menu, "ShaderList Only", "ToggleShowShaderlistOnly" );
+       }
  
 +      menu_separator( menu );
        create_check_menu_item_with_mnemonic( menu, "Fixed Size", "FixedSize" );
        create_check_menu_item_with_mnemonic( menu, "Transparency", "EnableAlpha" );
  
@@@ -2500,11 -2476,12 +2572,12 @@@ void TextureBrowser_pasteTag()
        BuildStoreAvailableTags( g_TextureBrowser.m_available_store, g_TextureBrowser.m_assigned_store, g_TextureBrowser.m_all_tags, &g_TextureBrowser );
  }
  
 -void RefreshShaders(){
 +void TextureBrowser_RefreshShaders(){
-       ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", "Loading Shaders" );
-       GlobalShaderSystem().refresh();
-       UpdateAllWindows();
+       /* When shaders are refreshed, forces reloading the textures as well.
+       Previously it would at best only display shaders, at worst mess up some textured objects. */
 -      GtkTreeSelection* selection = gtk_tree_view_get_selection((GtkTreeView*)GlobalTextureBrowser().m_treeViewTree);
 +    auto selection = gtk_tree_view_get_selection(GlobalTextureBrowser().m_treeViewTree);
        GtkTreeModel* model = NULL;
        GtkTreeIter iter;
        if ( gtk_tree_selection_get_selected (selection, &model, &iter) )
                TextureBrowser_ShowDirectory( GlobalTextureBrowser(), dirName );
                TextureBrowser_queueDraw( GlobalTextureBrowser() );
        }
 -
++
+       else{
+               ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", "Loading Shaders" );
+               GlobalShaderSystem().refresh();
+               UpdateAllWindows();
+       }
  }
  
  void TextureBrowser_ToggleShowShaders(){
@@@ -2712,36 -2705,47 +2814,39 @@@ void TextureBrowser_registerPreferences
  void TextureClipboard_textureSelected( const char* shader );
  
  void TextureBrowser_Construct(){
 -      GlobalCommands_insert( "ShaderInfo", FreeCaller<TextureBrowser_shaderInfo>() );
 -      GlobalCommands_insert( "ShowUntagged", FreeCaller<TextureBrowser_showUntagged>() );
 -      GlobalCommands_insert( "AddTag", FreeCaller<TextureBrowser_addTag>() );
 -      GlobalCommands_insert( "RenameTag", FreeCaller<TextureBrowser_renameTag>() );
 -      GlobalCommands_insert( "DeleteTag", FreeCaller<TextureBrowser_deleteTag>() );
 -      GlobalCommands_insert( "CopyTag", FreeCaller<TextureBrowser_copyTag>() );
 -      GlobalCommands_insert( "PasteTag", FreeCaller<TextureBrowser_pasteTag>() );
 -      GlobalCommands_insert( "RefreshShaders", FreeCaller<RefreshShaders>() );
 -      GlobalToggles_insert( "ShowInUse", FreeCaller<TextureBrowser_ToggleHideUnused>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hideunused_item ), Accelerator( 'U' ) );
 -      GlobalCommands_insert( "ShowAllTextures", FreeCaller<TextureBrowser_showAll>(), Accelerator( 'A', (GdkModifierType)GDK_CONTROL_MASK ) );
 -      GlobalCommands_insert( "ToggleTextures", FreeCaller<TextureBrowser_toggleShow>(), Accelerator( 'T' ) );
 -      GlobalToggles_insert( "ToggleShowShaders", FreeCaller<TextureBrowser_ToggleShowShaders>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaders_item ) );
 -      GlobalToggles_insert( "ToggleShowTextures", FreeCaller<TextureBrowser_ToggleShowTextures>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showtextures_item ) );
 -      GlobalToggles_insert( "ToggleShowShaderlistOnly", FreeCaller<TextureBrowser_ToggleShowShaderListOnly>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) );
 -      GlobalToggles_insert( "FixedSize", FreeCaller<TextureBrowser_FixedSize>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_fixedsize_item ) );
 -      GlobalToggles_insert( "FilterNotex", FreeCaller<TextureBrowser_FilterNotex>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_filternotex_item ) );
 -      GlobalToggles_insert( "EnableAlpha", FreeCaller<TextureBrowser_EnableAlpha>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_enablealpha_item ) );
 -
 -      GlobalPreferenceSystem().registerPreference( "TextureScale",
 -                                                                                               makeSizeStringImportCallback( TextureBrowserSetScaleCaller( g_TextureBrowser ) ),
 -                                                                                               SizeExportStringCaller( g_TextureBrowser.m_textureScale )
 -                                                                                               );
 -      GlobalPreferenceSystem().registerPreference( "UniformTextureSize",
 -                                                                                              makeIntStringImportCallback(UniformTextureSizeImportCaller(g_TextureBrowser)),
 -                                                                                              IntExportStringCaller(g_TextureBrowser.m_uniformTextureSize) );
 -      GlobalPreferenceSystem().registerPreference( "UniformTextureMinSize",
 -                                                                                              makeIntStringImportCallback(UniformTextureMinSizeImportCaller(g_TextureBrowser)),
 -                                                                                              IntExportStringCaller(g_TextureBrowser.m_uniformTextureMinSize) );
 -      GlobalPreferenceSystem().registerPreference( "TextureScrollbar",
 -                                                                                               makeBoolStringImportCallback( TextureBrowserImportShowScrollbarCaller( g_TextureBrowser ) ),
 -                                                                                               BoolExportStringCaller( GlobalTextureBrowser().m_showTextureScrollbar )
 -                                                                                               );
 -      GlobalPreferenceSystem().registerPreference( "ShowShaders", BoolImportStringCaller( GlobalTextureBrowser().m_showShaders ), BoolExportStringCaller( GlobalTextureBrowser().m_showShaders ) );
 -      GlobalPreferenceSystem().registerPreference( "ShowTextures", BoolImportStringCaller( GlobalTextureBrowser().m_showTextures ), BoolExportStringCaller( GlobalTextureBrowser().m_showTextures ) );
 -      GlobalPreferenceSystem().registerPreference( "ShowShaderlistOnly", BoolImportStringCaller( g_TextureBrowser_shaderlistOnly ), BoolExportStringCaller( g_TextureBrowser_shaderlistOnly ) );
 -      GlobalPreferenceSystem().registerPreference( "FixedSize", BoolImportStringCaller( g_TextureBrowser_fixedSize ), BoolExportStringCaller( g_TextureBrowser_fixedSize ) );
 -      GlobalPreferenceSystem().registerPreference( "FilterNotex", BoolImportStringCaller( g_TextureBrowser_filterNotex ), BoolExportStringCaller( g_TextureBrowser_filterNotex ) );
 -      GlobalPreferenceSystem().registerPreference( "EnableAlpha", BoolImportStringCaller( g_TextureBrowser_enableAlpha ), BoolExportStringCaller( g_TextureBrowser_enableAlpha ) );
 -      GlobalPreferenceSystem().registerPreference( "LoadShaders", IntImportStringCaller( reinterpret_cast<int&>( GlobalTextureBrowser().m_startupShaders ) ), IntExportStringCaller( reinterpret_cast<int&>( GlobalTextureBrowser().m_startupShaders ) ) );
 -      GlobalPreferenceSystem().registerPreference( "WheelMouseInc", SizeImportStringCaller( GlobalTextureBrowser().m_mouseWheelScrollIncrement ), SizeExportStringCaller( GlobalTextureBrowser().m_mouseWheelScrollIncrement ) );
 -      GlobalPreferenceSystem().registerPreference( "SI_Colors0", Vector3ImportStringCaller( GlobalTextureBrowser().color_textureback ), Vector3ExportStringCaller( GlobalTextureBrowser().color_textureback ) );
 +      GlobalCommands_insert( "ShaderInfo", makeCallbackF(TextureBrowser_shaderInfo) );
 +      GlobalCommands_insert( "ShowUntagged", makeCallbackF(TextureBrowser_showUntagged) );
 +      GlobalCommands_insert( "AddTag", makeCallbackF(TextureBrowser_addTag) );
 +      GlobalCommands_insert( "RenameTag", makeCallbackF(TextureBrowser_renameTag) );
 +      GlobalCommands_insert( "DeleteTag", makeCallbackF(TextureBrowser_deleteTag) );
 +      GlobalCommands_insert( "CopyTag", makeCallbackF(TextureBrowser_copyTag) );
 +      GlobalCommands_insert( "PasteTag", makeCallbackF(TextureBrowser_pasteTag) );
 +      GlobalCommands_insert( "RefreshShaders", makeCallbackF(VFS_Refresh) );
 +      GlobalToggles_insert( "ShowInUse", makeCallbackF(TextureBrowser_ToggleHideUnused), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hideunused_item ), Accelerator( 'U' ) );
 +      GlobalCommands_insert( "ShowAllTextures", makeCallbackF(TextureBrowser_showAll), Accelerator( 'A', (GdkModifierType)GDK_CONTROL_MASK ) );
 +      GlobalCommands_insert( "ToggleTextures", makeCallbackF(TextureBrowser_toggleShow), Accelerator( 'T' ) );
 +      GlobalToggles_insert( "ToggleShowShaders", makeCallbackF(TextureBrowser_ToggleShowShaders), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaders_item ) );
-       GlobalToggles_insert( "ToggleShowShaderlistOnly", makeCallbackF(TextureBrowser_ToggleShowShaderListOnly), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) );
++      GlobalToggles_insert( "ToggleShowTextures", makeCallbackF(TextureBrowser_ToggleShowTextures), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showtextures_item ) );
++      GlobalToggles_insert( "ToggleShowShaderlistOnly", makeCallbackF(TextureBrowser_ToggleShowShaderListOnly),
++ ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) );
 +      GlobalToggles_insert( "FixedSize", makeCallbackF(TextureBrowser_FixedSize), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_fixedsize_item ) );
 +      GlobalToggles_insert( "FilterMissing", makeCallbackF(TextureBrowser_FilterMissing), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_filternotex_item ) );
 +      GlobalToggles_insert( "FilterFallback", makeCallbackF(TextureBrowser_FilterFallback), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hidenotex_item ) );
 +      GlobalToggles_insert( "EnableAlpha", makeCallbackF(TextureBrowser_EnableAlpha), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_enablealpha_item ) );
 +
 +      GlobalPreferenceSystem().registerPreference( "TextureScale", make_property_string<TextureScale>(g_TextureBrowser) );
 +      GlobalPreferenceSystem().registerPreference( "UniformTextureSize", make_property_string<UniformTextureSize>(g_TextureBrowser) );
 +      GlobalPreferenceSystem().registerPreference( "UniformTextureMinSize", make_property_string<UniformTextureMinSize>(g_TextureBrowser) );
 +      GlobalPreferenceSystem().registerPreference( "TextureScrollbar", make_property_string<TextureBrowser_ShowScrollbar>(GlobalTextureBrowser()));
 +      GlobalPreferenceSystem().registerPreference( "ShowShaders", make_property_string( GlobalTextureBrowser().m_showShaders ) );
++      GlobalPreferenceSystem().registerPreference( "ShowTextures", make_property_string( GlobalTextureBrowser().m_showTextures ) );
 +      GlobalPreferenceSystem().registerPreference( "ShowShaderlistOnly", make_property_string( g_TextureBrowser_shaderlistOnly ) );
 +      GlobalPreferenceSystem().registerPreference( "FixedSize", make_property_string( g_TextureBrowser_fixedSize ) );
 +      GlobalPreferenceSystem().registerPreference( "FilterMissing", make_property_string( g_TextureBrowser_filterMissing ) );
 +      GlobalPreferenceSystem().registerPreference( "EnableAlpha", make_property_string( g_TextureBrowser_enableAlpha ) );
 +      GlobalPreferenceSystem().registerPreference( "LoadShaders", make_property_string( reinterpret_cast<int&>( GlobalTextureBrowser().m_startupShaders ) ) );
 +      GlobalPreferenceSystem().registerPreference( "WheelMouseInc", make_property_string( GlobalTextureBrowser().m_mouseWheelScrollIncrement ) );
 +      GlobalPreferenceSystem().registerPreference( "SI_Colors0", make_property_string( GlobalTextureBrowser().color_textureback ) );
  
        g_TextureBrowser.shader = texdef_name_default();