mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 18:04:09 +03:00
Ax ScaleSurfaceSlow() in favor of ScaleSurface()
ScaleSurfaceSlow() uses DrawPixel() instead of SDL_FillRect() to scale a given surface, which is slow and inefficient, and makes it less likely that the game could be moved to SDL_Render. Unfortunately, it has this weird -1,-1 offset, but that will be fixed in the next commit.
This commit is contained in:
@@ -424,7 +424,7 @@ void Graphics::bigprint( int _x, int _y, std::string _s, int r, int g, int b, b
|
||||
idx = font_idx(curr);
|
||||
if (INBOUNDS(idx, font))
|
||||
{
|
||||
SDL_Surface* tempPrint = ScaleSurfaceSlow(font[idx], font[idx]->w *sc,font[idx]->h *sc);
|
||||
SDL_Surface* tempPrint = ScaleSurface(font[idx], font[idx]->w *sc,font[idx]->h *sc);
|
||||
SDL_Rect printrect = { static_cast<Sint16>((_x) + bfontpos), static_cast<Sint16>(_y) , static_cast<Sint16>((bfont_rect.w*sc)+1), static_cast<Sint16>((bfont_rect.h * sc)+1)};
|
||||
BlitSurfaceColoured(tempPrint, NULL, backBuffer, &printrect, ct);
|
||||
SDL_FreeSurface(tempPrint);
|
||||
@@ -3023,7 +3023,7 @@ void Graphics::bigrprint(int x, int y, std::string& t, int r, int g, int b, bool
|
||||
idx = font_idx(cur);
|
||||
if (INBOUNDS(idx, font))
|
||||
{
|
||||
SDL_Surface* tempPrint = ScaleSurfaceSlow(font[idx], font[idx]->w *sc,font[idx]->h *sc);
|
||||
SDL_Surface* tempPrint = ScaleSurface(font[idx], font[idx]->w *sc,font[idx]->h *sc);
|
||||
SDL_Rect printrect = { Sint16((x) + bfontpos), Sint16(y) , Sint16(bfont_rect.w*sc), Sint16(bfont_rect.h * sc)};
|
||||
BlitSurfaceColoured(tempPrint, NULL, backBuffer, &printrect, ct);
|
||||
SDL_FreeSurface(tempPrint);
|
||||
|
||||
Reference in New Issue
Block a user