diff --git a/MiniEngine.cpp b/MiniEngine.cpp index 4822dc2..a65006c 100644 --- a/MiniEngine.cpp +++ b/MiniEngine.cpp @@ -295,6 +295,35 @@ namespace MiniEngine return SDL_BlitSurface(s._get(),NULL,_get(),NULL); } + int Surface::blitScaled(Surface s,Rect src,Rect dst) + { + SDL_Rect rsrc=src.toSDLRect(); + SDL_Rect rdst=dst.toSDLRect(); + return SDL_BlitScaled(s._get(),&rsrc,_get(),&rdst); + } + + int Surface::blitScaledTo(Surface s,Rect dst) + { + SDL_Rect rdst=dst.toSDLRect(); + return SDL_BlitScaled(s._get(),NULL,_get(),&rdst); + } + + int Surface::blitScaledTo(Surface s,Point lupoint) + { + return blitScaledTo(s,Rect(lupoint.x,lupoint.y,s.getw(),s.geth())); + } + + int Surface::blitScaledFill(Surface s,Rect src) + { + SDL_Rect rsrc=src.toSDLRect(); + return SDL_BlitScaled(s._get(),&rsrc,_get(),NULL); + } + + int Surface::blitScaledFullFill(Surface s) + { + return SDL_BlitScaled(s._get(),NULL,_get(),NULL); + } + int Surface::setAlphaMode(int alpha) { return SDL_SetSurfaceAlphaMod(_get(),alpha); diff --git a/MiniEngine.h b/MiniEngine.h index d6fa859..e255f41 100644 --- a/MiniEngine.h +++ b/MiniEngine.h @@ -107,6 +107,12 @@ namespace MiniEngine int blitFill(Surface t, Rect src); int blitFullFill(Surface t); + int blitScaled(Surface s,Rect src,Rect dst); + int blitScaledTo(Surface t, Rect dst); + int blitScaledTo(Surface t, Point lupoint); + int blitScaledFill(Surface t, Rect src); + int blitScaledFullFill(Surface t); + int setAlphaMode(int alpha); int getAlphaMode();