diff --git a/basegraph.cpp b/basegraph.cpp index 630d2339..2dd4de8d 100644 --- a/basegraph.cpp +++ b/basegraph.cpp @@ -1039,11 +1039,11 @@ EX void drawCircle(int x, int y, int size, color_t color, color_t fillcolor IS(0 #elif CAP_SDLGFX if(pconf.stretch == 1) { if(fillcolor) filledCircleColor(srend, x, y, size, fillcolor); - if(color) ((vid.antialias && AA_NOGL)?aacircleColor:circleColor) (srend, x, y, size, color); + if(color) ((vid.antialias && AA_NOGL)?aacircleColor:circleColor) (srend, x, y, size, align(color)); } else { if(fillcolor) filledEllipseColor(srend, x, y, size, size * pconf.stretch, fillcolor); - if(color) ((vid.antialias && AA_NOGL)?aaellipseColor:ellipseColor) (srend, x, y, size, size * pconf.stretch, color); + if(color) ((vid.antialias && AA_NOGL)?aaellipseColor:ellipseColor) (srend, x, y, size, size * pconf.stretch, align(color)); } #elif CAP_SDL int pts = size * 4; diff --git a/drawing.cpp b/drawing.cpp index 705d44a4..7623f58c 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -558,21 +558,30 @@ void addpoly(const shiftmatrix& V, const vector &tab, int ofs, int cnt } } +EX color_t align(color_t col) { + #if CAP_SDL2 + swap(part(col, 0), part(col, 3)); + swap(part(col, 1), part(col, 2)); + #endif + return col; + } + + #if CAP_SDLGFX void aapolylineColor(SDL_Renderer *s, int*x, int *y, int polyi, color_t col) { for(int i=1; i spx(px, px + polyi); std::vector spy(py, py + polyi); - filledPolygonColor(s, spx.data(), spy.data(), polyi, col); + filledPolygonColor(s, spx.data(), spy.data(), polyi, align(col)); } #endif diff --git a/netgen.cpp b/netgen.cpp index 84f65984..2c45bcee 100644 --- a/netgen.cpp +++ b/netgen.cpp @@ -208,7 +208,7 @@ EX namespace netgen { void blackline(vec v1, vec v2, color_t col = 0x000000FF) { #if CAP_SDLGFX - aalineColor(srend, int(v1.x), int(v1.y), int(v2.x), int(v2.y), col); + aalineColor(srend, int(v1.x), int(v1.y), int(v2.x), int(v2.y), align(col)); #elif CAP_SDL SDL_LockSurface(s); int len = abs(v1.x-v2.x) + abs(v1.y-v2.y);