Make sure to round up the scaling
authorBill Lash <william.lash@gmail.com>
Wed, 2 Oct 2019 02:56:47 +0000 (21:56 -0500)
committerBill Lash <william.lash@gmail.com>
Wed, 2 Oct 2019 02:56:47 +0000 (21:56 -0500)
Use ceil to make sure to round up the scaling increment to get all
of the picture

src/sdl/sf_video.c

index 2d47520e2aa787c273b8f95c786b94963b2aab40..135ef1df6670b508c80a64884e3885bad47e1c0d 100644 (file)
@@ -600,9 +600,9 @@ void os_draw_picture(int picture, int y, int x)
                        sf_flushdisplay();
 
                for (yy = 0; yy < eh * m_gfxScale_h; yy++) {
-                       int ys = yy / m_gfxScale_h;
+                       int ys = ceil(yy / m_gfxScale_h);
                        for (xx = 0; xx < ew * m_gfxScale_w; xx++) {
-                               int xs = xx / m_gfxScale_w;
+                               int xs = ceil(xx / m_gfxScale_w);
                                int index = pic->pixels[ys * pic->width + xs];
                                if (index != pic->transparentcolor)
                                        sf_wpixel(x + xx, y + yy,