From 79fd3e1d36dd7898cbfef7fee8d4bb8011f1ff72 Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 4 Aug 2020 13:10:50 -0700 Subject: [PATCH] Remove -1,-1 offset from ScaleSurface() For some reason, ScaleSurface() was drawing each pixel one pixel up and to the left from its actual position. I have no idea why. But this was causing an issue where pixels would just be dropped, because they would be drawn outside of the temporary SDL_Surface from which the scaled surface would be drawn onto. Also, the offset just creates a visual one-pixel offset in the result for no reason. So I'm just removing it. Big Viridian also suffered from this one-pixel offset, so now they will no longer look like they're floating above the ground when standing on the floor. --- desktop_version/src/GraphicsUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/GraphicsUtil.cpp b/desktop_version/src/GraphicsUtil.cpp index 37fdd286..159fe26a 100644 --- a/desktop_version/src/GraphicsUtil.cpp +++ b/desktop_version/src/GraphicsUtil.cpp @@ -161,7 +161,7 @@ SDL_Surface * ScaleSurface( SDL_Surface *_surface, int Width, int Height, SDL_Su for(Sint32 y = 0; y < _surface->h; y++) for(Sint32 x = 0; x < _surface->w; x++) { - setRect(gigantoPixel, static_cast((float(x)*_stretch_factor_x) -1), static_cast((float(y) *_stretch_factor_y)-1), static_cast(_stretch_factor_x +1.0),static_cast( _stretch_factor_y+1.0)) ; + setRect(gigantoPixel, static_cast(float(x)*_stretch_factor_x), static_cast(float(y) *_stretch_factor_y), static_cast(_stretch_factor_x),static_cast( _stretch_factor_y)) ; SDL_FillRect(_ret, &gigantoPixel, ReadPixel(_surface, x, y)); }