]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/texwindow.cpp
Merge remote-tracking branch 'illwieckz/lokipaths'
[xonotic/netradiant.git] / radiant / texwindow.cpp
index 622170c100d0358e2e4948c7a61757ee07627f96..33e7e5c257d8ef227a6e13f75fffa9cf2868953a 100644 (file)
@@ -132,9 +132,9 @@ typedef ReferenceCaller1<TextureGroups, const char*, TextureGroups_addDirectory>
 namespace
 {
 bool g_TextureBrowser_shaderlistOnly = false;
-bool g_TextureBrowser_fixedSize = false;
+bool g_TextureBrowser_fixedSize = true;
 bool g_TextureBrowser_filterNotex = false;
-bool g_TextureBrowser_enableAlpha = false;
+bool g_TextureBrowser_enableAlpha = true;
 }
 
 class DeferredAdjustment
@@ -326,7 +326,7 @@ TextureBrowser() :
        m_rmbSelected( false ),
        m_searchedTags( false ),
        m_tags( false ),
-       m_uniformTextureSize( 128 ){
+       m_uniformTextureSize( 96 ){
 }
 };
 
@@ -1208,6 +1208,12 @@ void TextureBrowser_setScale( TextureBrowser& textureBrowser, std::size_t scale
        TextureBrowser_queueDraw( textureBrowser );
 }
 
+void TextureBrowser_setUniformSize( TextureBrowser& textureBrowser, std::size_t scale ){
+       textureBrowser.m_uniformTextureSize = scale;
+
+       TextureBrowser_queueDraw( textureBrowser );
+}
+
 
 void TextureBrowser_MouseWheel( TextureBrowser& textureBrowser, bool bUp ){
        int originy = TextureBrowser_getOriginY( textureBrowser );
@@ -1921,11 +1927,11 @@ void TextureBrowser_checkTagFile(){
 
 void TextureBrowser_SetNotex(){
        StringOutputStream name( 256 );
-       name << GlobalRadiant().getAppPath() << "bitmaps/notex.bmp";
+       name << GlobalRadiant().getAppPath() << "bitmaps/notex.png";
        g_notex = name.c_str();
 
        name = NULL;
-       name << GlobalRadiant().getAppPath() << "bitmaps/shadernotex.bmp";
+       name << GlobalRadiant().getAppPath() << "bitmaps/shadernotex.png";
        g_shadernotex = name.c_str();
 }
 
@@ -2496,6 +2502,14 @@ void TextureScaleExport( TextureBrowser& textureBrowser, const IntImportCallback
 }
 typedef ReferenceCaller1<TextureBrowser, const IntImportCallback&, TextureScaleExport> TextureScaleExportCaller;
 
+
+void UniformTextureSizeImport( TextureBrowser& textureBrowser, int value ){
+
+       if ( value > 16 )
+               TextureBrowser_setUniformSize( textureBrowser, value );
+}
+typedef ReferenceCaller1<TextureBrowser, int, UniformTextureSizeImport> UniformTextureSizeImportCaller;
+
 void TextureBrowser_constructPreferences( PreferencesPage& page ){
        page.appendCheckBox(
                "", "Texture scrollbar",
@@ -2511,6 +2525,12 @@ void TextureBrowser_constructPreferences( PreferencesPage& page ){
                        IntExportCallback( TextureScaleExportCaller( GlobalTextureBrowser() ) )
                        );
        }
+       page.appendSpinner(
+               "Texture Thumbnail Size",
+               GlobalTextureBrowser().m_uniformTextureSize,
+               GlobalTextureBrowser().m_uniformTextureSize,
+               16, 8192
+       );
        page.appendEntry( "Mousewheel Increment", GlobalTextureBrowser().m_mouseWheelScrollIncrement );
        {
                const char* startup_shaders[] = { "None", TextureBrowser_getComonShadersName() };
@@ -2557,6 +2577,9 @@ void TextureBrowser_Construct(){
                                                                                                 makeSizeStringImportCallback( TextureBrowserSetScaleCaller( g_TextureBrowser ) ),
                                                                                                 SizeExportStringCaller( g_TextureBrowser.m_textureScale )
                                                                                                 );
+       GlobalPreferenceSystem().registerPreference( "UniformTextureSize",
+                                                                                                makeIntStringImportCallback(UniformTextureSizeImportCaller(g_TextureBrowser)),
+                                                                                                IntExportStringCaller(g_TextureBrowser.m_uniformTextureSize) );
        GlobalPreferenceSystem().registerPreference( "TextureScrollbar",
                                                                                                 makeBoolStringImportCallback( TextureBrowserImportShowScrollbarCaller( g_TextureBrowser ) ),
                                                                                                 BoolExportStringCaller( GlobalTextureBrowser().m_showTextureScrollbar )