X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fresources%2Fresources.cpp;h=8a7780cd4016521c2b0cb39428270ad0f50c1609;hb=dbc91b65728ab9c0e574bb1127cfe4d2da55de7f;hp=79c95932b6c52b03f45c669d58a68f71d5e2bbeb;hpb=fe2fc291a4fc618425c64112c9ffd3519f0b8a3e;p=libs%2Fgl.git diff --git a/source/resources/resources.cpp b/source/resources/resources.cpp index 79c95932..8a7780cd 100644 --- a/source/resources/resources.cpp +++ b/source/resources/resources.cpp @@ -37,18 +37,18 @@ void init_builtin_data(DataFile::BuiltinSource &); Resources *Resources::global_resources = 0; Resources::Resources(bool set_as_global): - default_tex_filter(Texture::can_generate_mipmap() ? LINEAR_MIPMAP_LINEAR : LINEAR), - default_tex_anisotropy(1.0f), srgb_conversion(false), resource_manager(0) { add_type().suffix(".anim").keyword("animation"); add_type().suffix(".arma").keyword("armature"); - add_type().keyword("camera"); + add_type().keyword("camera") + .notify(&Resources::set_debug_name); add_type().keyword("font"); add_type().suffix(".kframe").keyword("keyframe"); add_type().keyword("light"); - add_type().suffix(".lightn").keyword("lighting"); + add_type().suffix(".lightn").keyword("lighting") + .notify(&Resources::set_debug_name); add_type().suffix(".mat") .creator(&Resources::create_material).notify(&Resources::set_debug_name); add_type().keyword("mesh") @@ -111,16 +111,6 @@ const DataFile::CollectionSource &Resources::get_builtins() return builtins; } -void Resources::set_default_texture_filter(TextureFilter tf) -{ - default_tex_filter = tf; -} - -void Resources::set_default_texture_anisotropy(float a) -{ - default_tex_anisotropy = a; -} - void Resources::set_srgb_conversion(bool c) { srgb_conversion = c; @@ -197,16 +187,6 @@ Texture2D *Resources::create_texture2d(const string &name) image.load_io(*io); tex = new Texture2D(resource_manager); - Sampler &samp = tex->get_default_sampler(); - if(is_mipmapped(default_tex_filter)) - { - tex->set_auto_generate_mipmap(true); - samp.set_mag_filter(LINEAR); - } - else - samp.set_mag_filter(default_tex_filter); - samp.set_min_filter(default_tex_filter); - samp.set_max_anisotropy(default_tex_anisotropy); if(resource_manager) resource_manager->set_resource_location(*tex, *this, name);