From d313e815d342430502796d11033d6d685096058e Mon Sep 17 00:00:00 2001 From: omigamedev Date: Tue, 31 Jan 2017 11:21:56 +0000 Subject: [PATCH] moved libs to submodules, small fix in Node move ctor --- .gitignore | 4 +++- .gitmodules | 12 ++++++++++++ data/layout.xml | 18 +++++++++--------- engine/app.cpp | 4 ++-- engine/layout.h | 3 +++ libs/glm | 1 + libs/stb/stb | 1 + libs/tinyxml2 | 1 + libs/yoga | 1 + 9 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 .gitmodules create mode 160000 libs/glm create mode 160000 libs/stb/stb create mode 160000 libs/tinyxml2 create mode 160000 libs/yoga diff --git a/.gitignore b/.gitignore index f0e21dd..f8d8b56 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ xcuserdata -libs xcshareddata/ x64/ .vs/ engine.vcxproj.user +ipch/ +engine.VC.opendb +engine.sdf diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a646b7e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "libs/glm"] + path = libs/glm + url = https://github.com/g-truc/glm.git +[submodule "libs/stb/stb"] + path = libs/stb/stb + url = https://github.com/nothings/stb.git +[submodule "libs/yoga"] + path = libs/yoga + url = https://github.com/facebook/yoga.git +[submodule "libs/tinyxml2"] + path = libs/tinyxml2 + url = https://github.com/leethomason/tinyxml2.git diff --git a/data/layout.xml b/data/layout.xml index 7fd3aae..f4b26b5 100644 --- a/data/layout.xml +++ b/data/layout.xml @@ -3,17 +3,17 @@ - - - + + + - - - + + + - - - + + + diff --git a/engine/app.cpp b/engine/app.cpp index 0a32357..41298ec 100644 --- a/engine/app.cpp +++ b/engine/app.cpp @@ -125,11 +125,11 @@ void App::update(float dt) glEnable(GL_SCISSOR_TEST); for (auto& n : layout) { - auto box = n.m_clip; - glScissor(box.x, height - box.y - box.w, box.z, box.w); if (n.m_widget) { + auto box = n.m_widget->clip; + glScissor(box.x, height - box.y - box.w, box.z, box.w); n.m_widget->draw(); } } diff --git a/engine/layout.h b/engine/layout.h index 2d3cddc..9c34488 100644 --- a/engine/layout.h +++ b/engine/layout.h @@ -108,6 +108,9 @@ public: Node&& operator=(Node&& o) { return std::forward(o); } Node(Node&& o) { + m_name = std::move(o.m_name); + m_path = std::move(o.m_path); + m_widget = std::move(o.m_widget); m_children = std::move(o.m_children); for (auto& c : m_children) c.parent = this; diff --git a/libs/glm b/libs/glm new file mode 160000 index 0000000..f84437d --- /dev/null +++ b/libs/glm @@ -0,0 +1 @@ +Subproject commit f84437dc56786b17eebebf1666bde9a93188fc3e diff --git a/libs/stb/stb b/libs/stb/stb new file mode 160000 index 0000000..59a5a15 --- /dev/null +++ b/libs/stb/stb @@ -0,0 +1 @@ +Subproject commit 59a5a155b463c2adb8ce6d7eca348c097062430a diff --git a/libs/tinyxml2 b/libs/tinyxml2 new file mode 160000 index 0000000..1f5ab7c --- /dev/null +++ b/libs/tinyxml2 @@ -0,0 +1 @@ +Subproject commit 1f5ab7cd0bbbf3bb9902813c99fb5ae84e495c18 diff --git a/libs/yoga b/libs/yoga new file mode 160000 index 0000000..c217553 --- /dev/null +++ b/libs/yoga @@ -0,0 +1 @@ +Subproject commit c217553cf8d12312bc4deeee6d373160314496fa