From 2ac6a8ee45fe450c1d74914afb5a0ef2852e150e Mon Sep 17 00:00:00 2001 From: Alexander Sherikov Date: Mon, 14 Aug 2023 22:41:51 +0200 Subject: [PATCH] Minor compilation fixes. (#13) --- src/rocky/GDAL.cpp | 2 +- src/rocky/Image.h | 4 ++-- src/rocky_vsg/Application.cpp | 2 +- src/rocky_vsg/FeatureView.cpp | 8 ++++---- src/rocky_vsg/InstanceVSG.cpp | 2 ++ src/rocky_vsg/engine/Utils.h | 1 + 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/rocky/GDAL.cpp b/src/rocky/GDAL.cpp index b0171869..bdc606e5 100644 --- a/src/rocky/GDAL.cpp +++ b/src/rocky/GDAL.cpp @@ -628,7 +628,7 @@ GDAL::Driver::open( if (numSubDatasets > 0) { - int subDataset = layer->subDataSet().has_value() ? layer->subDataSet() : 1; + int subDataset = layer->subDataSet().has_value() ? static_cast(layer->subDataSet()) : 1; if (subDataset < 1 || subDataset > numSubDatasets) subDataset = 1; std::stringstream buf; buf << "SUBDATASET_" << subDataset << "_NAME"; diff --git a/src/rocky/Image.h b/src/rocky/Image.h index dbded70c..5e00a038 100644 --- a/src/rocky/Image.h +++ b/src/rocky/Image.h @@ -245,13 +245,13 @@ namespace ROCKY_NAMESPACE float sizeS = (float)(width() - 1); float s = u * sizeS; - float s0 = std::max(floor(s), 0.0f); + float s0 = std::max(std::floor(s), 0.0f); float s1 = std::min(s0 + 1.0f, sizeS); float smix = s0 < s1 ? (s - s0) / (s1 - s0) : 0.0f; float sizeT = (float)(height() - 1); float t = v * sizeT; - float t0 = std::max(floor(t), 0.0f); + float t0 = std::max(std::floor(t), 0.0f); float t1 = std::min(t0 + 1.0f, sizeT); float tmix = t0 < t1 ? (t - t0) / (t1 - t0) : 0.0f; diff --git a/src/rocky_vsg/Application.cpp b/src/rocky_vsg/Application.cpp index acfabc69..f7054b8d 100644 --- a/src/rocky_vsg/Application.cpp +++ b/src/rocky_vsg/Application.cpp @@ -401,7 +401,7 @@ Application::refreshView(vsg::ref_ptr view) // wait until the device is idle to avoid changing state while it's being used. viewer->deviceWaitIdle(); - auto& vp = view->camera->getViewport(); + auto vp = view->camera->getViewport(); viewdata.parentRenderGraph->renderArea.offset.x = (std::uint32_t)vp.x; viewdata.parentRenderGraph->renderArea.offset.y = (std::uint32_t)vp.y; viewdata.parentRenderGraph->renderArea.extent.width = (std::uint32_t)vp.width; diff --git a/src/rocky_vsg/FeatureView.cpp b/src/rocky_vsg/FeatureView.cpp index 52e579a9..0f6262fc 100644 --- a/src/rocky_vsg/FeatureView.cpp +++ b/src/rocky_vsg/FeatureView.cpp @@ -14,12 +14,12 @@ namespace // Transforms a range of points from geographic (long lat) to gnomonic coordinates // around a centroid with an optional scale. template - void geo_to_gnomonic(typename ITER begin, typename ITER end, const T& centroid, double scale = 1.0) + void geo_to_gnomonic(ITER begin, ITER end, const T& centroid, double scale = 1.0) { double lon0 = deg2rad(centroid.x); double lat0 = deg2rad(centroid.y); - for (typename ITER p = begin; p != end; ++p) + for (ITER p = begin; p != end; ++p) { double lon = deg2rad(p->x); double lat = deg2rad(p->y); @@ -32,12 +32,12 @@ namespace // Transforms a range of points from gnomonic coordinates around a centroid with a // given scale to geographic (long lat) coordinates. template - void gnomonic_to_geo(typename ITER begin, typename ITER end, const T& centroid, double scale = 1.0) + void gnomonic_to_geo(ITER begin, ITER end, const T& centroid, double scale = 1.0) { double lon0 = deg2rad(centroid.x); double lat0 = deg2rad(centroid.y); - for (typename ITER p = begin; p != end; ++p) + for (ITER p = begin; p != end; ++p) { double x = p->x / scale, y = p->y / scale; double rho = sqrt(x * x + y * y); diff --git a/src/rocky_vsg/InstanceVSG.cpp b/src/rocky_vsg/InstanceVSG.cpp index 9a49aec7..1ae93a4b 100644 --- a/src/rocky_vsg/InstanceVSG.cpp +++ b/src/rocky_vsg/InstanceVSG.cpp @@ -9,6 +9,8 @@ #include #include #include +#include + ROCKY_ABOUT(VulkanSceneGraph, VSG_VERSION_STRING) diff --git a/src/rocky_vsg/engine/Utils.h b/src/rocky_vsg/engine/Utils.h index 0b34fe90..c0cd9cf3 100644 --- a/src/rocky_vsg/engine/Utils.h +++ b/src/rocky_vsg/engine/Utils.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace ROCKY_NAMESPACE {