Clean up love.image because we own the memory, not DevIL

This commit is contained in:
Boolsheet
2012-05-29 23:36:49 +02:00
parent 0a423d3e67
commit 73672bd674
8 changed files with 202 additions and 251 deletions
+7 -5
View File
@@ -33,12 +33,14 @@ namespace image
int w_newImageData(lua_State * L)
{
// Case 1: Integers.
if (lua_isnumber(L, 1))
{
int w = luaL_checkint(L, 1);
int h = luaL_checkint(L, 2);
if (w <= 0 || h <= 0)
return luaL_error(L, "Invalid image size.");
ImageData * t = 0;
try
{
@@ -46,7 +48,7 @@ namespace image
}
catch (love::Exception & e)
{
return luaL_error(L, e.what());
return luaL_error(L, "%s", e.what());
}
luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void*)t);
return 1;
@@ -63,7 +65,7 @@ namespace image
}
catch (love::Exception & e)
{
return luaL_error(L, e.what());
return luaL_error(L, "%s", e.what());
}
luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void*)t);
return 1;
@@ -84,7 +86,7 @@ namespace image
}
catch (love::Exception & e)
{
return luaL_error(L, e.what());
return luaL_error(L, "%s", e.what());
}
luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void*)t);
return 1;
@@ -111,7 +113,7 @@ namespace image
}
catch (Exception & e)
{
return luaL_error(L, e.what());
return luaL_error(L, "%s", e.what());
}
}
else