Imported some of the dynamiccore branch from love-experiments:

- Type names for love's Lua objects are specified as an argument to luax_register_type, rather than being statically defined in an array.

- luax_register_type takes a variable number of method array arguments, for registering superclass methods without copying them into the subclass' method array.

Also removed most of the header declarations for wrapper functions.
This commit is contained in:
Alex Szpakowski
2015-11-29 20:38:12 -04:00
parent 77998c707d
commit 2c4e713114
124 changed files with 251 additions and 1300 deletions
-23
View File
@@ -32,29 +32,6 @@ namespace love
namespace audio
{
int w_getSourceCount(lua_State *L);
int w_newSource(lua_State *L);
int w_play(lua_State *L);
int w_stop(lua_State *L);
int w_pause(lua_State *L);
int w_resume(lua_State *L);
int w_rewind(lua_State *L);
int w_setVolume(lua_State *L);
int w_getVolume(lua_State *L);
int w_setPosition(lua_State *L);
int w_getPosition(lua_State *L);
int w_setOrientation(lua_State *L);
int w_getOrientation(lua_State *L);
int w_setVelocity(lua_State *L);
int w_getVelocity(lua_State *L);
int w_setDopplerScale(lua_State *L);
int w_getDopplerScale(lua_State *L);
int w_record(lua_State *L);
int w_getRecordedData(lua_State *L);
int w_stopRecording(lua_State *L);
int w_canRecord(lua_State *L);
int w_setDistanceModel(lua_State *L);
int w_getDistanceModel(lua_State *L);
extern "C" LOVE_EXPORT int luaopen_love_audio(lua_State *L);
} // audio
+2 -2
View File
@@ -370,7 +370,7 @@ int w_Source_getType(lua_State *L)
return 1;
}
static const luaL_Reg functions[] =
static const luaL_Reg w_Source_functions[] =
{
{ "clone", w_Source_clone },
@@ -420,7 +420,7 @@ static const luaL_Reg functions[] =
extern "C" int luaopen_source(lua_State *L)
{
return luax_register_type(L, AUDIO_SOURCE_ID, functions);
return luax_register_type(L, AUDIO_SOURCE_ID, "Source", w_Source_functions, nullptr);
}
} // audio
-36
View File
@@ -30,42 +30,6 @@ namespace audio
{
Source *luax_checksource(lua_State *L, int idx);
int w_Source_clone(lua_State *L);
int w_Source_play(lua_State *L);
int w_Source_stop(lua_State *L);
int w_Source_pause(lua_State *L);
int w_Source_resume(lua_State *L);
int w_Source_rewind(lua_State *L);
int w_Source_setPitch(lua_State *L);
int w_Source_getPitch(lua_State *L);
int w_Source_setVolume(lua_State *L);
int w_Source_getVolume(lua_State *L);
int w_Source_seek(lua_State *L);
int w_Source_tell(lua_State *L);
int w_Source_getDuration(lua_State *L);
int w_Source_setPosition(lua_State *L);
int w_Source_getPosition(lua_State *L);
int w_Source_setVelocity(lua_State *L);
int w_Source_getVelocity(lua_State *L);
int w_Source_setDirection(lua_State *L);
int w_Source_getDirection(lua_State *L);
int w_Source_setCone(lua_State *L);
int w_Source_getCone(lua_State *L);
int w_Source_setRelative(lua_State *L);
int w_Source_isRelative(lua_State *L);
int w_Source_setLooping(lua_State *L);
int w_Source_isLooping(lua_State *L);
int w_Source_isStopped(lua_State *L);
int w_Source_isPaused(lua_State *L);
int w_Source_isPlaying(lua_State *L);
int w_Source_setVolumeLimits(lua_State *L);
int w_Source_getVolumeLimits(lua_State *L);
int w_Source_setAttenuationDistances(lua_State *L);
int w_Source_getAttenuationDistances(lua_State *L);
int w_Source_setRolloff(lua_State *L);
int w_Source_getRolloff(lua_State *L);
int w_Source_getChannels(lua_State *L);
int w_Source_getType(lua_State *L);
extern "C" int luaopen_source(lua_State *L);
} // audio