From dfeeff779b4dfb22ca7172a02c5c57f2360545eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 15 Dec 2013 20:07:49 +0100 Subject: [PATCH 1/4] Shaders: oops. --- src/Shaders/Flat.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shaders/Flat.frag b/src/Shaders/Flat.frag index c2ea645cf..b24e8e2d4 100644 --- a/src/Shaders/Flat.frag +++ b/src/Shaders/Flat.frag @@ -46,7 +46,7 @@ layout(location = 1) uniform vec4 color; # ifndef GL_ES uniform lowp vec4 color = vec4(1.0f, 1.0f, 1.0f, 1.0f); # else -unfirom lowp vec4 color; +uniform lowp vec4 color; # endif #endif From ae9c02d5917dd390a275142d74fa6e7954a52315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 15 Dec 2013 20:08:26 +0100 Subject: [PATCH 2/4] Text: actually have some sane default plugin dir. --- src/Text/configure.h.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/configure.h.cmake b/src/Text/configure.h.cmake index 048adae7a..4555f5dc6 100644 --- a/src/Text/configure.h.cmake +++ b/src/Text/configure.h.cmake @@ -22,4 +22,4 @@ DEALINGS IN THE SOFTWARE. */ -#define MAGNUM_PLUGINS_DIR "${MAGNUM_PLUGINS_DIR}" +#define MAGNUM_PLUGINS_DIR "${MAGNUM_PLUGINS_INSTALL_DIR}" From 744cc2f8060828f38c1e6af33326a5356004228b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 15 Dec 2013 20:09:20 +0100 Subject: [PATCH 3/4] Text: fix error in fontconverter utility documentation. --- src/Text/fontconverter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/fontconverter.cpp b/src/Text/fontconverter.cpp index a944fce6f..5189b056d 100644 --- a/src/Text/fontconverter.cpp +++ b/src/Text/fontconverter.cpp @@ -55,7 +55,7 @@ FontConverter::FontConverter(const Arguments& arguments): Platform::WindowlessAp .addOption("characters", "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789?!:,. ").setHelp("characters", "characters to include in the output") - .addOption("font-size", "128").setHelpKey("font-size", "\"X Y\"").setHelp("font-size", "TTF font size") + .addOption("font-size", "128").setHelpKey("font-size", "N").setHelp("font-size", "TTF font size") .addOption("atlas-size", "2048 2048").setHelpKey("atlas-size", "\"X Y\"").setHelp("atlas-size", "glyph atlas size") .addOption("output-size", "256 256").setHelpKey("output-size", "\"X Y\"").setHelp("output-size", "output atlas size. If set to zero size, distance field computation will not be used.") .addOption("radius", "24").setHelpKey("radius", "N").setHelp("radius", "distance field computation radius") From 282ee58c627a47b38175408ac5fc2d3b79f9ba2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 15 Dec 2013 20:14:47 +0100 Subject: [PATCH 4/4] Math: work around missing std::round() in NaCl newlib. Also test that our implementation behaves the same. --- src/Math/Functions.h | 11 ++++++++++- src/Math/Test/FunctionsTest.cpp | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Math/Functions.h b/src/Math/Functions.h index 8e1e08b75..6230b4390 100644 --- a/src/Math/Functions.h +++ b/src/Math/Functions.h @@ -251,12 +251,21 @@ template Vector floor(const Vector& template inline T round(const T& a); #else template inline typename std::enable_if::value, T>::type round(T a) { + #ifndef CORRADE_TARGET_NACL_NEWLIB return std::round(a); + #else + return (a > T(0)) ? std::floor(a + T(0.5)) : std::ceil(a - T(0.5)); + #endif } template Vector round(const Vector& a) { Vector out; - for(std::size_t i = 0; i != size; ++i) + for(std::size_t i = 0; i != size; ++i) { + #ifndef CORRADE_TARGET_NACL_NEWLIB out[i] = std::round(a[i]); + #else + out[i] = round(a[i]); + #endif + } return out; } #endif diff --git a/src/Math/Test/FunctionsTest.cpp b/src/Math/Test/FunctionsTest.cpp index dc682e664..b2dd56187 100644 --- a/src/Math/Test/FunctionsTest.cpp +++ b/src/Math/Test/FunctionsTest.cpp @@ -167,6 +167,15 @@ void FunctionsTest::floor() { void FunctionsTest::round() { CORRADE_COMPARE(Math::round(2.3f), 2.0f); CORRADE_COMPARE(Math::round(Vector3(2.3f, 0.7f, 1.5f)), Vector3(2.0f, 1.0f, 2.0f)); + + /* We are working around missing std::round() in NaCl newlib, thus we must + test that the behavior is the same on both implementations */ + CORRADE_COMPARE(Math::round(-2.0f), -2.0f); + CORRADE_COMPARE(Math::round(-1.5f), -2.0f); + CORRADE_COMPARE(Math::round(-1.3f), -1.0f); + CORRADE_COMPARE(Math::round(1.3f), 1.0f); + CORRADE_COMPARE(Math::round(1.5f), 2.0f); + CORRADE_COMPARE(Math::round(2.0f), 2.0f); } void FunctionsTest::ceil() {