Improve global header generation to take ECS into account
This commit is contained in:
parent
c1a9a22177
commit
0eda2d0721
|
|
@ -39,6 +39,7 @@
|
||||||
#include <Nazara/Graphics/FramePassAttachment.hpp>
|
#include <Nazara/Graphics/FramePassAttachment.hpp>
|
||||||
#include <Nazara/Graphics/GraphicalMesh.hpp>
|
#include <Nazara/Graphics/GraphicalMesh.hpp>
|
||||||
#include <Nazara/Graphics/Graphics.hpp>
|
#include <Nazara/Graphics/Graphics.hpp>
|
||||||
|
#include <Nazara/Graphics/InstancedRenderable.hpp>
|
||||||
#include <Nazara/Graphics/Material.hpp>
|
#include <Nazara/Graphics/Material.hpp>
|
||||||
#include <Nazara/Graphics/MaterialPipeline.hpp>
|
#include <Nazara/Graphics/MaterialPipeline.hpp>
|
||||||
#include <Nazara/Graphics/MaterialSettings.hpp>
|
#include <Nazara/Graphics/MaterialSettings.hpp>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
// This file was automatically generated
|
||||||
|
|
||||||
|
/*
|
||||||
|
Nazara Engine - Graphics module
|
||||||
|
|
||||||
|
Copyright (C) 2020 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_GLOBAL_GRAPHICS_COMPONENTS_HPP
|
||||||
|
#define NAZARA_GLOBAL_GRAPHICS_COMPONENTS_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Graphics/Components/GraphicsComponent.hpp>
|
||||||
|
|
||||||
|
#endif // NAZARA_GLOBAL_GRAPHICS_COMPONENTS_HPP
|
||||||
|
|
@ -1,5 +1,29 @@
|
||||||
// This file was automatically generated
|
// This file was automatically generated
|
||||||
|
|
||||||
|
/*
|
||||||
|
Nazara Engine - OpenGL
|
||||||
|
|
||||||
|
Copyright (C) 2015 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef NAZARA_GLOBAL_OPENGLRENDERER_WRAPPER_HPP
|
#ifndef NAZARA_GLOBAL_OPENGLRENDERER_WRAPPER_HPP
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
// This file was automatically generated
|
||||||
|
|
||||||
|
/*
|
||||||
|
Nazara Engine - Physics 3D module
|
||||||
|
|
||||||
|
Copyright (C) 2015 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_GLOBAL_PHYSICS3D_COMPONENTS_HPP
|
||||||
|
#define NAZARA_GLOBAL_PHYSICS3D_COMPONENTS_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Physics3D/Components/RigidBody3DComponent.hpp>
|
||||||
|
|
||||||
|
#endif // NAZARA_GLOBAL_PHYSICS3D_COMPONENTS_HPP
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
// This file was automatically generated
|
||||||
|
|
||||||
|
/*
|
||||||
|
Nazara Engine - Physics 3D module
|
||||||
|
|
||||||
|
Copyright (C) 2015 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_GLOBAL_PHYSICS3D_SYSTEMS_HPP
|
||||||
|
#define NAZARA_GLOBAL_PHYSICS3D_SYSTEMS_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Physics3D/Systems/Physics3DSystem.hpp>
|
||||||
|
|
||||||
|
#endif // NAZARA_GLOBAL_PHYSICS3D_SYSTEMS_HPP
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
// This file was automatically generated
|
||||||
|
|
||||||
|
/*
|
||||||
|
Nazara Engine - Utility module
|
||||||
|
|
||||||
|
Copyright (C) 2015 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_GLOBAL_UTILITY_COMPONENTS_HPP
|
||||||
|
#define NAZARA_GLOBAL_UTILITY_COMPONENTS_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Utility/Components/NodeComponent.hpp>
|
||||||
|
|
||||||
|
#endif // NAZARA_GLOBAL_UTILITY_COMPONENTS_HPP
|
||||||
|
|
@ -54,6 +54,5 @@
|
||||||
#include <Nazara/VulkanRenderer/VulkanTexture.hpp>
|
#include <Nazara/VulkanRenderer/VulkanTexture.hpp>
|
||||||
#include <Nazara/VulkanRenderer/VulkanTextureSampler.hpp>
|
#include <Nazara/VulkanRenderer/VulkanTextureSampler.hpp>
|
||||||
#include <Nazara/VulkanRenderer/VulkanUploadPool.hpp>
|
#include <Nazara/VulkanRenderer/VulkanUploadPool.hpp>
|
||||||
#include <Nazara/VulkanRenderer/Wrapper.hpp>
|
|
||||||
|
|
||||||
#endif // NAZARA_GLOBAL_VULKANRENDERER_HPP
|
#endif // NAZARA_GLOBAL_VULKANRENDERER_HPP
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,29 @@
|
||||||
// This file was automatically generated
|
// This file was automatically generated
|
||||||
|
|
||||||
|
/*
|
||||||
|
Nazara Engine - Vulkan
|
||||||
|
|
||||||
|
Copyright (C) 2015 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef NAZARA_GLOBAL_VULKANRENDERER_WRAPPER_HPP
|
#ifndef NAZARA_GLOBAL_VULKANRENDERER_WRAPPER_HPP
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,11 @@ on_run(function ()
|
||||||
local paths = {}
|
local paths = {}
|
||||||
|
|
||||||
local excludedFiles = {
|
local excludedFiles = {
|
||||||
|
["Components.hpp"] = true,
|
||||||
["ConfigCheck.hpp"] = true,
|
["ConfigCheck.hpp"] = true,
|
||||||
["Debug.hpp"] = true,
|
["Debug.hpp"] = true,
|
||||||
["DebugOff.hpp"] = true,
|
["DebugOff.hpp"] = true,
|
||||||
|
["Systems.hpp"] = true,
|
||||||
["ThreadSafety.hpp"] = true,
|
["ThreadSafety.hpp"] = true,
|
||||||
["ThreadSafetyOff.hpp"] = true
|
["ThreadSafetyOff.hpp"] = true
|
||||||
}
|
}
|
||||||
|
|
@ -37,42 +39,80 @@ on_run(function ()
|
||||||
|
|
||||||
config:close()
|
config:close()
|
||||||
|
|
||||||
table.insert(paths, {
|
paths[moduleName] = {
|
||||||
Excludes = excludedFiles,
|
Excludes = table.copy(excludedFiles),
|
||||||
Header = head,
|
Header = head,
|
||||||
HeaderGuard = "NAZARA_GLOBAL_" .. moduleName:upper() .. "_HPP",
|
HeaderGuard = "NAZARA_GLOBAL_" .. moduleName:upper() .. "_HPP",
|
||||||
Name = "Nazara" .. moduleName,
|
Name = "Nazara" .. moduleName,
|
||||||
SearchDir = modulePath,
|
SearchDir = modulePath,
|
||||||
Target = modulePath .. ".hpp"
|
Target = modulePath .. ".hpp"
|
||||||
})
|
}
|
||||||
|
|
||||||
|
-- Handle components and systems
|
||||||
|
if (os.isdir(modulePath .. "/Components")) then
|
||||||
|
paths[moduleName .. "_Components"] = {
|
||||||
|
Excludes = table.copy(excludedFiles),
|
||||||
|
Header = head,
|
||||||
|
HeaderGuard = "NAZARA_GLOBAL_" .. moduleName:upper() .. "_COMPONENTS_HPP",
|
||||||
|
Name = "Nazara" .. moduleName .. " components",
|
||||||
|
SearchDir = modulePath .. "/Components",
|
||||||
|
Target = modulePath .. "/Components.hpp"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
if (os.isdir(modulePath .. "/Systems")) then
|
||||||
|
paths[moduleName .. "_Systems"] = {
|
||||||
|
Excludes = table.copy(excludedFiles),
|
||||||
|
Header = head,
|
||||||
|
HeaderGuard = "NAZARA_GLOBAL_" .. moduleName:upper() .. "_SYSTEMS_HPP",
|
||||||
|
Name = "Nazara" .. moduleName .. " systems",
|
||||||
|
SearchDir = modulePath .. "/Systems",
|
||||||
|
Target = modulePath .. "/Systems.hpp"
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
table.insert(paths, {
|
paths["Core"].Excludes["ECS.hpp"] = true
|
||||||
|
paths["OpenGLRenderer"].Excludes["Wrapper.hpp"] = true
|
||||||
|
paths["Shader"].Excludes["ShaderLangTokenList.hpp"] = true
|
||||||
|
paths["VulkanRenderer"].Excludes["Wrapper.hpp"] = true
|
||||||
|
|
||||||
|
-- OpenGL renderer wrapper
|
||||||
|
paths["OpenGLWrapper"] = {
|
||||||
Excludes = {
|
Excludes = {
|
||||||
["DeviceFunctions.hpp"] = true,
|
["DeviceFunctions.hpp"] = true,
|
||||||
["GlobalFunctions.hpp"] = true,
|
["GlobalFunctions.hpp"] = true,
|
||||||
["InstanceFunctions.hpp"] = true,
|
["InstanceFunctions.hpp"] = true,
|
||||||
},
|
},
|
||||||
|
Header = paths["OpenGLRenderer"].Header,
|
||||||
HeaderGuard = "NAZARA_GLOBAL_OPENGLRENDERER_WRAPPER_HPP",
|
HeaderGuard = "NAZARA_GLOBAL_OPENGLRENDERER_WRAPPER_HPP",
|
||||||
Name = "OpenGL wrapper",
|
Name = "OpenGL wrapper",
|
||||||
SearchDir = "include/Nazara/OpenGLRenderer/Wrapper",
|
SearchDir = "include/Nazara/OpenGLRenderer/Wrapper",
|
||||||
Target = "include/Nazara/OpenGLRenderer/Wrapper.hpp"
|
Target = "include/Nazara/OpenGLRenderer/Wrapper.hpp"
|
||||||
})
|
}
|
||||||
|
|
||||||
table.insert(paths, {
|
-- Vulkan renderer wrapper
|
||||||
|
paths["VulkanWrapper"] = {
|
||||||
Excludes = {
|
Excludes = {
|
||||||
["DeviceFunctions.hpp"] = true,
|
["DeviceFunctions.hpp"] = true,
|
||||||
["GlobalFunctions.hpp"] = true,
|
["GlobalFunctions.hpp"] = true,
|
||||||
["InstanceFunctions.hpp"] = true,
|
["InstanceFunctions.hpp"] = true,
|
||||||
},
|
},
|
||||||
|
Header = paths["VulkanRenderer"].Header,
|
||||||
HeaderGuard = "NAZARA_GLOBAL_VULKANRENDERER_WRAPPER_HPP",
|
HeaderGuard = "NAZARA_GLOBAL_VULKANRENDERER_WRAPPER_HPP",
|
||||||
Name = "Vulkan wrapper",
|
Name = "Vulkan wrapper",
|
||||||
SearchDir = "include/Nazara/VulkanRenderer/Wrapper",
|
SearchDir = "include/Nazara/VulkanRenderer/Wrapper",
|
||||||
Target = "include/Nazara/VulkanRenderer/Wrapper.hpp"
|
Target = "include/Nazara/VulkanRenderer/Wrapper.hpp"
|
||||||
})
|
}
|
||||||
|
|
||||||
for k,v in ipairs(paths) do
|
for _,v in pairs(paths) do
|
||||||
print(v.Name)
|
print(v.Name)
|
||||||
|
local files = os.files(v.SearchDir .. "/*.hpp")
|
||||||
|
if (#files == 0) then
|
||||||
|
print("Skipped (no file matched)")
|
||||||
|
goto continue
|
||||||
|
end
|
||||||
|
|
||||||
local header, err = io.open(v.Target, "w+")
|
local header, err = io.open(v.Target, "w+")
|
||||||
if (not header) then
|
if (not header) then
|
||||||
error("Failed to create header file (" .. v.Target .. "): " .. err)
|
error("Failed to create header file (" .. v.Target .. "): " .. err)
|
||||||
|
|
@ -87,7 +127,6 @@ on_run(function ()
|
||||||
header:write("#ifndef " .. v.HeaderGuard .. "\n")
|
header:write("#ifndef " .. v.HeaderGuard .. "\n")
|
||||||
header:write("#define " .. v.HeaderGuard .. "\n\n")
|
header:write("#define " .. v.HeaderGuard .. "\n\n")
|
||||||
|
|
||||||
local files = os.files(v.SearchDir .. "/*.hpp")
|
|
||||||
local count = 0
|
local count = 0
|
||||||
for _, filePath in pairs(files) do
|
for _, filePath in pairs(files) do
|
||||||
local pathParts = path.split(filePath)
|
local pathParts = path.split(filePath)
|
||||||
|
|
@ -96,7 +135,6 @@ on_run(function ()
|
||||||
end
|
end
|
||||||
|
|
||||||
local include = table.concat(pathParts, "/")
|
local include = table.concat(pathParts, "/")
|
||||||
print(include)
|
|
||||||
local fileName = path.filename(filePath)
|
local fileName = path.filename(filePath)
|
||||||
if (not v.Excludes[fileName]) then
|
if (not v.Excludes[fileName]) then
|
||||||
header:write("#include <" .. include .. ">\n")
|
header:write("#include <" .. include .. ">\n")
|
||||||
|
|
@ -108,5 +146,6 @@ on_run(function ()
|
||||||
header:close()
|
header:close()
|
||||||
|
|
||||||
print(string.format("-#include count: %d", count))
|
print(string.format("-#include count: %d", count))
|
||||||
|
::continue::
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue