X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FScene.cc;h=ccfd4f934060b605ad5de663c9e62bf84414c9e0;hp=1f76570f77363f08f81cb65163d6f0556c18f8a8;hb=f72400af4fa3e7b54dab154b5a2b6503a6f9af18;hpb=5fa5f117f28922a7e539a432367960c1a61f837d diff --git a/src/Moof/Scene.cc b/src/Moof/Scene.cc index 1f76570..ccfd4f9 100644 --- a/src/Moof/Scene.cc +++ b/src/Moof/Scene.cc @@ -133,13 +133,13 @@ class Scene::Impl : public Mippleton }; - static void loadBox(Aabb& theBox, SerializablePtr obj) + static void loadBox(Aabb& theBox, SerializableP obj) { - std::vector numbers; + Serializable::Array numbers; if (obj->get(numbers) && numbers.size() == 6) { - double num; + Serializable::Float num; if (numbers[0]->getNumber(num)) theBox.min[0] = Scalar(num); if (numbers[1]->getNumber(num)) theBox.min[1] = Scalar(num); @@ -158,10 +158,10 @@ public: } - void loadInstructions(SerializablePtr root) + void loadInstructions(SerializableP root) { - std::vector rootObj; - std::vector::iterator it; + Serializable::Array rootObj; + Serializable::Array::iterator it; if (!root->get(rootObj)) { @@ -184,7 +184,7 @@ public: } else if (instruction == "translate") { - std::vector values; + Serializable::Array values; ++it; if ((*it)->get(values)) @@ -193,7 +193,7 @@ public: for (size_t i = 0; i < values.size(); ++i) { - double value; + Serializable::Float value; if (values[i]->getNumber(value)) { @@ -208,14 +208,14 @@ public: } else if (instruction == "scale") { - std::vector values; + Serializable::Array values; ++it; if ((*it)->get(values)) { if (values.size() == 1) { - double value = 1.0; + Serializable::Float value = 1.0; values[0]->getNumber(value); @@ -230,7 +230,7 @@ public: for (size_t i = 0; i < values.size(); ++i) { - double value; + Serializable::Float value; if (values[i]->getNumber(value)) { @@ -246,7 +246,7 @@ public: } else if (instruction == "rotate") { - std::vector values; + Serializable::Array values; ++it; if ((*it)->get(values)) @@ -255,7 +255,7 @@ public: { std::string axis; size_t index = 0; - double value = 0.0; + Serializable::Float value = 0.0; if (values[0]->get(axis)) { @@ -291,11 +291,11 @@ public: } - void loadTilemap(SerializablePtr root, const Matrix4& transform, + void loadTilemap(SerializableP root, const Matrix4& transform, const std::string& texture) { - std::map rootObj; - std::map::iterator it; + Serializable::Map rootObj; + Serializable::Map::iterator it; if (!root->get(rootObj)) { @@ -317,13 +317,13 @@ public: return; } - std::vector tiles; + Serializable::Array tiles; if ((it = rootObj.find("tiles")) != rootObj.end() && (*it).second->get(tiles) && tiles.size() % width == 0) { - std::vector::iterator jt; + Serializable::Array::iterator jt; int w, h; height = tiles.size() / width; @@ -339,7 +339,7 @@ public: for (w = 0; w < width && jt != tiles.end(); ++w, ++jt) { - long index; + Serializable::Integer index; if ((*jt)->get(index)) { @@ -391,11 +391,11 @@ public: } } - void loadBillboard(SerializablePtr root, const Matrix4& transform, + void loadBillboard(SerializableP root, const Matrix4& transform, const std::string& texture) { - std::map rootObj; - std::map::iterator it; + Serializable::Map rootObj; + Serializable::Map::iterator it; Tilemap::Index index = 0; long width = 1; @@ -406,7 +406,7 @@ public: { if ((it = rootObj.find("tile")) != rootObj.end()) { - long value; + Serializable::Integer value; if ((*it).second->get(value)) { index = Tilemap::Index(value); @@ -473,10 +473,10 @@ public: std::string filePath = Scene::getPath(getName()); Deserializer deserializer(filePath, true); - SerializablePtr root = deserializer.deserialize(); + SerializableP root = deserializer.deserialize(); - std::map rootObj; - std::map::iterator it; + Serializable::Map rootObj; + Serializable::Map::iterator it; if (!root || !root->get(rootObj)) { @@ -499,7 +499,7 @@ public: } // create the tree to store the quads - octree = OctreePtr(new Octree(maximumBounds)); + octree = Octree::alloc(maximumBounds); if ((it = rootObj.find("instructions")) != rootObj.end()) { @@ -535,7 +535,7 @@ public: Aabb playfieldBounds; Aabb maximumBounds; - OctreePtr octree; + OctreeP octree; }; @@ -557,7 +557,7 @@ void Scene::refresh() } -OctreePtr Scene::getOctree() const +OctreeP Scene::getOctree() const { // pass through return impl_->octree;