Browse Source

Changing the SDL mode broke the RGB calculation

We no longer are using ARGB but ABGR.
Godzil 3 years ago
parent
commit
53877e277e
2 changed files with 3 additions and 3 deletions
  1. 2 2
      source/include/display.h
  2. 1 1
      source/main.c

+ 2 - 2
source/include/display.h

@@ -68,7 +68,7 @@ static inline void doubleSwap(double *a, double *b)
     *b = tmp;
 }
 
-#define MAKE_RGB(_r, _g, _b) ((0xFF000000) | ((_r & 0xFF) << 16) | ((_g & 0xFF) << 8) | ((_b & 0xFF)))
-#define MAKE_ARGB(_a, _r, _g, _b) (((_a & 0xFF) << 24) | ((_r & 0xFF) << 16) | ((_g & 0xFF) << 8) | ((_b & 0xFF)))
+#define MAKE_RGB(_r, _g, _b) ((0xFF000000) | ((_b & 0xFF) << 16) | ((_g & 0xFF) << 8) | ((_r & 0xFF)))
+#define MAKE_ARGB(_a, _r, _g, _b) (((_a & 0xFF) << 24) | ((_g & 0xFF) << 16) | ((_g & 0xFF) << 8) | ((_r & 0xFF)))
 
 #endif /* THREEDENGINE_SOURCE_INCLUDE_DISPLAY_H */

+ 1 - 1
source/main.c

@@ -352,7 +352,7 @@ void render()
     }
 
     renderFrameBuffer();
-    clearFrameBuffer(0xFF000000);
+    clearFrameBuffer(MAKE_RGB(0, 0, 0));
 
     renderTime = (renderTime + (getMicroSecTime() - ticks) / 1000.) / 2.0;