mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Add Scaled Blit Functions to Surface
This commit is contained in:
parent
3043ae0684
commit
d9b26de617
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user