diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | include/glm/detail/setup.hpp | 10 | ||||
-rw-r--r-- | include/glm/detail/type_vec2.hpp | 6 | ||||
-rw-r--r-- | src/ui.cpp | 3 | ||||
-rw-r--r-- | src/world.cpp | 13 |
5 files changed, 24 insertions, 12 deletions
@@ -12,9 +12,9 @@ ifeq ($(TARGET_OS),win32) -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lfreetype endif -CXXFLAGS = -g -m$(TARGET_BITS) -std=c++14 -fext-numeric-literals +CXXFLAGS = -ggdb -m$(TARGET_BITS) -std=c++14 -fext-numeric-literals CXXINC = -Iinclude -Iinclude/freetype -CXXWARN = -Wall -Wextra -Werror +CXXWARN = -Wall -Wextra -Werror -pedantic CXXSRCDIR = src CXXOUTDIR = out diff --git a/include/glm/detail/setup.hpp b/include/glm/detail/setup.hpp index dbd81c1..0b40e4f 100644 --- a/include/glm/detail/setup.hpp +++ b/include/glm/detail/setup.hpp @@ -426,17 +426,17 @@ #define GLM_NOT_BUGGY_VC32BITS (!(GLM_MODEL == GLM_MODEL_32 && (GLM_COMPILER & GLM_COMPILER_VC) && GLM_COMPILER < GLM_COMPILER_VC2013)) -#if GLM_COMPILER & GLM_COMPILER_LLVM +/*#if GLM_COMPILER & GLM_COMPILER_LLVM # define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions) -#elif GLM_LANG & (GLM_LANG_CXX11_FLAG | GLM_LANG_CXXMS_FLAG) -# define GLM_HAS_UNRESTRICTED_UNIONS 1 -#else +#elif GLM_LANG & (GLM_LANG_CXX11_FLAG | GLM_LANG_CXXMS_FLAG)*/ +# define GLM_HAS_UNRESTRICTED_UNIONS 0 // 1 +/*#else # define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_LANG & GLM_LANG_CXXMS_FLAG)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2015)) || \ ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46))) -#endif +#endif*/ // N2346 #if GLM_COMPILER & GLM_COMPILER_LLVM diff --git a/include/glm/detail/type_vec2.hpp b/include/glm/detail/type_vec2.hpp index 6dc2fd4..1ce30ea 100644 --- a/include/glm/detail/type_vec2.hpp +++ b/include/glm/detail/type_vec2.hpp @@ -55,7 +55,7 @@ namespace glm // -- Data -- -# if GLM_HAS_UNRESTRICTED_UNIONS +/*# if GLM_HAS_UNRESTRICTED_UNIONS union { struct{ T x, y; }; @@ -74,14 +74,14 @@ namespace glm _GLM_SWIZZLE2_4_MEMBERS(T, P, tvec4, s, t) # endif//GLM_SWIZZLE }; -# else +# else*/ union {T x, r, s;}; union {T y, g, t;}; # ifdef GLM_SWIZZLE GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, P, tvec2, tvec2, tvec3, tvec4) # endif//GLM_SWIZZLE -# endif +//# endif // -- Component accesses -- @@ -571,7 +571,8 @@ namespace ui { */ void waitForDialog(void) { - while (dialogBoxExists); + while (dialogBoxExists) + std::this_thread::sleep_for(std::chrono::milliseconds(1)); } void waitForCover(void) { diff --git a/src/world.cpp b/src/world.cpp index a0c5641..4a946d7 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -844,6 +844,14 @@ void WorldSystem::render(void) std::vector<std::pair<vec2,vec3>> c; for (int i = iStart; i < iEnd; i++) { + + // world switching changes world data size, render doesn't know + // because it's in a different thread, I guess. make sure we don't + // die: + if (i > static_cast<int>(world.data.size())) + return; // death for a frame is okay, right? + + if (world.data[i].groundHeight <= 0) { // TODO holes (andy) world.data[i].groundHeight = GROUND_HEIGHT_MINIMUM - 1; glColor4ub(0, 0, 0, 255); @@ -898,6 +906,10 @@ void WorldSystem::render(void) std::vector<GLfloat> grasst; for (int i = iStart; i < iEnd; i++) { + + if (i > static_cast<int>(world.data.size())) + return; // see dirt rendering + auto wd = world.data[i]; auto gh = wd.grassHeight; @@ -1185,7 +1197,6 @@ void WorldSystem::detect(entityx::TimeDelta dt) void WorldSystem::goWorldRight(Position& p, Solid &d) { if (!(world.toRight.empty()) && (p.x + d.width > world.startX * -1 - HLINES(15))) { - BREAKPOINT; ui::toggleBlack(); ui::waitForCover(); auto file = world.toRight; |