Replaced most cases of type bits and type name strings in love's Lua wrapper code with type id's.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2015-03-01 18:32:41 -04:00
parent 3830a0969c
commit 2f419c1c83
79 changed files with 601 additions and 566 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ namespace image
CompressedData *luax_checkcompresseddata(lua_State *L, int idx)
{
return luax_checktype<CompressedData>(L, idx, "CompressedData", IMAGE_COMPRESSED_DATA_T);
return luax_checktype<CompressedData>(L, idx, IMAGE_COMPRESSED_DATA_ID);
}
int w_CompressedData_getWidth(lua_State *L)
@@ -111,7 +111,7 @@ static const luaL_Reg functions[] =
extern "C" int luaopen_compresseddata(lua_State *L)
{
return luax_register_type(L, "CompressedData", functions);
return luax_register_type(L, IMAGE_COMPRESSED_DATA_ID, functions);
}
} // image
+4 -4
View File
@@ -47,7 +47,7 @@ int w_newImageData(lua_State *L)
ImageData *t = nullptr;
luax_catchexcept(L, [&](){ t = instance()->newImageData(w, h); });
luax_pushtype(L, "ImageData", IMAGE_IMAGE_DATA_T, t);
luax_pushtype(L, IMAGE_IMAGE_DATA_ID, t);
t->release();
return 1;
}
@@ -61,7 +61,7 @@ int w_newImageData(lua_State *L)
[&]() { data->release(); }
);
luax_pushtype(L, "ImageData", IMAGE_IMAGE_DATA_T, t);
luax_pushtype(L, IMAGE_IMAGE_DATA_ID, t);
t->release();
return 1;
}
@@ -76,7 +76,7 @@ int w_newCompressedData(lua_State *L)
[&]() { data->release(); }
);
luax_pushtype(L, "CompressedData", IMAGE_COMPRESSED_DATA_T, t);
luax_pushtype(L, IMAGE_COMPRESSED_DATA_ID, t);
t->release();
return 1;
}
@@ -120,7 +120,7 @@ extern "C" int luaopen_love_image(lua_State *L)
WrappedModule w;
w.module = instance;
w.name = "image";
w.flags = MODULE_IMAGE_T;
w.type = MODULE_IMAGE_ID;
w.functions = functions;
w.types = types;
+3 -3
View File
@@ -30,7 +30,7 @@ namespace image
ImageData *luax_checkimagedata(lua_State *L, int idx)
{
return luax_checktype<ImageData>(L, idx, "ImageData", IMAGE_IMAGE_DATA_T);
return luax_checktype<ImageData>(L, idx, IMAGE_IMAGE_DATA_ID);
}
int w_ImageData_getWidth(lua_State *L)
@@ -245,7 +245,7 @@ int w_ImageData_encode(lua_State *L)
if (lua_isstring(L, 2))
luax_convobj(L, 2, "filesystem", "newFile");
love::filesystem::File *file = luax_checktype<love::filesystem::File>(L, 2, "File", FILESYSTEM_FILE_T);
love::filesystem::File *file = luax_checktype<love::filesystem::File>(L, 2, FILESYSTEM_FILE_ID);
if (lua_isnoneornil(L, 3))
{
@@ -285,7 +285,7 @@ static const luaL_Reg functions[] =
extern "C" int luaopen_imagedata(lua_State *L)
{
return luax_register_type(L, "ImageData", functions);
return luax_register_type(L, IMAGE_IMAGE_DATA_ID, functions);
}
} // image