]> Dogcows Code - chaz/yoink/blobdiff - src/Scene.cc
library class revamped as manager, goodbye tilemap
[chaz/yoink] / src / Scene.cc
index aa2249c596ae0b462e9910db1bd93362ef8ceabd..45fc3a0ac9bc6f70397206fc49646546c1006614 100644 (file)
 #include <Moof/Aabb.hh>
 #include <Moof/Camera.hh>
 #include <Moof/Entity.hh>
-#include <Moof/Library.hh>
+#include <Moof/Manager.hh>
 #include <Moof/Line.hh>
 #include <Moof/Log.hh>
 #include <Moof/Math.hh>
 //#include <Moof/Octree.hh>
 #include <Moof/Script.hh>
 #include <Moof/Settings.hh>
+#include <Moof/Texture.hh>
 
 #include "Character.hh"
 #include "Scene.hh"
-#include "Tilemap.hh"
 
 
-struct Scene::Impl : public Mf::Library<Impl>
+struct Scene::Impl : public Mf::Manager<Impl>
 {
        struct Quad : public Mf::Entity
        {
@@ -57,7 +57,7 @@ struct Scene::Impl : public Mf::Library<Impl>
                };
 
                Quad(const Mf::Vector3* vertices[4], const std::string& texture,
-                               Tilemap::Index tileIndex) :
+                               Mf::Texture::TileIndex tileIndex) :
                        mTilemap(texture),
                        mBlending(false),
                        mFog(false),
@@ -143,7 +143,7 @@ struct Scene::Impl : public Mf::Library<Impl>
                Mf::Vector3             mVertices[4];
                Mf::Scalar              mTexCoords[8];
                
-               Tilemap                 mTilemap;
+               Mf::Texture             mTilemap;
 
                bool                    mBlending;
                bool                    mFog;
@@ -170,8 +170,8 @@ struct Scene::Impl : public Mf::Library<Impl>
        };
 
 
-       explicit Impl(const std::string& name) :
-               Mf::Library<Impl>(name) {}
+       void init(const std::string& name) {}
+
 
        void importSceneBindings(Mf::Script& script)
        {
@@ -372,7 +372,7 @@ struct Scene::Impl : public Mf::Library<Impl>
 
                                table.pushField(i);
 
-                               Tilemap::Index index;
+                               Mf::Texture::TileIndex index;
                                top.get(index);
 
                                script.pop();
@@ -380,7 +380,7 @@ struct Scene::Impl : public Mf::Library<Impl>
                                vertices[h][wPlus1] = Mf::demote(mTransform *
                                                Mf::Vector4(wPlus1, h, 0.0, 1.0));
 
-                               if (index == Tilemap::NO_TILE) continue;
+                               if (index == Mf::Texture::NO_TILE) continue;
 
                                const Mf::Vector3* corners[4] = {
                                        &vertices[h][w],
@@ -425,10 +425,10 @@ struct Scene::Impl : public Mf::Library<Impl>
                Mf::Script::Slot param = script[1];
                Mf::Script::Slot top = script[-1];
 
-               Tilemap::Index  index = 0;
-               int                             width = 1;
-               bool                    blending = false;
-               bool                    fog = false;
+               Mf::Texture::TileIndex  index = 0;
+               int                                             width = 1;
+               bool                                    blending = false;
+               bool                                    fog = false;
 
                if (param.isTable())
                {
This page took 0.023828 seconds and 4 git commands to generate.