diff --git a/engine.xcodeproj/project.pbxproj b/engine.xcodeproj/project.pbxproj index 369d2c2..21dae9c 100644 --- a/engine.xcodeproj/project.pbxproj +++ b/engine.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + AD3B1EC01E3B8B7600E918E3 /* layout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD3B1EBE1E3B8B7600E918E3 /* layout.cpp */; }; AD58E0531E107411006ACC15 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD58E0521E107411006ACC15 /* main.cpp */; }; AD58E05A1E10752E006ACC15 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD58E0591E10752E006ACC15 /* OpenGL.framework */; }; AD58E05C1E107536006ACC15 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD58E05B1E107536006ACC15 /* Cocoa.framework */; }; @@ -37,6 +38,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + AD3B1EBE1E3B8B7600E918E3 /* layout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = layout.cpp; sourceTree = ""; }; + AD3B1EBF1E3B8B7600E918E3 /* layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = layout.h; sourceTree = ""; }; AD58E04F1E107411006ACC15 /* engine */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = engine; sourceTree = BUILT_PRODUCTS_DIR; }; AD58E0521E107411006ACC15 /* main.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = main.cpp; sourceTree = ""; }; AD58E0591E10752E006ACC15 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; @@ -100,6 +103,8 @@ AD58E0511E107411006ACC15 /* engine */ = { isa = PBXGroup; children = ( + AD3B1EBE1E3B8B7600E918E3 /* layout.cpp */, + AD3B1EBF1E3B8B7600E918E3 /* layout.h */, AD58E0631E2A76FD006ACC15 /* shader.cpp */, AD58E0641E2A76FD006ACC15 /* shader.hpp */, AD58E0521E107411006ACC15 /* main.cpp */, @@ -187,6 +192,7 @@ AD58E0651E2A76FD006ACC15 /* shader.cpp in Sources */, AD58E0761E3421F2006ACC15 /* YGNodeList.c in Sources */, AD58E06B1E2A774F006ACC15 /* texture.cpp in Sources */, + AD3B1EC01E3B8B7600E918E3 /* layout.cpp in Sources */, AD58E0721E2A90EF006ACC15 /* app.cpp in Sources */, AD58E0531E107411006ACC15 /* main.cpp in Sources */, AD58E0681E2A7741006ACC15 /* image.cpp in Sources */, @@ -224,6 +230,7 @@ GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = engine/pch.h; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -272,6 +279,7 @@ GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = engine/pch.h; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; diff --git a/engine/layout.cpp b/engine/layout.cpp index 9850c31..213c617 100644 --- a/engine/layout.cpp +++ b/engine/layout.cpp @@ -170,6 +170,8 @@ void Node::load(const char* path) tinyxml2::XMLDocument xml; auto ret = xml.LoadFile(path); + if (ret != tinyxml2::XMLError::XML_SUCCESS) + return; load_internal(xml.RootElement()); } diff --git a/engine/layout.h b/engine/layout.h index c6f5bbd..0653227 100644 --- a/engine/layout.h +++ b/engine/layout.h @@ -110,7 +110,7 @@ public: glm::vec4 m_clip; Node(const Node&) = delete; Node& operator=(const Node&) = delete; - Node& operator=(Node&& o) { return Node(std::forward(o)); } + Node&& operator=(Node&& o) { return std::forward(o); } Node(Node&& o) { children = std::move(o.children); diff --git a/engine/pch.h b/engine/pch.h index 4d4ce8b..43a5e1c 100644 --- a/engine/pch.h +++ b/engine/pch.h @@ -1,4 +1,4 @@ -#pragma once +//#pragma once #ifdef __APPLE__ #include @@ -12,6 +12,7 @@ #include #endif +#ifdef __cplusplus #include #include #include @@ -32,3 +33,4 @@ #include #include +#endif \ No newline at end of file