Skip to content

Commit

Permalink
Only using earcut if c++11 is available. Changed nth function to spec…
Browse files Browse the repository at this point in the history
…ify return type
  • Loading branch information
jasonbeverage committed Feb 28, 2019
1 parent 74f06e4 commit a83762e
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions src/osgEarth/Tessellator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,30 @@

#include <osgEarth/Tessellator>

#ifdef OSGEARTH_CXX11

#include <osgEarth/earcut.hpp>
namespace mapbox {
namespace util {
template <>
struct nth<0, osg::Vec2> {
inline static float get(const osg::Vec2 &t) {
return t.x();
};
};

template <>
struct nth<1, osg::Vec2> {
inline static float get(const osg::Vec2 &t) {
return t.y();
};
};
}
}

#define USE_EARCUT

#endif

using namespace osgEarth;

Expand Down Expand Up @@ -127,26 +150,6 @@ typedef std::vector<TriIndices> TriList;
}


namespace mapbox {
namespace util {
template <>
struct nth<0, osg::Vec2> {
inline static auto get(const osg::Vec2 &t) {
return t.x();
};
};

template <>
struct nth<1, osg::Vec2> {
inline static auto get(const osg::Vec2 &t) {
return t.y();
};
};
}
}

#define USE_EARCUT

bool
Tessellator::tessellateGeometry(osg::Geometry &geom)
{
Expand Down

0 comments on commit a83762e

Please sign in to comment.