From a97384839b4a4db6f233de29949471c955d8c4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 3 Jan 2018 03:12:43 +0100 Subject: [PATCH] Use privately Corrade Optional instead of the problematic std::optional. Not in the public APIs yet (Trade etc.), as I need to solve backwards compatibility first. --- src/Magnum/Context.h | 4 ++-- src/Magnum/Implementation/RendererState.cpp | 2 +- src/Magnum/Implementation/RendererState.h | 4 ++-- src/Magnum/PixelStorage.cpp | 2 +- src/Magnum/Shaders/MeshVisualizer.cpp | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index df7912225..27da95ad1 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -34,12 +34,12 @@ #include #include #include +#include #include "Magnum/Magnum.h" #include "Magnum/OpenGL.h" #include "Magnum/Tags.h" #include "Magnum/visibility.h" -#include "MagnumExternal/Optional/optional.hpp" namespace Magnum { @@ -602,7 +602,7 @@ class MAGNUM_EXPORT Context { Implementation::State* _state; - std::optional _detectedDrivers; + Containers::Optional _detectedDrivers; /* True means known and disabled, false means known */ std::vector> _driverWorkarounds; diff --git a/src/Magnum/Implementation/RendererState.cpp b/src/Magnum/Implementation/RendererState.cpp index 2d4ce36c6..e72bd24cc 100644 --- a/src/Magnum/Implementation/RendererState.cpp +++ b/src/Magnum/Implementation/RendererState.cpp @@ -105,7 +105,7 @@ RendererState::PixelStorage::PixelStorage(): void RendererState::PixelStorage::reset() { #ifndef MAGNUM_TARGET_GLES - swapBytes = std::nullopt; + swapBytes = Containers::NullOpt; #endif alignment = DisengagedValue; #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) diff --git a/src/Magnum/Implementation/RendererState.h b/src/Magnum/Implementation/RendererState.h index 49a583557..862dc670a 100644 --- a/src/Magnum/Implementation/RendererState.h +++ b/src/Magnum/Implementation/RendererState.h @@ -27,10 +27,10 @@ #include #include +#include #include "Magnum/Renderer.h" #include "Magnum/Math/Vector3.h" -#include "MagnumExternal/Optional/optional.hpp" namespace Magnum { namespace Implementation { @@ -52,7 +52,7 @@ struct RendererState { void reset(); #ifndef MAGNUM_TARGET_GLES - std::optional swapBytes; + Containers::Optional swapBytes; #endif Int alignment; #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) diff --git a/src/Magnum/PixelStorage.cpp b/src/Magnum/PixelStorage.cpp index 95e8bfb10..d5e66e51b 100644 --- a/src/Magnum/PixelStorage.cpp +++ b/src/Magnum/PixelStorage.cpp @@ -220,7 +220,7 @@ void PixelStorage::applyInternal(const bool isUnpack) { #ifndef MAGNUM_TARGET_GLES /* Byte swap */ - if(state.swapBytes == std::nullopt || state.swapBytes != _swapBytes) + if(state.swapBytes == Containers::NullOpt || state.swapBytes != _swapBytes) glPixelStorei(isUnpack ? GL_UNPACK_SWAP_BYTES : GL_PACK_SWAP_BYTES, *(state.swapBytes = _swapBytes)); #endif diff --git a/src/Magnum/Shaders/MeshVisualizer.cpp b/src/Magnum/Shaders/MeshVisualizer.cpp index bb3d81819..e14a3321c 100644 --- a/src/Magnum/Shaders/MeshVisualizer.cpp +++ b/src/Magnum/Shaders/MeshVisualizer.cpp @@ -25,12 +25,12 @@ #include "MeshVisualizer.h" +#include #include #include "Magnum/Context.h" #include "Magnum/Extensions.h" #include "Magnum/Shader.h" -#include "MagnumExternal/Optional/optional.hpp" #include "Implementation/CreateCompatibilityShader.h" @@ -86,7 +86,7 @@ MeshVisualizer::MeshVisualizer(const Flags flags): _flags{flags} { .addSource(rs.get("MeshVisualizer.frag")); #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - std::optional geom; + Containers::Optional geom; if(flags & Flag::Wireframe && !(flags & Flag::NoGeometryShader)) { geom = Implementation::createCompatibilityShader(rs, version, Shader::Type::Geometry); geom->addSource(rs.get("MeshVisualizer.geom"));