Renamed CompressedData:getNumMipmaps to CompressedData:getMipmapCount; Improved type-checking error messages for some functions which expect function arguments

This commit is contained in:
Alex Szpakowski
2013-05-02 17:26:50 -04:00
parent 77c6efd8fd
commit 3bf43dadd8
14 changed files with 43 additions and 44 deletions
+6 -6
View File
@@ -40,7 +40,7 @@ int w_CompressedData_getString(lua_State *L)
size_t totalsize = 0;
for (int i = 0; i < t->getNumMipmaps(); i++)
for (int i = 0; i < t->getMipmapCount(); i++)
totalsize += t->getSize(i);
if (totalsize == 0)
@@ -60,7 +60,7 @@ int w_CompressedData_getString(lua_State *L)
}
size_t curpos = 0;
for (int i = 0; i < t->getNumMipmaps(); i++)
for (int i = 0; i < t->getMipmapCount(); i++)
{
memcpy(&datastr[curpos], t->getData(i), t->getSize(i));
curpos += t->getSize(i);
@@ -79,7 +79,7 @@ int w_CompressedData_getSize(lua_State *L)
size_t totalsize = 0;
for (int i = 0; i < t->getNumMipmaps(); i++)
for (int i = 0; i < t->getMipmapCount(); i++)
totalsize += t->getSize(i);
lua_pushnumber(L, (lua_Number) totalsize);
@@ -140,10 +140,10 @@ int w_CompressedData_getDimensions(lua_State *L)
return 2;
}
int w_CompressedData_getNumMipmaps(lua_State *L)
int w_CompressedData_getMipmapCount(lua_State *L)
{
CompressedData *t = luax_checkcompresseddata(L, 1);
lua_pushinteger(L, t->getNumMipmaps());
lua_pushinteger(L, t->getMipmapCount());
return 1;
}
@@ -172,7 +172,7 @@ static const luaL_Reg functions[] =
{ "getWidth", w_CompressedData_getWidth },
{ "getHeight", w_CompressedData_getHeight },
{ "getDimensions", w_CompressedData_getDimensions },
{ "getNumMipmaps", w_CompressedData_getNumMipmaps },
{ "getMipmapCount", w_CompressedData_getMipmapCount },
{ "getType", w_CompressedData_getType },
{ 0, 0 },
};