Build type information on first use (load-time), instead of using a hardcoded list

--HG--
branch : dynamiccore2
This commit is contained in:
Bart van Strien
2016-11-13 16:38:57 +01:00
parent 452a8a877e
commit c761202486
192 changed files with 734 additions and 614 deletions
+3 -3
View File
@@ -39,7 +39,7 @@ namespace sound
SoundData *luax_checksounddata(lua_State *L, int idx)
{
return luax_checktype<SoundData>(L, idx, SOUND_SOUND_DATA_ID);
return luax_checktype<SoundData>(L, idx, SoundData::type);
}
int w_SoundData_getChannels(lua_State *L)
@@ -110,9 +110,9 @@ static const luaL_Reg w_SoundData_functions[] =
extern "C" int luaopen_sounddata(lua_State *L)
{
int ret = luax_register_type(L, SOUND_SOUND_DATA_ID, "SoundData", w_Data_functions, w_SoundData_functions, nullptr);
int ret = luax_register_type(L, SoundData::type, "SoundData", w_Data_functions, w_SoundData_functions, nullptr);
luax_gettypemetatable(L, SOUND_SOUND_DATA_ID);
luax_gettypemetatable(L, SoundData::type);
// Load and execute SoundData.lua, sending the metatable as an argument.
if (lua_istable(L, -1))