]> Dogcows Code - chaz/yoink/blobdiff - src/Scene.cc
minor refactoring and state progress
[chaz/yoink] / src / Scene.cc
index cffd382b1a7aaa62a0e1da42e592b6fea83421bf..bad59bfd79c0c0103e117324f895f003720ceb66 100644 (file)
@@ -324,13 +324,13 @@ struct Scene::Impl : public Mf::Mippleton<Impl>
                Mf::Settings::getInstance().get("detail", detail);
                script.push(detail); script.set("detail");
 
-               script.push(Quad::LEFT);  script.set("LEFT");
-               script.push(Quad::RIGHT); script.set("RIGHT");
-               script.push(Quad::TOP);   script.set("TOP");
-
                script.push(X); script.set("X");
                script.push(Y); script.set("Y");
                script.push(Z); script.set("Z");
+
+               script.push(Quad::LEFT);  script.set("LEFT");
+               script.push(Quad::RIGHT); script.set("RIGHT");
+               script.push(Quad::TOP);   script.set("TOP");
        }
 
 
@@ -447,7 +447,7 @@ struct Scene::Impl : public Mf::Mippleton<Impl>
 
        int rotate(Mf::Script& script)
        {
-               Mf::Script::Value axis = script[1].requireString();
+               Mf::Script::Value axis = script[1].requireNumber();
                Mf::Script::Value angle = script[2].requireNumber();
 
                size_t index = 0;
@@ -463,10 +463,7 @@ struct Scene::Impl : public Mf::Mippleton<Impl>
 
        int setTexture(Mf::Script& script)
        {
-               Mf::Script::Value name = script[1].requireString();
-
-               name.get(texture);
-
+               script[1].requireString().get(texture);
                return 0;
        }
 
@@ -500,9 +497,8 @@ struct Scene::Impl : public Mf::Mippleton<Impl>
                height = nTiles / width;
                indices.resize(height);
 
-               // the indices are stored upside-down in the scene file so that they
-               // are easier to edit as text, so we'll need to load them last row
-               // first
+               // the indices are stored upside-down in the scene file so that they are
+               // easier to edit as text, so we'll need to load them last row first
 
                i = 1;
                for (h = height - 1; h >= 0; --h)
@@ -628,17 +624,17 @@ struct Scene::Impl : public Mf::Mippleton<Impl>
 
 Scene::Scene(const std::string& name) :
        // pass through
-       impl_(Scene::Impl::getInstance(name)) {}
+       mImpl(Scene::Impl::getInstance(name)) {}
 
 
 void Scene::draw(Mf::Scalar alpha) const
 {
-       impl_->octree->draw(alpha);
+       mImpl->octree->draw(alpha);
 }
 
 void Scene::drawIfVisible(Mf::Scalar alpha, const Mf::Frustum& frustum) const
 {
-       impl_->octree->drawIfVisible(alpha, frustum);
+       mImpl->octree->drawIfVisible(alpha, frustum);
 }
 
 
@@ -646,8 +642,8 @@ bool Scene::checkForCollision(Character& character)
 {
        std::list< boost::shared_ptr<Impl::Quad> > objects;
        //std::list<Mf::Octree<Impl::Quad>::InsertableP> objects;
-       impl_->octree->getNearbyObjects(objects, character);
-       impl_->maximumBounds.draw();
+       mImpl->octree->getNearbyObjects(objects, character);
+       mImpl->maximumBounds.draw();
 
        Mf::logDebug("nearby objects: %d", objects.size());
        return false;
This page took 0.01988 seconds and 4 git commands to generate.