mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Build type information on first use (load-time), instead of using a hardcoded list
--HG-- branch : dynamiccore2
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user