Replace boost/units in favor of units library

This commit is contained in:
Dan Paulat 2023-08-18 10:45:52 -05:00
parent 12833202b7
commit 35b90fa98d
15 changed files with 67 additions and 67 deletions

View file

@ -6,7 +6,6 @@
#include <GL/glu.h>
#include <boost/container/stable_vector.hpp>
#include <boost/units/base_units/metric/nautical_mile.hpp>
#if defined(_WIN32)
typedef void (*_GLUfuncptr)(void);
@ -216,11 +215,9 @@ void PlacefilePolygons::Render(
if (p->thresholded_)
{
// If thresholding is enabled, set the map distance
// TODO: nautical miles
auto mapDistance =
util::maplibre::GetMapDistance(params).value() / 1852.0f;
gl.glUniform1f(p->uMapDistanceLocation_,
static_cast<float>(mapDistance));
units::length::nautical_miles<float> mapDistance =
util::maplibre::GetMapDistance(params);
gl.glUniform1f(p->uMapDistanceLocation_, mapDistance.value());
}
else
{
@ -311,9 +308,9 @@ void PlacefilePolygons::Impl::Tessellate(
// Default color to "Color" statement
boost::gil::rgba8_pixel_t lastColor = di->color_;
// TODO: nautical miles
currentThreshold_ =
static_cast<GLint>(std::roundf(di->threshold_.value() / 1852.0f));
// Current threshold
units::length::nautical_miles<double> threshold = di->threshold_;
currentThreshold_ = static_cast<GLint>(std::round(threshold.value()));
gluTessBeginPolygon(tessellator_, this);