From 18868082fc88036c0ccd6c3d819c8549ba03feb7 Mon Sep 17 00:00:00 2001 From: Lynix Date: Mon, 30 May 2016 07:41:32 +0200 Subject: [PATCH 01/11] Graphics/DepthRenderTechnique: Fix typo in include name Former-commit-id: 8ac7a886fbb406d1c03ceae5ea8ac71bb48364b7 --- include/Nazara/Graphics/DepthRenderTechnique.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Nazara/Graphics/DepthRenderTechnique.hpp b/include/Nazara/Graphics/DepthRenderTechnique.hpp index ac75f7e52..42b7f6e0a 100644 --- a/include/Nazara/Graphics/DepthRenderTechnique.hpp +++ b/include/Nazara/Graphics/DepthRenderTechnique.hpp @@ -74,6 +74,6 @@ namespace Nz } -#include +#include #endif // NAZARA_DEPTHRENDERTECHNIQUE_HPP From 6959e0bde6d4bda4d09aef792d043fcfd84cbabd Mon Sep 17 00:00:00 2001 From: Lynix Date: Mon, 30 May 2016 08:48:22 +0200 Subject: [PATCH 02/11] Build: Improve build - Help linux default to 64bits build in case of 64bits OS - Fix linux linking with tools Former-commit-id: c6444a691a8b0be6e85b284c60cc3f43056eee01 --- build/scripts/common.lua | 60 +++++++++++++++++++++++------------ examples/FirstScene/build.lua | 4 --- examples/Tut01/build.lua | 4 --- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/build/scripts/common.lua b/build/scripts/common.lua index ec95c2641..15bf69849 100644 --- a/build/scripts/common.lua +++ b/build/scripts/common.lua @@ -5,12 +5,19 @@ function NazaraBuild:Execute() return -- Alors l'utilisateur voulait probablement savoir comment utiliser le programme, on ne fait rien end + local platformData + if (os.is64bit()) then + platformData = {"x64", "x86"} + else + platformData = {"x64", "x86"} + end + if (self.Actions[_ACTION] == nil) then local makeLibDir = os.is("windows") and "mingw" or "gmake" if (#self.OrderedExtLibs > 0) then workspace("NazaraExtlibs") - platforms({"x32", "x64"}) + platforms(platformData) -- Configuration générale configurations({ @@ -23,13 +30,13 @@ function NazaraBuild:Execute() location(_ACTION) kind("StaticLib") - configuration("x32") + configuration("x86") libdirs("../extlibs/lib/common/x86") configuration("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") targetdir("../extlibs/lib/" .. makeLibDir .. "/x86") @@ -40,7 +47,7 @@ function NazaraBuild:Execute() configuration("vs*") buildoptions("/MP") - configuration({"vs*", "x32"}) + configuration({"vs*", "x86"}) libdirs("../extlibs/lib/msvc/x86") targetdir("../extlibs/lib/msvc/x86") @@ -48,7 +55,7 @@ function NazaraBuild:Execute() libdirs("../extlibs/lib/msvc/x64") targetdir("../extlibs/lib/msvc/x64") - configuration({"xcode3 or xcode4", "x32"}) + configuration({"xcode3 or xcode4", "x86"}) libdirs("../extlibs/lib/xcode/x86") targetdir("../extlibs/lib/xcode/x86") @@ -102,7 +109,7 @@ function NazaraBuild:Execute() end workspace("NazaraEngine") - platforms({"x32", "x64"}) + platforms(platformData) -- Configuration générale configurations({ @@ -171,14 +178,14 @@ function NazaraBuild:Execute() libdirs("../lib") libdirs("../extlibs/lib/common") - configuration("x32") + configuration("x86") libdirs("../extlibs/lib/common/x86") configuration("x64") defines("NAZARA_PLATFORM_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("../lib/" .. makeLibDir .. "/x86") targetdir("../lib/" .. makeLibDir .. "/x86") @@ -193,7 +200,7 @@ function NazaraBuild:Execute() self:MakeCopyAfterBuild(moduleTable) end - configuration({"vs*", "x32"}) + configuration({"vs*", "x86"}) libdirs("../extlibs/lib/msvc/x86") libdirs("../lib/msvc/x86") targetdir("../lib/msvc/x86") @@ -203,7 +210,7 @@ function NazaraBuild:Execute() libdirs("../lib/msvc/x64") targetdir("../lib/msvc/x64") - configuration({"xcode3 or xcode4", "x32"}) + configuration({"xcode3 or xcode4", "x86"}) libdirs("../extlibs/lib/xcode/x86") libdirs("../lib/xcode/x86") targetdir("../lib/xcode/x86") @@ -278,20 +285,20 @@ function NazaraBuild:Execute() libdirs("../lib") libdirs("../extlibs/lib/common") - configuration("x32") + configuration("x86") libdirs("../extlibs/lib/common/x86") configuration("x64") defines("NAZARA_PLATFORM_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("../lib/" .. makeLibDir .. "/x86") if (toolTable.Kind == "library") then targetdir("../lib/" .. makeLibDir .. "/x86") elseif (toolTable.Kind == "plugin") then - targetdir("../plugins/" .. toolTable.Name .. "/lib/" .. makeLibDir .. "/x32") + targetdir("../plugins/" .. toolTable.Name .. "/lib/" .. makeLibDir .. "/x86") end configuration({"codeblocks or codelite or gmake", "x64"}) @@ -308,7 +315,7 @@ function NazaraBuild:Execute() self:MakeCopyAfterBuild(toolTable) end - configuration({"vs*", "x32"}) + configuration({"vs*", "x86"}) libdirs("../extlibs/lib/msvc/x86") libdirs("../lib/msvc/x86") if (toolTable.Kind == "library") then @@ -326,7 +333,7 @@ function NazaraBuild:Execute() targetdir("../plugins/" .. toolTable.Name .. "/lib/msvc/x64") end - configuration({"xcode3 or xcode4", "x32"}) + configuration({"xcode3 or xcode4", "x86"}) libdirs("../extlibs/lib/xcode/x86") libdirs("../lib/xcode/x86") if (toolTable.Kind == "library") then @@ -406,26 +413,26 @@ function NazaraBuild:Execute() includedirs(exampleTable.Includes) links(exampleTable.Libraries) - configuration("x32") + configuration("x86") libdirs("../extlibs/lib/common/x86") configuration("x64") defines("NAZARA_PLATFORM_x64") libdirs("../extlibs/lib/common/x64") - configuration({"codeblocks or codelite or gmake", "x32"}) + configuration({"codeblocks or codelite or gmake", "x86"}) libdirs("../lib/" .. makeLibDir .. "/x86") configuration({"codeblocks or codelite or gmake", "x64"}) libdirs("../lib/" .. makeLibDir .. "/x64") - configuration({"vs*", "x32"}) + configuration({"vs*", "x86"}) libdirs("../lib/msvc/x86") configuration({"vs*", "x64"}) libdirs("../lib/msvc/x64") - configuration({"xcode3 or xcode4", "x32"}) + configuration({"xcode3 or xcode4", "x86"}) libdirs("../lib/xcode/x86") configuration({"xcode3 or xcode4", "x64"}) @@ -801,6 +808,17 @@ function NazaraBuild:Process(infoTable) for k,v in ipairs(toolTable.Includes) do table.insert(infoTable.Includes, v) 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.ReleaseStatic, library .. "-s") @@ -853,8 +871,8 @@ function NazaraBuild:MakeCopyAfterBuild(infoTable) for k,v in pairs(table.join(infoTable.Libraries, infoTable.DynLib)) do local paths = {} - table.insert(paths, {"x32", "../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/" .. 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/lib" .. v .. ".dll"}) diff --git a/examples/FirstScene/build.lua b/examples/FirstScene/build.lua index bdcdf8bca..14bf8a42f 100644 --- a/examples/FirstScene/build.lua +++ b/examples/FirstScene/build.lua @@ -7,9 +7,5 @@ EXAMPLE.Files = { } EXAMPLE.Libraries = { - "NazaraCore", - "NazaraGraphics", - "NazaraRenderer", - "NazaraUtility", "NazaraSDK" } diff --git a/examples/Tut01/build.lua b/examples/Tut01/build.lua index 03b4457ab..c12dc35b5 100644 --- a/examples/Tut01/build.lua +++ b/examples/Tut01/build.lua @@ -7,9 +7,5 @@ EXAMPLE.Files = { } EXAMPLE.Libraries = { - "NazaraCore", - "NazaraGraphics", - "NazaraRenderer", - "NazaraUtility", "NazaraSDK" } From 3e4051d82c9b24094e2ba012fddbbf8afeb35226 Mon Sep 17 00:00:00 2001 From: Lynix Date: Mon, 30 May 2016 08:50:49 +0200 Subject: [PATCH 03/11] Build: Fix linking for audio and utility system for POSIX Former-commit-id: b6bf529230e967996fa27d5636aeedc9f78d6e73 --- build/scripts/modules/audio.lua | 17 ++++++++++++----- build/scripts/modules/utility.lua | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/build/scripts/modules/audio.lua b/build/scripts/modules/audio.lua index 4fcb1bf5a..27e49a08c 100644 --- a/build/scripts/modules/audio.lua +++ b/build/scripts/modules/audio.lua @@ -5,19 +5,26 @@ MODULE.Defines = { } MODULE.Libraries = { - "NazaraCore", + "NazaraCore" +} + +MODULE.OsLibraries.Windows = { "sndfile-1" } +MODULE.OsLibraries.Posix = { + "sndfile" +} + +MODULE.OsDynLib.Windows = { + "soft_oal" +} + MODULE.OsFiles.Windows = { "../src/Nazara/Audio/Win32/**.hpp", "../src/Nazara/Audio/Win32/**.cpp" } -MODULE.OsDynLib.Windows = { - "soft_oal" -} - MODULE.OsFiles.Posix = { "../src/Nazara/Audio/Posix/**.hpp", "../src/Nazara/Audio/Posix/**.cpp" diff --git a/build/scripts/modules/utility.lua b/build/scripts/modules/utility.lua index 1fafbd1a4..c1bc186c0 100644 --- a/build/scripts/modules/utility.lua +++ b/build/scripts/modules/utility.lua @@ -1,7 +1,6 @@ MODULE.Name = "Utility" MODULE.Libraries = { - "freetype-s", "NazaraCore", "stb_image" } @@ -17,10 +16,12 @@ MODULE.OsFiles.Posix = { } MODULE.OsLibraries.Windows = { + "freetype-s", "gdi32" } MODULE.OsLibraries.Posix = { + "freetype", "X11", "xcb", "xcb-cursor", From dc4510d5cfb44ecb6fe44b200645f4d17037725a Mon Sep 17 00:00:00 2001 From: Lynix Date: Mon, 30 May 2016 13:50:52 +0200 Subject: [PATCH 04/11] Examples: Add empty project for testing purposes Former-commit-id: bdecb65da518637c42e608e77ac49fedeb24ef00 --- examples/Tut00/build.lua | 20 ++++++++++++++++++++ examples/Tut00/main.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 examples/Tut00/build.lua create mode 100644 examples/Tut00/main.cpp diff --git a/examples/Tut00/build.lua b/examples/Tut00/build.lua new file mode 100644 index 000000000..d0c499df6 --- /dev/null +++ b/examples/Tut00/build.lua @@ -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" +} diff --git a/examples/Tut00/main.cpp b/examples/Tut00/main.cpp new file mode 100644 index 000000000..472db3148 --- /dev/null +++ b/examples/Tut00/main.cpp @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +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; +} \ No newline at end of file From 79c15d6271939bd18f67f0521014615e60aaa596 Mon Sep 17 00:00:00 2001 From: Lynix Date: Mon, 30 May 2016 13:52:08 +0200 Subject: [PATCH 05/11] Build: Fix default platform on 32bits os Former-commit-id: 01a32275da73f662048a9acb4750c43e7d483305 --- build/scripts/common.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/scripts/common.lua b/build/scripts/common.lua index 15bf69849..822067ea2 100644 --- a/build/scripts/common.lua +++ b/build/scripts/common.lua @@ -9,7 +9,7 @@ function NazaraBuild:Execute() if (os.is64bit()) then platformData = {"x64", "x86"} else - platformData = {"x64", "x86"} + platformData = {"x86", "x64"} end if (self.Actions[_ACTION] == nil) then From b6ba99ae23836b755a56f602cf45deabca2f68a1 Mon Sep 17 00:00:00 2001 From: Lynix Date: Tue, 31 May 2016 09:02:35 +0200 Subject: [PATCH 07/11] Physics: Upgrade Newton to 3.13 Former-commit-id: 0744442f892fd7f53d9497669975b381b7bc1369 --- include/Nazara/Physics/Geom.hpp | 2 +- include/Nazara/Physics/PhysObject.hpp | 2 +- include/Nazara/Physics/PhysWorld.hpp | 2 +- src/Nazara/Physics/PhysObject.cpp | 10 ++++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/Nazara/Physics/Geom.hpp b/include/Nazara/Physics/Geom.hpp index 34b6c58ba..23a02c72b 100644 --- a/include/Nazara/Physics/Geom.hpp +++ b/include/Nazara/Physics/Geom.hpp @@ -20,7 +20,7 @@ #include #include -struct NewtonCollision; +class NewtonCollision; namespace Nz { diff --git a/include/Nazara/Physics/PhysObject.hpp b/include/Nazara/Physics/PhysObject.hpp index 7df72b1d1..d4d9c61b7 100644 --- a/include/Nazara/Physics/PhysObject.hpp +++ b/include/Nazara/Physics/PhysObject.hpp @@ -15,7 +15,7 @@ #include #include -struct NewtonBody; +class NewtonBody; namespace Nz { diff --git a/include/Nazara/Physics/PhysWorld.hpp b/include/Nazara/Physics/PhysWorld.hpp index b6fd7eae3..0300048b5 100644 --- a/include/Nazara/Physics/PhysWorld.hpp +++ b/include/Nazara/Physics/PhysWorld.hpp @@ -12,7 +12,7 @@ #include #include -struct NewtonWorld; +class NewtonWorld; namespace Nz { diff --git a/src/Nazara/Physics/PhysObject.cpp b/src/Nazara/Physics/PhysObject.cpp index 1b4816ee6..1ee4a44d5 100644 --- a/src/Nazara/Physics/PhysObject.cpp +++ b/src/Nazara/Physics/PhysObject.cpp @@ -68,7 +68,7 @@ namespace Nz PhysObject::~PhysObject() { if (m_body) - NewtonDestroyBody(m_world->GetHandle(), m_body); + NewtonDestroyBody(m_body); } void PhysObject::AddForce(const Vector3f& force, CoordSys coordSys) @@ -304,11 +304,13 @@ namespace Nz Vector3f 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); NewtonBodySetSleepState(body, 0); - }, nullptr); + return 1; + }, + nullptr); } /*for (std::set::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it) (*it)->PhysObjectOnUpdate(this);*/ @@ -317,7 +319,7 @@ namespace Nz PhysObject& PhysObject::operator=(PhysObject&& object) { if (m_body) - NewtonDestroyBody(m_world->GetHandle(), m_body); + NewtonDestroyBody(m_body); m_body = object.m_body; m_forceAccumulator = std::move(object.m_forceAccumulator); From f19117e84f94ec411cc32b79fc0c64cb2981eb45 Mon Sep 17 00:00:00 2001 From: Lynix Date: Tue, 31 May 2016 09:06:24 +0200 Subject: [PATCH 08/11] Physics: Add new libraries for Windows Former-commit-id: 55870046787c3c3ae067f09d1ab1c8cb2114f2ca --- build/scripts/modules/physics.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/scripts/modules/physics.lua b/build/scripts/modules/physics.lua index fbf6f39c8..f6d485a67 100644 --- a/build/scripts/modules/physics.lua +++ b/build/scripts/modules/physics.lua @@ -2,5 +2,5 @@ MODULE.Name = "Physics" MODULE.Libraries = { "NazaraCore", - "newton" + "Newton" } From 94ff113930065b79437a241579f3fd98c10fbe3d Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 1 Jun 2016 08:34:44 +0200 Subject: [PATCH 11/11] Sdk: Fix uninitialization of components and systems Former-commit-id: 143a252c13269402f6c69c8831f7f1aef0c89c0c [formerly 2cd2160a2cd6da2c0763ca97157dd1349ec28233] Former-commit-id: 1b1fbb0770b993babde90c789250da0bcc8fbcb4 --- SDK/src/NDK/Sdk.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SDK/src/NDK/Sdk.cpp b/SDK/src/NDK/Sdk.cpp index 21bfd236f..7f29bb18e 100644 --- a/SDK/src/NDK/Sdk.cpp +++ b/SDK/src/NDK/Sdk.cpp @@ -112,6 +112,12 @@ namespace Ndk // Uninitialize the SDK s_referenceCounter = 0; + // Components + BaseComponent::Uninitialize(); + + // Systems + BaseSystem::Uninitialize(); + // Uninitialize the engine #ifndef NDK_SERVER