Skip to content

Commit

Permalink
[FIX] : fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
aiekick committed Aug 1, 2024
1 parent 6d0628b commit 5e11d7c
Show file tree
Hide file tree
Showing 111 changed files with 259 additions and 255 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/BuildInc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ enable_language(C)
project(${PROJECT} C)

add_executable(${PROJECT} BuildInc.c)
set_target_properties(${PROJECT} PROPERTIES FOLDER 3rdpartyTools)
set_target_properties(${PROJECT} PROPERTIES FOLDER 3rdparty/Tools)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Lumo_Windows_Debug_x64_v0.0.5571
Lumo_Windows_Debug_x64_v0.0.5587
2 changes: 1 addition & 1 deletion cmake/libs/gaia.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(USE_MSVC_RUNTIME_LIBRARY_DLL ON CACHE BOOL "")

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/Gaia)

set_target_properties(Gaia PROPERTIES FOLDER Libs/Shared)
set_target_properties(Gaia PROPERTIES FOLDER 3rdparty/Shared/aiekick)

set_target_properties(Gaia PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${FINAL_BIN_DIR}")
set_target_properties(Gaia PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${FINAL_BIN_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion cmake/libs/lumobackend.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(USE_MSVC_RUNTIME_LIBRARY_DLL ON CACHE BOOL "")

add_subdirectory(${CMAKE_SOURCE_DIR}/libs/LumoBackend)

set_target_properties(LumoBackend PROPERTIES FOLDER Libs/Shared)
set_target_properties(LumoBackend PROPERTIES FOLDER 3rdparty/Shared/aiekick)

set_target_properties(LumoBackend PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${FINAL_BIN_DIR}")
set_target_properties(LumoBackend PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${FINAL_BIN_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion libs/LumoBackend/include/LumoBackend/Base/BaseRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class LUMO_BACKEND_API BaseRenderer : public conf::ConfigAbstract, public GuiInt
bool DrawOverlays(
const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override;
bool DrawDialogsAndPopups(
const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override;
const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override;

virtual void ResetFrame();

Expand Down
2 changes: 1 addition & 1 deletion libs/LumoBackend/include/LumoBackend/Base/ShaderPass.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class LUMO_BACKEND_API ShaderPass : public conf::ConfigAbstract, public ShaderUp
bool DrawOverlays(
const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override;
bool DrawDialogsAndPopups(
const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override;
const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override;

void SetFrameBuffer(FrameBufferWeak vFrameBufferWeak);

Expand Down
2 changes: 1 addition & 1 deletion libs/LumoBackend/include/LumoBackend/Graph/Base/BaseNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ class LUMO_BACKEND_API BaseNode : public conf::ConfigAbstract,
public: // gui interface
bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr, void* vUserDatas) override;
bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr, void* vUserDatas) override;
bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) override;
bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) override;

public: // pane
virtual bool DrawDebugInfos(BaseNodeState* vBaseNodeState);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#define LumoBackend_Prefix "LumoBackend"
#define LumoBackend_BuildNumber 717
#define LumoBackend_BuildNumber 729
#define LumoBackend_MinorNumber 2
#define LumoBackend_MajorNumber 0
#define LumoBackend_BuildId "0.2.717"
#define LumoBackend_BuildId "0.2.729"
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ class LUMO_BACKEND_API GuiInterface {
public:
virtual bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr, void* vUserDatas) = 0;
virtual bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr, void* vUserDatas) = 0;
virtual bool DrawDialogsAndPopups(
const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) = 0;
virtual bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) = 0;
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ limitations under the License.
#include <LumoBackend/Graph/Graph.h>
#include <ctools/cTools.h>
#include <LumoBackend/Headers/LumoBackendDefs.h>
#include <ImGuiPack.h>

class LUMO_BACKEND_API NodeInterface {
protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ limitations under the License.

#include <ctools/cTools.h>
#include <ctools/ConfigAbstract.h>
#include <AbstractPane.h>

#include <LumoBackend/Graph/Graph.h>
#include <LumoBackend/Headers/LumoBackendDefs.h>
Expand Down Expand Up @@ -83,7 +82,8 @@ class LUMO_BACKEND_API PluginPaneConfig {
AbstractPaneWeak paneWeak;
std::string paneName;
std::string paneCategory;
PaneDisposal paneDisposal = PaneDisposal::CENTRAL;
float paneRatio = 0.0f;
PaneDisposal paneDisposal = "CENTRAL";
bool isPaneOpenedDefault = false;
bool isPaneFocusedDefault = false;

Expand All @@ -92,11 +92,13 @@ class LUMO_BACKEND_API PluginPaneConfig {
std::string vName,
std::string vPaneCategory,
PaneDisposal vPaneDisposal,
float vPaneRatio,
bool vIsOpenedDefault,
bool vIsFocusedDefault)
: paneWeak(vPaneWeak),
paneName(vName),
paneCategory(vPaneCategory),
paneRatio(vPaneRatio),
paneDisposal(vPaneDisposal),
isPaneOpenedDefault(vIsOpenedDefault),
isPaneFocusedDefault(vIsFocusedDefault) {
Expand Down
2 changes: 1 addition & 1 deletion libs/LumoBackend/include/LumoBackend/Systems/SceneMerger.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class LUMO_BACKEND_API SceneMerger : public BaseRenderer, //

bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override;
bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override;
bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override;
bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override;

void NeedResizeByResizeEvent(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers) override;
void NeedResizeByHand(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers) override;
Expand Down
4 changes: 2 additions & 2 deletions libs/LumoBackend/src/Base/BaseRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,15 +391,15 @@ bool BaseRenderer::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRe
}

bool BaseRenderer::DrawDialogsAndPopups(
const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) {
const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) {
ZoneScoped;
assert(vContextPtr);
ImGui::SetCurrentContext(vContextPtr);
bool change = false;
for (auto pass : m_ShaderPasses) {
auto pass_ptr = pass.lock();
if (pass_ptr) {
change |= pass_ptr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas);
change |= pass_ptr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas);
}
}
return change;
Expand Down
4 changes: 2 additions & 2 deletions libs/LumoBackend/src/Base/ShaderPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,10 @@ bool ShaderPass::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect
}

bool ShaderPass::DrawDialogsAndPopups(
const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) {
const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) {
ZoneScoped;
UNUSED(vCurrentFrame);
UNUSED(vMaxSize);
UNUSED(vMaxRect);
assert(vContextPtr);
ImGui::SetCurrentContext(vContextPtr);
UNUSED(vUserDatas);
Expand Down
28 changes: 15 additions & 13 deletions libs/LumoBackend/src/Graph/Base/BaseNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,15 +973,13 @@ bool BaseNode::DrawWidgets(const uint32_t& /*vCurrentFrame*/, ImGuiContext* vCon
return false;
}

bool BaseNode::DrawOverlays(
const uint32_t& /*vCurrentFrame*/, const ImRect& /*vRect*/, ImGuiContext* vContextPtr, void* /*vUserDatas*/) {
bool BaseNode::DrawOverlays(const uint32_t& /*vCurrentFrame*/, const ImRect& /*vRect*/, ImGuiContext* vContextPtr, void* /*vUserDatas*/) {
assert(vContextPtr);
ImGui::SetCurrentContext(vContextPtr);
return false;
}

bool BaseNode::DrawDialogsAndPopups(
const uint32_t& /*vCurrentFrame*/, const ImVec2& /*vMaxSize*/, ImGuiContext* vContextPtr, void* /*vUserDatas*/) {
bool BaseNode::DrawDialogsAndPopups(const uint32_t& /*vCurrentFrame*/, const ImRect& /*vMaxRect*/, ImGuiContext* vContextPtr, void* /*vUserDatas*/) {
assert(vContextPtr);
ImGui::SetCurrentContext(vContextPtr);
return false;
Expand Down Expand Up @@ -2247,14 +2245,22 @@ std::vector<NodeSlotWeak> BaseNode::InjectTypeInSlot(NodeSlotWeak vSlotToSplit,
//// CONFIGURATION ///////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////

static inline ct::fvec2 toFVec2(const ImVec2& v) {
return ct::fvec2(v.x, v.y);
}

static inline ImVec2 toImVec2(const ct::fvec2& v) {
return ImVec2(v.x, v.y);
}

std::string BaseNode::getXml(const std::string& vOffset, const std::string& vUserDatas) {
std::string res;

if (!m_ChildNodes.empty()) {
res += vOffset + "<graph>\n";

res += vOffset + "\t<canvas>\n";
res += vOffset + "\t\t<offset>" + ct::fvec2(GetCanvasOffset()).string() + "</offset>\n";
res += vOffset + "\t\t<offset>" + toFVec2(GetCanvasOffset()).string() + "</offset>\n";
res += vOffset + "\t\t<scale>" + ct::toStr(GetCanvasScale()) + "</scale>\n";
res += vOffset + "\t</canvas>\n";

Expand Down Expand Up @@ -2357,23 +2363,21 @@ bool BaseNode::setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vPa
strParentName = vParent->Value();

if (strParentName == "canvas") {
if (strName == "offset")
SetCanvasOffset(ct::toImVec2(ct::fvariant(strValue).GetV2()));
else if (strName == "scale")
if (strName == "offset") {
SetCanvasOffset(toImVec2(ct::fvariant(strValue).GetV2()));
} else if (strName == "scale") {
SetCanvasScale(ct::fvariant(strValue).GetF());

}
return false;
} else if (strParentName == "nodes") {
if (strName == "node") {
std::string _name;
std::string _type;
ct::fvec2 _pos;
uint32_t _nodeId = 0;

for (const tinyxml2::XMLAttribute* attr = vElem->FirstAttribute(); attr != nullptr; attr = attr->Next()) {
std::string attName = attr->Name();
std::string attValue = attr->Value();

if (attName == "name")
_name = attValue;
else if (attName == "type")
Expand All @@ -2383,11 +2387,9 @@ bool BaseNode::setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vPa
else if (attName == "id")
_nodeId = ct::ivariant(attValue).GetU();
}

if (LoadNodeFromXML_Callback(m_This, vElem, vParent, _name, _type, _pos, _nodeId)) {
RecursParsingConfigChilds(vElem, vUserDatas);
}

return false;
}
} else if (strParentName == "links") {
Expand Down
7 changes: 4 additions & 3 deletions libs/LumoBackend/src/SceneGraph/SceneLight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ limitations under the License.

#include <LumoBackend/SceneGraph/SceneLight.h>
#include <LumoBackend/Systems/CommonSystem.h>
#include <ImGuiPack.h>

SceneLightPtr SceneLight::Create() {
auto res = std::make_shared<SceneLight>();
Expand Down Expand Up @@ -95,10 +96,10 @@ bool SceneLight::NeedUpdateCamera() {
}

void SceneLight::AdaptIconColor() {
gizmo_idle_color = ct::toImVec4(lightDatas.lightColor);
gizmo_idle_color = ImVec4(lightDatas.lightColor.x, lightDatas.lightColor.y, lightDatas.lightColor.z, lightDatas.lightColor.w);
gizmo_idle_color.w = 1.0f;
gizmo_hovered_color = ct::toImVec4(lightDatas.lightColor * 1.5f);
gizmo_hovered_color = gizmo_idle_color * 1.5f;
gizmo_hovered_color.w = 1.0f;
gizmo_pressed_color = ct::toImVec4(lightDatas.lightColor * 2.0f);
gizmo_pressed_color = gizmo_idle_color * 2.0f;
gizmo_pressed_color.w = 1.0f;
}
2 changes: 1 addition & 1 deletion libs/LumoBackend/src/Systems/SceneMerger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ bool SceneMerger::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRec
return false;
}

bool SceneMerger::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) {
bool SceneMerger::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) {
ZoneScoped;
assert(vContextPtr);
ImGui::SetCurrentContext(vContextPtr);
Expand Down
12 changes: 6 additions & 6 deletions src/Backend/MainBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ void MainBackend::m_MainLoop() {

m_Update(); // to do absolutly beofre imgui rendering

m_PrepareImGui(ct::ivec4(0, m_VulkanWindowPtr->getWindowResolution()));
const auto& reso = m_VulkanWindowPtr->getWindowResolution();
m_PrepareImGui(ImRect(ImVec2(), ImVec2(reso.x, reso.y)));

// Merged Rendering
bool needResize = false;
Expand Down Expand Up @@ -405,7 +406,7 @@ void MainBackend::m_EndRender() {
m_VulkanCorePtr->Present();
}

void MainBackend::m_PrepareImGui(ct::ivec4 vViewport) {
void MainBackend::m_PrepareImGui(ImRect vViewport) {
ZoneScoped;

ImGui::SetPUSHID(125);
Expand All @@ -415,8 +416,7 @@ void MainBackend::m_PrepareImGui(ct::ivec4 vViewport) {
FrameMark;

m_ImGuiOverlayPtr->getFrontend()->Display(m_CurrentFrame);
NodeManager::Instance()->DrawDialogsAndPopups(
m_CurrentFrame, ImVec2((float)vViewport.size().x, (float)vViewport.size().y), ImGui::GetCurrentContext(), {});
NodeManager::Instance()->DrawDialogsAndPopups(m_CurrentFrame, vViewport, ImGui::GetCurrentContext(), {});
m_ImGuiOverlayPtr->end();
}

Expand Down Expand Up @@ -746,7 +746,7 @@ void MainBackend::m_InitPlugins() {
for (auto& pluginPane : pluginPanes) {
if (!pluginPane.paneWeak.expired()) {
LayoutManager::Instance()->AddPane(pluginPane.paneWeak, pluginPane.paneName, pluginPane.paneCategory, pluginPane.paneDisposal,
pluginPane.isPaneOpenedDefault, pluginPane.isPaneFocusedDefault);
pluginPane.paneRatio, pluginPane.isPaneOpenedDefault, pluginPane.isPaneFocusedDefault);
auto plugin_ptr = std::dynamic_pointer_cast<PluginPane>(pluginPane.paneWeak.lock());
if (plugin_ptr != nullptr) {
plugin_ptr->SetProjectInstancePtr(ProjectFile::Instance());
Expand All @@ -772,7 +772,7 @@ void MainBackend::m_UnitSystems() {
void MainBackend::m_InitPanes() {
if (LayoutManager::Instance()->InitPanes()) {
// a faire apres InitPanes() sinon ConsolePane::Instance()->paneFlag vaudra 0 et changeras apres InitPanes()
Messaging::Instance()->sMessagePaneId = ConsolePane::Instance()->paneFlag;
Messaging::Instance()->sMessagePaneId = ConsolePane::Instance()->GetFlag();
}
}

Expand Down
10 changes: 9 additions & 1 deletion src/Backend/MainBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class MainBackend : public gaia::iService, public gaia::iSurface<ct::ivec2>, pub

std::vector<std::shared_ptr<FileDialogAsset>> m_FileDialogAssets;

ct::ivec2 m_DisplayPos;
ct::ivec2 m_DisplaySize;

// mouse
Expand Down Expand Up @@ -84,9 +85,16 @@ class MainBackend : public gaia::iService, public gaia::iSurface<ct::ivec2>, pub
BackendDatas& GetBackendDatasRef() {
return m_BackendDatas;
}
ImVec2 GetDisplayPos() {
return ImVec2((float)m_DisplayPos.x, (float)m_DisplayPos.y);
}
ImVec2 GetDisplaySize() {
return ImVec2((float)m_DisplaySize.x, (float)m_DisplaySize.y);
}
ImRect GetDisplayRect() {
const auto& p = GetDisplayPos();
return ImRect(p, p + GetDisplaySize());
}

public:
virtual ~MainBackend();
Expand Down Expand Up @@ -183,7 +191,7 @@ class MainBackend : public gaia::iService, public gaia::iSurface<ct::ivec2>, pub
void m_MainLoop();
bool m_BeginRender(bool& vNeedResize);
void m_EndRender();
void m_PrepareImGui(ct::ivec4 vViewport);
void m_PrepareImGui(ImRect vViewport);
void m_Update();
void m_IncFrame();
void m_Resize();
Expand Down
Loading

0 comments on commit 5e11d7c

Please sign in to comment.