Sdk/LuaBinding: Remove "class" suffix from classes instances
This commit is contained in:
parent
6d597aa2bc
commit
6b6608eccc
|
|
@ -38,52 +38,52 @@ namespace Ndk
|
||||||
void RegisterClasses(Nz::LuaInstance& instance);
|
void RegisterClasses(Nz::LuaInstance& instance);
|
||||||
|
|
||||||
// Core
|
// Core
|
||||||
Nz::LuaClass<Nz::Clock> clockClass;
|
Nz::LuaClass<Nz::Clock> clock;
|
||||||
Nz::LuaClass<Nz::Directory> directoryClass;
|
Nz::LuaClass<Nz::Directory> directory;
|
||||||
Nz::LuaClass<Nz::File> fileClass;
|
Nz::LuaClass<Nz::File> file;
|
||||||
Nz::LuaClass<Nz::Stream> streamClass;
|
Nz::LuaClass<Nz::Stream> stream;
|
||||||
|
|
||||||
// Math
|
// Math
|
||||||
Nz::LuaClass<Nz::EulerAnglesd> eulerAnglesClass;
|
Nz::LuaClass<Nz::EulerAnglesd> eulerAngles;
|
||||||
Nz::LuaClass<Nz::Matrix4d> matrix4dClass;
|
Nz::LuaClass<Nz::Matrix4d> matrix4d;
|
||||||
Nz::LuaClass<Nz::Quaterniond> quaternionClass;
|
Nz::LuaClass<Nz::Quaterniond> quaternion;
|
||||||
Nz::LuaClass<Nz::Rectd> rectClass;
|
Nz::LuaClass<Nz::Rectd> rect;
|
||||||
Nz::LuaClass<Nz::Vector2d> vector2dClass;
|
Nz::LuaClass<Nz::Vector2d> vector2d;
|
||||||
Nz::LuaClass<Nz::Vector3d> vector3dClass;
|
Nz::LuaClass<Nz::Vector3d> vector3d;
|
||||||
|
|
||||||
// Network
|
// Network
|
||||||
Nz::LuaClass<Nz::AbstractSocket> abstractSocketClass;
|
Nz::LuaClass<Nz::AbstractSocket> abstractSocket;
|
||||||
Nz::LuaClass<Nz::IpAddress> ipAddressClass;
|
Nz::LuaClass<Nz::IpAddress> ipAddress;
|
||||||
|
|
||||||
// Utility
|
// Utility
|
||||||
Nz::LuaClass<Nz::AbstractImageRef> abstractImage;
|
Nz::LuaClass<Nz::AbstractImageRef> abstractImage;
|
||||||
Nz::LuaClass<Nz::FontRef> fontClass;
|
Nz::LuaClass<Nz::FontRef> font;
|
||||||
Nz::LuaClass<Nz::Node> nodeClass;
|
Nz::LuaClass<Nz::Node> node;
|
||||||
|
|
||||||
// SDK
|
// SDK
|
||||||
Nz::LuaClass<Application*> application;
|
Nz::LuaClass<Application*> application;
|
||||||
Nz::LuaClass<EntityHandle> entityClass;
|
Nz::LuaClass<EntityHandle> entity;
|
||||||
Nz::LuaClass<NodeComponentHandle> nodeComponent;
|
Nz::LuaClass<NodeComponentHandle> nodeComponent;
|
||||||
Nz::LuaClass<VelocityComponentHandle> velocityComponent;
|
Nz::LuaClass<VelocityComponentHandle> velocityComponent;
|
||||||
Nz::LuaClass<WorldHandle> worldClass;
|
Nz::LuaClass<WorldHandle> world;
|
||||||
|
|
||||||
#ifndef NDK_SERVER
|
#ifndef NDK_SERVER
|
||||||
// Audio
|
// Audio
|
||||||
Nz::LuaClass<Nz::Music> musicClass;
|
Nz::LuaClass<Nz::Music> music;
|
||||||
Nz::LuaClass<Nz::Sound> soundClass;
|
Nz::LuaClass<Nz::Sound> sound;
|
||||||
Nz::LuaClass<Nz::SoundBufferRef> soundBuffer;
|
Nz::LuaClass<Nz::SoundBufferRef> soundBuffer;
|
||||||
Nz::LuaClass<Nz::SoundEmitter> soundEmitter;
|
Nz::LuaClass<Nz::SoundEmitter> soundEmitter;
|
||||||
|
|
||||||
// Graphics
|
// Graphics
|
||||||
Nz::LuaClass<Nz::InstancedRenderableRef> instancedRenderable;
|
Nz::LuaClass<Nz::InstancedRenderableRef> instancedRenderable;
|
||||||
Nz::LuaClass<Nz::ModelRef> modelClass;
|
Nz::LuaClass<Nz::ModelRef> model;
|
||||||
Nz::LuaClass<Nz::SpriteRef> spriteClass;
|
Nz::LuaClass<Nz::SpriteRef> sprite;
|
||||||
|
|
||||||
// Renderer
|
// Renderer
|
||||||
Nz::LuaClass<Nz::TextureRef> texture;
|
Nz::LuaClass<Nz::TextureRef> texture;
|
||||||
|
|
||||||
// SDK
|
// SDK
|
||||||
Nz::LuaClass<ConsoleHandle> consoleClass;
|
Nz::LuaClass<ConsoleHandle> console;
|
||||||
Nz::LuaClass<GraphicsComponentHandle> graphicsComponent;
|
Nz::LuaClass<GraphicsComponentHandle> graphicsComponent;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,54 +16,54 @@ namespace Ndk
|
||||||
|
|
||||||
LuaBinding::LuaBinding() :
|
LuaBinding::LuaBinding() :
|
||||||
// Core
|
// Core
|
||||||
clockClass("Clock"),
|
clock("Clock"),
|
||||||
directoryClass("Directory"),
|
directory("Directory"),
|
||||||
fileClass("File"),
|
file("File"),
|
||||||
streamClass("Stream"),
|
stream("Stream"),
|
||||||
|
|
||||||
// Math
|
// Math
|
||||||
eulerAnglesClass("EulerAngles"),
|
eulerAngles("EulerAngles"),
|
||||||
matrix4dClass("Matrix4"),
|
matrix4d("Matrix4"),
|
||||||
quaternionClass("Quaternion"),
|
quaternion("Quaternion"),
|
||||||
rectClass("Rect"),
|
rect("Rect"),
|
||||||
vector2dClass("Vector2"),
|
vector2d("Vector2"),
|
||||||
vector3dClass("Vector3"),
|
vector3d("Vector3"),
|
||||||
|
|
||||||
// Network
|
// Network
|
||||||
abstractSocketClass("AbstractSocket"),
|
abstractSocket("AbstractSocket"),
|
||||||
ipAddressClass("IpAddress"),
|
ipAddress("IpAddress"),
|
||||||
|
|
||||||
// Utility
|
// Utility
|
||||||
abstractImage("AbstractImage"),
|
abstractImage("AbstractImage"),
|
||||||
fontClass("Font"),
|
font("Font"),
|
||||||
nodeClass("Node"),
|
node("Node"),
|
||||||
|
|
||||||
// SDK
|
// SDK
|
||||||
application("Application"),
|
application("Application"),
|
||||||
entityClass("Entity"),
|
entity("Entity"),
|
||||||
nodeComponent("NodeComponent"),
|
nodeComponent("NodeComponent"),
|
||||||
velocityComponent("VelocityComponent"),
|
velocityComponent("VelocityComponent"),
|
||||||
worldClass("World")
|
world("World")
|
||||||
|
|
||||||
#ifndef NDK_SERVER
|
#ifndef NDK_SERVER
|
||||||
,
|
,
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
musicClass("Music"),
|
music("Music"),
|
||||||
soundClass("Sound"),
|
sound("Sound"),
|
||||||
soundBuffer("SoundBuffer"),
|
soundBuffer("SoundBuffer"),
|
||||||
soundEmitter("SoundEmitter"),
|
soundEmitter("SoundEmitter"),
|
||||||
|
|
||||||
// Graphics
|
// Graphics
|
||||||
instancedRenderable("InstancedRenderable"),
|
instancedRenderable("InstancedRenderable"),
|
||||||
modelClass("Model"),
|
model("Model"),
|
||||||
spriteClass("Sprite"),
|
sprite("Sprite"),
|
||||||
|
|
||||||
// Renderer
|
// Renderer
|
||||||
texture("Texture"),
|
texture("Texture"),
|
||||||
|
|
||||||
// SDK
|
// SDK
|
||||||
consoleClass("Console"),
|
console("Console"),
|
||||||
graphicsComponent("GraphicsComponent")
|
graphicsComponent("GraphicsComponent")
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,35 +13,35 @@ namespace Ndk
|
||||||
void LuaBinding::BindAudio()
|
void LuaBinding::BindAudio()
|
||||||
{
|
{
|
||||||
/*********************************** Nz::Music **********************************/
|
/*********************************** Nz::Music **********************************/
|
||||||
musicClass.Inherit(soundEmitter);
|
music.Inherit(soundEmitter);
|
||||||
|
|
||||||
musicClass.BindDefaultConstructor();
|
music.BindDefaultConstructor();
|
||||||
|
|
||||||
//musicClass.SetMethod("Create", &Nz::Music::Create);
|
//musicClass.SetMethod("Create", &Nz::Music::Create);
|
||||||
//musicClass.SetMethod("Destroy", &Nz::Music::Destroy);
|
//musicClass.SetMethod("Destroy", &Nz::Music::Destroy);
|
||||||
|
|
||||||
musicClass.BindMethod("EnableLooping", &Nz::Music::EnableLooping);
|
music.BindMethod("EnableLooping", &Nz::Music::EnableLooping);
|
||||||
|
|
||||||
musicClass.BindMethod("GetDuration", &Nz::Music::GetDuration);
|
music.BindMethod("GetDuration", &Nz::Music::GetDuration);
|
||||||
musicClass.BindMethod("GetFormat", &Nz::Music::GetFormat);
|
music.BindMethod("GetFormat", &Nz::Music::GetFormat);
|
||||||
musicClass.BindMethod("GetPlayingOffset", &Nz::Music::GetPlayingOffset);
|
music.BindMethod("GetPlayingOffset", &Nz::Music::GetPlayingOffset);
|
||||||
musicClass.BindMethod("GetSampleCount", &Nz::Music::GetSampleCount);
|
music.BindMethod("GetSampleCount", &Nz::Music::GetSampleCount);
|
||||||
musicClass.BindMethod("GetSampleRate", &Nz::Music::GetSampleRate);
|
music.BindMethod("GetSampleRate", &Nz::Music::GetSampleRate);
|
||||||
musicClass.BindMethod("GetStatus", &Nz::Music::GetStatus);
|
music.BindMethod("GetStatus", &Nz::Music::GetStatus);
|
||||||
|
|
||||||
musicClass.BindMethod("IsLooping", &Nz::Music::IsLooping);
|
music.BindMethod("IsLooping", &Nz::Music::IsLooping);
|
||||||
|
|
||||||
musicClass.BindMethod("OpenFromFile", &Nz::Music::OpenFromFile, Nz::MusicParams());
|
music.BindMethod("OpenFromFile", &Nz::Music::OpenFromFile, Nz::MusicParams());
|
||||||
|
|
||||||
musicClass.BindMethod("Pause", &Nz::Music::Pause);
|
music.BindMethod("Pause", &Nz::Music::Pause);
|
||||||
musicClass.BindMethod("Play", &Nz::Music::Play);
|
music.BindMethod("Play", &Nz::Music::Play);
|
||||||
|
|
||||||
musicClass.BindMethod("SetPlayingOffset", &Nz::Music::SetPlayingOffset);
|
music.BindMethod("SetPlayingOffset", &Nz::Music::SetPlayingOffset);
|
||||||
|
|
||||||
musicClass.BindMethod("Stop", &Nz::Music::Stop);
|
music.BindMethod("Stop", &Nz::Music::Stop);
|
||||||
|
|
||||||
// Manual
|
// Manual
|
||||||
musicClass.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::Music& music) -> int
|
music.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::Music& music) -> int
|
||||||
{
|
{
|
||||||
Nz::StringStream stream("Music(");
|
Nz::StringStream stream("Music(");
|
||||||
stream << music.GetFilePath() << ')';
|
stream << music.GetFilePath() << ')';
|
||||||
|
|
@ -51,21 +51,21 @@ namespace Ndk
|
||||||
});
|
});
|
||||||
|
|
||||||
/*********************************** Nz::Sound **********************************/
|
/*********************************** Nz::Sound **********************************/
|
||||||
soundClass.Inherit(soundEmitter);
|
sound.Inherit(soundEmitter);
|
||||||
|
|
||||||
soundClass.BindDefaultConstructor();
|
sound.BindDefaultConstructor();
|
||||||
|
|
||||||
soundClass.BindMethod("GetBuffer", &Nz::Sound::GetBuffer);
|
sound.BindMethod("GetBuffer", &Nz::Sound::GetBuffer);
|
||||||
|
|
||||||
soundClass.BindMethod("IsPlayable", &Nz::Sound::IsPlayable);
|
sound.BindMethod("IsPlayable", &Nz::Sound::IsPlayable);
|
||||||
soundClass.BindMethod("IsPlaying", &Nz::Sound::IsPlaying);
|
sound.BindMethod("IsPlaying", &Nz::Sound::IsPlaying);
|
||||||
|
|
||||||
soundClass.BindMethod("LoadFromFile", &Nz::Sound::LoadFromFile, Nz::SoundBufferParams());
|
sound.BindMethod("LoadFromFile", &Nz::Sound::LoadFromFile, Nz::SoundBufferParams());
|
||||||
|
|
||||||
soundClass.BindMethod("SetPlayingOffset", &Nz::Sound::SetPlayingOffset);
|
sound.BindMethod("SetPlayingOffset", &Nz::Sound::SetPlayingOffset);
|
||||||
|
|
||||||
// Manual
|
// Manual
|
||||||
soundClass.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::Sound& sound) -> int
|
sound.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::Sound& sound) -> int
|
||||||
{
|
{
|
||||||
Nz::StringStream stream("Sound(");
|
Nz::StringStream stream("Sound(");
|
||||||
if (const Nz::SoundBuffer* buffer = sound.GetBuffer())
|
if (const Nz::SoundBuffer* buffer = sound.GetBuffer())
|
||||||
|
|
@ -177,8 +177,8 @@ namespace Ndk
|
||||||
|
|
||||||
void LuaBinding::RegisterAudio(Nz::LuaInstance& instance)
|
void LuaBinding::RegisterAudio(Nz::LuaInstance& instance)
|
||||||
{
|
{
|
||||||
musicClass.Register(instance);
|
music.Register(instance);
|
||||||
soundClass.Register(instance);
|
sound.Register(instance);
|
||||||
soundBuffer.Register(instance);
|
soundBuffer.Register(instance);
|
||||||
soundEmitter.Register(instance);
|
soundEmitter.Register(instance);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace Ndk
|
||||||
void LuaBinding::BindCore()
|
void LuaBinding::BindCore()
|
||||||
{
|
{
|
||||||
/*********************************** Nz::Clock **********************************/
|
/*********************************** Nz::Clock **********************************/
|
||||||
clockClass.SetConstructor([](Nz::LuaInstance& lua, Nz::Clock* clock, std::size_t /*argumentCount*/)
|
clock.SetConstructor([](Nz::LuaInstance& lua, Nz::Clock* clock, std::size_t /*argumentCount*/)
|
||||||
{
|
{
|
||||||
int argIndex = 1;
|
int argIndex = 1;
|
||||||
Nz::Int64 startingValue = lua.Check<Nz::Int64>(&argIndex, 0);
|
Nz::Int64 startingValue = lua.Check<Nz::Int64>(&argIndex, 0);
|
||||||
|
|
@ -23,16 +23,16 @@ namespace Ndk
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
clockClass.BindMethod("GetMicroseconds", &Nz::Clock::GetMicroseconds);
|
clock.BindMethod("GetMicroseconds", &Nz::Clock::GetMicroseconds);
|
||||||
clockClass.BindMethod("GetMilliseconds", &Nz::Clock::GetMilliseconds);
|
clock.BindMethod("GetMilliseconds", &Nz::Clock::GetMilliseconds);
|
||||||
clockClass.BindMethod("GetSeconds", &Nz::Clock::GetSeconds);
|
clock.BindMethod("GetSeconds", &Nz::Clock::GetSeconds);
|
||||||
clockClass.BindMethod("IsPaused", &Nz::Clock::IsPaused);
|
clock.BindMethod("IsPaused", &Nz::Clock::IsPaused);
|
||||||
clockClass.BindMethod("Pause", &Nz::Clock::Pause);
|
clock.BindMethod("Pause", &Nz::Clock::Pause);
|
||||||
clockClass.BindMethod("Restart", &Nz::Clock::Restart);
|
clock.BindMethod("Restart", &Nz::Clock::Restart);
|
||||||
clockClass.BindMethod("Unpause", &Nz::Clock::Unpause);
|
clock.BindMethod("Unpause", &Nz::Clock::Unpause);
|
||||||
|
|
||||||
// Manual
|
// Manual
|
||||||
clockClass.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::Clock& clock) -> int {
|
clock.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::Clock& clock) -> int {
|
||||||
Nz::StringStream stream("Clock(Elapsed: ");
|
Nz::StringStream stream("Clock(Elapsed: ");
|
||||||
stream << clock.GetSeconds();
|
stream << clock.GetSeconds();
|
||||||
stream << "s, Paused: ";
|
stream << "s, Paused: ";
|
||||||
|
|
@ -44,7 +44,7 @@ namespace Ndk
|
||||||
});
|
});
|
||||||
|
|
||||||
/********************************* Nz::Directory ********************************/
|
/********************************* Nz::Directory ********************************/
|
||||||
directoryClass.SetConstructor([](Nz::LuaInstance& lua, Nz::Directory* directory, std::size_t argumentCount)
|
directory.SetConstructor([](Nz::LuaInstance& lua, Nz::Directory* directory, std::size_t argumentCount)
|
||||||
{
|
{
|
||||||
std::size_t argCount = std::min<std::size_t>(argumentCount, 1U);
|
std::size_t argCount = std::min<std::size_t>(argumentCount, 1U);
|
||||||
|
|
||||||
|
|
@ -63,29 +63,29 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
directoryClass.BindMethod("Close", &Nz::Directory::Close);
|
directory.BindMethod("Close", &Nz::Directory::Close);
|
||||||
directoryClass.BindMethod("Exists", &Nz::Directory::Exists);
|
directory.BindMethod("Exists", &Nz::Directory::Exists);
|
||||||
directoryClass.BindMethod("GetPath", &Nz::Directory::GetPath);
|
directory.BindMethod("GetPath", &Nz::Directory::GetPath);
|
||||||
directoryClass.BindMethod("GetPattern", &Nz::Directory::GetPattern);
|
directory.BindMethod("GetPattern", &Nz::Directory::GetPattern);
|
||||||
directoryClass.BindMethod("GetResultName", &Nz::Directory::GetResultName);
|
directory.BindMethod("GetResultName", &Nz::Directory::GetResultName);
|
||||||
directoryClass.BindMethod("GetResultPath", &Nz::Directory::GetResultPath);
|
directory.BindMethod("GetResultPath", &Nz::Directory::GetResultPath);
|
||||||
directoryClass.BindMethod("GetResultSize", &Nz::Directory::GetResultSize);
|
directory.BindMethod("GetResultSize", &Nz::Directory::GetResultSize);
|
||||||
directoryClass.BindMethod("IsOpen", &Nz::Directory::IsOpen);
|
directory.BindMethod("IsOpen", &Nz::Directory::IsOpen);
|
||||||
directoryClass.BindMethod("IsResultDirectory", &Nz::Directory::IsResultDirectory);
|
directory.BindMethod("IsResultDirectory", &Nz::Directory::IsResultDirectory);
|
||||||
directoryClass.BindMethod("NextResult", &Nz::Directory::NextResult, true);
|
directory.BindMethod("NextResult", &Nz::Directory::NextResult, true);
|
||||||
directoryClass.BindMethod("Open", &Nz::Directory::Open);
|
directory.BindMethod("Open", &Nz::Directory::Open);
|
||||||
directoryClass.BindMethod("SetPath", &Nz::Directory::SetPath);
|
directory.BindMethod("SetPath", &Nz::Directory::SetPath);
|
||||||
directoryClass.BindMethod("SetPattern", &Nz::Directory::SetPattern);
|
directory.BindMethod("SetPattern", &Nz::Directory::SetPattern);
|
||||||
|
|
||||||
directoryClass.BindStaticMethod("Copy", Nz::Directory::Copy);
|
directory.BindStaticMethod("Copy", Nz::Directory::Copy);
|
||||||
directoryClass.BindStaticMethod("Create", Nz::Directory::Create);
|
directory.BindStaticMethod("Create", Nz::Directory::Create);
|
||||||
directoryClass.BindStaticMethod("Exists", Nz::Directory::Exists);
|
directory.BindStaticMethod("Exists", Nz::Directory::Exists);
|
||||||
directoryClass.BindStaticMethod("GetCurrent", Nz::Directory::GetCurrent);
|
directory.BindStaticMethod("GetCurrent", Nz::Directory::GetCurrent);
|
||||||
directoryClass.BindStaticMethod("Remove", Nz::Directory::Remove);
|
directory.BindStaticMethod("Remove", Nz::Directory::Remove);
|
||||||
directoryClass.BindStaticMethod("SetCurrent", Nz::Directory::SetCurrent);
|
directory.BindStaticMethod("SetCurrent", Nz::Directory::SetCurrent);
|
||||||
|
|
||||||
// Manual
|
// Manual
|
||||||
directoryClass.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::Directory& directory) -> int {
|
directory.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::Directory& directory) -> int {
|
||||||
Nz::StringStream stream("Directory(");
|
Nz::StringStream stream("Directory(");
|
||||||
stream << directory.GetPath();
|
stream << directory.GetPath();
|
||||||
stream << ')';
|
stream << ')';
|
||||||
|
|
@ -95,22 +95,22 @@ namespace Ndk
|
||||||
});
|
});
|
||||||
|
|
||||||
/*********************************** Nz::Stream ***********************************/
|
/*********************************** Nz::Stream ***********************************/
|
||||||
streamClass.BindMethod("EnableTextMode", &Nz::Stream::EnableTextMode);
|
stream.BindMethod("EnableTextMode", &Nz::Stream::EnableTextMode);
|
||||||
streamClass.BindMethod("Flush", &Nz::Stream::Flush);
|
stream.BindMethod("Flush", &Nz::Stream::Flush);
|
||||||
streamClass.BindMethod("GetCursorPos", &Nz::Stream::GetCursorPos);
|
stream.BindMethod("GetCursorPos", &Nz::Stream::GetCursorPos);
|
||||||
streamClass.BindMethod("GetDirectory", &Nz::Stream::GetDirectory);
|
stream.BindMethod("GetDirectory", &Nz::Stream::GetDirectory);
|
||||||
streamClass.BindMethod("GetPath", &Nz::Stream::GetPath);
|
stream.BindMethod("GetPath", &Nz::Stream::GetPath);
|
||||||
streamClass.BindMethod("GetOpenMode", &Nz::Stream::GetOpenMode);
|
stream.BindMethod("GetOpenMode", &Nz::Stream::GetOpenMode);
|
||||||
streamClass.BindMethod("GetStreamOptions", &Nz::Stream::GetStreamOptions);
|
stream.BindMethod("GetStreamOptions", &Nz::Stream::GetStreamOptions);
|
||||||
streamClass.BindMethod("GetSize", &Nz::Stream::GetSize);
|
stream.BindMethod("GetSize", &Nz::Stream::GetSize);
|
||||||
streamClass.BindMethod("ReadLine", &Nz::Stream::ReadLine, 0U);
|
stream.BindMethod("ReadLine", &Nz::Stream::ReadLine, 0U);
|
||||||
streamClass.BindMethod("IsReadable", &Nz::Stream::IsReadable);
|
stream.BindMethod("IsReadable", &Nz::Stream::IsReadable);
|
||||||
streamClass.BindMethod("IsSequential", &Nz::Stream::IsSequential);
|
stream.BindMethod("IsSequential", &Nz::Stream::IsSequential);
|
||||||
streamClass.BindMethod("IsTextModeEnabled", &Nz::Stream::IsTextModeEnabled);
|
stream.BindMethod("IsTextModeEnabled", &Nz::Stream::IsTextModeEnabled);
|
||||||
streamClass.BindMethod("IsWritable", &Nz::Stream::IsWritable);
|
stream.BindMethod("IsWritable", &Nz::Stream::IsWritable);
|
||||||
streamClass.BindMethod("SetCursorPos", &Nz::Stream::SetCursorPos);
|
stream.BindMethod("SetCursorPos", &Nz::Stream::SetCursorPos);
|
||||||
|
|
||||||
streamClass.BindMethod("Read", [] (Nz::LuaInstance& lua, Nz::Stream& stream) -> int {
|
stream.BindMethod("Read", [] (Nz::LuaInstance& lua, Nz::Stream& stream) -> int {
|
||||||
int argIndex = 1;
|
int argIndex = 1;
|
||||||
|
|
||||||
std::size_t length = lua.Check<std::size_t>(&argIndex);
|
std::size_t length = lua.Check<std::size_t>(&argIndex);
|
||||||
|
|
@ -122,7 +122,7 @@ namespace Ndk
|
||||||
return 1;
|
return 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
streamClass.BindMethod("Write", [] (Nz::LuaInstance& lua, Nz::Stream& stream) -> int {
|
stream.BindMethod("Write", [] (Nz::LuaInstance& lua, Nz::Stream& stream) -> int {
|
||||||
int argIndex = 1;
|
int argIndex = 1;
|
||||||
|
|
||||||
std::size_t bufferSize = 0;
|
std::size_t bufferSize = 0;
|
||||||
|
|
@ -136,9 +136,9 @@ namespace Ndk
|
||||||
});
|
});
|
||||||
|
|
||||||
/*********************************** Nz::File ***********************************/
|
/*********************************** Nz::File ***********************************/
|
||||||
fileClass.Inherit(streamClass);
|
file.Inherit(stream);
|
||||||
|
|
||||||
fileClass.SetConstructor([] (Nz::LuaInstance& lua, Nz::File* file, std::size_t argumentCount)
|
file.SetConstructor([] (Nz::LuaInstance& lua, Nz::File* file, std::size_t argumentCount)
|
||||||
{
|
{
|
||||||
std::size_t argCount = std::min<std::size_t>(argumentCount, 1U);
|
std::size_t argCount = std::min<std::size_t>(argumentCount, 1U);
|
||||||
|
|
||||||
|
|
@ -171,37 +171,37 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
fileClass.BindMethod("Close", &Nz::File::Close);
|
file.BindMethod("Close", &Nz::File::Close);
|
||||||
fileClass.BindMethod("Copy", &Nz::File::Copy);
|
file.BindMethod("Copy", &Nz::File::Copy);
|
||||||
fileClass.BindMethod("Delete", &Nz::File::Delete);
|
file.BindMethod("Delete", &Nz::File::Delete);
|
||||||
fileClass.BindMethod("EndOfFile", &Nz::File::EndOfFile);
|
file.BindMethod("EndOfFile", &Nz::File::EndOfFile);
|
||||||
fileClass.BindMethod("Exists", &Nz::File::Exists);
|
file.BindMethod("Exists", &Nz::File::Exists);
|
||||||
fileClass.BindMethod("GetCreationTime", &Nz::File::GetCreationTime);
|
file.BindMethod("GetCreationTime", &Nz::File::GetCreationTime);
|
||||||
fileClass.BindMethod("GetFileName", &Nz::File::GetFileName);
|
file.BindMethod("GetFileName", &Nz::File::GetFileName);
|
||||||
fileClass.BindMethod("GetLastAccessTime", &Nz::File::GetLastAccessTime);
|
file.BindMethod("GetLastAccessTime", &Nz::File::GetLastAccessTime);
|
||||||
fileClass.BindMethod("GetLastWriteTime", &Nz::File::GetLastWriteTime);
|
file.BindMethod("GetLastWriteTime", &Nz::File::GetLastWriteTime);
|
||||||
fileClass.BindMethod("IsOpen", &Nz::File::IsOpen);
|
file.BindMethod("IsOpen", &Nz::File::IsOpen);
|
||||||
fileClass.BindMethod("Rename", &Nz::File::GetLastWriteTime);
|
file.BindMethod("Rename", &Nz::File::GetLastWriteTime);
|
||||||
fileClass.BindMethod("GetLastWriteTime", &Nz::File::GetLastWriteTime);
|
file.BindMethod("GetLastWriteTime", &Nz::File::GetLastWriteTime);
|
||||||
fileClass.BindMethod("SetFile", &Nz::File::GetLastWriteTime);
|
file.BindMethod("SetFile", &Nz::File::GetLastWriteTime);
|
||||||
|
|
||||||
fileClass.BindStaticMethod("AbsolutePath", &Nz::File::AbsolutePath);
|
file.BindStaticMethod("AbsolutePath", &Nz::File::AbsolutePath);
|
||||||
fileClass.BindStaticMethod("ComputeHash", (Nz::ByteArray (*)(Nz::HashType, const Nz::String&)) &Nz::File::ComputeHash);
|
file.BindStaticMethod("ComputeHash", (Nz::ByteArray (*)(Nz::HashType, const Nz::String&)) &Nz::File::ComputeHash);
|
||||||
fileClass.BindStaticMethod("Copy", &Nz::File::Copy);
|
file.BindStaticMethod("Copy", &Nz::File::Copy);
|
||||||
fileClass.BindStaticMethod("Delete", &Nz::File::Delete);
|
file.BindStaticMethod("Delete", &Nz::File::Delete);
|
||||||
fileClass.BindStaticMethod("Exists", &Nz::File::Exists);
|
file.BindStaticMethod("Exists", &Nz::File::Exists);
|
||||||
//fileClass.SetStaticMethod("GetCreationTime", &Nz::File::GetCreationTime);
|
//fileClass.SetStaticMethod("GetCreationTime", &Nz::File::GetCreationTime);
|
||||||
fileClass.BindStaticMethod("GetDirectory", &Nz::File::GetDirectory);
|
file.BindStaticMethod("GetDirectory", &Nz::File::GetDirectory);
|
||||||
//fileClass.SetStaticMethod("GetLastAccessTime", &Nz::File::GetLastAccessTime);
|
//fileClass.SetStaticMethod("GetLastAccessTime", &Nz::File::GetLastAccessTime);
|
||||||
//fileClass.SetStaticMethod("GetLastWriteTime", &Nz::File::GetLastWriteTime);
|
//fileClass.SetStaticMethod("GetLastWriteTime", &Nz::File::GetLastWriteTime);
|
||||||
fileClass.BindStaticMethod("GetSize", &Nz::File::GetSize);
|
file.BindStaticMethod("GetSize", &Nz::File::GetSize);
|
||||||
fileClass.BindStaticMethod("IsAbsolute", &Nz::File::IsAbsolute);
|
file.BindStaticMethod("IsAbsolute", &Nz::File::IsAbsolute);
|
||||||
fileClass.BindStaticMethod("NormalizePath", &Nz::File::NormalizePath);
|
file.BindStaticMethod("NormalizePath", &Nz::File::NormalizePath);
|
||||||
fileClass.BindStaticMethod("NormalizeSeparators", &Nz::File::NormalizeSeparators);
|
file.BindStaticMethod("NormalizeSeparators", &Nz::File::NormalizeSeparators);
|
||||||
fileClass.BindStaticMethod("Rename", &Nz::File::Rename);
|
file.BindStaticMethod("Rename", &Nz::File::Rename);
|
||||||
|
|
||||||
// Manual
|
// Manual
|
||||||
fileClass.BindMethod("Open", [] (Nz::LuaInstance& lua, Nz::File& file) -> int
|
file.BindMethod("Open", [] (Nz::LuaInstance& lua, Nz::File& file) -> int
|
||||||
{
|
{
|
||||||
unsigned int argCount = std::min(lua.GetStackTop(), 2U);
|
unsigned int argCount = std::min(lua.GetStackTop(), 2U);
|
||||||
|
|
||||||
|
|
@ -224,7 +224,7 @@ namespace Ndk
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
fileClass.BindMethod("SetCursorPos", [] (Nz::LuaInstance& lua, Nz::File& file) -> int
|
file.BindMethod("SetCursorPos", [] (Nz::LuaInstance& lua, Nz::File& file) -> int
|
||||||
{
|
{
|
||||||
unsigned int argCount = std::min(lua.GetStackTop(), 2U);
|
unsigned int argCount = std::min(lua.GetStackTop(), 2U);
|
||||||
|
|
||||||
|
|
@ -246,7 +246,7 @@ namespace Ndk
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
fileClass.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::File& file) -> int {
|
file.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::File& file) -> int {
|
||||||
Nz::StringStream stream("File(");
|
Nz::StringStream stream("File(");
|
||||||
if (file.IsOpen())
|
if (file.IsOpen())
|
||||||
stream << "Path: " << file.GetPath();
|
stream << "Path: " << file.GetPath();
|
||||||
|
|
@ -267,10 +267,10 @@ namespace Ndk
|
||||||
void LuaBinding::RegisterCore(Nz::LuaInstance& instance)
|
void LuaBinding::RegisterCore(Nz::LuaInstance& instance)
|
||||||
{
|
{
|
||||||
// Classes
|
// Classes
|
||||||
clockClass.Register(instance);
|
clock.Register(instance);
|
||||||
directoryClass.Register(instance);
|
directory.Register(instance);
|
||||||
fileClass.Register(instance);
|
file.Register(instance);
|
||||||
streamClass.Register(instance);
|
stream.Register(instance);
|
||||||
|
|
||||||
// Enums
|
// Enums
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,62 +15,62 @@ namespace Ndk
|
||||||
/*********************************** Nz::InstancedRenderable ***********************************/
|
/*********************************** Nz::InstancedRenderable ***********************************/
|
||||||
|
|
||||||
/*********************************** Nz::Model ***********************************/
|
/*********************************** Nz::Model ***********************************/
|
||||||
modelClass.Inherit<Nz::InstancedRenderableRef>(instancedRenderable, [] (Nz::ModelRef* model) -> Nz::InstancedRenderableRef*
|
model.Inherit<Nz::InstancedRenderableRef>(instancedRenderable, [] (Nz::ModelRef* model) -> Nz::InstancedRenderableRef*
|
||||||
{
|
{
|
||||||
return reinterpret_cast<Nz::InstancedRenderableRef*>(model); //TODO: Make a ObjectRefCast
|
return reinterpret_cast<Nz::InstancedRenderableRef*>(model); //TODO: Make a ObjectRefCast
|
||||||
});
|
});
|
||||||
|
|
||||||
modelClass.SetConstructor([] (Nz::LuaInstance& /*lua*/, Nz::ModelRef* model, std::size_t /*argumentCount*/)
|
model.SetConstructor([] (Nz::LuaInstance& /*lua*/, Nz::ModelRef* model, std::size_t /*argumentCount*/)
|
||||||
{
|
{
|
||||||
Nz::PlacementNew(model, Nz::Model::New());
|
Nz::PlacementNew(model, Nz::Model::New());
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
//modelClass.SetMethod("GetMaterial", &Nz::Model::GetMaterial);
|
//modelClass.SetMethod("GetMaterial", &Nz::Model::GetMaterial);
|
||||||
modelClass.BindMethod("GetMaterialCount", &Nz::Model::GetMaterialCount);
|
model.BindMethod("GetMaterialCount", &Nz::Model::GetMaterialCount);
|
||||||
//modelClass.SetMethod("GetMesh", &Nz::Model::GetMesh);
|
//modelClass.SetMethod("GetMesh", &Nz::Model::GetMesh);
|
||||||
modelClass.BindMethod("GetSkin", &Nz::Model::GetSkin);
|
model.BindMethod("GetSkin", &Nz::Model::GetSkin);
|
||||||
modelClass.BindMethod("GetSkinCount", &Nz::Model::GetSkinCount);
|
model.BindMethod("GetSkinCount", &Nz::Model::GetSkinCount);
|
||||||
|
|
||||||
modelClass.BindMethod("IsAnimated", &Nz::Model::IsAnimated);
|
model.BindMethod("IsAnimated", &Nz::Model::IsAnimated);
|
||||||
modelClass.BindMethod("LoadFromFile", &Nz::Model::LoadFromFile, Nz::ModelParameters());
|
model.BindMethod("LoadFromFile", &Nz::Model::LoadFromFile, Nz::ModelParameters());
|
||||||
|
|
||||||
modelClass.BindMethod("Reset", &Nz::Model::Reset);
|
model.BindMethod("Reset", &Nz::Model::Reset);
|
||||||
|
|
||||||
//modelClass.SetMethod("SetMaterial", &Nz::Model::SetMaterial);
|
//modelClass.SetMethod("SetMaterial", &Nz::Model::SetMaterial);
|
||||||
//modelClass.SetMethod("SetMesh", &Nz::Model::SetMesh);
|
//modelClass.SetMethod("SetMesh", &Nz::Model::SetMesh);
|
||||||
//modelClass.SetMethod("SetSequence", &Nz::Model::SetSequence);
|
//modelClass.SetMethod("SetSequence", &Nz::Model::SetSequence);
|
||||||
modelClass.BindMethod("SetSkin", &Nz::Model::SetSkin);
|
model.BindMethod("SetSkin", &Nz::Model::SetSkin);
|
||||||
modelClass.BindMethod("SetSkinCount", &Nz::Model::SetSkinCount);
|
model.BindMethod("SetSkinCount", &Nz::Model::SetSkinCount);
|
||||||
|
|
||||||
/*********************************** Nz::Sprite ***********************************/
|
/*********************************** Nz::Sprite ***********************************/
|
||||||
spriteClass.Inherit<Nz::InstancedRenderableRef>(instancedRenderable, [] (Nz::SpriteRef* sprite) -> Nz::InstancedRenderableRef*
|
sprite.Inherit<Nz::InstancedRenderableRef>(instancedRenderable, [] (Nz::SpriteRef* sprite) -> Nz::InstancedRenderableRef*
|
||||||
{
|
{
|
||||||
return reinterpret_cast<Nz::InstancedRenderableRef*>(sprite); //TODO: Make a ObjectRefCast
|
return reinterpret_cast<Nz::InstancedRenderableRef*>(sprite); //TODO: Make a ObjectRefCast
|
||||||
});
|
});
|
||||||
|
|
||||||
spriteClass.SetConstructor([] (Nz::LuaInstance& /*lua*/, Nz::SpriteRef* sprite, std::size_t /*argumentCount*/)
|
sprite.SetConstructor([] (Nz::LuaInstance& /*lua*/, Nz::SpriteRef* sprite, std::size_t /*argumentCount*/)
|
||||||
{
|
{
|
||||||
Nz::PlacementNew(sprite, Nz::Sprite::New());
|
Nz::PlacementNew(sprite, Nz::Sprite::New());
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
spriteClass.BindMethod("GetColor", &Nz::Sprite::GetColor);
|
sprite.BindMethod("GetColor", &Nz::Sprite::GetColor);
|
||||||
spriteClass.BindMethod("GetCornerColor", &Nz::Sprite::GetCornerColor);
|
sprite.BindMethod("GetCornerColor", &Nz::Sprite::GetCornerColor);
|
||||||
//spriteClass.BindMethod("GetMaterial", &Nz::Sprite::GetMaterial);
|
//spriteClass.BindMethod("GetMaterial", &Nz::Sprite::GetMaterial);
|
||||||
spriteClass.BindMethod("GetOrigin", &Nz::Sprite::GetOrigin);
|
sprite.BindMethod("GetOrigin", &Nz::Sprite::GetOrigin);
|
||||||
spriteClass.BindMethod("GetSize", &Nz::Sprite::GetSize);
|
sprite.BindMethod("GetSize", &Nz::Sprite::GetSize);
|
||||||
spriteClass.BindMethod("GetTextureCoords", &Nz::Sprite::GetTextureCoords);
|
sprite.BindMethod("GetTextureCoords", &Nz::Sprite::GetTextureCoords);
|
||||||
|
|
||||||
spriteClass.BindMethod("SetColor", &Nz::Sprite::SetColor);
|
sprite.BindMethod("SetColor", &Nz::Sprite::SetColor);
|
||||||
spriteClass.BindMethod("SetCornerColor", &Nz::Sprite::SetCornerColor);
|
sprite.BindMethod("SetCornerColor", &Nz::Sprite::SetCornerColor);
|
||||||
spriteClass.BindMethod("SetDefaultMaterial", &Nz::Sprite::SetDefaultMaterial);
|
sprite.BindMethod("SetDefaultMaterial", &Nz::Sprite::SetDefaultMaterial);
|
||||||
//spriteClass.BindMethod("SetMaterial", &Nz::Sprite::SetMaterial, true);
|
//spriteClass.BindMethod("SetMaterial", &Nz::Sprite::SetMaterial, true);
|
||||||
spriteClass.BindMethod("SetOrigin", &Nz::Sprite::SetOrigin);
|
sprite.BindMethod("SetOrigin", &Nz::Sprite::SetOrigin);
|
||||||
spriteClass.BindMethod("SetSize", (void(Nz::Sprite::*)(const Nz::Vector2f&)) &Nz::Sprite::SetSize);
|
sprite.BindMethod("SetSize", (void(Nz::Sprite::*)(const Nz::Vector2f&)) &Nz::Sprite::SetSize);
|
||||||
spriteClass.BindMethod("SetTexture", &Nz::Sprite::SetTexture, true);
|
sprite.BindMethod("SetTexture", &Nz::Sprite::SetTexture, true);
|
||||||
spriteClass.BindMethod("SetTextureCoords", &Nz::Sprite::SetTextureCoords);
|
sprite.BindMethod("SetTextureCoords", &Nz::Sprite::SetTextureCoords);
|
||||||
spriteClass.BindMethod("SetTextureRect", &Nz::Sprite::SetTextureRect);
|
sprite.BindMethod("SetTextureRect", &Nz::Sprite::SetTextureRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -82,7 +82,7 @@ namespace Ndk
|
||||||
void LuaBinding::RegisterGraphics(Nz::LuaInstance& instance)
|
void LuaBinding::RegisterGraphics(Nz::LuaInstance& instance)
|
||||||
{
|
{
|
||||||
instancedRenderable.Register(instance);
|
instancedRenderable.Register(instance);
|
||||||
modelClass.Register(instance);
|
model.Register(instance);
|
||||||
spriteClass.Register(instance);
|
sprite.Register(instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Ndk
|
||||||
void LuaBinding::BindMath()
|
void LuaBinding::BindMath()
|
||||||
{
|
{
|
||||||
/*********************************** Nz::EulerAngles **********************************/
|
/*********************************** Nz::EulerAngles **********************************/
|
||||||
eulerAnglesClass.SetConstructor([] (Nz::LuaInstance& lua, Nz::EulerAnglesd* angles, std::size_t argumentCount)
|
eulerAngles.SetConstructor([] (Nz::LuaInstance& lua, Nz::EulerAnglesd* angles, std::size_t argumentCount)
|
||||||
{
|
{
|
||||||
std::size_t argCount = std::min<std::size_t>(argumentCount, 1U);
|
std::size_t argCount = std::min<std::size_t>(argumentCount, 1U);
|
||||||
|
|
||||||
|
|
@ -37,9 +37,9 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
eulerAnglesClass.BindMethod("__tostring", &Nz::EulerAnglesd::ToString);
|
eulerAngles.BindMethod("__tostring", &Nz::EulerAnglesd::ToString);
|
||||||
|
|
||||||
eulerAnglesClass.SetGetter([] (Nz::LuaInstance& lua, Nz::EulerAnglesd& instance)
|
eulerAngles.SetGetter([] (Nz::LuaInstance& lua, Nz::EulerAnglesd& instance)
|
||||||
{
|
{
|
||||||
std::size_t length;
|
std::size_t length;
|
||||||
const char* ypr = lua.CheckString(1, &length);
|
const char* ypr = lua.CheckString(1, &length);
|
||||||
|
|
@ -96,7 +96,7 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
eulerAnglesClass.SetSetter([] (Nz::LuaInstance& lua, Nz::EulerAnglesd& instance)
|
eulerAngles.SetSetter([] (Nz::LuaInstance& lua, Nz::EulerAnglesd& instance)
|
||||||
{
|
{
|
||||||
std::size_t length;
|
std::size_t length;
|
||||||
const char* ypr = lua.CheckString(1, &length);
|
const char* ypr = lua.CheckString(1, &length);
|
||||||
|
|
@ -156,7 +156,7 @@ namespace Ndk
|
||||||
|
|
||||||
|
|
||||||
/*********************************** Nz::Matrix4 **********************************/
|
/*********************************** Nz::Matrix4 **********************************/
|
||||||
matrix4dClass.SetConstructor([] (Nz::LuaInstance& lua, Nz::Matrix4d* matrix, std::size_t argumentCount)
|
matrix4d.SetConstructor([] (Nz::LuaInstance& lua, Nz::Matrix4d* matrix, std::size_t argumentCount)
|
||||||
{
|
{
|
||||||
std::size_t argCount = std::min<std::size_t>(argumentCount, 3U);
|
std::size_t argCount = std::min<std::size_t>(argumentCount, 3U);
|
||||||
|
|
||||||
|
|
@ -187,9 +187,9 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
matrix4dClass.BindMethod("__tostring", &Nz::Matrix4d::ToString);
|
matrix4d.BindMethod("__tostring", &Nz::Matrix4d::ToString);
|
||||||
|
|
||||||
matrix4dClass.SetGetter([] (Nz::LuaInstance& lua, Nz::Matrix4d& instance)
|
matrix4d.SetGetter([] (Nz::LuaInstance& lua, Nz::Matrix4d& instance)
|
||||||
{
|
{
|
||||||
int argIndex = 1;
|
int argIndex = 1;
|
||||||
std::size_t index = lua.Check<std::size_t>(&argIndex);
|
std::size_t index = lua.Check<std::size_t>(&argIndex);
|
||||||
|
|
@ -200,7 +200,7 @@ namespace Ndk
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
matrix4dClass.SetSetter([] (Nz::LuaInstance& lua, Nz::Matrix4d& instance)
|
matrix4d.SetSetter([] (Nz::LuaInstance& lua, Nz::Matrix4d& instance)
|
||||||
{
|
{
|
||||||
int argIndex = 1;
|
int argIndex = 1;
|
||||||
std::size_t index = lua.Check<std::size_t>(&argIndex);
|
std::size_t index = lua.Check<std::size_t>(&argIndex);
|
||||||
|
|
@ -213,7 +213,7 @@ namespace Ndk
|
||||||
});
|
});
|
||||||
|
|
||||||
/*********************************** Nz::Rect **********************************/
|
/*********************************** Nz::Rect **********************************/
|
||||||
rectClass.SetConstructor([] (Nz::LuaInstance& lua, Nz::Rectd* rect, std::size_t argumentCount)
|
rect.SetConstructor([] (Nz::LuaInstance& lua, Nz::Rectd* rect, std::size_t argumentCount)
|
||||||
{
|
{
|
||||||
std::size_t argCount = std::min<std::size_t>(argumentCount, 4U);
|
std::size_t argCount = std::min<std::size_t>(argumentCount, 4U);
|
||||||
|
|
||||||
|
|
@ -261,9 +261,9 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
rectClass.BindMethod("__tostring", &Nz::Rectd::ToString);
|
rect.BindMethod("__tostring", &Nz::Rectd::ToString);
|
||||||
|
|
||||||
rectClass.SetGetter([] (Nz::LuaInstance& lua, Nz::Rectd& instance)
|
rect.SetGetter([] (Nz::LuaInstance& lua, Nz::Rectd& instance)
|
||||||
{
|
{
|
||||||
switch (lua.GetType(1))
|
switch (lua.GetType(1))
|
||||||
{
|
{
|
||||||
|
|
@ -316,7 +316,7 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
rectClass.SetSetter([] (Nz::LuaInstance& lua, Nz::Rectd& instance)
|
rect.SetSetter([] (Nz::LuaInstance& lua, Nz::Rectd& instance)
|
||||||
{
|
{
|
||||||
switch (lua.GetType(1))
|
switch (lua.GetType(1))
|
||||||
{
|
{
|
||||||
|
|
@ -369,7 +369,7 @@ namespace Ndk
|
||||||
});
|
});
|
||||||
|
|
||||||
/*********************************** Nz::Quaternion **********************************/
|
/*********************************** Nz::Quaternion **********************************/
|
||||||
quaternionClass.SetConstructor([] (Nz::LuaInstance& lua, Nz::Quaterniond* quaternion, std::size_t argumentCount)
|
quaternion.SetConstructor([] (Nz::LuaInstance& lua, Nz::Quaterniond* quaternion, std::size_t argumentCount)
|
||||||
{
|
{
|
||||||
std::size_t argCount = std::min<std::size_t>(argumentCount, 4U);
|
std::size_t argCount = std::min<std::size_t>(argumentCount, 4U);
|
||||||
|
|
||||||
|
|
@ -407,9 +407,9 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
quaternionClass.BindMethod("__tostring", &Nz::Quaterniond::ToString);
|
quaternion.BindMethod("__tostring", &Nz::Quaterniond::ToString);
|
||||||
|
|
||||||
quaternionClass.SetGetter([] (Nz::LuaInstance& lua, Nz::Quaterniond& instance)
|
quaternion.SetGetter([] (Nz::LuaInstance& lua, Nz::Quaterniond& instance)
|
||||||
{
|
{
|
||||||
std::size_t length;
|
std::size_t length;
|
||||||
const char* wxyz = lua.CheckString(1, &length);
|
const char* wxyz = lua.CheckString(1, &length);
|
||||||
|
|
@ -439,7 +439,7 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
quaternionClass.SetSetter([] (Nz::LuaInstance& lua, Nz::Quaterniond& instance)
|
quaternion.SetSetter([] (Nz::LuaInstance& lua, Nz::Quaterniond& instance)
|
||||||
{
|
{
|
||||||
std::size_t length;
|
std::size_t length;
|
||||||
const char* wxyz = lua.CheckString(1, &length);
|
const char* wxyz = lua.CheckString(1, &length);
|
||||||
|
|
@ -475,7 +475,7 @@ namespace Ndk
|
||||||
});
|
});
|
||||||
|
|
||||||
/*********************************** Nz::Vector2 **********************************/
|
/*********************************** Nz::Vector2 **********************************/
|
||||||
vector2dClass.SetConstructor([] (Nz::LuaInstance& lua, Nz::Vector2d* vector, std::size_t argumentCount)
|
vector2d.SetConstructor([] (Nz::LuaInstance& lua, Nz::Vector2d* vector, std::size_t argumentCount)
|
||||||
{
|
{
|
||||||
std::size_t argCount = std::min<std::size_t>(argumentCount, 2U);
|
std::size_t argCount = std::min<std::size_t>(argumentCount, 2U);
|
||||||
|
|
||||||
|
|
@ -503,9 +503,9 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
vector2dClass.BindMethod("__tostring", &Nz::Vector2d::ToString);
|
vector2d.BindMethod("__tostring", &Nz::Vector2d::ToString);
|
||||||
|
|
||||||
vector2dClass.SetGetter([](Nz::LuaInstance& lua, Nz::Vector2d& instance)
|
vector2d.SetGetter([](Nz::LuaInstance& lua, Nz::Vector2d& instance)
|
||||||
{
|
{
|
||||||
switch (lua.GetType(1))
|
switch (lua.GetType(1))
|
||||||
{
|
{
|
||||||
|
|
@ -550,7 +550,7 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
vector2dClass.SetSetter([](Nz::LuaInstance& lua, Nz::Vector2d& instance)
|
vector2d.SetSetter([](Nz::LuaInstance& lua, Nz::Vector2d& instance)
|
||||||
{
|
{
|
||||||
switch (lua.GetType(1))
|
switch (lua.GetType(1))
|
||||||
{
|
{
|
||||||
|
|
@ -598,7 +598,7 @@ namespace Ndk
|
||||||
});
|
});
|
||||||
|
|
||||||
/*********************************** Nz::Vector3 **********************************/
|
/*********************************** Nz::Vector3 **********************************/
|
||||||
vector3dClass.SetConstructor([] (Nz::LuaInstance& lua, Nz::Vector3d* vector, std::size_t argumentCount)
|
vector3d.SetConstructor([] (Nz::LuaInstance& lua, Nz::Vector3d* vector, std::size_t argumentCount)
|
||||||
{
|
{
|
||||||
std::size_t argCount = std::min<std::size_t>(argumentCount, 3U);
|
std::size_t argCount = std::min<std::size_t>(argumentCount, 3U);
|
||||||
|
|
||||||
|
|
@ -640,9 +640,9 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
vector3dClass.BindMethod("__tostring", &Nz::Vector3d::ToString);
|
vector3d.BindMethod("__tostring", &Nz::Vector3d::ToString);
|
||||||
|
|
||||||
vector3dClass.SetGetter([] (Nz::LuaInstance& lua, Nz::Vector3d& instance)
|
vector3d.SetGetter([] (Nz::LuaInstance& lua, Nz::Vector3d& instance)
|
||||||
{
|
{
|
||||||
switch (lua.GetType(1))
|
switch (lua.GetType(1))
|
||||||
{
|
{
|
||||||
|
|
@ -691,7 +691,7 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
vector3dClass.SetSetter([] (Nz::LuaInstance& lua, Nz::Vector3d& instance)
|
vector3d.SetSetter([] (Nz::LuaInstance& lua, Nz::Vector3d& instance)
|
||||||
{
|
{
|
||||||
switch (lua.GetType(1))
|
switch (lua.GetType(1))
|
||||||
{
|
{
|
||||||
|
|
@ -751,11 +751,11 @@ namespace Ndk
|
||||||
|
|
||||||
void LuaBinding::RegisterMath(Nz::LuaInstance& instance)
|
void LuaBinding::RegisterMath(Nz::LuaInstance& instance)
|
||||||
{
|
{
|
||||||
eulerAnglesClass.Register(instance);
|
eulerAngles.Register(instance);
|
||||||
matrix4dClass.Register(instance);
|
matrix4d.Register(instance);
|
||||||
quaternionClass.Register(instance);
|
quaternion.Register(instance);
|
||||||
rectClass.Register(instance);
|
rect.Register(instance);
|
||||||
vector2dClass.Register(instance);
|
vector2d.Register(instance);
|
||||||
vector3dClass.Register(instance);
|
vector3d.Register(instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,16 @@ namespace Ndk
|
||||||
void LuaBinding::BindNetwork()
|
void LuaBinding::BindNetwork()
|
||||||
{
|
{
|
||||||
/*********************************** Nz::AbstractSocket **********************************/
|
/*********************************** Nz::AbstractSocket **********************************/
|
||||||
abstractSocketClass.BindMethod("Close", &Nz::AbstractSocket::Close);
|
abstractSocket.BindMethod("Close", &Nz::AbstractSocket::Close);
|
||||||
abstractSocketClass.BindMethod("EnableBlocking", &Nz::AbstractSocket::EnableBlocking);
|
abstractSocket.BindMethod("EnableBlocking", &Nz::AbstractSocket::EnableBlocking);
|
||||||
abstractSocketClass.BindMethod("GetLastError", &Nz::AbstractSocket::GetLastError);
|
abstractSocket.BindMethod("GetLastError", &Nz::AbstractSocket::GetLastError);
|
||||||
abstractSocketClass.BindMethod("GetState", &Nz::AbstractSocket::GetState);
|
abstractSocket.BindMethod("GetState", &Nz::AbstractSocket::GetState);
|
||||||
abstractSocketClass.BindMethod("GetType", &Nz::AbstractSocket::GetType);
|
abstractSocket.BindMethod("GetType", &Nz::AbstractSocket::GetType);
|
||||||
abstractSocketClass.BindMethod("IsBlockingEnabled", &Nz::AbstractSocket::IsBlockingEnabled);
|
abstractSocket.BindMethod("IsBlockingEnabled", &Nz::AbstractSocket::IsBlockingEnabled);
|
||||||
abstractSocketClass.BindMethod("QueryAvailableBytes", &Nz::AbstractSocket::QueryAvailableBytes);
|
abstractSocket.BindMethod("QueryAvailableBytes", &Nz::AbstractSocket::QueryAvailableBytes);
|
||||||
|
|
||||||
/*********************************** Nz::IpAddress **********************************/
|
/*********************************** Nz::IpAddress **********************************/
|
||||||
ipAddressClass.SetConstructor([] (Nz::LuaInstance& lua, Nz::IpAddress* address, std::size_t argumentCount)
|
ipAddress.SetConstructor([] (Nz::LuaInstance& lua, Nz::IpAddress* address, std::size_t argumentCount)
|
||||||
{
|
{
|
||||||
std::size_t argCount = std::min<std::size_t>(argumentCount, 9U);
|
std::size_t argCount = std::min<std::size_t>(argumentCount, 9U);
|
||||||
|
|
||||||
|
|
@ -71,14 +71,14 @@ namespace Ndk
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
ipAddressClass.BindMethod("GetPort", &Nz::IpAddress::GetPort);
|
ipAddress.BindMethod("GetPort", &Nz::IpAddress::GetPort);
|
||||||
ipAddressClass.BindMethod("GetProtocol", &Nz::IpAddress::GetProtocol);
|
ipAddress.BindMethod("GetProtocol", &Nz::IpAddress::GetProtocol);
|
||||||
ipAddressClass.BindMethod("IsLoopback", &Nz::IpAddress::IsLoopback);
|
ipAddress.BindMethod("IsLoopback", &Nz::IpAddress::IsLoopback);
|
||||||
ipAddressClass.BindMethod("IsValid", &Nz::IpAddress::IsValid);
|
ipAddress.BindMethod("IsValid", &Nz::IpAddress::IsValid);
|
||||||
ipAddressClass.BindMethod("ToUInt32", &Nz::IpAddress::ToUInt32);
|
ipAddress.BindMethod("ToUInt32", &Nz::IpAddress::ToUInt32);
|
||||||
ipAddressClass.BindMethod("__tostring", &Nz::IpAddress::ToString);
|
ipAddress.BindMethod("__tostring", &Nz::IpAddress::ToString);
|
||||||
|
|
||||||
ipAddressClass.BindStaticMethod("ResolveAddress", [] (Nz::LuaInstance& instance) -> int
|
ipAddress.BindStaticMethod("ResolveAddress", [] (Nz::LuaInstance& instance) -> int
|
||||||
{
|
{
|
||||||
Nz::String service;
|
Nz::String service;
|
||||||
Nz::ResolveError error = Nz::ResolveError_Unknown;
|
Nz::ResolveError error = Nz::ResolveError_Unknown;
|
||||||
|
|
@ -100,7 +100,7 @@ namespace Ndk
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ipAddressClass.BindStaticMethod("ResolveHostname", [] (Nz::LuaInstance& instance) -> int
|
ipAddress.BindStaticMethod("ResolveHostname", [] (Nz::LuaInstance& instance) -> int
|
||||||
{
|
{
|
||||||
Nz::ResolveError error = Nz::ResolveError_Unknown;
|
Nz::ResolveError error = Nz::ResolveError_Unknown;
|
||||||
|
|
||||||
|
|
@ -145,8 +145,8 @@ namespace Ndk
|
||||||
void LuaBinding::RegisterNetwork(Nz::LuaInstance& instance)
|
void LuaBinding::RegisterNetwork(Nz::LuaInstance& instance)
|
||||||
{
|
{
|
||||||
// Classes
|
// Classes
|
||||||
abstractSocketClass.Register(instance);
|
abstractSocket.Register(instance);
|
||||||
ipAddressClass.Register(instance);
|
ipAddress.Register(instance);
|
||||||
|
|
||||||
// Enums
|
// Enums
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,58 +36,58 @@ namespace Ndk
|
||||||
|
|
||||||
/*********************************** Ndk::Console **********************************/
|
/*********************************** Ndk::Console **********************************/
|
||||||
#ifndef NDK_SERVER
|
#ifndef NDK_SERVER
|
||||||
consoleClass.Inherit<Nz::Node>(nodeClass, [] (ConsoleHandle* handle) -> Nz::Node*
|
console.Inherit<Nz::Node>(node, [] (ConsoleHandle* handle) -> Nz::Node*
|
||||||
{
|
{
|
||||||
return handle->GetObject();
|
return handle->GetObject();
|
||||||
});
|
});
|
||||||
|
|
||||||
consoleClass.BindMethod("AddLine", &Console::AddLine, Nz::Color::White);
|
console.BindMethod("AddLine", &Console::AddLine, Nz::Color::White);
|
||||||
consoleClass.BindMethod("Clear", &Console::Clear);
|
console.BindMethod("Clear", &Console::Clear);
|
||||||
consoleClass.BindMethod("GetCharacterSize", &Console::GetCharacterSize);
|
console.BindMethod("GetCharacterSize", &Console::GetCharacterSize);
|
||||||
consoleClass.BindMethod("GetHistory", &Console::GetHistory);
|
console.BindMethod("GetHistory", &Console::GetHistory);
|
||||||
consoleClass.BindMethod("GetHistoryBackground", &Console::GetHistoryBackground);
|
console.BindMethod("GetHistoryBackground", &Console::GetHistoryBackground);
|
||||||
consoleClass.BindMethod("GetInput", &Console::GetInput);
|
console.BindMethod("GetInput", &Console::GetInput);
|
||||||
consoleClass.BindMethod("GetInputBackground", &Console::GetInputBackground);
|
console.BindMethod("GetInputBackground", &Console::GetInputBackground);
|
||||||
consoleClass.BindMethod("GetSize", &Console::GetSize);
|
console.BindMethod("GetSize", &Console::GetSize);
|
||||||
consoleClass.BindMethod("GetTextFont", &Console::GetTextFont);
|
console.BindMethod("GetTextFont", &Console::GetTextFont);
|
||||||
|
|
||||||
consoleClass.BindMethod("IsVisible", &Console::IsVisible);
|
console.BindMethod("IsVisible", &Console::IsVisible);
|
||||||
|
|
||||||
consoleClass.BindMethod("SendCharacter", &Console::SendCharacter);
|
console.BindMethod("SendCharacter", &Console::SendCharacter);
|
||||||
//consoleClass.SetMethod("SendEvent", &Console::SendEvent);
|
//consoleClass.SetMethod("SendEvent", &Console::SendEvent);
|
||||||
|
|
||||||
consoleClass.BindMethod("SetCharacterSize", &Console::SetCharacterSize);
|
console.BindMethod("SetCharacterSize", &Console::SetCharacterSize);
|
||||||
consoleClass.BindMethod("SetSize", &Console::SetSize);
|
console.BindMethod("SetSize", &Console::SetSize);
|
||||||
consoleClass.BindMethod("SetTextFont", &Console::SetTextFont);
|
console.BindMethod("SetTextFont", &Console::SetTextFont);
|
||||||
|
|
||||||
consoleClass.BindMethod("Show", &Console::Show, true);
|
console.BindMethod("Show", &Console::Show, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********************************** Ndk::Entity **********************************/
|
/*********************************** Ndk::Entity **********************************/
|
||||||
entityClass.BindMethod("Enable", &Entity::Enable, true);
|
entity.BindMethod("Enable", &Entity::Enable, true);
|
||||||
entityClass.BindMethod("GetId", &Entity::GetId);
|
entity.BindMethod("GetId", &Entity::GetId);
|
||||||
entityClass.BindMethod("GetWorld", &Entity::GetWorld);
|
entity.BindMethod("GetWorld", &Entity::GetWorld);
|
||||||
entityClass.BindMethod("Kill", &Entity::Kill);
|
entity.BindMethod("Kill", &Entity::Kill);
|
||||||
entityClass.BindMethod("IsEnabled", &Entity::IsEnabled);
|
entity.BindMethod("IsEnabled", &Entity::IsEnabled);
|
||||||
entityClass.BindMethod("IsValid", &Entity::IsValid);
|
entity.BindMethod("IsValid", &Entity::IsValid);
|
||||||
entityClass.BindMethod("RemoveAllComponents", &Entity::RemoveAllComponents);
|
entity.BindMethod("RemoveAllComponents", &Entity::RemoveAllComponents);
|
||||||
entityClass.BindMethod("__tostring", &EntityHandle::ToString);
|
entity.BindMethod("__tostring", &EntityHandle::ToString);
|
||||||
|
|
||||||
entityClass.BindMethod("AddComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle) -> int
|
entity.BindMethod("AddComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle) -> int
|
||||||
{
|
{
|
||||||
ComponentBinding* binding = QueryComponentIndex(instance);
|
ComponentBinding* binding = QueryComponentIndex(instance);
|
||||||
|
|
||||||
return binding->adder(instance, handle);
|
return binding->adder(instance, handle);
|
||||||
});
|
});
|
||||||
|
|
||||||
entityClass.BindMethod("GetComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle) -> int
|
entity.BindMethod("GetComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle) -> int
|
||||||
{
|
{
|
||||||
ComponentBinding* binding = QueryComponentIndex(instance);
|
ComponentBinding* binding = QueryComponentIndex(instance);
|
||||||
|
|
||||||
return binding->getter(instance, handle->GetComponent(binding->index));
|
return binding->getter(instance, handle->GetComponent(binding->index));
|
||||||
});
|
});
|
||||||
|
|
||||||
entityClass.BindMethod("RemoveComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle) -> int
|
entity.BindMethod("RemoveComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle) -> int
|
||||||
{
|
{
|
||||||
ComponentBinding* binding = QueryComponentIndex(instance);
|
ComponentBinding* binding = QueryComponentIndex(instance);
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ namespace Ndk
|
||||||
});
|
});
|
||||||
|
|
||||||
/*********************************** Ndk::NodeComponent **********************************/
|
/*********************************** Ndk::NodeComponent **********************************/
|
||||||
nodeComponent.Inherit<Nz::Node>(nodeClass, [] (NodeComponentHandle* handle) -> Nz::Node*
|
nodeComponent.Inherit<Nz::Node>(node, [] (NodeComponentHandle* handle) -> Nz::Node*
|
||||||
{
|
{
|
||||||
return handle->GetObject();
|
return handle->GetObject();
|
||||||
});
|
});
|
||||||
|
|
@ -132,9 +132,9 @@ namespace Ndk
|
||||||
});
|
});
|
||||||
|
|
||||||
/*********************************** Ndk::World **********************************/
|
/*********************************** Ndk::World **********************************/
|
||||||
worldClass.BindMethod("CreateEntity", &World::CreateEntity);
|
world.BindMethod("CreateEntity", &World::CreateEntity);
|
||||||
worldClass.BindMethod("CreateEntities", &World::CreateEntities);
|
world.BindMethod("CreateEntities", &World::CreateEntities);
|
||||||
worldClass.BindMethod("Clear", &World::Clear);
|
world.BindMethod("Clear", &World::Clear);
|
||||||
|
|
||||||
|
|
||||||
#ifndef NDK_SERVER
|
#ifndef NDK_SERVER
|
||||||
|
|
@ -222,13 +222,13 @@ namespace Ndk
|
||||||
{
|
{
|
||||||
// Classes
|
// Classes
|
||||||
application.Register(instance);
|
application.Register(instance);
|
||||||
entityClass.Register(instance);
|
entity.Register(instance);
|
||||||
nodeComponent.Register(instance);
|
nodeComponent.Register(instance);
|
||||||
velocityComponent.Register(instance);
|
velocityComponent.Register(instance);
|
||||||
worldClass.Register(instance);
|
world.Register(instance);
|
||||||
|
|
||||||
#ifndef NDK_SERVER
|
#ifndef NDK_SERVER
|
||||||
consoleClass.Register(instance);
|
console.Register(instance);
|
||||||
graphicsComponent.Register(instance);
|
graphicsComponent.Register(instance);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,19 +93,19 @@ namespace Ndk
|
||||||
});
|
});
|
||||||
|
|
||||||
/*********************************** Nz::Font **********************************/
|
/*********************************** Nz::Font **********************************/
|
||||||
fontClass.SetConstructor([] (Nz::LuaInstance& /*lua*/, Nz::FontRef* font, std::size_t /*argumentCount*/)
|
font.SetConstructor([] (Nz::LuaInstance& /*lua*/, Nz::FontRef* font, std::size_t /*argumentCount*/)
|
||||||
{
|
{
|
||||||
Nz::PlacementNew(font, Nz::Font::New());
|
Nz::PlacementNew(font, Nz::Font::New());
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
fontClass.BindMethod("ClearGlyphCache", &Nz::Font::ClearGlyphCache);
|
font.BindMethod("ClearGlyphCache", &Nz::Font::ClearGlyphCache);
|
||||||
fontClass.BindMethod("ClearKerningCache", &Nz::Font::ClearKerningCache);
|
font.BindMethod("ClearKerningCache", &Nz::Font::ClearKerningCache);
|
||||||
fontClass.BindMethod("ClearSizeInfoCache", &Nz::Font::ClearSizeInfoCache);
|
font.BindMethod("ClearSizeInfoCache", &Nz::Font::ClearSizeInfoCache);
|
||||||
|
|
||||||
fontClass.BindMethod("Destroy", &Nz::Font::Destroy);
|
font.BindMethod("Destroy", &Nz::Font::Destroy);
|
||||||
|
|
||||||
fontClass.BindMethod("GetCachedGlyphCount", [] (Nz::LuaInstance& lua, Nz::FontRef& instance) -> int
|
font.BindMethod("GetCachedGlyphCount", [] (Nz::LuaInstance& lua, Nz::FontRef& instance) -> int
|
||||||
{
|
{
|
||||||
unsigned int argCount = std::min(lua.GetStackTop(), 2U);
|
unsigned int argCount = std::min(lua.GetStackTop(), 2U);
|
||||||
|
|
||||||
|
|
@ -130,76 +130,76 @@ namespace Ndk
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
fontClass.BindMethod("GetFamilyName", &Nz::Font::GetFamilyName);
|
font.BindMethod("GetFamilyName", &Nz::Font::GetFamilyName);
|
||||||
fontClass.BindMethod("GetKerning", &Nz::Font::GetKerning);
|
font.BindMethod("GetKerning", &Nz::Font::GetKerning);
|
||||||
fontClass.BindMethod("GetGlyphBorder", &Nz::Font::GetGlyphBorder);
|
font.BindMethod("GetGlyphBorder", &Nz::Font::GetGlyphBorder);
|
||||||
fontClass.BindMethod("GetMinimumStepSize", &Nz::Font::GetMinimumStepSize);
|
font.BindMethod("GetMinimumStepSize", &Nz::Font::GetMinimumStepSize);
|
||||||
fontClass.BindMethod("GetSizeInfo", &Nz::Font::GetSizeInfo);
|
font.BindMethod("GetSizeInfo", &Nz::Font::GetSizeInfo);
|
||||||
fontClass.BindMethod("GetStyleName", &Nz::Font::GetStyleName);
|
font.BindMethod("GetStyleName", &Nz::Font::GetStyleName);
|
||||||
|
|
||||||
fontClass.BindMethod("IsValid", &Nz::Font::IsValid);
|
font.BindMethod("IsValid", &Nz::Font::IsValid);
|
||||||
|
|
||||||
fontClass.BindMethod("Precache", (bool(Nz::Font::*)(unsigned int, Nz::UInt32, const Nz::String&) const) &Nz::Font::Precache);
|
font.BindMethod("Precache", (bool(Nz::Font::*)(unsigned int, Nz::UInt32, const Nz::String&) const) &Nz::Font::Precache);
|
||||||
|
|
||||||
fontClass.BindMethod("OpenFromFile", &Nz::Font::OpenFromFile, Nz::FontParams());
|
font.BindMethod("OpenFromFile", &Nz::Font::OpenFromFile, Nz::FontParams());
|
||||||
|
|
||||||
fontClass.BindMethod("SetGlyphBorder", &Nz::Font::SetGlyphBorder);
|
font.BindMethod("SetGlyphBorder", &Nz::Font::SetGlyphBorder);
|
||||||
fontClass.BindMethod("SetMinimumStepSize", &Nz::Font::SetMinimumStepSize);
|
font.BindMethod("SetMinimumStepSize", &Nz::Font::SetMinimumStepSize);
|
||||||
|
|
||||||
fontClass.BindStaticMethod("GetDefault", &Nz::Font::GetDefault);
|
font.BindStaticMethod("GetDefault", &Nz::Font::GetDefault);
|
||||||
fontClass.BindStaticMethod("GetDefaultGlyphBorder", &Nz::Font::GetDefaultGlyphBorder);
|
font.BindStaticMethod("GetDefaultGlyphBorder", &Nz::Font::GetDefaultGlyphBorder);
|
||||||
fontClass.BindStaticMethod("GetDefaultMinimumStepSize", &Nz::Font::GetDefaultMinimumStepSize);
|
font.BindStaticMethod("GetDefaultMinimumStepSize", &Nz::Font::GetDefaultMinimumStepSize);
|
||||||
|
|
||||||
fontClass.BindStaticMethod("SetDefaultGlyphBorder", &Nz::Font::SetDefaultGlyphBorder);
|
font.BindStaticMethod("SetDefaultGlyphBorder", &Nz::Font::SetDefaultGlyphBorder);
|
||||||
fontClass.BindStaticMethod("SetDefaultMinimumStepSize", &Nz::Font::SetDefaultMinimumStepSize);
|
font.BindStaticMethod("SetDefaultMinimumStepSize", &Nz::Font::SetDefaultMinimumStepSize);
|
||||||
|
|
||||||
/*********************************** Nz::Node **********************************/
|
/*********************************** Nz::Node **********************************/
|
||||||
nodeClass.BindMethod("GetBackward", &Nz::Node::GetBackward);
|
node.BindMethod("GetBackward", &Nz::Node::GetBackward);
|
||||||
//nodeClass.SetMethod("GetChilds", &Nz::Node::GetChilds);
|
//nodeClass.SetMethod("GetChilds", &Nz::Node::GetChilds);
|
||||||
nodeClass.BindMethod("GetDown", &Nz::Node::GetDown);
|
node.BindMethod("GetDown", &Nz::Node::GetDown);
|
||||||
nodeClass.BindMethod("GetForward", &Nz::Node::GetForward);
|
node.BindMethod("GetForward", &Nz::Node::GetForward);
|
||||||
nodeClass.BindMethod("GetInheritPosition", &Nz::Node::GetInheritPosition);
|
node.BindMethod("GetInheritPosition", &Nz::Node::GetInheritPosition);
|
||||||
nodeClass.BindMethod("GetInheritRotation", &Nz::Node::GetInheritRotation);
|
node.BindMethod("GetInheritRotation", &Nz::Node::GetInheritRotation);
|
||||||
nodeClass.BindMethod("GetInheritScale", &Nz::Node::GetInheritScale);
|
node.BindMethod("GetInheritScale", &Nz::Node::GetInheritScale);
|
||||||
nodeClass.BindMethod("GetInitialPosition", &Nz::Node::GetInitialPosition);
|
node.BindMethod("GetInitialPosition", &Nz::Node::GetInitialPosition);
|
||||||
//nodeClass.SetMethod("GetInitialRotation", &Nz::Node::GetInitialRotation);
|
//nodeClass.SetMethod("GetInitialRotation", &Nz::Node::GetInitialRotation);
|
||||||
nodeClass.BindMethod("GetInitialScale", &Nz::Node::GetInitialScale);
|
node.BindMethod("GetInitialScale", &Nz::Node::GetInitialScale);
|
||||||
nodeClass.BindMethod("GetLeft", &Nz::Node::GetLeft);
|
node.BindMethod("GetLeft", &Nz::Node::GetLeft);
|
||||||
nodeClass.BindMethod("GetNodeType", &Nz::Node::GetNodeType);
|
node.BindMethod("GetNodeType", &Nz::Node::GetNodeType);
|
||||||
//nodeClass.SetMethod("GetParent", &Nz::Node::GetParent);
|
//nodeClass.SetMethod("GetParent", &Nz::Node::GetParent);
|
||||||
nodeClass.BindMethod("GetPosition", &Nz::Node::GetPosition, Nz::CoordSys_Global);
|
node.BindMethod("GetPosition", &Nz::Node::GetPosition, Nz::CoordSys_Global);
|
||||||
nodeClass.BindMethod("GetRight", &Nz::Node::GetRight);
|
node.BindMethod("GetRight", &Nz::Node::GetRight);
|
||||||
//nodeClass.SetMethod("GetRotation", &Nz::Node::GetRotation, Nz::CoordSys_Global);
|
//nodeClass.SetMethod("GetRotation", &Nz::Node::GetRotation, Nz::CoordSys_Global);
|
||||||
nodeClass.BindMethod("GetScale", &Nz::Node::GetScale, Nz::CoordSys_Global);
|
node.BindMethod("GetScale", &Nz::Node::GetScale, Nz::CoordSys_Global);
|
||||||
//nodeClass.SetMethod("GetTransformMatrix", &Nz::Node::GetTransformMatrix);
|
//nodeClass.SetMethod("GetTransformMatrix", &Nz::Node::GetTransformMatrix);
|
||||||
nodeClass.BindMethod("GetUp", &Nz::Node::GetUp);
|
node.BindMethod("GetUp", &Nz::Node::GetUp);
|
||||||
|
|
||||||
nodeClass.BindMethod("HasChilds", &Nz::Node::HasChilds);
|
node.BindMethod("HasChilds", &Nz::Node::HasChilds);
|
||||||
|
|
||||||
nodeClass.BindMethod("GetBackward", &Nz::Node::GetBackward);
|
node.BindMethod("GetBackward", &Nz::Node::GetBackward);
|
||||||
nodeClass.BindMethod("GetDown", &Nz::Node::GetDown);
|
node.BindMethod("GetDown", &Nz::Node::GetDown);
|
||||||
nodeClass.BindMethod("GetForward", &Nz::Node::GetForward);
|
node.BindMethod("GetForward", &Nz::Node::GetForward);
|
||||||
nodeClass.BindMethod("GetInheritPosition", &Nz::Node::GetInheritPosition);
|
node.BindMethod("GetInheritPosition", &Nz::Node::GetInheritPosition);
|
||||||
nodeClass.BindMethod("GetInheritRotation", &Nz::Node::GetInheritRotation);
|
node.BindMethod("GetInheritRotation", &Nz::Node::GetInheritRotation);
|
||||||
nodeClass.BindMethod("GetInheritScale", &Nz::Node::GetInheritScale);
|
node.BindMethod("GetInheritScale", &Nz::Node::GetInheritScale);
|
||||||
nodeClass.BindMethod("GetInitialPosition", &Nz::Node::GetInitialPosition);
|
node.BindMethod("GetInitialPosition", &Nz::Node::GetInitialPosition);
|
||||||
nodeClass.BindMethod("GetInitialRotation", &Nz::Node::GetInitialRotation);
|
node.BindMethod("GetInitialRotation", &Nz::Node::GetInitialRotation);
|
||||||
nodeClass.BindMethod("GetInitialScale", &Nz::Node::GetInitialScale);
|
node.BindMethod("GetInitialScale", &Nz::Node::GetInitialScale);
|
||||||
nodeClass.BindMethod("GetLeft", &Nz::Node::GetLeft);
|
node.BindMethod("GetLeft", &Nz::Node::GetLeft);
|
||||||
nodeClass.BindMethod("GetNodeType", &Nz::Node::GetNodeType);
|
node.BindMethod("GetNodeType", &Nz::Node::GetNodeType);
|
||||||
nodeClass.BindMethod("GetPosition", &Nz::Node::GetPosition, Nz::CoordSys_Global);
|
node.BindMethod("GetPosition", &Nz::Node::GetPosition, Nz::CoordSys_Global);
|
||||||
nodeClass.BindMethod("GetRight", &Nz::Node::GetRight);
|
node.BindMethod("GetRight", &Nz::Node::GetRight);
|
||||||
nodeClass.BindMethod("GetRotation", &Nz::Node::GetRotation, Nz::CoordSys_Global);
|
node.BindMethod("GetRotation", &Nz::Node::GetRotation, Nz::CoordSys_Global);
|
||||||
nodeClass.BindMethod("GetScale", &Nz::Node::GetScale, Nz::CoordSys_Global);
|
node.BindMethod("GetScale", &Nz::Node::GetScale, Nz::CoordSys_Global);
|
||||||
nodeClass.BindMethod("GetUp", &Nz::Node::GetUp);
|
node.BindMethod("GetUp", &Nz::Node::GetUp);
|
||||||
|
|
||||||
nodeClass.BindMethod("SetInitialPosition", (void(Nz::Node::*)(const Nz::Vector3f&)) &Nz::Node::SetInitialPosition);
|
node.BindMethod("SetInitialPosition", (void(Nz::Node::*)(const Nz::Vector3f&)) &Nz::Node::SetInitialPosition);
|
||||||
nodeClass.BindMethod("SetInitialRotation", (void(Nz::Node::*)(const Nz::Quaternionf&)) &Nz::Node::SetInitialRotation);
|
node.BindMethod("SetInitialRotation", (void(Nz::Node::*)(const Nz::Quaternionf&)) &Nz::Node::SetInitialRotation);
|
||||||
|
|
||||||
nodeClass.BindMethod("SetPosition", (void(Nz::Node::*)(const Nz::Vector3f&, Nz::CoordSys)) &Nz::Node::SetPosition, Nz::CoordSys_Local);
|
node.BindMethod("SetPosition", (void(Nz::Node::*)(const Nz::Vector3f&, Nz::CoordSys)) &Nz::Node::SetPosition, Nz::CoordSys_Local);
|
||||||
nodeClass.BindMethod("SetRotation", (void(Nz::Node::*)(const Nz::Quaternionf&, Nz::CoordSys)) &Nz::Node::SetRotation, Nz::CoordSys_Local);
|
node.BindMethod("SetRotation", (void(Nz::Node::*)(const Nz::Quaternionf&, Nz::CoordSys)) &Nz::Node::SetRotation, Nz::CoordSys_Local);
|
||||||
|
|
||||||
nodeClass.BindMethod("Move", [] (Nz::LuaInstance& lua, Nz::Node& node) -> int
|
node.BindMethod("Move", [] (Nz::LuaInstance& lua, Nz::Node& node) -> int
|
||||||
{
|
{
|
||||||
int argIndex = 1;
|
int argIndex = 1;
|
||||||
|
|
||||||
|
|
@ -210,7 +210,7 @@ namespace Ndk
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
nodeClass.BindMethod("Rotate", [] (Nz::LuaInstance& lua, Nz::Node& node) -> int
|
node.BindMethod("Rotate", [] (Nz::LuaInstance& lua, Nz::Node& node) -> int
|
||||||
{
|
{
|
||||||
int argIndex = 1;
|
int argIndex = 1;
|
||||||
|
|
||||||
|
|
@ -221,7 +221,7 @@ namespace Ndk
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
nodeClass.BindMethod("Scale", [] (Nz::LuaInstance& lua, Nz::Node& node) -> int
|
node.BindMethod("Scale", [] (Nz::LuaInstance& lua, Nz::Node& node) -> int
|
||||||
{
|
{
|
||||||
unsigned int argCount = std::min(lua.GetStackTop(), 4U);
|
unsigned int argCount = std::min(lua.GetStackTop(), 4U);
|
||||||
|
|
||||||
|
|
@ -247,7 +247,7 @@ namespace Ndk
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
nodeClass.BindMethod("SetScale", [] (Nz::LuaInstance& lua, Nz::Node& node) -> int
|
node.BindMethod("SetScale", [] (Nz::LuaInstance& lua, Nz::Node& node) -> int
|
||||||
{
|
{
|
||||||
unsigned int argCount = std::min(lua.GetStackTop(), 4U);
|
unsigned int argCount = std::min(lua.GetStackTop(), 4U);
|
||||||
|
|
||||||
|
|
@ -284,7 +284,7 @@ namespace Ndk
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
nodeClass.BindMethod("SetInitialScale", [] (Nz::LuaInstance& lua, Nz::Node& node) -> int
|
node.BindMethod("SetInitialScale", [] (Nz::LuaInstance& lua, Nz::Node& node) -> int
|
||||||
{
|
{
|
||||||
unsigned int argCount = std::min(lua.GetStackTop(), 4U);
|
unsigned int argCount = std::min(lua.GetStackTop(), 4U);
|
||||||
|
|
||||||
|
|
@ -321,7 +321,7 @@ namespace Ndk
|
||||||
void LuaBinding::RegisterUtility(Nz::LuaInstance& instance)
|
void LuaBinding::RegisterUtility(Nz::LuaInstance& instance)
|
||||||
{
|
{
|
||||||
abstractImage.Register(instance);
|
abstractImage.Register(instance);
|
||||||
fontClass.Register(instance);
|
font.Register(instance);
|
||||||
nodeClass.Register(instance);
|
node.Register(instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue