From 0fc02952ed449ff85f5f9e96ea2fc724c8456891 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 6 Sep 2011 23:49:10 +0300 Subject: [PATCH] mspdatafile APIs have changed slightly --- source/font.cpp | 2 +- source/object.cpp | 8 +++----- source/renderpass.cpp | 7 ++----- source/technique.cpp | 6 +++--- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/source/font.cpp b/source/font.cpp index 33c1584b..c96ec750 100644 --- a/source/font.cpp +++ b/source/font.cpp @@ -145,7 +145,7 @@ void Font::Loader::texture() void Font::Loader::texture_ref(const string &name) { - obj.texture = get_collection().get(name); + obj.texture = &get_collection().get(name); obj.texture.keep(); } diff --git a/source/object.cpp b/source/object.cpp index 1e94d7cc..5aec7e74 100644 --- a/source/object.cpp +++ b/source/object.cpp @@ -117,8 +117,6 @@ Object::Loader::Loader(Object &o, Collection &c): void Object::Loader::init() { - allow_pointer_reload = false; - add("mesh", &Loader::mesh_inline); add("mesh", &Loader::mesh_inline_lod); add("mesh", &Loader::mesh); @@ -152,12 +150,12 @@ void Object::Loader::mesh_inline_lod(unsigned l) void Object::Loader::mesh(const std::string &n) { - obj.set_mesh(get_collection().get(n)); + obj.set_mesh(&get_collection().get(n)); } void Object::Loader::mesh_lod(unsigned l, const string &n) { - obj.set_mesh(l, get_collection().get(n)); + obj.set_mesh(l, &get_collection().get(n)); } void Object::Loader::technique_inline() @@ -172,7 +170,7 @@ void Object::Loader::technique_inline() void Object::Loader::technique(const std::string &n) { - obj.set_technique(get_collection().get(n)); + obj.set_technique(&get_collection().get(n)); } } // namespace GL diff --git a/source/renderpass.cpp b/source/renderpass.cpp index 93538d48..fc2d37ed 100644 --- a/source/renderpass.cpp +++ b/source/renderpass.cpp @@ -1,4 +1,3 @@ -#include #include #include #include "error.h" @@ -74,8 +73,6 @@ RenderPass::Loader::Loader(RenderPass &p, Collection &c): void RenderPass::Loader::init() { - allow_pointer_reload = false; - add("shader", &RenderPass::shprog); add("material", &Loader::material_inline); add("material", &Loader::material); @@ -93,7 +90,7 @@ void RenderPass::Loader::material_inline() void RenderPass::Loader::material(const string &name) { - obj.material = get_collection().get(name); + obj.material = &get_collection().get(name); obj.material.keep(); } @@ -151,7 +148,7 @@ void RenderPass::TextureLoader::texenv() void RenderPass::TextureLoader::texture(const string &name) { - tex = get_collection().get(name); + tex = &get_collection().get(name); tex.keep(); } diff --git a/source/technique.cpp b/source/technique.cpp index b809abde..fcb2ffe5 100644 --- a/source/technique.cpp +++ b/source/technique.cpp @@ -49,7 +49,7 @@ void Technique::Loader::init() void Technique::Loader::inherit(const string &n) { - obj.passes = get_collection().get(n)->get_passes(); + obj.passes = get_collection().get(n).get_passes(); InheritLoader ldr(obj, get_collection()); load_sub_with(ldr); } @@ -74,13 +74,13 @@ Technique::InheritLoader::InheritLoader(Technique &t, Collection &c): void Technique::InheritLoader::texture(const std::string &slot, const string &name) { - Texture *tex = get_collection().get(name); + Texture &tex = get_collection().get(name); for(PassMap::iterator i=obj.passes.begin(); i!=obj.passes.end(); ++i) { int index = i->second.get_texture_index(slot); if(index<0) continue; - i->second.set_texture(index, tex); + i->second.set_texture(index, &tex); } } -- 2.43.0