removing more boost usage
This commit is contained in:
@@ -1053,7 +1053,7 @@ bool MapChunk::blurTerrain ( glm::vec3 const& pos
|
||||
, float radius
|
||||
, int BrushType
|
||||
, flatten_mode const& mode
|
||||
, std::function<boost::optional<float> (float, float)> height
|
||||
, std::function<std::optional<float> (float, float)> height
|
||||
)
|
||||
{
|
||||
bool changed (false);
|
||||
@@ -1087,7 +1087,7 @@ bool MapChunk::blurTerrain ( glm::vec3 const& pos
|
||||
auto h (height (tx, tz));
|
||||
if (h)
|
||||
{
|
||||
TotalHeight += (1.0f - dist2 / radius) * h.get();
|
||||
TotalHeight += (1.0f - dist2 / radius) * h.value();
|
||||
TotalWeight += (1.0f - dist2 / radius);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <opengl/scoped.hpp>
|
||||
#include <opengl/texture.hpp>
|
||||
#include <noggit/Misc.h>
|
||||
|
||||
#include <optional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <array>
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
bool changeTerrain(glm::vec3 const& pos, float change, float radius, int BrushType, float inner_radius);
|
||||
bool flattenTerrain(glm::vec3 const& pos, float remain, float radius, int BrushType, flatten_mode const& mode, const glm::vec3& origin, math::degrees angle, math::degrees orientation);
|
||||
bool blurTerrain ( glm::vec3 const& pos, float remain, float radius, int BrushType, flatten_mode const& mode
|
||||
, std::function<boost::optional<float> (float, float)> height
|
||||
, std::function<std::optional<float> (float, float)> height
|
||||
);
|
||||
|
||||
bool changeTerrainProcessVertex(glm::vec3 const& pos, glm::vec3 const& vertex, float& dt, float radiusOuter, float radiusInner, int brushType);
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
#include <external/QtAdvancedDockingSystem/src/DockManager.h>
|
||||
#include <opengl/texture.hpp>
|
||||
#include <opengl/scoped.hpp>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include <QtCore/QElapsedTimer>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
@@ -2238,11 +2238,11 @@ void World::blurTerrain(glm::vec3 const& pos, float remain, float radius, int Br
|
||||
, radius
|
||||
, BrushType
|
||||
, mode
|
||||
, [this] (float x, float z) -> boost::optional<float>
|
||||
, [this] (float x, float z) -> std::optional<float>
|
||||
{
|
||||
glm::vec3 vec;
|
||||
auto res (GetVertex (x, z, &vec));
|
||||
return boost::make_optional (res, vec.y);
|
||||
return res ? std::optional<float>(vec.y) : std::nullopt;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user