X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fresources.cpp;h=c34139b25e139e1b53e588c732715afc30a7ce62;hb=18240e2bb031551e9c72a55c7d974904d209760a;hp=8f3b4b8ba29fd3c49d9039d7747f3099ec821d8e;hpb=b2764a3a349b48d7445202faa903383386c09a4c;p=libs%2Fgl.git diff --git a/source/resources.cpp b/source/resources.cpp index 8f3b4b8b..c34139b2 100644 --- a/source/resources.cpp +++ b/source/resources.cpp @@ -1,12 +1,14 @@ +#include #include -#include #include "animation.h" #include "armature.h" #include "font.h" #include "keyframe.h" +#include "lighting.h" #include "material.h" #include "mesh.h" #include "object.h" +#include "pipelinetemplate.h" #include "pose.h" #include "program.h" #include "programcompiler.h" @@ -26,7 +28,7 @@ namespace GL { void init_shaderlib(DataFile::BuiltinSource &); Resources::Resources(): - default_tex_filter(SGIS_generate_mipmap ? LINEAR_MIPMAP_LINEAR : LINEAR), + default_tex_filter(Texture::can_generate_mipmap() ? LINEAR_MIPMAP_LINEAR : LINEAR), srgb_conversion(false), resource_manager(0) { @@ -34,9 +36,11 @@ Resources::Resources(): add_type().suffix(".arma").keyword("armature"); add_type().keyword("font"); add_type().suffix(".kframe").keyword("keyframe"); + add_type().suffix(".lightn").keyword("lighting"); add_type().suffix(".mat").keyword("material"); add_type().keyword("mesh").creator(&Resources::create_mesh); add_type().keyword("object"); + add_type().suffix(".pipe").keyword("pipeline"); add_type().keyword("pose"); add_type().keyword("shader").suffix(".glsl").creator(&Resources::create_program); add_type().suffix(".tech").keyword("technique"); @@ -49,7 +53,7 @@ Resources::Resources(): add_source(get_builtins()); } -DataFile::BuiltinSource &Resources::get_builtins() +const DataFile::CollectionSource &Resources::get_builtins() { static DataFile::BuiltinSource builtins; bool init_done = false; @@ -85,7 +89,7 @@ Mesh *Resources::create_mesh(const string &name) if(RefPtr io = open_from_sources(name)) { - RefPtr mesh = new GL::Mesh(resource_manager); + RefPtr mesh = new Mesh(resource_manager); resource_manager->set_resource_location(*mesh, *this, name); return mesh.release(); } @@ -105,7 +109,7 @@ Texture2D *Resources::create_texture2d(const string &name) if(!resource_manager) image.load_io(*io); - RefPtr tex = new GL::Texture2D(resource_manager); + RefPtr tex = new Texture2D(resource_manager); if(is_mipmapped(default_tex_filter)) {