Merge branch 'master' into culling
This commit is contained in:
@@ -59,7 +59,7 @@ namespace Ndk
|
||||
* \param args Arguments used to create the window
|
||||
*/
|
||||
#ifndef NDK_SERVER
|
||||
template<typename T, typename... Args>
|
||||
template<typename T, typename... Args>
|
||||
T& Application::AddWindow(Args&&... args)
|
||||
{
|
||||
static_assert(std::is_base_of<Nz::Window, T>::value, "Type must inherit Window");
|
||||
@@ -82,7 +82,7 @@ namespace Ndk
|
||||
* \param args Arguments used to create the world
|
||||
*/
|
||||
|
||||
template<typename... Args>
|
||||
template<typename... Args>
|
||||
World& Application::AddWorld(Args&&... args)
|
||||
{
|
||||
m_worlds.emplace_back(std::forward<Args>(args)...);
|
||||
@@ -373,9 +373,9 @@ namespace Ndk
|
||||
{
|
||||
}
|
||||
|
||||
inline Application::WindowInfo::WindowInfo(std::unique_ptr<Nz::Window>&& window) :
|
||||
inline Application::WindowInfo::WindowInfo(std::unique_ptr<Nz::Window>&& windowPtr) :
|
||||
renderTarget(nullptr),
|
||||
window(std::move(window))
|
||||
window(std::move(windowPtr))
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file was automatically generated on 30 Jul 2016 at 15:29:16
|
||||
// This file was automatically generated
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -77,21 +77,21 @@ namespace Ndk
|
||||
dataUpdated(false)
|
||||
{
|
||||
}
|
||||
|
||||
Renderable(Renderable&& renderable) noexcept :
|
||||
renderableBoundingVolumeInvalidationSlot(std::move(renderable.renderableBoundingVolumeInvalidationSlot)),
|
||||
renderableDataInvalidationSlot(std::move(renderable.renderableDataInvalidationSlot)),
|
||||
renderableReleaseSlot(std::move(renderable.renderableReleaseSlot)),
|
||||
data(std::move(renderable.data)),
|
||||
renderable(std::move(renderable.renderable)),
|
||||
dataUpdated(renderable.dataUpdated)
|
||||
|
||||
Renderable(Renderable&& rhs) noexcept :
|
||||
renderableBoundingVolumeInvalidationSlot(std::move(rhs.renderableBoundingVolumeInvalidationSlot)),
|
||||
renderableDataInvalidationSlot(std::move(rhs.renderableDataInvalidationSlot)),
|
||||
renderableReleaseSlot(std::move(rhs.renderableReleaseSlot)),
|
||||
data(std::move(rhs.data)),
|
||||
renderable(std::move(rhs.rhs)),
|
||||
dataUpdated(rhs.dataUpdated)
|
||||
{
|
||||
}
|
||||
|
||||
~Renderable()
|
||||
{
|
||||
// Disconnect release slot before releasing instanced renderable reference
|
||||
renderableReleaseSlot.Disconnect();
|
||||
renderableReleaseSlot.Disconnect();
|
||||
}
|
||||
|
||||
Renderable& operator=(Renderable&& r) noexcept
|
||||
@@ -136,4 +136,4 @@ namespace Ndk
|
||||
#include <NDK/Components/GraphicsComponent.inl>
|
||||
|
||||
#endif // NDK_COMPONENTS_GRAPHICSCOMPONENT_HPP
|
||||
#endif // NDK_SERVER
|
||||
#endif // NDK_SERVER
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
class Entity;
|
||||
class VelocityComponent;
|
||||
|
||||
using VelocityComponentHandle = Nz::ObjectHandle<VelocityComponent>;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Ndk
|
||||
LuaAPI() = delete;
|
||||
~LuaAPI() = delete;
|
||||
|
||||
static inline LuaBinding* GetBinding();
|
||||
static LuaBinding* GetBinding();
|
||||
|
||||
static bool Initialize();
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <Nazara/Math/Vector3.hpp>
|
||||
#include <Nazara/Network/IpAddress.hpp>
|
||||
#include <Nazara/Utility/Font.hpp>
|
||||
#include <Nazara/Utility/Image.hpp>
|
||||
#include <Nazara/Utility/Mesh.hpp>
|
||||
#include <NDK/Application.hpp>
|
||||
#include <NDK/Components.hpp>
|
||||
@@ -21,22 +22,10 @@
|
||||
#include <Nazara/Audio/Music.hpp>
|
||||
#include <Nazara/Audio/SoundBuffer.hpp>
|
||||
#include <Nazara/Graphics/Model.hpp>
|
||||
#include <Nazara/Renderer/Texture.hpp>
|
||||
#include <NDK/Console.hpp>
|
||||
#endif
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
/*!
|
||||
* \brief Gets the internal binding for Lua
|
||||
* \return A pointer to the binding
|
||||
*/
|
||||
|
||||
inline LuaBinding* LuaAPI::GetBinding()
|
||||
{
|
||||
return s_binding;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
/*!
|
||||
@@ -143,6 +132,104 @@ namespace Nz
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param params Resulting parameters for an image
|
||||
*/
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, ImageParams* params, TypeTag<ImageParams>)
|
||||
{
|
||||
instance.CheckType(index, Nz::LuaType_Table);
|
||||
|
||||
params->levelCount = instance.CheckField<Nz::UInt8>("LevelCount");
|
||||
params->loadFormat = instance.CheckField<Nz::PixelFormatType>("LoadFormat");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param address Resulting IP address
|
||||
*/
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, IpAddress* address, TypeTag<IpAddress>)
|
||||
{
|
||||
switch (instance.GetType(index))
|
||||
{
|
||||
case Nz::LuaType_String:
|
||||
address->BuildFromAddress(instance.CheckString(index));
|
||||
return 1;
|
||||
|
||||
default:
|
||||
*address = *static_cast<IpAddress*>(instance.CheckUserdata(index, "IpAddress"));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param quat Resulting quaternion
|
||||
*/
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Matrix4d* mat, TypeTag<Matrix4d>)
|
||||
{
|
||||
switch (instance.GetType(index))
|
||||
{
|
||||
case Nz::LuaType_Table:
|
||||
{
|
||||
double values[16];
|
||||
for (std::size_t i = 0; i < 16; ++i)
|
||||
{
|
||||
instance.PushInteger(i + 1);
|
||||
instance.GetTable();
|
||||
|
||||
values[i] = instance.CheckNumber(-1);
|
||||
instance.Pop();
|
||||
}
|
||||
|
||||
mat->Set(values);
|
||||
return 1;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
if (instance.IsOfType(index, "Matrix4"))
|
||||
mat->Set(*static_cast<Matrix4d*>(instance.ToUserdata(index)));
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param quat Resulting quaternion
|
||||
*/
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Matrix4f* mat, TypeTag<Matrix4f>)
|
||||
{
|
||||
Matrix4d matDouble = Matrix4d::Identity();
|
||||
unsigned int ret = LuaImplQueryArg(instance, index, &matDouble, TypeTag<Matrix4d>());
|
||||
|
||||
mat->Set(matDouble);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
@@ -156,15 +243,62 @@ namespace Nz
|
||||
{
|
||||
instance.CheckType(index, Nz::LuaType_Table);
|
||||
|
||||
params->animated = instance.CheckField<bool>("Animated", params->animated);
|
||||
params->center = instance.CheckField<bool>("Center", params->center);
|
||||
params->flipUVs = instance.CheckField<bool>("FlipUVs", params->flipUVs);
|
||||
//params->matrix = instance.CheckField<Matrix4f>("Matrix", params->matrix);
|
||||
params->animated = instance.CheckField<bool>("Animated", params->animated);
|
||||
params->center = instance.CheckField<bool>("Center", params->center);
|
||||
params->flipUVs = instance.CheckField<bool>("FlipUVs", params->flipUVs);
|
||||
params->matrix = instance.CheckField<Matrix4f>("Matrix", params->matrix);
|
||||
params->optimizeIndexBuffers = instance.CheckField<bool>("OptimizeIndexBuffers", params->optimizeIndexBuffers);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param quat Resulting quaternion
|
||||
*/
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Quaterniond* quat, TypeTag<Quaterniond>)
|
||||
{
|
||||
switch (instance.GetType(index))
|
||||
{
|
||||
case Nz::LuaType_Table:
|
||||
quat->Set(instance.CheckField<double>("w", index), instance.CheckField<double>("x", index), instance.CheckField<double>("y", index), instance.CheckField<double>("z", index));
|
||||
return 1;
|
||||
|
||||
default:
|
||||
{
|
||||
if (instance.IsOfType(index, "EulerAngles"))
|
||||
quat->Set(*static_cast<EulerAnglesd*>(instance.ToUserdata(index)));
|
||||
else
|
||||
quat->Set(*static_cast<Quaterniond*>(instance.CheckUserdata(index, "Quaternion")));
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param quat Resulting quaternion
|
||||
*/
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Quaternionf* quat, TypeTag<Quaternionf>)
|
||||
{
|
||||
Quaterniond quatDouble;
|
||||
unsigned int ret = LuaImplQueryArg(instance, index, &quatDouble, TypeTag<Quaterniond>());
|
||||
|
||||
quat->Set(quatDouble);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
@@ -222,76 +356,6 @@ namespace Nz
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param quat Resulting quaternion
|
||||
*/
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Quaterniond* quat, TypeTag<Quaterniond>)
|
||||
{
|
||||
switch (instance.GetType(index))
|
||||
{
|
||||
case Nz::LuaType_Table:
|
||||
quat->Set(instance.CheckField<double>("w", index), instance.CheckField<double>("x", index), instance.CheckField<double>("y", index), instance.CheckField<double>("z", index));
|
||||
return 1;
|
||||
|
||||
default:
|
||||
{
|
||||
if (instance.IsOfType(index, "EulerAngles"))
|
||||
quat->Set(*static_cast<EulerAnglesd*>(instance.ToUserdata(index)));
|
||||
else
|
||||
quat->Set(*static_cast<Quaterniond*>(instance.CheckUserdata(index, "Quaternion")));
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param quat Resulting quaternion
|
||||
*/
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, Quaternionf* quat, TypeTag<Quaternionf>)
|
||||
{
|
||||
Quaterniond quatDouble;
|
||||
unsigned int ret = LuaImplQueryArg(instance, index, &quatDouble, TypeTag<Quaterniond>());
|
||||
|
||||
quat->Set(quatDouble);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param address Resulting IP address
|
||||
*/
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, IpAddress* address, TypeTag<IpAddress>)
|
||||
{
|
||||
switch (instance.GetType(index))
|
||||
{
|
||||
case Nz::LuaType_String:
|
||||
address->BuildFromAddress(instance.CheckString(index));
|
||||
return 1;
|
||||
|
||||
default:
|
||||
*address = *static_cast<IpAddress*>(instance.CheckUserdata(index, "IpAddress"));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
@@ -469,10 +533,31 @@ namespace Nz
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, InstancedRenderableRef* renderable, TypeTag<InstancedRenderableRef>)
|
||||
{
|
||||
if (instance.IsOfType(index, "InstancedRenderable"))
|
||||
*renderable = *static_cast<InstancedRenderableRef*>(instance.CheckUserdata(index, "InstancedRenderable"));
|
||||
if (instance.IsOfType(index, "InstancedRenderable") ||
|
||||
instance.IsOfType(index, "Model") ||
|
||||
instance.IsOfType(index, "Sprite"))
|
||||
{
|
||||
*renderable = *static_cast<InstancedRenderableRef*>(instance.ToUserdata(index));
|
||||
}
|
||||
else
|
||||
*renderable = *static_cast<InstancedRenderableRef*>(instance.CheckUserdata(index, "Model"));
|
||||
instance.ArgError(index, "is not a InstancedRenderable instance");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param renderable Resulting reference to a material
|
||||
*/
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, MaterialRef* materialRef, TypeTag<MaterialRef>)
|
||||
{
|
||||
*materialRef = *static_cast<MaterialRef*>(instance.CheckUserdata(index, "Material"));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -495,6 +580,7 @@ namespace Nz
|
||||
params->loadHeightMap = instance.CheckField<bool>("LoadHeightMap", params->loadHeightMap);
|
||||
params->loadNormalMap = instance.CheckField<bool>("LoadNormalMap", params->loadNormalMap);
|
||||
params->loadSpecularMap = instance.CheckField<bool>("LoadSpecularMap", params->loadSpecularMap);
|
||||
params->shaderName = instance.CheckField<String>("ShaderName", params->shaderName);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -556,8 +642,59 @@ namespace Nz
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param renderable Resulting reference to a sprite
|
||||
*/
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, SpriteRef* spriteRef, TypeTag<SpriteRef>)
|
||||
{
|
||||
*spriteRef = *static_cast<SpriteRef*>(instance.CheckUserdata(index, "Sprite"));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Queries arguments for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param index Index type
|
||||
* \param fontRef Resulting reference to a font
|
||||
*/
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, TextureRef* textureRef, TypeTag<TextureRef>)
|
||||
{
|
||||
*textureRef = *static_cast<TextureRef*>(instance.CheckUserdata(index, "Texture"));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param val Resulting color
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, Color&& val, TypeTag<Color>)
|
||||
{
|
||||
instance.PushTable();
|
||||
instance.PushField("r", val.r);
|
||||
instance.PushField("g", val.g);
|
||||
instance.PushField("b", val.b);
|
||||
instance.PushField("a", val.a);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
@@ -619,6 +756,65 @@ namespace Nz
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param val Resulting ImageParams
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, ImageParams&& val, TypeTag<ImageParams>)
|
||||
{
|
||||
instance.PushTable(0, 2);
|
||||
instance.PushField("LevelCount", val.levelCount);
|
||||
instance.PushField("LoadFormat", val.loadFormat);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param val Resulting IP address
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, IpAddress&& val, TypeTag<IpAddress>)
|
||||
{
|
||||
instance.PushInstance<IpAddress>("IpAddress", val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param val Resulting rectangle
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, Matrix4d&& val, TypeTag<Matrix4d>)
|
||||
{
|
||||
instance.PushInstance<Matrix4d>("Matrix4", val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param val Resulting rectangle
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, Matrix4f&& val, TypeTag<Matrix4f>)
|
||||
{
|
||||
instance.PushInstance<Matrix4d>("Matrix4", val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
@@ -647,20 +843,6 @@ namespace Nz
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param val Resulting IP address
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, IpAddress&& val, TypeTag<IpAddress>)
|
||||
{
|
||||
instance.PushInstance<IpAddress>("IpAddress", val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
@@ -669,7 +851,7 @@ namespace Nz
|
||||
* \param val Resulting rectangle
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, Rectd&& val, TypeTag<Rectf>)
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, Rectd&& val, TypeTag<Rectd>)
|
||||
{
|
||||
instance.PushInstance<Rectd>("Rect", val);
|
||||
return 1;
|
||||
@@ -887,6 +1069,62 @@ namespace Nz
|
||||
|
||||
#ifndef NDK_SERVER
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param handle Resulting material
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, MaterialRef&& handle, TypeTag<MaterialRef>)
|
||||
{
|
||||
instance.PushInstance<MaterialRef>("Material", handle);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param val Resulting sound buffer
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, const SoundBuffer* val, TypeTag<const SoundBuffer*>)
|
||||
{
|
||||
instance.PushInstance<SoundBufferConstRef>("SoundBuffer", val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param handle Resulting sprite
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, SpriteRef&& handle, TypeTag<SpriteRef>)
|
||||
{
|
||||
instance.PushInstance<SpriteRef>("Sprite", handle);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param handle Resulting texture
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, TextureRef&& handle, TypeTag<TextureRef>)
|
||||
{
|
||||
instance.PushInstance<TextureRef>("Texture", handle);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
@@ -914,21 +1152,6 @@ namespace Nz
|
||||
instance.PushInstance<Ndk::GraphicsComponentHandle>("GraphicsComponent", handle);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Replies by value for Lua
|
||||
* \return 1 in case of success
|
||||
*
|
||||
* \param instance Lua instance to interact with
|
||||
* \param val Resulting sound buffer
|
||||
*/
|
||||
|
||||
inline int LuaImplReplyVal(const LuaInstance& instance, const SoundBuffer* val, TypeTag<const SoundBuffer*>)
|
||||
{
|
||||
instance.PushInstance<SoundBufferConstRef>("SoundBuffer", val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -38,47 +38,56 @@ namespace Ndk
|
||||
void RegisterClasses(Nz::LuaInstance& instance);
|
||||
|
||||
// Core
|
||||
Nz::LuaClass<Nz::Clock> clockClass;
|
||||
Nz::LuaClass<Nz::Directory> directoryClass;
|
||||
Nz::LuaClass<Nz::File> fileClass;
|
||||
Nz::LuaClass<Nz::Stream> streamClass;
|
||||
Nz::LuaClass<Nz::Clock> clock;
|
||||
Nz::LuaClass<Nz::Directory> directory;
|
||||
Nz::LuaClass<Nz::File> file;
|
||||
Nz::LuaClass<Nz::Stream> stream;
|
||||
|
||||
// Math
|
||||
Nz::LuaClass<Nz::EulerAnglesd> eulerAnglesClass;
|
||||
Nz::LuaClass<Nz::Quaterniond> quaternionClass;
|
||||
Nz::LuaClass<Nz::Rectd> rectClass;
|
||||
Nz::LuaClass<Nz::Vector2d> vector2dClass;
|
||||
Nz::LuaClass<Nz::Vector3d> vector3dClass;
|
||||
Nz::LuaClass<Nz::EulerAnglesd> eulerAngles;
|
||||
Nz::LuaClass<Nz::Matrix4d> matrix4d;
|
||||
Nz::LuaClass<Nz::Quaterniond> quaternion;
|
||||
Nz::LuaClass<Nz::Rectd> rect;
|
||||
Nz::LuaClass<Nz::Vector2d> vector2d;
|
||||
Nz::LuaClass<Nz::Vector3d> vector3d;
|
||||
|
||||
// Network
|
||||
Nz::LuaClass<Nz::AbstractSocket> abstractSocketClass;
|
||||
Nz::LuaClass<Nz::IpAddress> ipAddressClass;
|
||||
Nz::LuaClass<Nz::AbstractSocket> abstractSocket;
|
||||
Nz::LuaClass<Nz::IpAddress> ipAddress;
|
||||
|
||||
// Utility
|
||||
Nz::LuaClass<Nz::AbstractImage*> abstractImage;
|
||||
Nz::LuaClass<Nz::FontRef> fontClass;
|
||||
Nz::LuaClass<Nz::Node> nodeClass;
|
||||
Nz::LuaClass<Nz::AbstractImageRef> abstractImage;
|
||||
Nz::LuaClass<Nz::FontRef> font;
|
||||
Nz::LuaClass<Nz::Node> node;
|
||||
|
||||
// SDK
|
||||
Nz::LuaClass<Application*> application;
|
||||
Nz::LuaClass<EntityHandle> entityClass;
|
||||
Nz::LuaClass<EntityHandle> entity;
|
||||
Nz::LuaClass<NodeComponentHandle> nodeComponent;
|
||||
Nz::LuaClass<VelocityComponentHandle> velocityComponent;
|
||||
Nz::LuaClass<WorldHandle> worldClass;
|
||||
Nz::LuaClass<WorldHandle> world;
|
||||
|
||||
#ifndef NDK_SERVER
|
||||
// Audio
|
||||
Nz::LuaClass<Nz::Music> musicClass;
|
||||
Nz::LuaClass<Nz::Sound> soundClass;
|
||||
Nz::LuaClass<Nz::Music> music;
|
||||
Nz::LuaClass<Nz::Sound> sound;
|
||||
Nz::LuaClass<Nz::SoundBufferRef> soundBuffer;
|
||||
Nz::LuaClass<Nz::SoundEmitter> soundEmitter;
|
||||
|
||||
// Graphics
|
||||
Nz::LuaClass<Nz::InstancedRenderableRef> instancedRenderable;
|
||||
Nz::LuaClass<Nz::ModelRef> modelClass;
|
||||
Nz::LuaClass<Nz::MaterialRef> material;
|
||||
Nz::LuaClass<Nz::ModelRef> model;
|
||||
Nz::LuaClass<Nz::SpriteRef> sprite;
|
||||
Nz::LuaClass<Nz::SpriteLibrary> spriteLibrary;
|
||||
Nz::LuaClass<Nz::TextureLibrary> textureLibrary;
|
||||
Nz::LuaClass<Nz::TextureManager> textureManager;
|
||||
|
||||
// Renderer
|
||||
Nz::LuaClass<Nz::TextureRef> texture;
|
||||
|
||||
// SDK
|
||||
Nz::LuaClass<ConsoleHandle> consoleClass;
|
||||
Nz::LuaClass<ConsoleHandle> console;
|
||||
Nz::LuaClass<GraphicsComponentHandle> graphicsComponent;
|
||||
#endif
|
||||
|
||||
@@ -117,7 +126,7 @@ namespace Ndk
|
||||
Nz::String name;
|
||||
};
|
||||
|
||||
ComponentBinding* QueryComponentIndex(Nz::LuaInstance& lua, int argIndex = 1);
|
||||
ComponentBinding* QueryComponentIndex(Nz::LuaInstance& lua, int argIndex = 2);
|
||||
|
||||
std::vector<ComponentBinding> m_componentBinding;
|
||||
std::unordered_map<Nz::String, ComponentIndex> m_componentBindingByName;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
// Importation/Exportation of the API
|
||||
#if defined(NAZARA_STATIC)
|
||||
#define #define NDK_API
|
||||
#define NDK_API
|
||||
#else
|
||||
#ifdef NDK_BUILD
|
||||
#define NDK_API NAZARA_EXPORT
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file was automatically generated on 30 Jul 2016 at 15:29:16
|
||||
// This file was automatically generated
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
Reference in New Issue
Block a user