]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
modified glm; added pedantic flag
authorClyne Sullivan <tullivan99@gmail.com>
Fri, 25 Nov 2016 19:12:05 +0000 (14:12 -0500)
committerClyne Sullivan <tullivan99@gmail.com>
Fri, 25 Nov 2016 19:12:05 +0000 (14:12 -0500)
Makefile
include/glm/detail/setup.hpp
include/glm/detail/type_vec2.hpp
src/ui.cpp
src/world.cpp

index 8d5197c9039bc258ce8c52c34702466163004592..26adce16ab860b125a9489977a76174b924deee5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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
index dbd81c1f884860c0fc8c378879bb2ebb3140289c..0b40e4f8e9f57bc7297cae318f82aff48d5b52e3 100644 (file)
 
 #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
index 6dc2fd42f1ecc40337e7d218f3d97a486726c828..1ce30eaa5da96270f9013ef9f14ed91c8c6cb0db 100644 (file)
@@ -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 --
 
index 40339a08fe83a4deec3353b7ef78933603ef4e25..5939368860eaea2882d4594fea265867c8a6a77e 100644 (file)
@@ -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) {
index a0c5641455a475411ab3397ad56e863294704a61..4a946d75d5ee728c7883fb57be4e01864ad0e2ea 100644 (file)
@@ -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;