Skip to content

Commit

Permalink
Minor compilation fixes. (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
asherikov authored Aug 14, 2023
1 parent 7b1c17b commit 2ac6a8e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/rocky/GDAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(layer->subDataSet()) : 1;
if (subDataset < 1 || subDataset > numSubDatasets) subDataset = 1;
std::stringstream buf;
buf << "SUBDATASET_" << subDataset << "_NAME";
Expand Down
4 changes: 2 additions & 2 deletions src/rocky/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/rocky_vsg/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ Application::refreshView(vsg::ref_ptr<vsg::View> 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;
Expand Down
8 changes: 4 additions & 4 deletions src/rocky_vsg/FeatureView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<class T, class ITER>
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);
Expand All @@ -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<class T, class ITER>
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);
Expand Down
2 changes: 2 additions & 0 deletions src/rocky_vsg/InstanceVSG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <vsg/io/read.h>
#include <vsg/io/Logger.h>
#include <vsg/state/Image.h>
#include <vsg/io/ReaderWriter.h>


ROCKY_ABOUT(VulkanSceneGraph, VSG_VERSION_STRING)

Expand Down
1 change: 1 addition & 0 deletions src/rocky_vsg/engine/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <vsg/maths/vec3.h>
#include <vsg/maths/mat4.h>
#include <vsg/vk/State.h>
#include <vsg/threading/OperationThreads.h>

namespace ROCKY_NAMESPACE
{
Expand Down

0 comments on commit 2ac6a8e

Please sign in to comment.