Improve global header generation to take ECS into account

This commit is contained in:
Jérôme Leclercq 2021-06-20 13:34:11 +02:00
parent c1a9a22177
commit 0eda2d0721
9 changed files with 234 additions and 11 deletions

View File

@ -39,6 +39,7 @@
#include <Nazara/Graphics/FramePassAttachment.hpp>
#include <Nazara/Graphics/GraphicalMesh.hpp>
#include <Nazara/Graphics/Graphics.hpp>
#include <Nazara/Graphics/InstancedRenderable.hpp>
#include <Nazara/Graphics/Material.hpp>
#include <Nazara/Graphics/MaterialPipeline.hpp>
#include <Nazara/Graphics/MaterialSettings.hpp>

View File

@ -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

View File

@ -1,5 +1,29 @@
// 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
#ifndef NAZARA_GLOBAL_OPENGLRENDERER_WRAPPER_HPP

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -54,6 +54,5 @@
#include <Nazara/VulkanRenderer/VulkanTexture.hpp>
#include <Nazara/VulkanRenderer/VulkanTextureSampler.hpp>
#include <Nazara/VulkanRenderer/VulkanUploadPool.hpp>
#include <Nazara/VulkanRenderer/Wrapper.hpp>
#endif // NAZARA_GLOBAL_VULKANRENDERER_HPP

View File

@ -1,5 +1,29 @@
// 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
#ifndef NAZARA_GLOBAL_VULKANRENDERER_WRAPPER_HPP

View File

@ -11,9 +11,11 @@ on_run(function ()
local paths = {}
local excludedFiles = {
["Components.hpp"] = true,
["ConfigCheck.hpp"] = true,
["Debug.hpp"] = true,
["DebugOff.hpp"] = true,
["Systems.hpp"] = true,
["ThreadSafety.hpp"] = true,
["ThreadSafetyOff.hpp"] = true
}
@ -37,42 +39,80 @@ on_run(function ()
config:close()
table.insert(paths, {
Excludes = excludedFiles,
paths[moduleName] = {
Excludes = table.copy(excludedFiles),
Header = head,
HeaderGuard = "NAZARA_GLOBAL_" .. moduleName:upper() .. "_HPP",
Name = "Nazara" .. moduleName,
SearchDir = modulePath,
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
table.insert(paths, {
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
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 = {
["DeviceFunctions.hpp"] = true,
["GlobalFunctions.hpp"] = true,
["InstanceFunctions.hpp"] = true,
},
Header = paths["OpenGLRenderer"].Header,
HeaderGuard = "NAZARA_GLOBAL_OPENGLRENDERER_WRAPPER_HPP",
Name = "OpenGL wrapper",
SearchDir = "include/Nazara/OpenGLRenderer/Wrapper",
Target = "include/Nazara/OpenGLRenderer/Wrapper.hpp"
})
}
table.insert(paths, {
-- Vulkan renderer wrapper
paths["VulkanWrapper"] = {
Excludes = {
["DeviceFunctions.hpp"] = true,
["GlobalFunctions.hpp"] = true,
["InstanceFunctions.hpp"] = true,
},
Header = paths["VulkanRenderer"].Header,
HeaderGuard = "NAZARA_GLOBAL_VULKANRENDERER_WRAPPER_HPP",
Name = "Vulkan wrapper",
SearchDir = "include/Nazara/VulkanRenderer/Wrapper",
Target = "include/Nazara/VulkanRenderer/Wrapper.hpp"
})
}
for k,v in ipairs(paths) do
for _,v in pairs(paths) do
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+")
if (not header) then
error("Failed to create header file (" .. v.Target .. "): " .. err)
@ -87,7 +127,6 @@ on_run(function ()
header:write("#ifndef " .. v.HeaderGuard .. "\n")
header:write("#define " .. v.HeaderGuard .. "\n\n")
local files = os.files(v.SearchDir .. "/*.hpp")
local count = 0
for _, filePath in pairs(files) do
local pathParts = path.split(filePath)
@ -96,7 +135,6 @@ on_run(function ()
end
local include = table.concat(pathParts, "/")
print(include)
local fileName = path.filename(filePath)
if (not v.Excludes[fileName]) then
header:write("#include <" .. include .. ">\n")
@ -108,5 +146,6 @@ on_run(function ()
header:close()
print(string.format("-#include count: %d", count))
::continue::
end
end)