Cosmetic code improvements

--HG--
branch : image-CompressedData
This commit is contained in:
Alex Szpakowski
2013-04-07 22:58:08 -03:00
parent 88d64954a4
commit 7403245715
15 changed files with 39 additions and 48 deletions
+5 -2
View File
@@ -146,10 +146,13 @@ private:
{
return texture;
}
// The ImageData from which the texture is created.
// The ImageData from which the texture is created. May be null if
// Compressed image data was used to create the texture.
love::image::ImageData *data;
// Or the Compressed Image Data from which the texture is created.
// Or the Compressed Image Data from which the texture is created. May be
// null if raw ImageData was used to create the texture.
love::image::CompressedData *cdata;
// Width and height of the hardware texture.
@@ -418,7 +418,7 @@ int w_newImageFont(lua_State *L)
int startIndex = 2;
// Convert to ImageData if necessary.
if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_T) || (luax_istype(L, 1, DATA_T) && !luax_istype(L, 1, IMAGE_IMAGE_DATA_T)))
if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_T) || luax_istype(L, 1, FILESYSTEM_FILE_DATA_T))
luax_convobj(L, 1, "image", "newImageData");
else if (luax_istype(L, 1, GRAPHICS_IMAGE_T))
{
@@ -426,6 +426,8 @@ int w_newImageFont(lua_State *L)
img_filter = i->getFilter();
setFilter = true;
love::image::ImageData *id = i->getData();
if (!id)
return luaL_argerror(L, 1, "image cannot be compressed");
luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)id, false);
lua_replace(L, 1);
}