X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Ftgdb%2FTreeBin.hxx;h=9b9c3bc91a2e5466bce318d7ed2026b655993a57;hb=3b5665fe92802d3d36d6304cb2c184dc03e91de4;hp=3c7970281005d2e83d1f9bd756aa801b1f19005f;hpb=8cbe9f1bd0b2fb48480ecd03e817930e8d5a126e;p=simgear.git diff --git a/simgear/scene/tgdb/TreeBin.hxx b/simgear/scene/tgdb/TreeBin.hxx index 3c797028..9b9c3bc9 100644 --- a/simgear/scene/tgdb/TreeBin.hxx +++ b/simgear/scene/tgdb/TreeBin.hxx @@ -29,19 +29,17 @@ #include #include -#include +#include namespace simgear { class TreeBin { public: struct Tree { - Tree(const SGVec3f& p, int t, float s) : - position(p), texture_index(t), scale(s) + Tree(const SGVec3f& p) : + position(p) { } SGVec3f position; - int texture_index; - float scale; }; typedef std::vector TreeList; @@ -51,20 +49,26 @@ public: float height; float width; std::string texture; - + void insert(const Tree& t) { _trees.push_back(t); } void insert(const SGVec3f& p, int t, float s) - { insert(Tree(p, t, s)); } + { insert(Tree(p)); } unsigned getNumTrees() const { return _trees.size(); } const Tree& getTree(unsigned i) const { return _trees[i]; } TreeList _trees; + + ~TreeBin() { + _trees.clear(); + } }; -osg::Geometry* createOrthQuads(float w, float h, const osg::Matrix& rotate); -osg::Group* createForest(TreeBin& forest, const osg::Matrix& transform); +typedef std::list SGTreeBinList; + +osg::Group* createForest(SGTreeBinList& forestList, const osg::Matrix& transform, + const SGReaderWriterOptions* options); } #endif