From 0c5a504ad521c95dd9bea42ed239e04b6c21dcbd Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 11 Aug 2023 08:36:08 -0500 Subject: [PATCH] Placefile polygon Linux fixes --- .../source/scwx/qt/gl/draw/placefile_polygons.cpp | 12 +++++++----- scwx-qt/source/scwx/qt/map/placefile_layer.cpp | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp index a2337d33..216b4a9b 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp @@ -7,6 +7,10 @@ #include #include +#if defined(_WIN32) +typedef void (*_GLUfuncptr)(void); +#endif + namespace scwx { namespace qt @@ -52,10 +56,10 @@ public: gluTessCallback(tessellator_, // GLU_TESS_COMBINE_DATA, - (GLvoid(*)()) & TessellateCombineCallback); + (_GLUfuncptr) &TessellateCombineCallback); gluTessCallback(tessellator_, // GLU_TESS_VERTEX_DATA, - (GLvoid(*)()) & TessellateVertexCallback); + (_GLUfuncptr) &TessellateVertexCallback); // Force GLU_TRIANGLES gluTessCallback(tessellator_, // @@ -64,7 +68,7 @@ public: gluTessCallback(tessellator_, // GLU_TESS_ERROR, - (GLvoid(*)()) & TessellateErrorCallback); + (_GLUfuncptr) &TessellateErrorCallback); } ~Impl() { gluDeleteTess(tessellator_); } @@ -328,8 +332,6 @@ void PlacefilePolygons::Impl::TessellateCombineCallback(GLdouble coords[3], void* polygonData) { 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_; Impl* self = static_cast(polygonData); diff --git a/scwx-qt/source/scwx/qt/map/placefile_layer.cpp b/scwx-qt/source/scwx/qt/map/placefile_layer.cpp index c98338f7..a7e258e6 100644 --- a/scwx-qt/source/scwx/qt/map/placefile_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/placefile_layer.cpp @@ -261,8 +261,8 @@ void PlacefileLayer::Render( {params.latitude, params.longitude}); p->mapScale_ = std::pow(2.0, params.zoom) * mbgl::util::tileSize_D / mbgl::util::DEGREES_MAX; - p->mapBearingCos_ = std::cosf(params.bearing * common::kDegreesToRadians); - p->mapBearingSin_ = std::sinf(params.bearing * common::kDegreesToRadians); + p->mapBearingCos_ = cosf(params.bearing * common::kDegreesToRadians); + p->mapBearingSin_ = sinf(params.bearing * common::kDegreesToRadians); p->halfWidth_ = params.width * 0.5f; p->halfHeight_ = params.height * 0.5f;