Placefile polygon Linux fixes

This commit is contained in:
Dan Paulat 2023-08-11 08:36:08 -05:00
parent cdef5a9938
commit 0c5a504ad5
2 changed files with 9 additions and 7 deletions

View file

@ -7,6 +7,10 @@
#include <GL/glu.h> #include <GL/glu.h>
#include <boost/container/stable_vector.hpp> #include <boost/container/stable_vector.hpp>
#if defined(_WIN32)
typedef void (*_GLUfuncptr)(void);
#endif
namespace scwx namespace scwx
{ {
namespace qt namespace qt
@ -52,10 +56,10 @@ public:
gluTessCallback(tessellator_, // gluTessCallback(tessellator_, //
GLU_TESS_COMBINE_DATA, GLU_TESS_COMBINE_DATA,
(GLvoid(*)()) & TessellateCombineCallback); (_GLUfuncptr) &TessellateCombineCallback);
gluTessCallback(tessellator_, // gluTessCallback(tessellator_, //
GLU_TESS_VERTEX_DATA, GLU_TESS_VERTEX_DATA,
(GLvoid(*)()) & TessellateVertexCallback); (_GLUfuncptr) &TessellateVertexCallback);
// Force GLU_TRIANGLES // Force GLU_TRIANGLES
gluTessCallback(tessellator_, // gluTessCallback(tessellator_, //
@ -64,7 +68,7 @@ public:
gluTessCallback(tessellator_, // gluTessCallback(tessellator_, //
GLU_TESS_ERROR, GLU_TESS_ERROR,
(GLvoid(*)()) & TessellateErrorCallback); (_GLUfuncptr) &TessellateErrorCallback);
} }
~Impl() { gluDeleteTess(tessellator_); } ~Impl() { gluDeleteTess(tessellator_); }
@ -328,8 +332,6 @@ void PlacefilePolygons::Impl::TessellateCombineCallback(GLdouble coords[3],
void* polygonData) void* polygonData)
{ {
static constexpr std::size_t r = kTessVertexR_; static constexpr std::size_t r = kTessVertexR_;
static constexpr std::size_t g = kTessVertexG_;
static constexpr std::size_t b = kTessVertexB_;
static constexpr std::size_t a = kTessVertexA_; static constexpr std::size_t a = kTessVertexA_;
Impl* self = static_cast<Impl*>(polygonData); Impl* self = static_cast<Impl*>(polygonData);

View file

@ -261,8 +261,8 @@ void PlacefileLayer::Render(
{params.latitude, params.longitude}); {params.latitude, params.longitude});
p->mapScale_ = std::pow(2.0, params.zoom) * mbgl::util::tileSize_D / p->mapScale_ = std::pow(2.0, params.zoom) * mbgl::util::tileSize_D /
mbgl::util::DEGREES_MAX; mbgl::util::DEGREES_MAX;
p->mapBearingCos_ = std::cosf(params.bearing * common::kDegreesToRadians); p->mapBearingCos_ = cosf(params.bearing * common::kDegreesToRadians);
p->mapBearingSin_ = std::sinf(params.bearing * common::kDegreesToRadians); p->mapBearingSin_ = sinf(params.bearing * common::kDegreesToRadians);
p->halfWidth_ = params.width * 0.5f; p->halfWidth_ = params.width * 0.5f;
p->halfHeight_ = params.height * 0.5f; p->halfHeight_ = params.height * 0.5f;