diff --git a/bazaar/SDL/SDL.upp b/bazaar/SDL/SDL.upp index 02bf375ff..779fa525a 100644 --- a/bazaar/SDL/SDL.upp +++ b/bazaar/SDL/SDL.upp @@ -4,9 +4,7 @@ uses Core, CtrlLib; -library(MSC) SDL; - -library(GCC WIN32) SDL; +library(WIN32) SDL; library(LINUX) SDL; diff --git a/bazaar/SDL/SDLCtrl.h b/bazaar/SDL/SDLCtrl.h index c4b821056..7289c3286 100644 --- a/bazaar/SDL/SDLCtrl.h +++ b/bazaar/SDL/SDLCtrl.h @@ -26,10 +26,22 @@ public: void DrawCircle(int x, int y, int radius, int thick, Color color); void FillCircle(int x, int y, int radius, Color color); void DrawPixel(int x, int y, Color color); - void DrawPixel(int x, int y, Uint32 scolor); + inline void DrawPixel(int x, int y, Uint32 scolor) { + byte *pixelpos = GetPixelPos(x, y); + if (!pixelpos) + return; + if (surface->format->BytesPerPixel == 1) + *pixelpos = (byte)scolor; + else + memcpy(pixelpos, &scolor, surface->format->BytesPerPixel); + } Color GetPixel(int x, int y); byte GetPixelByte(int x, int y); - byte *GetPixelPos(int x, int y); + inline byte *GetPixelPos(int x, int y) { + if (x < 0 || y < 0|| x >= surface->w || y >= surface->h) + return 0; + return (byte *)surface->pixels + surface->pitch*y + surface->format->BytesPerPixel*x; + } Uint32 GetColor(Color color); int GetBpp() {return surface->format->BitsPerPixel;}; int GetWidth() {return surface->w;}; diff --git a/bazaar/SDL/SDLSurface.cpp b/bazaar/SDL/SDLSurface.cpp index 6b50d7e33..a574e973e 100644 --- a/bazaar/SDL/SDLSurface.cpp +++ b/bazaar/SDL/SDLSurface.cpp @@ -93,12 +93,6 @@ bool SDLSurface::Blit(SDLSurface &surf, Rect source, Rect dest) { return true; } -inline byte *SDLSurface::GetPixelPos(int x, int y) { - if (x < 0 || y < 0|| x >= surface->w || y >= surface->h) - return 0; - return (byte *)surface->pixels + surface->pitch*y + surface->format->BytesPerPixel*x; -} - void SDLSurface::DrawPixel(int x, int y, Color color) { Uint32 scolor = GetColor(color); byte *pixelpos = GetPixelPos(x, y); @@ -106,16 +100,6 @@ void SDLSurface::DrawPixel(int x, int y, Color color) { memcpy(pixelpos, &scolor, surface->format->BytesPerPixel); } -inline void SDLSurface::DrawPixel(int x, int y, Uint32 scolor) { - byte *pixelpos = GetPixelPos(x, y); - if (!pixelpos) - return; - if (surface->format->BytesPerPixel == 1) - *pixelpos = (byte)scolor; - else - memcpy(pixelpos, &scolor, surface->format->BytesPerPixel); -} - Color SDLSurface::GetPixel(int x, int y) { Uint32 scolor; byte *pixelpos = GetPixelPos(x, y);