X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=radiant%2Ftextures.cpp;h=eb98984620a3b71f669947b538ae823c891fc2d4;hp=b724c3176ce3bb2b3b3265f304ff5535b750bfb8;hb=2a1cfc426e60b77c7b212d827e2592de01041266;hpb=1ede3dc63143af40210a3e9c1c601028359fac11 diff --git a/radiant/textures.cpp b/radiant/textures.cpp index b724c317..eb989846 100644 --- a/radiant/textures.cpp +++ b/radiant/textures.cpp @@ -166,7 +166,7 @@ inline const int& min_int( const int& left, const int& right ){ int max_tex_size = 0; const int max_texture_quality = 3; -LatchedInt g_Textures_textureQuality( 3, "Texture Quality" ); +LatchedValue g_Textures_textureQuality( 3, "Texture Quality" ); /// \brief This function does the actual processing of raw RGBA data into a GL texture. /// It will also resample to power-of-two dimensions, generate the mipmaps and adjust gamma. @@ -685,7 +685,7 @@ void TextureModeImport( ETexturesMode& self, int value ){ } typedef ReferenceCaller TextureModeImportCaller; -void TextureModeExport( ETexturesMode& self, const IntImportCallback& importer ){ +void TextureModeExport( ETexturesMode& self, const ImportExportCallback::Import_t& importer ){ switch ( self ) { case eTextures_NEAREST: @@ -713,7 +713,7 @@ void TextureModeExport( ETexturesMode& self, const IntImportCallback& importer ) importer( 4 ); } } -typedef ReferenceCaller TextureModeExportCaller; +typedef ReferenceCaller::Import_t&), TextureModeExport> TextureModeExportCaller; void Textures_constructPreferences( PreferencesPage& page ){ { @@ -721,8 +721,7 @@ void Textures_constructPreferences( PreferencesPage& page ){ page.appendRadio( "Texture Quality", STRING_ARRAY_RANGE( percentages ), - LatchedIntImportCaller( g_Textures_textureQuality ), - IntExportCaller( g_Textures_textureQuality.m_latched ) + mkImportExportCallback( g_Textures_textureQuality ) ); } page.appendSpinner( @@ -730,16 +729,16 @@ void Textures_constructPreferences( PreferencesPage& page ){ 1.0, 0.0, 1.0, - FloatImportCallback( TextureGammaImportCaller( g_texture_globals.fGamma ) ), - FloatExportCallback( FloatExportCaller( g_texture_globals.fGamma ) ) + {ImportExportCallback::Import_t( TextureGammaImportCaller( g_texture_globals.fGamma ) ), + ImportExportCallback::Export_t( FloatExportCaller( g_texture_globals.fGamma ) )} ); { const char* texture_mode[] = { "Nearest", "Nearest Mipmap", "Linear", "Bilinear", "Bilinear Mipmap", "Trilinear", "Anisotropy" }; page.appendCombo( "Texture Render Mode", STRING_ARRAY_RANGE( texture_mode ), - IntImportCallback( TextureModeImportCaller( g_texture_mode ) ), - IntExportCallback( TextureModeExportCaller( g_texture_mode ) ) + {ImportExportCallback::Import_t( TextureModeImportCaller( g_texture_mode ) ), + ImportExportCallback::Export_t( TextureModeExportCaller( g_texture_mode ) )} ); } { @@ -759,8 +758,8 @@ void Textures_constructPreferences( PreferencesPage& page ){ page.appendCombo( "Hardware Texture Compression", compression, - TextureCompressionImportCaller( g_texture_globals.m_nTextureCompressionFormat ), - IntExportCaller( reinterpret_cast( g_texture_globals.m_nTextureCompressionFormat ) ) + {TextureCompressionImportCaller( g_texture_globals.m_nTextureCompressionFormat ), + IntExportCaller( reinterpret_cast( g_texture_globals.m_nTextureCompressionFormat ) )} ); } }