summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-06-09 18:46:41 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-06-11 12:00:42 (GMT)
commit93316a9f1d687a86558daef529d583f5ae2be992 (patch)
treeae98719e4fe31f5a06a30a54208ce85ec200b5ae /src/graphics.c
parent7ae52660f58188a1bc9d8e69ff2711c6737c7e66 (diff)
downloadpowder-93316a9f1d687a86558daef529d583f5ae2be992.zip
powder-93316a9f1d687a86558daef529d583f5ae2be992.tar.gz
Fix a load of memory leaks
Also fix some compiler warnings (missing headers, wrong pointer type for modf, etc) and move variable declarations for Visual Studio.
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 669086a..8d06088 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -172,8 +172,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 = modf(fx, &intp);
- fyc = modf(fy, &intp);
+ fxc = modff(fx, &intp);
+ fyc = modff(fy, &intp);
fxceil = (int)ceil(fx);
fyceil = (int)ceil(fy);
if (fxceil>=sw) fxceil = sw-1;
@@ -212,8 +212,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 = modf(fx, &intp);
- fyc = modf(fy, &intp);
+ fxc = modff(fx, &intp);
+ fyc = modff(fy, &intp);
fxceil = (int)ceil(fx);
fyceil = (int)ceil(fy);
if (fxceil>=sw) fxceil = sw-1;