Merge branch 'vulkan' of https://github.com/DigitalPulseSoftware/NazaraEngine into vulkan
Former-commit-id: 6b03014473198cb45b6eab38b14c3ec13dbccd63 [formerly 0010931b9e12714978c529537acdab9a8a1b5f92] Former-commit-id: 5d25a8929388c9986bba1d28f4fabd93504d6101
This commit is contained in:
commit
1e9a835a93
|
|
@ -11,8 +11,8 @@ namespace Ndk
|
||||||
inline CameraComponent::CameraComponent() :
|
inline CameraComponent::CameraComponent() :
|
||||||
m_projectionType(Nz::ProjectionType_Perspective),
|
m_projectionType(Nz::ProjectionType_Perspective),
|
||||||
m_targetRegion(0.f, 0.f, 1.f, 1.f),
|
m_targetRegion(0.f, 0.f, 1.f, 1.f),
|
||||||
m_size(0.f),
|
|
||||||
m_target(nullptr),
|
m_target(nullptr),
|
||||||
|
m_size(0.f),
|
||||||
m_frustumUpdated(false),
|
m_frustumUpdated(false),
|
||||||
m_projectionMatrixUpdated(false),
|
m_projectionMatrixUpdated(false),
|
||||||
m_viewMatrixUpdated(false),
|
m_viewMatrixUpdated(false),
|
||||||
|
|
@ -30,8 +30,8 @@ namespace Ndk
|
||||||
AbstractViewer(camera),
|
AbstractViewer(camera),
|
||||||
m_projectionType(camera.m_projectionType),
|
m_projectionType(camera.m_projectionType),
|
||||||
m_targetRegion(camera.m_targetRegion),
|
m_targetRegion(camera.m_targetRegion),
|
||||||
m_size(camera.m_size),
|
|
||||||
m_target(nullptr),
|
m_target(nullptr),
|
||||||
|
m_size(camera.m_size),
|
||||||
m_frustumUpdated(false),
|
m_frustumUpdated(false),
|
||||||
m_projectionMatrixUpdated(false),
|
m_projectionMatrixUpdated(false),
|
||||||
m_viewMatrixUpdated(false),
|
m_viewMatrixUpdated(false),
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ namespace Ndk
|
||||||
{
|
{
|
||||||
inline GraphicsComponent::GraphicsComponent(const GraphicsComponent& graphicsComponent) :
|
inline GraphicsComponent::GraphicsComponent(const GraphicsComponent& graphicsComponent) :
|
||||||
Component(graphicsComponent),
|
Component(graphicsComponent),
|
||||||
|
HandledObject(graphicsComponent),
|
||||||
m_boundingVolume(graphicsComponent.m_boundingVolume),
|
m_boundingVolume(graphicsComponent.m_boundingVolume),
|
||||||
m_transformMatrix(graphicsComponent.m_transformMatrix),
|
m_transformMatrix(graphicsComponent.m_transformMatrix),
|
||||||
m_boundingVolumeUpdated(graphicsComponent.m_boundingVolumeUpdated),
|
m_boundingVolumeUpdated(graphicsComponent.m_boundingVolumeUpdated),
|
||||||
|
|
@ -41,7 +42,7 @@ namespace Ndk
|
||||||
r.data.renderOrder = renderOrder;
|
r.data.renderOrder = renderOrder;
|
||||||
r.renderable = std::move(renderable);
|
r.renderable = std::move(renderable);
|
||||||
r.renderableInvalidationSlot.Connect(r.renderable->OnInstancedRenderableInvalidateData, std::bind(&GraphicsComponent::InvalidateRenderableData, this, std::placeholders::_1, std::placeholders::_2, m_renderables.size()-1));
|
r.renderableInvalidationSlot.Connect(r.renderable->OnInstancedRenderableInvalidateData, std::bind(&GraphicsComponent::InvalidateRenderableData, this, std::placeholders::_1, std::placeholders::_2, m_renderables.size()-1));
|
||||||
|
|
||||||
InvalidateBoundingVolume();
|
InvalidateBoundingVolume();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,8 +84,12 @@ namespace Nz
|
||||||
|
|
||||||
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, FontParams* params, TypeTag<FontParams>)
|
inline unsigned int LuaImplQueryArg(const LuaInstance& instance, int index, FontParams* params, TypeTag<FontParams>)
|
||||||
{
|
{
|
||||||
|
NazaraUnused(params);
|
||||||
|
|
||||||
instance.CheckType(index, Nz::LuaType_Table);
|
instance.CheckType(index, Nz::LuaType_Table);
|
||||||
|
|
||||||
|
// Structure is empty for now
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ namespace Ndk
|
||||||
{
|
{
|
||||||
case Nz::Keyboard::Down:
|
case Nz::Keyboard::Down:
|
||||||
case Nz::Keyboard::Up:
|
case Nz::Keyboard::Up:
|
||||||
|
{
|
||||||
if (event.key.code == Nz::Keyboard::Up)
|
if (event.key.code == Nz::Keyboard::Up)
|
||||||
m_historyPosition = std::min<std::size_t>(m_commandHistory.size(), m_historyPosition + 1);
|
m_historyPosition = std::min<std::size_t>(m_commandHistory.size(), m_historyPosition + 1);
|
||||||
else
|
else
|
||||||
|
|
@ -159,6 +160,10 @@ namespace Ndk
|
||||||
m_inputDrawer.SetText(s_inputPrefix + text);
|
m_inputDrawer.SetText(s_inputPrefix + text);
|
||||||
m_inputTextSprite->Update(m_inputDrawer);
|
m_inputTextSprite->Update(m_inputDrawer);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ namespace Ndk
|
||||||
|
|
||||||
// SDK
|
// SDK
|
||||||
application("Application"),
|
application("Application"),
|
||||||
nodeComponent("NodeComponent"),
|
|
||||||
entityClass("Entity"),
|
entityClass("Entity"),
|
||||||
|
nodeComponent("NodeComponent"),
|
||||||
velocityComponent("VelocityComponent"),
|
velocityComponent("VelocityComponent"),
|
||||||
worldClass("World")
|
worldClass("World")
|
||||||
|
|
||||||
|
|
@ -39,9 +39,9 @@ namespace Ndk
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
musicClass("Music"),
|
musicClass("Music"),
|
||||||
|
soundClass("Sound"),
|
||||||
soundBuffer("SoundBuffer"),
|
soundBuffer("SoundBuffer"),
|
||||||
soundEmitter("SoundEmitter"),
|
soundEmitter("SoundEmitter"),
|
||||||
soundClass("Sound"),
|
|
||||||
|
|
||||||
// Graphics
|
// Graphics
|
||||||
instancedRenderable("InstancedRenderable"),
|
instancedRenderable("InstancedRenderable"),
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,8 @@ namespace Ndk
|
||||||
/*********************************** Nz::SoundBuffer **********************************/
|
/*********************************** Nz::SoundBuffer **********************************/
|
||||||
soundBuffer.SetConstructor([] (Nz::LuaInstance& lua, Nz::SoundBufferRef* instance)
|
soundBuffer.SetConstructor([] (Nz::LuaInstance& lua, Nz::SoundBufferRef* instance)
|
||||||
{
|
{
|
||||||
|
NazaraUnused(lua);
|
||||||
|
|
||||||
Nz::PlacementNew(instance, Nz::SoundBuffer::New());
|
Nz::PlacementNew(instance, Nz::SoundBuffer::New());
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
@ -115,16 +117,16 @@ namespace Ndk
|
||||||
return 1;
|
return 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
soundBuffer.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::SoundBufferRef& soundBuffer) -> int
|
soundBuffer.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::SoundBufferRef& instance) -> int
|
||||||
{
|
{
|
||||||
Nz::StringStream stream("SoundBuffer(");
|
Nz::StringStream stream("SoundBuffer(");
|
||||||
if (soundBuffer->IsValid())
|
if (instance->IsValid())
|
||||||
{
|
{
|
||||||
Nz::String filePath = soundBuffer->GetFilePath();
|
Nz::String filePath = instance->GetFilePath();
|
||||||
if (!filePath.IsEmpty())
|
if (!filePath.IsEmpty())
|
||||||
stream << "File: " << filePath << ", ";
|
stream << "File: " << filePath << ", ";
|
||||||
|
|
||||||
stream << "Duration: " << soundBuffer->GetDuration() / 1000.f << "s";
|
stream << "Duration: " << instance->GetDuration() / 1000.f << "s";
|
||||||
}
|
}
|
||||||
stream << ')';
|
stream << ')';
|
||||||
|
|
||||||
|
|
@ -148,17 +150,17 @@ namespace Ndk
|
||||||
|
|
||||||
soundEmitter.BindMethod("IsLooping", &Nz::SoundEmitter::IsLooping);
|
soundEmitter.BindMethod("IsLooping", &Nz::SoundEmitter::IsLooping);
|
||||||
soundEmitter.BindMethod("IsSpatialized", &Nz::SoundEmitter::IsSpatialized);
|
soundEmitter.BindMethod("IsSpatialized", &Nz::SoundEmitter::IsSpatialized);
|
||||||
|
|
||||||
soundEmitter.BindMethod("Pause", &Nz::SoundEmitter::Pause);
|
soundEmitter.BindMethod("Pause", &Nz::SoundEmitter::Pause);
|
||||||
soundEmitter.BindMethod("Play", &Nz::SoundEmitter::Play);
|
soundEmitter.BindMethod("Play", &Nz::SoundEmitter::Play);
|
||||||
|
|
||||||
soundEmitter.BindMethod("SetAttenuation", &Nz::SoundEmitter::SetAttenuation);
|
soundEmitter.BindMethod("SetAttenuation", &Nz::SoundEmitter::SetAttenuation);
|
||||||
soundEmitter.BindMethod("SetMinDistance", &Nz::SoundEmitter::SetMinDistance);
|
soundEmitter.BindMethod("SetMinDistance", &Nz::SoundEmitter::SetMinDistance);
|
||||||
soundEmitter.BindMethod("SetPitch", &Nz::SoundEmitter::SetPitch);
|
soundEmitter.BindMethod("SetPitch", &Nz::SoundEmitter::SetPitch);
|
||||||
soundEmitter.BindMethod("SetPosition", (void(Nz::SoundEmitter::*)(const Nz::Vector3f&)) &Nz::SoundEmitter::SetPosition);
|
soundEmitter.BindMethod("SetPosition", (void(Nz::SoundEmitter::*)(const Nz::Vector3f&)) &Nz::SoundEmitter::SetPosition);
|
||||||
soundEmitter.BindMethod("SetVelocity", (void(Nz::SoundEmitter::*)(const Nz::Vector3f&)) &Nz::SoundEmitter::SetVelocity);
|
soundEmitter.BindMethod("SetVelocity", (void(Nz::SoundEmitter::*)(const Nz::Vector3f&)) &Nz::SoundEmitter::SetVelocity);
|
||||||
soundEmitter.BindMethod("SetVolume", &Nz::SoundEmitter::SetVolume);
|
soundEmitter.BindMethod("SetVolume", &Nz::SoundEmitter::SetVolume);
|
||||||
|
|
||||||
soundEmitter.BindMethod("Stop", &Nz::SoundEmitter::Stop);
|
soundEmitter.BindMethod("Stop", &Nz::SoundEmitter::Stop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -238,9 +238,15 @@ namespace Ndk
|
||||||
case 'h':
|
case 'h':
|
||||||
lua.Push(instance.height);
|
lua.Push(instance.height);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -290,6 +296,9 @@ namespace Ndk
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -313,7 +322,7 @@ namespace Ndk
|
||||||
Nz::PlacementNew(quaternion, *static_cast<Nz::Quaterniond*>(lua.ToUserdata(1)));
|
Nz::PlacementNew(quaternion, *static_cast<Nz::Quaterniond*>(lua.ToUserdata(1)));
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -389,6 +398,9 @@ namespace Ndk
|
||||||
case 'z':
|
case 'z':
|
||||||
instance.z = value;
|
instance.z = value;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -455,9 +467,15 @@ namespace Ndk
|
||||||
case 'y':
|
case 'y':
|
||||||
lua.Push(instance.y);
|
lua.Push(instance.y);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -496,9 +514,15 @@ namespace Ndk
|
||||||
case 'y':
|
case 'y':
|
||||||
instance.y = value;
|
instance.y = value;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -582,9 +606,15 @@ namespace Ndk
|
||||||
case 'z':
|
case 'z':
|
||||||
lua.Push(instance.z);
|
lua.Push(instance.z);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -627,9 +657,15 @@ namespace Ndk
|
||||||
case 'z':
|
case 'z':
|
||||||
instance.z = value;
|
instance.z = value;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,12 @@ namespace Ndk
|
||||||
// Uninitialize the SDK
|
// Uninitialize the SDK
|
||||||
s_referenceCounter = 0;
|
s_referenceCounter = 0;
|
||||||
|
|
||||||
|
// Components
|
||||||
|
BaseComponent::Uninitialize();
|
||||||
|
|
||||||
|
// Systems
|
||||||
|
BaseSystem::Uninitialize();
|
||||||
|
|
||||||
// Uninitialize the engine
|
// Uninitialize the engine
|
||||||
|
|
||||||
#ifndef NDK_SERVER
|
#ifndef NDK_SERVER
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,19 @@ function NazaraBuild:Execute()
|
||||||
return -- Alors l'utilisateur voulait probablement savoir comment utiliser le programme, on ne fait rien
|
return -- Alors l'utilisateur voulait probablement savoir comment utiliser le programme, on ne fait rien
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local platformData
|
||||||
|
if (os.is64bit()) then
|
||||||
|
platformData = {"x64", "x86"}
|
||||||
|
else
|
||||||
|
platformData = {"x86", "x64"}
|
||||||
|
end
|
||||||
|
|
||||||
if (self.Actions[_ACTION] == nil) then
|
if (self.Actions[_ACTION] == nil) then
|
||||||
local makeLibDir = os.is("windows") and "mingw" or "gmake"
|
local makeLibDir = os.is("windows") and "mingw" or "gmake"
|
||||||
|
|
||||||
if (#self.OrderedExtLibs > 0) then
|
if (#self.OrderedExtLibs > 0) then
|
||||||
workspace("NazaraExtlibs")
|
workspace("NazaraExtlibs")
|
||||||
platforms({"x32", "x64"})
|
platforms(platformData)
|
||||||
|
|
||||||
-- Configuration générale
|
-- Configuration générale
|
||||||
configurations({
|
configurations({
|
||||||
|
|
@ -23,13 +30,13 @@ function NazaraBuild:Execute()
|
||||||
location(_ACTION)
|
location(_ACTION)
|
||||||
kind("StaticLib")
|
kind("StaticLib")
|
||||||
|
|
||||||
configuration("x32")
|
configuration("x86")
|
||||||
libdirs("../extlibs/lib/common/x86")
|
libdirs("../extlibs/lib/common/x86")
|
||||||
|
|
||||||
configuration("x64")
|
configuration("x64")
|
||||||
libdirs("../extlibs/lib/common/x64")
|
libdirs("../extlibs/lib/common/x64")
|
||||||
|
|
||||||
configuration({"codeblocks or codelite or gmake", "x32"})
|
configuration({"codeblocks or codelite or gmake", "x86"})
|
||||||
libdirs("../extlibs/lib/" .. makeLibDir .. "/x86")
|
libdirs("../extlibs/lib/" .. makeLibDir .. "/x86")
|
||||||
targetdir("../extlibs/lib/" .. makeLibDir .. "/x86")
|
targetdir("../extlibs/lib/" .. makeLibDir .. "/x86")
|
||||||
|
|
||||||
|
|
@ -40,7 +47,7 @@ function NazaraBuild:Execute()
|
||||||
configuration("vs*")
|
configuration("vs*")
|
||||||
buildoptions("/MP")
|
buildoptions("/MP")
|
||||||
|
|
||||||
configuration({"vs*", "x32"})
|
configuration({"vs*", "x86"})
|
||||||
libdirs("../extlibs/lib/msvc/x86")
|
libdirs("../extlibs/lib/msvc/x86")
|
||||||
targetdir("../extlibs/lib/msvc/x86")
|
targetdir("../extlibs/lib/msvc/x86")
|
||||||
|
|
||||||
|
|
@ -48,7 +55,7 @@ function NazaraBuild:Execute()
|
||||||
libdirs("../extlibs/lib/msvc/x64")
|
libdirs("../extlibs/lib/msvc/x64")
|
||||||
targetdir("../extlibs/lib/msvc/x64")
|
targetdir("../extlibs/lib/msvc/x64")
|
||||||
|
|
||||||
configuration({"xcode3 or xcode4", "x32"})
|
configuration({"xcode3 or xcode4", "x86"})
|
||||||
libdirs("../extlibs/lib/xcode/x86")
|
libdirs("../extlibs/lib/xcode/x86")
|
||||||
targetdir("../extlibs/lib/xcode/x86")
|
targetdir("../extlibs/lib/xcode/x86")
|
||||||
|
|
||||||
|
|
@ -102,7 +109,7 @@ function NazaraBuild:Execute()
|
||||||
end
|
end
|
||||||
|
|
||||||
workspace("NazaraEngine")
|
workspace("NazaraEngine")
|
||||||
platforms({"x32", "x64"})
|
platforms(platformData)
|
||||||
|
|
||||||
-- Configuration générale
|
-- Configuration générale
|
||||||
configurations({
|
configurations({
|
||||||
|
|
@ -171,14 +178,14 @@ function NazaraBuild:Execute()
|
||||||
libdirs("../lib")
|
libdirs("../lib")
|
||||||
libdirs("../extlibs/lib/common")
|
libdirs("../extlibs/lib/common")
|
||||||
|
|
||||||
configuration("x32")
|
configuration("x86")
|
||||||
libdirs("../extlibs/lib/common/x86")
|
libdirs("../extlibs/lib/common/x86")
|
||||||
|
|
||||||
configuration("x64")
|
configuration("x64")
|
||||||
defines("NAZARA_PLATFORM_x64")
|
defines("NAZARA_PLATFORM_x64")
|
||||||
libdirs("../extlibs/lib/common/x64")
|
libdirs("../extlibs/lib/common/x64")
|
||||||
|
|
||||||
configuration({"codeblocks or codelite or gmake", "x32"})
|
configuration({"codeblocks or codelite or gmake", "x86"})
|
||||||
libdirs("../extlibs/lib/" .. makeLibDir .. "/x86")
|
libdirs("../extlibs/lib/" .. makeLibDir .. "/x86")
|
||||||
libdirs("../lib/" .. makeLibDir .. "/x86")
|
libdirs("../lib/" .. makeLibDir .. "/x86")
|
||||||
targetdir("../lib/" .. makeLibDir .. "/x86")
|
targetdir("../lib/" .. makeLibDir .. "/x86")
|
||||||
|
|
@ -193,7 +200,7 @@ function NazaraBuild:Execute()
|
||||||
self:MakeCopyAfterBuild(moduleTable)
|
self:MakeCopyAfterBuild(moduleTable)
|
||||||
end
|
end
|
||||||
|
|
||||||
configuration({"vs*", "x32"})
|
configuration({"vs*", "x86"})
|
||||||
libdirs("../extlibs/lib/msvc/x86")
|
libdirs("../extlibs/lib/msvc/x86")
|
||||||
libdirs("../lib/msvc/x86")
|
libdirs("../lib/msvc/x86")
|
||||||
targetdir("../lib/msvc/x86")
|
targetdir("../lib/msvc/x86")
|
||||||
|
|
@ -203,7 +210,7 @@ function NazaraBuild:Execute()
|
||||||
libdirs("../lib/msvc/x64")
|
libdirs("../lib/msvc/x64")
|
||||||
targetdir("../lib/msvc/x64")
|
targetdir("../lib/msvc/x64")
|
||||||
|
|
||||||
configuration({"xcode3 or xcode4", "x32"})
|
configuration({"xcode3 or xcode4", "x86"})
|
||||||
libdirs("../extlibs/lib/xcode/x86")
|
libdirs("../extlibs/lib/xcode/x86")
|
||||||
libdirs("../lib/xcode/x86")
|
libdirs("../lib/xcode/x86")
|
||||||
targetdir("../lib/xcode/x86")
|
targetdir("../lib/xcode/x86")
|
||||||
|
|
@ -278,20 +285,20 @@ function NazaraBuild:Execute()
|
||||||
libdirs("../lib")
|
libdirs("../lib")
|
||||||
libdirs("../extlibs/lib/common")
|
libdirs("../extlibs/lib/common")
|
||||||
|
|
||||||
configuration("x32")
|
configuration("x86")
|
||||||
libdirs("../extlibs/lib/common/x86")
|
libdirs("../extlibs/lib/common/x86")
|
||||||
|
|
||||||
configuration("x64")
|
configuration("x64")
|
||||||
defines("NAZARA_PLATFORM_x64")
|
defines("NAZARA_PLATFORM_x64")
|
||||||
libdirs("../extlibs/lib/common/x64")
|
libdirs("../extlibs/lib/common/x64")
|
||||||
|
|
||||||
configuration({"codeblocks or codelite or gmake", "x32"})
|
configuration({"codeblocks or codelite or gmake", "x86"})
|
||||||
libdirs("../extlibs/lib/" .. makeLibDir .. "/x86")
|
libdirs("../extlibs/lib/" .. makeLibDir .. "/x86")
|
||||||
libdirs("../lib/" .. makeLibDir .. "/x86")
|
libdirs("../lib/" .. makeLibDir .. "/x86")
|
||||||
if (toolTable.Kind == "library") then
|
if (toolTable.Kind == "library") then
|
||||||
targetdir("../lib/" .. makeLibDir .. "/x86")
|
targetdir("../lib/" .. makeLibDir .. "/x86")
|
||||||
elseif (toolTable.Kind == "plugin") then
|
elseif (toolTable.Kind == "plugin") then
|
||||||
targetdir("../plugins/" .. toolTable.Name .. "/lib/" .. makeLibDir .. "/x32")
|
targetdir("../plugins/" .. toolTable.Name .. "/lib/" .. makeLibDir .. "/x86")
|
||||||
end
|
end
|
||||||
|
|
||||||
configuration({"codeblocks or codelite or gmake", "x64"})
|
configuration({"codeblocks or codelite or gmake", "x64"})
|
||||||
|
|
@ -308,7 +315,7 @@ function NazaraBuild:Execute()
|
||||||
self:MakeCopyAfterBuild(toolTable)
|
self:MakeCopyAfterBuild(toolTable)
|
||||||
end
|
end
|
||||||
|
|
||||||
configuration({"vs*", "x32"})
|
configuration({"vs*", "x86"})
|
||||||
libdirs("../extlibs/lib/msvc/x86")
|
libdirs("../extlibs/lib/msvc/x86")
|
||||||
libdirs("../lib/msvc/x86")
|
libdirs("../lib/msvc/x86")
|
||||||
if (toolTable.Kind == "library") then
|
if (toolTable.Kind == "library") then
|
||||||
|
|
@ -326,7 +333,7 @@ function NazaraBuild:Execute()
|
||||||
targetdir("../plugins/" .. toolTable.Name .. "/lib/msvc/x64")
|
targetdir("../plugins/" .. toolTable.Name .. "/lib/msvc/x64")
|
||||||
end
|
end
|
||||||
|
|
||||||
configuration({"xcode3 or xcode4", "x32"})
|
configuration({"xcode3 or xcode4", "x86"})
|
||||||
libdirs("../extlibs/lib/xcode/x86")
|
libdirs("../extlibs/lib/xcode/x86")
|
||||||
libdirs("../lib/xcode/x86")
|
libdirs("../lib/xcode/x86")
|
||||||
if (toolTable.Kind == "library") then
|
if (toolTable.Kind == "library") then
|
||||||
|
|
@ -406,26 +413,26 @@ function NazaraBuild:Execute()
|
||||||
includedirs(exampleTable.Includes)
|
includedirs(exampleTable.Includes)
|
||||||
links(exampleTable.Libraries)
|
links(exampleTable.Libraries)
|
||||||
|
|
||||||
configuration("x32")
|
configuration("x86")
|
||||||
libdirs("../extlibs/lib/common/x86")
|
libdirs("../extlibs/lib/common/x86")
|
||||||
|
|
||||||
configuration("x64")
|
configuration("x64")
|
||||||
defines("NAZARA_PLATFORM_x64")
|
defines("NAZARA_PLATFORM_x64")
|
||||||
libdirs("../extlibs/lib/common/x64")
|
libdirs("../extlibs/lib/common/x64")
|
||||||
|
|
||||||
configuration({"codeblocks or codelite or gmake", "x32"})
|
configuration({"codeblocks or codelite or gmake", "x86"})
|
||||||
libdirs("../lib/" .. makeLibDir .. "/x86")
|
libdirs("../lib/" .. makeLibDir .. "/x86")
|
||||||
|
|
||||||
configuration({"codeblocks or codelite or gmake", "x64"})
|
configuration({"codeblocks or codelite or gmake", "x64"})
|
||||||
libdirs("../lib/" .. makeLibDir .. "/x64")
|
libdirs("../lib/" .. makeLibDir .. "/x64")
|
||||||
|
|
||||||
configuration({"vs*", "x32"})
|
configuration({"vs*", "x86"})
|
||||||
libdirs("../lib/msvc/x86")
|
libdirs("../lib/msvc/x86")
|
||||||
|
|
||||||
configuration({"vs*", "x64"})
|
configuration({"vs*", "x64"})
|
||||||
libdirs("../lib/msvc/x64")
|
libdirs("../lib/msvc/x64")
|
||||||
|
|
||||||
configuration({"xcode3 or xcode4", "x32"})
|
configuration({"xcode3 or xcode4", "x86"})
|
||||||
libdirs("../lib/xcode/x86")
|
libdirs("../lib/xcode/x86")
|
||||||
|
|
||||||
configuration({"xcode3 or xcode4", "x64"})
|
configuration({"xcode3 or xcode4", "x64"})
|
||||||
|
|
@ -801,6 +808,17 @@ function NazaraBuild:Process(infoTable)
|
||||||
for k,v in ipairs(toolTable.Includes) do
|
for k,v in ipairs(toolTable.Includes) do
|
||||||
table.insert(infoTable.Includes, v)
|
table.insert(infoTable.Includes, v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- And libraries
|
||||||
|
for k, v in pairs(toolTable.Libraries) do
|
||||||
|
table.insert(infoTable.Libraries, v)
|
||||||
|
end
|
||||||
|
|
||||||
|
for config, libs in pairs(toolTable.ConfigurationLibraries) do
|
||||||
|
for k,v in pairs(libs) do
|
||||||
|
table.insert(infoTable.ConfigurationLibraries[config], v)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
table.insert(infoTable.ConfigurationLibraries.DebugStatic, library .. "-s-d")
|
table.insert(infoTable.ConfigurationLibraries.DebugStatic, library .. "-s-d")
|
||||||
table.insert(infoTable.ConfigurationLibraries.ReleaseStatic, library .. "-s")
|
table.insert(infoTable.ConfigurationLibraries.ReleaseStatic, library .. "-s")
|
||||||
|
|
@ -853,8 +871,8 @@ function NazaraBuild:MakeCopyAfterBuild(infoTable)
|
||||||
|
|
||||||
for k,v in pairs(table.join(infoTable.Libraries, infoTable.DynLib)) do
|
for k,v in pairs(table.join(infoTable.Libraries, infoTable.DynLib)) do
|
||||||
local paths = {}
|
local paths = {}
|
||||||
table.insert(paths, {"x32", "../extlibs/lib/common/x86/" .. v .. ".dll"})
|
table.insert(paths, {"x86", "../extlibs/lib/common/x86/" .. v .. ".dll"})
|
||||||
table.insert(paths, {"x32", "../extlibs/lib/common/x86/lib" .. v .. ".dll"})
|
table.insert(paths, {"x86", "../extlibs/lib/common/x86/lib" .. v .. ".dll"})
|
||||||
table.insert(paths, {"x64", "../extlibs/lib/common/x64/" .. v .. ".dll"})
|
table.insert(paths, {"x64", "../extlibs/lib/common/x64/" .. v .. ".dll"})
|
||||||
table.insert(paths, {"x64", "../extlibs/lib/common/x64/lib" .. v .. ".dll"})
|
table.insert(paths, {"x64", "../extlibs/lib/common/x64/lib" .. v .. ".dll"})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,19 +5,26 @@ MODULE.Defines = {
|
||||||
}
|
}
|
||||||
|
|
||||||
MODULE.Libraries = {
|
MODULE.Libraries = {
|
||||||
"NazaraCore",
|
"NazaraCore"
|
||||||
|
}
|
||||||
|
|
||||||
|
MODULE.OsLibraries.Windows = {
|
||||||
"sndfile-1"
|
"sndfile-1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MODULE.OsLibraries.Posix = {
|
||||||
|
"sndfile"
|
||||||
|
}
|
||||||
|
|
||||||
|
MODULE.OsDynLib.Windows = {
|
||||||
|
"soft_oal"
|
||||||
|
}
|
||||||
|
|
||||||
MODULE.OsFiles.Windows = {
|
MODULE.OsFiles.Windows = {
|
||||||
"../src/Nazara/Audio/Win32/**.hpp",
|
"../src/Nazara/Audio/Win32/**.hpp",
|
||||||
"../src/Nazara/Audio/Win32/**.cpp"
|
"../src/Nazara/Audio/Win32/**.cpp"
|
||||||
}
|
}
|
||||||
|
|
||||||
MODULE.OsDynLib.Windows = {
|
|
||||||
"soft_oal"
|
|
||||||
}
|
|
||||||
|
|
||||||
MODULE.OsFiles.Posix = {
|
MODULE.OsFiles.Posix = {
|
||||||
"../src/Nazara/Audio/Posix/**.hpp",
|
"../src/Nazara/Audio/Posix/**.hpp",
|
||||||
"../src/Nazara/Audio/Posix/**.cpp"
|
"../src/Nazara/Audio/Posix/**.cpp"
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@ MODULE.Name = "Physics"
|
||||||
|
|
||||||
MODULE.Libraries = {
|
MODULE.Libraries = {
|
||||||
"NazaraCore",
|
"NazaraCore",
|
||||||
"newton"
|
"Newton"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
MODULE.Name = "Utility"
|
MODULE.Name = "Utility"
|
||||||
|
|
||||||
MODULE.Libraries = {
|
MODULE.Libraries = {
|
||||||
"freetype-s",
|
|
||||||
"NazaraCore",
|
"NazaraCore",
|
||||||
"stb_image"
|
"stb_image"
|
||||||
}
|
}
|
||||||
|
|
@ -17,10 +16,12 @@ MODULE.OsFiles.Posix = {
|
||||||
}
|
}
|
||||||
|
|
||||||
MODULE.OsLibraries.Windows = {
|
MODULE.OsLibraries.Windows = {
|
||||||
|
"freetype-s",
|
||||||
"gdi32"
|
"gdi32"
|
||||||
}
|
}
|
||||||
|
|
||||||
MODULE.OsLibraries.Posix = {
|
MODULE.OsLibraries.Posix = {
|
||||||
|
"freetype",
|
||||||
"X11",
|
"X11",
|
||||||
"xcb",
|
"xcb",
|
||||||
"xcb-cursor",
|
"xcb-cursor",
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,5 @@ EXAMPLE.Files = {
|
||||||
}
|
}
|
||||||
|
|
||||||
EXAMPLE.Libraries = {
|
EXAMPLE.Libraries = {
|
||||||
"NazaraCore",
|
|
||||||
"NazaraGraphics",
|
|
||||||
"NazaraRenderer",
|
|
||||||
"NazaraUtility",
|
|
||||||
"NazaraSDK"
|
"NazaraSDK"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
EXAMPLE.Name = "Tut00_EmptyProject"
|
||||||
|
|
||||||
|
EXAMPLE.Console = true
|
||||||
|
|
||||||
|
EXAMPLE.Files = {
|
||||||
|
"main.cpp"
|
||||||
|
}
|
||||||
|
|
||||||
|
EXAMPLE.Libraries = {
|
||||||
|
"NazaraAudio",
|
||||||
|
"NazaraCore",
|
||||||
|
"NazaraGraphics",
|
||||||
|
"NazaraLua",
|
||||||
|
"NazaraNetwork",
|
||||||
|
"NazaraNoise",
|
||||||
|
"NazaraPhysics",
|
||||||
|
"NazaraRenderer",
|
||||||
|
"NazaraUtility",
|
||||||
|
"NazaraSDK"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
#include <Nazara/Audio.hpp>
|
||||||
|
#include <Nazara/Core.hpp>
|
||||||
|
#include <Nazara/Graphics.hpp>
|
||||||
|
#include <Nazara/Lua.hpp>
|
||||||
|
#include <Nazara/Network.hpp>
|
||||||
|
#include <Nazara/Noise.hpp>
|
||||||
|
#include <Nazara/Physics.hpp>
|
||||||
|
#include <Nazara/Renderer.hpp>
|
||||||
|
#include <Nazara/Utility.hpp>
|
||||||
|
#include <NDK/Application.hpp>
|
||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
// This "example" has only one purpose: Giving an empty project for you to test whatever you want
|
||||||
|
// If you wish to have multiple test projects, you only have to copy/paste this directory and change the name in the build.lua
|
||||||
|
Ndk::Application app;
|
||||||
|
|
||||||
|
// Do what you want here
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
@ -7,9 +7,5 @@ EXAMPLE.Files = {
|
||||||
}
|
}
|
||||||
|
|
||||||
EXAMPLE.Libraries = {
|
EXAMPLE.Libraries = {
|
||||||
"NazaraCore",
|
|
||||||
"NazaraGraphics",
|
|
||||||
"NazaraRenderer",
|
|
||||||
"NazaraUtility",
|
|
||||||
"NazaraSDK"
|
"NazaraSDK"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ namespace Nz
|
||||||
* \param v Object to hash
|
* \param v Object to hash
|
||||||
*
|
*
|
||||||
* \remark a HashAppend specialization for type T is required
|
* \remark a HashAppend specialization for type T is required
|
||||||
*
|
*
|
||||||
* \see ComputeHash
|
* \see ComputeHash
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
@ -178,7 +178,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
T reversed = 0;
|
T reversed = 0;
|
||||||
for (std::size_t i = 0; i < sizeof(T); ++i)
|
for (std::size_t i = 0; i < sizeof(T); ++i)
|
||||||
reversed |= T(Detail::BitReverseTable256[(integer >> i * 8) & 0xFF]) << sizeof(T) * 8 - (i + 1) * 8;
|
reversed |= T(Detail::BitReverseTable256[(integer >> i * 8) & 0xFF]) << (sizeof(T) * 8 - (i + 1) * 8);
|
||||||
|
|
||||||
return reversed;
|
return reversed;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ namespace Nz
|
||||||
template<typename T>
|
template<typename T>
|
||||||
HandledObject<T>::HandledObject(const HandledObject& object)
|
HandledObject<T>::HandledObject(const HandledObject& object)
|
||||||
{
|
{
|
||||||
|
NazaraUnused(object);
|
||||||
// Don't copy anything, we're a copy of the object, we have no handle right now
|
// Don't copy anything, we're a copy of the object, we have no handle right now
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -40,7 +41,7 @@ namespace Nz
|
||||||
HandledObject<T>& HandledObject<T>::operator=(const HandledObject& object)
|
HandledObject<T>& HandledObject<T>::operator=(const HandledObject& object)
|
||||||
{
|
{
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,6 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include <Nazara/Graphics/dEPTHRenderTechnique.inl>
|
#include <Nazara/Graphics/DepthRenderTechnique.inl>
|
||||||
|
|
||||||
#endif // NAZARA_DEPTHRENDERTECHNIQUE_HPP
|
#endif // NAZARA_DEPTHRENDERTECHNIQUE_HPP
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ namespace Nz
|
||||||
{
|
{
|
||||||
inline Light::Light(const Light& light) :
|
inline Light::Light(const Light& light) :
|
||||||
Renderable(light),
|
Renderable(light),
|
||||||
|
m_color(light.m_color),
|
||||||
m_type(light.m_type),
|
m_type(light.m_type),
|
||||||
m_shadowMapFormat(light.m_shadowMapFormat),
|
m_shadowMapFormat(light.m_shadowMapFormat),
|
||||||
m_color(light.m_color),
|
|
||||||
m_shadowMapSize(light.m_shadowMapSize),
|
m_shadowMapSize(light.m_shadowMapSize),
|
||||||
m_shadowCastingEnabled(light.m_shadowCastingEnabled),
|
m_shadowCastingEnabled(light.m_shadowCastingEnabled),
|
||||||
m_shadowMapUpdated(false),
|
m_shadowMapUpdated(false),
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@ namespace Nz
|
||||||
{
|
{
|
||||||
SetConstructor([] (Nz::LuaInstance& lua, T* instance)
|
SetConstructor([] (Nz::LuaInstance& lua, T* instance)
|
||||||
{
|
{
|
||||||
|
NazaraUnused(lua);
|
||||||
|
|
||||||
PlacementNew(instance);
|
PlacementNew(instance);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
@ -132,9 +134,9 @@ namespace Nz
|
||||||
lua.SetField(pair.first); // Method name
|
lua.SetField(pair.first); // Method name
|
||||||
}
|
}
|
||||||
|
|
||||||
m_info->instanceGetters[m_info->name] = [info = m_info] (LuaInstance& lua)
|
m_info->instanceGetters[m_info->name] = [info = m_info] (LuaInstance& instance)
|
||||||
{
|
{
|
||||||
return static_cast<T*>(lua.CheckUserdata(1, info->name));
|
return static_cast<T*>(instance.CheckUserdata(1, info->name));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
lua.Pop(); // On pop la metatable
|
lua.Pop(); // On pop la metatable
|
||||||
|
|
@ -391,11 +393,11 @@ namespace Nz
|
||||||
|
|
||||||
if (!lua.IsValid(-1))
|
if (!lua.IsValid(-1))
|
||||||
{
|
{
|
||||||
for (const ParentFunc& getter : info->parentGetters)
|
for (const ParentFunc& parentGetter : info->parentGetters)
|
||||||
{
|
{
|
||||||
lua.Pop(); //< Pop the last nil value
|
lua.Pop(); //< Pop the last nil value
|
||||||
|
|
||||||
getter(lua, instance);
|
parentGetter(lua, instance);
|
||||||
if (lua.IsValid(-1))
|
if (lua.IsValid(-1))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ namespace std
|
||||||
|
|
||||||
// This is SDBM adapted for IP addresses, tested to generate the least collisions possible
|
// This is SDBM adapted for IP addresses, tested to generate the least collisions possible
|
||||||
// (It doesn't mean it cannot be improved though)
|
// (It doesn't mean it cannot be improved though)
|
||||||
std::size_t hash = 0;
|
std::size_t h = 0;
|
||||||
switch (ip.GetProtocol())
|
switch (ip.GetProtocol())
|
||||||
{
|
{
|
||||||
case Nz::NetProtocol_Any:
|
case Nz::NetProtocol_Any:
|
||||||
|
|
@ -233,20 +233,20 @@ namespace std
|
||||||
|
|
||||||
case Nz::NetProtocol_IPv4:
|
case Nz::NetProtocol_IPv4:
|
||||||
{
|
{
|
||||||
hash = ip.ToUInt32() + (hash << 6) + (hash << 16) - hash;
|
h = ip.ToUInt32() + (h << 6) + (h << 16) - h;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Nz::NetProtocol_IPv6:
|
case Nz::NetProtocol_IPv6:
|
||||||
{
|
{
|
||||||
Nz::IpAddress::IPv6 v6 = ip.ToIPv6();
|
Nz::IpAddress::IPv6 v6 = ip.ToIPv6();
|
||||||
for (std::size_t i = 0; i < v6.size(); i++)
|
for (std::size_t i = 0; i < v6.size(); i++)
|
||||||
hash = v6[i] + (hash << 6) + (hash << 16) - hash;
|
h = v6[i] + (h << 6) + (h << 16) - h;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ip.GetPort() + (hash << 6) + (hash << 16) - hash;
|
return ip.GetPort() + (h << 6) + (h << 16) - h;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,8 @@ namespace Nz
|
||||||
PendingPacket m_pendingPacket;
|
PendingPacket m_pendingPacket;
|
||||||
UInt64 m_keepAliveInterval;
|
UInt64 m_keepAliveInterval;
|
||||||
UInt64 m_keepAliveTime;
|
UInt64 m_keepAliveTime;
|
||||||
bool m_isLowDelayEnabled;
|
|
||||||
bool m_isKeepAliveEnabled;
|
bool m_isKeepAliveEnabled;
|
||||||
|
bool m_isLowDelayEnabled;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
#include <Nazara/Physics/Enums.hpp>
|
#include <Nazara/Physics/Enums.hpp>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
struct NewtonCollision;
|
class NewtonCollision;
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
#include <Nazara/Physics/Config.hpp>
|
#include <Nazara/Physics/Config.hpp>
|
||||||
#include <Nazara/Physics/Geom.hpp>
|
#include <Nazara/Physics/Geom.hpp>
|
||||||
|
|
||||||
struct NewtonBody;
|
class NewtonBody;
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
#include <Nazara/Math/Vector3.hpp>
|
#include <Nazara/Math/Vector3.hpp>
|
||||||
#include <Nazara/Physics/Config.hpp>
|
#include <Nazara/Physics/Config.hpp>
|
||||||
|
|
||||||
struct NewtonWorld;
|
class NewtonWorld;
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,29 +12,29 @@
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
inline PixelFormatInfo::PixelFormatInfo() :
|
inline PixelFormatInfo::PixelFormatInfo() :
|
||||||
bitsPerPixel(0),
|
content(PixelFormatContent_Undefined),
|
||||||
content(PixelFormatContent_Undefined)
|
bitsPerPixel(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PixelFormatInfo::PixelFormatInfo(PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType) :
|
inline PixelFormatInfo::PixelFormatInfo(PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType) :
|
||||||
bitsPerPixel(bpp),
|
|
||||||
content(formatContent),
|
|
||||||
redType(subType),
|
|
||||||
greenType(subType),
|
|
||||||
blueType(subType),
|
|
||||||
alphaType(subType)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
inline PixelFormatInfo::PixelFormatInfo(const String& formatName, PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType) :
|
|
||||||
bitsPerPixel(bpp),
|
|
||||||
content(formatContent),
|
content(formatContent),
|
||||||
redType(subType),
|
redType(subType),
|
||||||
greenType(subType),
|
greenType(subType),
|
||||||
blueType(subType),
|
blueType(subType),
|
||||||
alphaType(subType),
|
alphaType(subType),
|
||||||
name(formatName)
|
bitsPerPixel(bpp)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
inline PixelFormatInfo::PixelFormatInfo(const String& formatName, PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType) :
|
||||||
|
content(formatContent),
|
||||||
|
redType(subType),
|
||||||
|
greenType(subType),
|
||||||
|
blueType(subType),
|
||||||
|
alphaType(subType),
|
||||||
|
name(formatName),
|
||||||
|
bitsPerPixel(bpp)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -206,8 +206,8 @@ bool Load(Mesh* mesh, Stream& stream, const MeshParams& parameters)
|
||||||
{
|
{
|
||||||
aiVector3D position = iMesh->mVertices[j];
|
aiVector3D position = iMesh->mVertices[j];
|
||||||
aiVector3D normal = iMesh->mNormals[j];
|
aiVector3D normal = iMesh->mNormals[j];
|
||||||
aiVector3D tangent = iMesh->mTangents[j];
|
aiVector3D tangent = (iMesh->HasTangentsAndBitangents()) ? iMesh->mTangents[j] : aiVector3D(0.f, 1.f, 0.f);
|
||||||
aiVector3D uv = iMesh->mTextureCoords[0][j];
|
aiVector3D uv = (iMesh->HasTextureCoords(0)) ? iMesh->mTextureCoords[0][j] : aiVector3D(0.f);
|
||||||
|
|
||||||
vertex->position = parameters.scale * Vector3f(position.x, position.y, position.z);
|
vertex->position = parameters.scale * Vector3f(position.x, position.y, position.z);
|
||||||
vertex->normal.Set(normal.x, normal.y, normal.z);
|
vertex->normal.Set(normal.x, normal.y, normal.z);
|
||||||
|
|
@ -246,8 +246,8 @@ bool Load(Mesh* mesh, Stream& stream, const MeshParams& parameters)
|
||||||
auto ConvertTexture = [&] (aiTextureType aiType, const char* textureKey, const char* wrapKey = nullptr)
|
auto ConvertTexture = [&] (aiTextureType aiType, const char* textureKey, const char* wrapKey = nullptr)
|
||||||
{
|
{
|
||||||
aiString path;
|
aiString path;
|
||||||
aiTextureMapMode mapMode;
|
aiTextureMapMode mapMode[3];
|
||||||
if (aiGetMaterialTexture(aiMat, aiType, 0, &path, nullptr, nullptr, nullptr, nullptr, &mapMode, nullptr) == aiReturn_SUCCESS)
|
if (aiGetMaterialTexture(aiMat, aiType, 0, &path, nullptr, nullptr, nullptr, nullptr, &mapMode[0], nullptr) == aiReturn_SUCCESS)
|
||||||
{
|
{
|
||||||
matData.SetParameter(MaterialData::CustomDefined);
|
matData.SetParameter(MaterialData::CustomDefined);
|
||||||
matData.SetParameter(textureKey, stream.GetDirectory() + String(path.data, path.length));
|
matData.SetParameter(textureKey, stream.GetDirectory() + String(path.data, path.length));
|
||||||
|
|
@ -255,7 +255,7 @@ bool Load(Mesh* mesh, Stream& stream, const MeshParams& parameters)
|
||||||
if (wrapKey)
|
if (wrapKey)
|
||||||
{
|
{
|
||||||
SamplerWrap wrap = SamplerWrap_Default;
|
SamplerWrap wrap = SamplerWrap_Default;
|
||||||
switch (mapMode)
|
switch (mapMode[0])
|
||||||
{
|
{
|
||||||
case aiTextureMapMode_Clamp:
|
case aiTextureMapMode_Clamp:
|
||||||
case aiTextureMapMode_Decal:
|
case aiTextureMapMode_Decal:
|
||||||
|
|
@ -271,7 +271,7 @@ bool Load(Mesh* mesh, Stream& stream, const MeshParams& parameters)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
NazaraWarning("Assimp texture map mode 0x" + String::Number(mapMode, 16) + " not handled");
|
NazaraWarning("Assimp texture map mode 0x" + String::Number(mapMode[0], 16) + " not handled");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -385,7 +385,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Sets the position of the cursor
|
* \brief Sets the position of the cursor
|
||||||
* \return true if cursor is successfully positioned
|
* \return true if cursor is successfully positioned
|
||||||
*
|
*
|
||||||
* \param pos Position of the cursor
|
* \param pos Position of the cursor
|
||||||
|
|
@ -404,7 +404,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Sets the position of the cursor
|
* \brief Sets the position of the cursor
|
||||||
* \return true if cursor is successfully positioned
|
* \return true if cursor is successfully positioned
|
||||||
*
|
*
|
||||||
* \param offset Offset according to the cursor begin position
|
* \param offset Offset according to the cursor begin position
|
||||||
|
|
@ -906,5 +906,5 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ namespace Nz
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ParameterType_Color:
|
||||||
case ParameterType_Float:
|
case ParameterType_Float:
|
||||||
case ParameterType_None:
|
case ParameterType_None:
|
||||||
case ParameterType_Pointer:
|
case ParameterType_Pointer:
|
||||||
|
|
@ -198,6 +199,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
case ParameterType_Boolean:
|
case ParameterType_Boolean:
|
||||||
|
case ParameterType_Color:
|
||||||
case ParameterType_None:
|
case ParameterType_None:
|
||||||
case ParameterType_Pointer:
|
case ParameterType_Pointer:
|
||||||
case ParameterType_Userdata:
|
case ParameterType_Userdata:
|
||||||
|
|
@ -207,7 +209,7 @@ namespace Nz
|
||||||
NazaraError("Parameter value is not representable as a float");
|
NazaraError("Parameter value is not representable as a float");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Gets a parameter as an integer
|
* \brief Gets a parameter as an integer
|
||||||
* \return true if the parameter could be represented as an integer
|
* \return true if the parameter could be represented as an integer
|
||||||
|
|
@ -263,6 +265,7 @@ namespace Nz
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ParameterType_Color:
|
||||||
case ParameterType_None:
|
case ParameterType_None:
|
||||||
case ParameterType_Pointer:
|
case ParameterType_Pointer:
|
||||||
case ParameterType_Userdata:
|
case ParameterType_Userdata:
|
||||||
|
|
@ -331,6 +334,7 @@ namespace Nz
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case ParameterType_Boolean:
|
case ParameterType_Boolean:
|
||||||
|
case ParameterType_Color:
|
||||||
case ParameterType_Float:
|
case ParameterType_Float:
|
||||||
case ParameterType_Integer:
|
case ParameterType_Integer:
|
||||||
case ParameterType_None:
|
case ParameterType_None:
|
||||||
|
|
@ -411,7 +415,7 @@ namespace Nz
|
||||||
NazaraInternalError("Parameter value is not valid");
|
NazaraInternalError("Parameter value is not valid");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Gets a parameter as an userdata
|
* \brief Gets a parameter as an userdata
|
||||||
* \return true if the parameter could be represented as a userdata
|
* \return true if the parameter could be represented as a userdata
|
||||||
|
|
@ -584,7 +588,7 @@ namespace Nz
|
||||||
parameter.type = ParameterType_Integer;
|
parameter.type = ParameterType_Integer;
|
||||||
parameter.value.intVal = value;
|
parameter.value.intVal = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Sets a pointer parameter named `name`
|
* \brief Sets a pointer parameter named `name`
|
||||||
*
|
*
|
||||||
|
|
@ -593,7 +597,7 @@ namespace Nz
|
||||||
* \param name Name of the parameter
|
* \param name Name of the parameter
|
||||||
* \param value The pointer value
|
* \param value The pointer value
|
||||||
*
|
*
|
||||||
* \remark This sets a raw pointer, this class takes no responsibility toward it,
|
* \remark This sets a raw pointer, this class takes no responsibility toward it,
|
||||||
if you wish to destroy the pointed variable along with the parameter list, you should set a userdata
|
if you wish to destroy the pointed variable along with the parameter list, you should set a userdata
|
||||||
*/
|
*/
|
||||||
void ParameterList::SetParameter(const String& name, void* value)
|
void ParameterList::SetParameter(const String& name, void* value)
|
||||||
|
|
@ -639,6 +643,7 @@ namespace Nz
|
||||||
switch (it->second.type)
|
switch (it->second.type)
|
||||||
{
|
{
|
||||||
case ParameterType_Boolean:
|
case ParameterType_Boolean:
|
||||||
|
case ParameterType_Color:
|
||||||
case ParameterType_Float:
|
case ParameterType_Float:
|
||||||
case ParameterType_Integer:
|
case ParameterType_Integer:
|
||||||
case ParameterType_Pointer:
|
case ParameterType_Pointer:
|
||||||
|
|
|
||||||
|
|
@ -524,9 +524,9 @@ namespace Nz
|
||||||
Vector3f viewerPos = viewer->GetEyePosition();
|
Vector3f viewerPos = viewer->GetEyePosition();
|
||||||
Vector3f viewerNormal = viewer->GetForward();
|
Vector3f viewerNormal = viewer->GetForward();
|
||||||
|
|
||||||
for (auto& pair : layers)
|
for (auto& layerPair : layers)
|
||||||
{
|
{
|
||||||
Layer& layer = pair.second;
|
Layer& layer = layerPair.second;
|
||||||
|
|
||||||
std::sort(layer.transparentModels.begin(), layer.transparentModels.end(), [&layer, &nearPlane, &viewerNormal] (unsigned int index1, unsigned int index2)
|
std::sort(layer.transparentModels.begin(), layer.transparentModels.end(), [&layer, &nearPlane, &viewerNormal] (unsigned int index1, unsigned int index2)
|
||||||
{
|
{
|
||||||
|
|
@ -562,7 +562,7 @@ namespace Nz
|
||||||
auto it = layers.find(i);
|
auto it = layers.find(i);
|
||||||
if (it == layers.end())
|
if (it == layers.end())
|
||||||
it = layers.insert(std::make_pair(i, Layer())).first;
|
it = layers.insert(std::make_pair(i, Layer())).first;
|
||||||
|
|
||||||
Layer& layer = it->second;
|
Layer& layer = it->second;
|
||||||
layer.clearCount = 0;
|
layer.clearCount = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ namespace Nz
|
||||||
PhysObject::~PhysObject()
|
PhysObject::~PhysObject()
|
||||||
{
|
{
|
||||||
if (m_body)
|
if (m_body)
|
||||||
NewtonDestroyBody(m_world->GetHandle(), m_body);
|
NewtonDestroyBody(m_body);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhysObject::AddForce(const Vector3f& force, CoordSys coordSys)
|
void PhysObject::AddForce(const Vector3f& force, CoordSys coordSys)
|
||||||
|
|
@ -304,11 +304,13 @@ namespace Nz
|
||||||
Vector3f min, max;
|
Vector3f min, max;
|
||||||
NewtonBodyGetAABB(m_body, min, max);
|
NewtonBodyGetAABB(m_body, min, max);
|
||||||
|
|
||||||
NewtonWorldForEachBodyInAABBDo(m_world->GetHandle(), min, max, [](const NewtonBody* const body, void* const userData)
|
NewtonWorldForEachBodyInAABBDo(m_world->GetHandle(), min, max, [](const NewtonBody* const body, void* const userData) -> int
|
||||||
{
|
{
|
||||||
NazaraUnused(userData);
|
NazaraUnused(userData);
|
||||||
NewtonBodySetSleepState(body, 0);
|
NewtonBodySetSleepState(body, 0);
|
||||||
}, nullptr);
|
return 1;
|
||||||
|
},
|
||||||
|
nullptr);
|
||||||
}
|
}
|
||||||
/*for (std::set<PhysObjectListener*>::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
|
/*for (std::set<PhysObjectListener*>::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
|
||||||
(*it)->PhysObjectOnUpdate(this);*/
|
(*it)->PhysObjectOnUpdate(this);*/
|
||||||
|
|
@ -317,7 +319,7 @@ namespace Nz
|
||||||
PhysObject& PhysObject::operator=(PhysObject&& object)
|
PhysObject& PhysObject::operator=(PhysObject&& object)
|
||||||
{
|
{
|
||||||
if (m_body)
|
if (m_body)
|
||||||
NewtonDestroyBody(m_world->GetHandle(), m_body);
|
NewtonDestroyBody(m_body);
|
||||||
|
|
||||||
m_body = object.m_body;
|
m_body = object.m_body;
|
||||||
m_forceAccumulator = std::move(object.m_forceAccumulator);
|
m_forceAccumulator = std::move(object.m_forceAccumulator);
|
||||||
|
|
|
||||||
|
|
@ -57,11 +57,14 @@ namespace Nz
|
||||||
|
|
||||||
case PixelFormatContent_Stencil:
|
case PixelFormatContent_Stencil:
|
||||||
return AttachmentPoint_Stencil;
|
return AttachmentPoint_Stencil;
|
||||||
|
|
||||||
|
case PixelFormatContent_Undefined:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
NazaraInternalError("Unexpected pixel format content: 0x" + String::Number(info.content, 16));
|
NazaraInternalError("Unexpected pixel format content: 0x" + String::Number(info.content, 16));
|
||||||
return AttachmentPoint_Max;
|
return AttachmentPoint_Max;
|
||||||
};
|
}
|
||||||
|
|
||||||
GLuint lockedPrevious = 0;
|
GLuint lockedPrevious = 0;
|
||||||
UInt8 lockedLevel = 0;
|
UInt8 lockedLevel = 0;
|
||||||
|
|
|
||||||
|
|
@ -105,9 +105,9 @@ namespace Nz
|
||||||
for (unsigned int i = 0; i < recursionLevel; ++i)
|
for (unsigned int i = 0; i < recursionLevel; ++i)
|
||||||
{
|
{
|
||||||
std::size_t triangleCount = triangles.size();
|
std::size_t triangleCount = triangles.size();
|
||||||
for (std::size_t i = 0; i < triangleCount; ++i)
|
for (std::size_t j = 0; j < triangleCount; ++j)
|
||||||
{
|
{
|
||||||
Vector3ui& triangle = triangles[i];
|
Vector3ui& triangle = triangles[j];
|
||||||
|
|
||||||
unsigned int a = GetMiddleVertex(triangle.x, triangle.y);
|
unsigned int a = GetMiddleVertex(triangle.x, triangle.y);
|
||||||
unsigned int b = GetMiddleVertex(triangle.y, triangle.z);
|
unsigned int b = GetMiddleVertex(triangle.y, triangle.z);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue