mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Make love::Type handle type names
TODO: Fix undefined behaviour in luax_register_type, you can't use a va_list after a reference type --HG-- branch : dynamiccore2
This commit is contained in:
@@ -27,7 +27,7 @@ namespace love
|
||||
namespace sound
|
||||
{
|
||||
|
||||
love::Type Decoder::type(&Object::type);
|
||||
love::Type Decoder::type("Decoder", &Object::type);
|
||||
|
||||
Decoder::Decoder(Data *data, const std::string &ext, int bufferSize)
|
||||
: data(data)
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace love
|
||||
namespace sound
|
||||
{
|
||||
|
||||
love::Type Sound::type(&Module::type);
|
||||
love::Type Sound::type("Sound", &Module::type);
|
||||
|
||||
Sound::~Sound()
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace love
|
||||
namespace sound
|
||||
{
|
||||
|
||||
love::Type SoundData::type(&Data::type);
|
||||
love::Type SoundData::type("SoundData", &Data::type);
|
||||
|
||||
SoundData::SoundData(Decoder *decoder)
|
||||
: data(0)
|
||||
|
||||
@@ -109,7 +109,7 @@ static const luaL_Reg w_Decoder_functions[] =
|
||||
|
||||
extern "C" int luaopen_decoder(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, Decoder::type, "Decoder", w_Decoder_functions, nullptr);
|
||||
return luax_register_type(L, Decoder::type, w_Decoder_functions, nullptr);
|
||||
}
|
||||
|
||||
} // sound
|
||||
|
||||
@@ -110,7 +110,7 @@ static const luaL_Reg w_SoundData_functions[] =
|
||||
|
||||
extern "C" int luaopen_sounddata(lua_State *L)
|
||||
{
|
||||
int ret = luax_register_type(L, SoundData::type, "SoundData", w_Data_functions, w_SoundData_functions, nullptr);
|
||||
int ret = luax_register_type(L, SoundData::type, w_Data_functions, w_SoundData_functions, nullptr);
|
||||
|
||||
luax_gettypemetatable(L, SoundData::type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user