diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2011-06-22 18:22:48 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-06-25 14:52:24 (GMT) |
| commit | 36e2a07a5b5e0eb07bd9fcea48004dd8b5890322 (patch) | |
| tree | cfdb0166c3d18c41a9dacc82326711fdea564ab6 /src/graphics.c | |
| parent | 04b3eb11fd32daaf094df676d2037ed613c172a0 (diff) | |
| download | powder-36e2a07a5b5e0eb07bd9fcea48004dd8b5890322.zip powder-36e2a07a5b5e0eb07bd9fcea48004dd8b5890322.tar.gz | |
Visual Studio fixes
Diffstat (limited to 'src/graphics.c')
| -rw-r--r-- | src/graphics.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/graphics.c b/src/graphics.c index fd6213f..6a15e5a 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -163,7 +163,8 @@ pixel *resample_img(pixel *src, int sw, int sh, int rw, int rh) q = malloc(rw*rh*PIXELSIZE); memcpy(q, src, rw*rh*PIXELSIZE); } else if(rw > sw && rh > sh){ - float fx, fy, fyc, fxc, intp; + float fx, fy, fyc, fxc; + double intp; pixel tr, tl, br, bl; q = malloc(rw*rh*PIXELSIZE); //Bilinear interpolation for upscaling @@ -172,8 +173,8 @@ pixel *resample_img(pixel *src, int sw, int sh, int rw, int rh) { fx = ((float)x)*((float)sw)/((float)rw); fy = ((float)y)*((float)sh)/((float)rh); - fxc = modff(fx, &intp); - fyc = modff(fy, &intp); + fxc = modf(fx, &intp); + fyc = modf(fy, &intp); fxceil = (int)ceil(fx); fyceil = (int)ceil(fy); if (fxceil>=sw) fxceil = sw-1; @@ -190,7 +191,8 @@ pixel *resample_img(pixel *src, int sw, int sh, int rw, int rh) } } else { //Stairstepping - float fx, fy, fyc, fxc, intp; + float fx, fy, fyc, fxc; + double intp; pixel tr, tl, br, bl; int rrw = rw, rrh = rh; pixel * oq; @@ -212,8 +214,8 @@ pixel *resample_img(pixel *src, int sw, int sh, int rw, int rh) { fx = ((float)x)*((float)sw)/((float)rw); fy = ((float)y)*((float)sh)/((float)rh); - fxc = modff(fx, &intp); - fyc = modff(fy, &intp); + fxc = modf(fx, &intp); + fyc = modf(fy, &intp); fxceil = (int)ceil(fx); fyceil = (int)ceil(fy); if (fxceil>=sw) fxceil = sw-1; |
