X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture.cpp;h=d738bb36e9a63c2df69ef97a205e292b59aa5b49;hb=912ae952489699769be43f90d4478263461964a4;hp=fe8b7be9a3e4fbb56dda02464bfb0541d8e131ce;hpb=126161d1d44ab9503bc747d24a07b7b9d15e527a;p=libs%2Fgl.git diff --git a/source/texture.cpp b/source/texture.cpp index fe8b7be9..d738bb36 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -2,6 +2,7 @@ #include #include #include "error.h" +#include "resources.h" #include "texture.h" #include "texunit.h" @@ -209,8 +210,24 @@ void Texture::unbind_from(unsigned i) Texture::Loader::Loader(Texture &t): - DataFile::ObjectLoader(t) + DataFile::CollectionObjectLoader(t, 0) { + init(); +} + +Texture::Loader::Loader(Texture &t, Collection &c): + DataFile::CollectionObjectLoader(t, &c) +{ + init(); +} + +void Texture::Loader::init() +{ + if(Resources *res = dynamic_cast(coll)) + srgb = res->get_srgb_conversion(); + else + srgb = false; + add("filter", &Loader::filter); add("max_anisotropy", &Loader::max_anisotropy); add("generate_mipmap", &Loader::generate_mipmap);