From 6c866f458025d902ae5b4a736e50d4454ec0ba1f Mon Sep 17 00:00:00 2001 From: Aruki Date: Fri, 6 Jul 2018 16:50:17 -0600 Subject: [PATCH] Set up libraries as submodules, updated all libraries, updated to Visual Studio 2017 compiler --- .gitmodules | 12 +++ externals/assimp | 1 + externals/nod | 1 + externals/tinyxml2 | 1 + externals/zlib | 1 + src/Common/CFourCC.h | 2 +- src/Common/Common.pro | 14 +-- src/Common/FileUtil.cpp | 96 +++++++++++-------- src/Common/FileUtil.h | 1 + src/Common/Serialization/IArchive.h | 30 +++--- src/Core/Core.pro | 38 ++++---- src/Core/GameProject/CGameExporter.cpp | 12 ++- src/Core/GameProject/CGameProject.cpp | 8 +- src/Core/Resource/Factory/CTemplateLoader.cpp | 3 +- src/Editor/CExportGameDialog.cpp | 6 +- src/Editor/Editor.pro | 36 ++++--- src/Math/Math.pro | 8 +- 17 files changed, 146 insertions(+), 124 deletions(-) create mode 100644 .gitmodules create mode 160000 externals/assimp create mode 160000 externals/nod create mode 160000 externals/tinyxml2 create mode 160000 externals/zlib diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..392c0a09 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "externals/tinyxml2"] + path = externals/tinyxml2 + url = https://github.com/leethomason/tinyxml2 +[submodule "externals/zlib"] + path = externals/zlib + url = https://github.com/madler/zlib +[submodule "externals/assimp"] + path = externals/assimp + url = https://github.com/assimp/assimp +[submodule "externals/nod"] + path = externals/nod + url = https://github.com/arukibree/nod diff --git a/externals/assimp b/externals/assimp new file mode 160000 index 00000000..bca41ceb --- /dev/null +++ b/externals/assimp @@ -0,0 +1 @@ +Subproject commit bca41ceba5a76936807ea4d23d14a98444ed89b0 diff --git a/externals/nod b/externals/nod new file mode 160000 index 00000000..6f777ebb --- /dev/null +++ b/externals/nod @@ -0,0 +1 @@ +Subproject commit 6f777ebb481f58a4e05d7323176335b450ea8d42 diff --git a/externals/tinyxml2 b/externals/tinyxml2 new file mode 160000 index 00000000..c483646d --- /dev/null +++ b/externals/tinyxml2 @@ -0,0 +1 @@ +Subproject commit c483646db00a6a9ac3a8e93f7c490aecb589979d diff --git a/externals/zlib b/externals/zlib new file mode 160000 index 00000000..cacf7f1d --- /dev/null +++ b/externals/zlib @@ -0,0 +1 @@ +Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f diff --git a/src/Common/CFourCC.h b/src/Common/CFourCC.h index 52811304..d48e4cb2 100644 --- a/src/Common/CFourCC.h +++ b/src/Common/CFourCC.h @@ -72,7 +72,7 @@ public: inline void Reverse() const { - IOUtil::SwapBytes((u32) mFourCC); + IOUtil::SwapBytes((u32&) mFourCC); } // Operators diff --git a/src/Common/Common.pro b/src/Common/Common.pro index a5a519e3..412f6394 100644 --- a/src/Common/Common.pro +++ b/src/Common/Common.pro @@ -21,26 +21,17 @@ CONFIG (debug, debug|release) { # Debug Config OBJECTS_DIR = $$BUILD_DIR/Common/debug TARGET = Commond - - # Debug Libs - LIBS += -L$$EXTERNALS_DIR/boost_1_63_0/lib64-msvc-14.0 -llibboost_filesystem-vc140-mt-gd-1_63 \ - -L$$EXTERNALS_DIR/tinyxml2/lib -ltinyxml2d } CONFIG (release, debug|release) { # Release Config OBJECTS_DIR = $$BUILD_DIR/build/Common/release TARGET = Common - - # Release Libs - LIBS += -L$$EXTERNALS_DIR/boost_1_63_0/lib64-msvc-14.0 -llibboost_filesystem-vc140-mt-1_63 \ - -L$$EXTERNALS_DIR/tinyxml2/lib -ltinyxml2 } # Include Paths INCLUDEPATH += $$PWE_MAIN_INCLUDE \ - $$EXTERNALS_DIR/boost_1_63_0 \ - $$EXTERNALS_DIR/tinyxml2/include + $$EXTERNALS_DIR/tinyxml2 # Header Files HEADERS += \ @@ -109,3 +100,6 @@ SOURCES += \ FileIO\IOutputStream.cpp \ FileIO\CBitStreamInWrapper.cpp \ Hash/CCRC32.cpp + +# Library Sources +SOURCES += $$EXTERNALS_DIR/tinyxml2/tinyxml2.cpp diff --git a/src/Common/FileUtil.cpp b/src/Common/FileUtil.cpp index 3bb1ee1f..1443f17e 100644 --- a/src/Common/FileUtil.cpp +++ b/src/Common/FileUtil.cpp @@ -1,22 +1,19 @@ #include "FileUtil.h" #include "AssertMacro.h" -#include -#include +#include "Common/FileIO/CFileInStream.h" -// These are mostly just wrappers around boost::filesystem functions. -using namespace boost::filesystem; +#include +#include -// Macro encapsulating a TString -> boost::filesystem::path conversion -// boost does not handle conversion from UTF-8 correctly so we need to do it manually -#define TO_PATH(String) path( *String.ToUTF16() ) -#define FROM_PATH(Path) TWideString( Path.native() ).ToUTF8() +// These are mostly just wrappers around std::filesystem functions. +using namespace std::experimental::filesystem::v1; namespace FileUtil { bool Exists(const TString &rkFilePath) { - return exists( TO_PATH(rkFilePath) ); + return exists(*rkFilePath); } bool IsRoot(const TString& rkPath) @@ -29,22 +26,22 @@ bool IsRoot(const TString& rkPath) bool IsFile(const TString& rkFilePath) { - return is_regular_file( TO_PATH(rkFilePath) ); + return is_regular_file(*rkFilePath); } bool IsDirectory(const TString& rkDirPath) { - return is_directory( TO_PATH(rkDirPath) ); + return is_directory(*rkDirPath); } bool IsAbsolute(const TString& rkDirPath) { - return boost::filesystem::path( TO_PATH(rkDirPath) ).is_absolute(); + return path(*rkDirPath).is_absolute(); } bool IsRelative(const TString& rkDirPath) { - return boost::filesystem::path( TO_PATH(rkDirPath) ).is_relative(); + return path(*rkDirPath).is_relative(); } bool IsEmpty(const TString& rkDirPath) @@ -52,11 +49,10 @@ bool IsEmpty(const TString& rkDirPath) if (!IsDirectory(rkDirPath)) { Log::Error("Non-directory path passed to IsEmpty(): " + rkDirPath); - DEBUG_BREAK; return false; } - return is_empty( TO_PATH(rkDirPath) ); + return is_empty(*rkDirPath); } bool MakeDirectory(const TString& rkNewDir) @@ -67,7 +63,7 @@ bool MakeDirectory(const TString& rkNewDir) return false; } - return create_directories( TO_PATH(rkNewDir) ); + return create_directories(*rkNewDir); } bool CopyFile(const TString& rkOrigPath, const TString& rkNewPath) @@ -79,9 +75,10 @@ bool CopyFile(const TString& rkOrigPath, const TString& rkNewPath) } MakeDirectory(rkNewPath.GetFileDirectory()); - boost::system::error_code Error; - copy(TO_PATH(rkOrigPath), TO_PATH(rkNewPath), Error); - return (Error == boost::system::errc::success); + std::error_code Error; + // call std::filesystem::copy, not std::copy + std::experimental::filesystem::copy(*rkOrigPath, *rkNewPath, Error); + return (Error.value() == 0); } bool CopyDirectory(const TString& rkOrigPath, const TString& rkNewPath) @@ -93,9 +90,10 @@ bool CopyDirectory(const TString& rkOrigPath, const TString& rkNewPath) } MakeDirectory(rkNewPath.GetFileDirectory()); - boost::system::error_code Error; - copy_directory(TO_PATH(rkOrigPath), TO_PATH(rkNewPath), Error); - return (Error == boost::system::errc::success); + std::error_code Error; + // call std::filesystem::copy, not std::copy + std::experimental::filesystem::copy(*rkOrigPath, *rkNewPath, Error); + return (Error.value() == 0); } bool MoveFile(const TString& rkOldPath, const TString& rkNewPath) @@ -126,7 +124,7 @@ bool MoveDirectory(const TString& rkOldPath, const TString& rkNewPath) if (Exists(rkNewPath)) { - Log::Error("Unable to move directory because there is an existing directory at the destination path: " + rkNewPath); + Log::Error("Unable to move directory because there is an existing directory at the destination path: %s" + rkNewPath); return false; } @@ -137,7 +135,7 @@ bool MoveDirectory(const TString& rkOldPath, const TString& rkNewPath) bool DeleteFile(const TString& rkFilePath) { if (!IsFile(rkFilePath)) return false; - return remove( TO_PATH(rkFilePath) ) == 1; + return remove(*rkFilePath) == 1; } bool DeleteDirectory(const TString& rkDirPath, bool FailIfNotEmpty) @@ -151,7 +149,7 @@ bool DeleteDirectory(const TString& rkDirPath, bool FailIfNotEmpty) if (Root) { ASSERT(false); - Log::Error("Attempted to delete root directory!"); + Log::Fatal("Attempted to delete root directory!"); return false; } @@ -160,9 +158,9 @@ bool DeleteDirectory(const TString& rkDirPath, bool FailIfNotEmpty) return false; // Delete directory - boost::system::error_code Error; - remove_all(TO_PATH(rkDirPath), Error); - return (Error == boost::system::errc::success); + std::error_code Error; + remove_all(*rkDirPath, Error); + return (Error.value() == 0); } bool ClearDirectory(const TString& rkDirPath) @@ -176,7 +174,7 @@ bool ClearDirectory(const TString& rkDirPath) if (Root) { ASSERT(false); - Log::Error("Attempted to clear root directory!"); + Log::Fatal("Attempted to clear root directory!"); return false; } @@ -202,22 +200,22 @@ bool ClearDirectory(const TString& rkDirPath) u64 FileSize(const TString &rkFilePath) { - return (u64) (Exists(rkFilePath) ? file_size( TO_PATH(rkFilePath) ) : -1); + return (u64) (Exists(rkFilePath) ? file_size(*rkFilePath) : -1); } u64 LastModifiedTime(const TString& rkFilePath) { - return (u64) last_write_time( TO_PATH(rkFilePath) ); + return (u64) last_write_time(*rkFilePath).time_since_epoch().count(); } TString WorkingDirectory() { - return FROM_PATH( boost::filesystem::current_path() ); + return current_path().string(); } TString MakeAbsolute(TString Path) { - if (!TO_PATH(Path).has_root_name()) + if (!path(*Path).has_root_name()) Path = WorkingDirectory() + "/" + Path; TStringList Components = Path.Split("/\\"); @@ -474,26 +472,26 @@ void GetDirectoryContents(TString DirPath, TStringList& rOut, bool Recursive /*= DirPath.Replace("\\", "/"); bool IncludeAll = IncludeFiles && IncludeDirs; - auto AddFileLambda = [IncludeFiles, IncludeDirs, IncludeAll, &rOut](TString Path) -> void { - bool ShouldAddFile = IncludeAll || (IncludeFiles && IsFile(Path)) || (IncludeDirs && IsDirectory(Path)); + auto AddFileLambda = [IncludeFiles, IncludeDirs, IncludeAll, &rOut](const TString& rkPath) -> void { + bool ShouldAddFile = IncludeAll || (IncludeFiles && IsFile(rkPath)) || (IncludeDirs && IsDirectory(rkPath)); if (ShouldAddFile) - rOut.push_back(Path); + rOut.push_back(rkPath); }; if (Recursive) { - for (recursive_directory_iterator It( TO_PATH(DirPath) ); It != recursive_directory_iterator(); ++It) + for (recursive_directory_iterator It(*DirPath); It != recursive_directory_iterator(); ++It) { - AddFileLambda( FROM_PATH(It->path()) ); + AddFileLambda(It->path().string()); } } else { - for (directory_iterator It( TO_PATH(DirPath) ); It != directory_iterator(); ++It) + for (directory_iterator It(*DirPath); It != directory_iterator(); ++It) { - AddFileLambda( FROM_PATH(It->path()) ); + AddFileLambda(It->path().string()); } } } @@ -501,13 +499,27 @@ void GetDirectoryContents(TString DirPath, TStringList& rOut, bool Recursive /*= TString FindFileExtension(const TString& rkDir, const TString& rkName) { - for (directory_iterator It( TO_PATH(rkDir) ); It != directory_iterator(); ++It) + for (directory_iterator It(*rkDir); It != directory_iterator(); ++It) { - TString Name = FROM_PATH( It->path().filename() ); + TString Name = It->path().filename().string(); if (Name.GetFileName(false) == rkName) return Name.GetFileExtension(); } return ""; } +bool LoadFileToString(const TString& rkFilePath, TString& rOut) +{ + CFileInStream File(rkFilePath); + + if (File.IsValid()) + { + rOut = TString(File.Size()); + File.ReadBytes(&rOut[0], rOut.Size()); + return true; + } + else + return false; +} + } diff --git a/src/Common/FileUtil.h b/src/Common/FileUtil.h index e0c13a2f..9bf45f8b 100644 --- a/src/Common/FileUtil.h +++ b/src/Common/FileUtil.h @@ -36,6 +36,7 @@ bool IsValidName(const TString& rkName, bool Directory, bool RootDir = false); bool IsValidPath(const TString& rkPath, bool Directory); void GetDirectoryContents(TString DirPath, TStringList& rOut, bool Recursive = true, bool IncludeFiles = true, bool IncludeDirs = true); TString FindFileExtension(const TString& rkDir, const TString& rkName); +bool LoadFileToString(const TString& rkFilePath, TString& rOut); } diff --git a/src/Common/Serialization/IArchive.h b/src/Common/Serialization/IArchive.h index 2f78d93c..55692e4c 100644 --- a/src/Common/Serialization/IArchive.h +++ b/src/Common/Serialization/IArchive.h @@ -201,7 +201,7 @@ public: // Serialize primitives template - inline IArchive& operator<<(TSerialParameter& rParam) + inline IArchive& operator<<(TSerialParameter rParam) { if (ParamBegin(rParam.pkName)) { @@ -213,7 +213,7 @@ public: // Serialize pointers to primitives template - inline IArchive& operator<<(TSerialParameter& rParam) + inline IArchive& operator<<(TSerialParameter rParam) { if (ParamBegin(rParam.pkName)) { @@ -226,7 +226,7 @@ public: // Serialize hex primitives template - inline IArchive& operator<<(THexSerialParameter& rParam) + inline IArchive& operator<<(THexSerialParameter rParam) { if (ParamBegin(rParam.pkName)) { @@ -238,7 +238,7 @@ public: // Serialize pointers to hex primitives template - inline IArchive& operator<<(THexSerialParameter& rParam) + inline IArchive& operator<<(THexSerialParameter rParam) { if (ParamBegin(rParam.pkName)) { @@ -251,7 +251,7 @@ public: // Serialize objects with member Serialize methods template - inline IArchive& operator<<(TSerialParameter& rParam) + inline IArchive& operator<<(TSerialParameter rParam) { if (ParamBegin(rParam.pkName)) { @@ -263,7 +263,7 @@ public: // Serialize pointers to objects with member Serialize methods template - inline IArchive& operator<<(TSerialParameter& rParam) + inline IArchive& operator<<(TSerialParameter rParam) { if (ParamBegin(rParam.pkName)) { @@ -276,7 +276,7 @@ public: // Serialize objects with global Serialize functions template - inline IArchive& operator<<(TSerialParameter& rParam) + inline IArchive& operator<<(TSerialParameter rParam) { if (ParamBegin(rParam.pkName)) { @@ -288,7 +288,7 @@ public: // Serialize pointers to objects with global Serialize functions template - inline IArchive& operator<<(TSerialParameter& rParam) + inline IArchive& operator<<(TSerialParameter rParam) { if (ParamBegin(rParam.pkName)) { @@ -301,7 +301,7 @@ public: // Serialize abstract objects (global methods for abstract objects not supported) template - inline IArchive& operator<<(TAbstractSerialParameter& rParam) + inline IArchive& operator<<(TAbstractSerialParameter rParam) { if (ParamBegin(rParam.pkName)) { @@ -326,7 +326,7 @@ public: // Serialize containers (member methods for containers not supported) template - inline IArchive& operator<<(TContainerSerialParameter& rParam) + inline IArchive& operator<<(TContainerSerialParameter rParam) { if (ParamBegin(rParam.pkName)) { @@ -339,7 +339,7 @@ public: // Serialize abstract containers (member methods for containers not supported) template - inline IArchive& operator<<(TAbstractContainerSerialParameter& rParam) + inline IArchive& operator<<(TAbstractContainerSerialParameter rParam) { if (ParamBegin(rParam.pkName)) { @@ -352,25 +352,25 @@ public: // Generate compiler errors for classes with no valid Serialize function defined template - inline IArchive& operator<<(TSerialParameter&) + inline IArchive& operator<<(TSerialParameter) { static_assert(false, "Object being serialized has no valid Serialize method defined."); } template - inline IArchive& operator<<(TAbstractSerialParameter&) + inline IArchive& operator<<(TAbstractSerialParameter) { static_assert(false, "Abstract object being serialized must have a virtual Serialize method defined."); } template - inline IArchive& operator<<(TContainerSerialParameter&) + inline IArchive& operator<<(TContainerSerialParameter) { static_assert(false, "Container being serialized has no valid Serialize method defined."); } template - inline IArchive& operator<<(TAbstractContainerSerialParameter&) + inline IArchive& operator<<(TAbstractContainerSerialParameter) { static_assert(false, "Container being serialized has no valid Serialize method defined."); } diff --git a/src/Core/Core.pro b/src/Core/Core.pro index 88fd99ff..4708d707 100644 --- a/src/Core/Core.pro +++ b/src/Core/Core.pro @@ -12,6 +12,9 @@ TEMPLATE = lib DESTDIR = $$BUILD_DIR/Core DEFINES += GLEW_STATIC +win32 { + QMAKE_CXXFLAGS += -std:c++17 +} unix { target.path = /usr/lib QMAKE_CXXFLAGS += /WX @@ -26,11 +29,9 @@ CONFIG (debug, debug|release) { # Debug Libs LIBS += -L$$BUILD_DIR/Common/ -lCommond \ -L$$BUILD_DIR/Math/ -lMathd \ - -L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc140-mtd \ - -L$$EXTERNALS_DIR/lzo-2.09/lib/ -llzo2d \ - -L$$EXTERNALS_DIR/nodtool/build/debug/lib/ -lnod \ - -L$$EXTERNALS_DIR/nodtool/build/debug/logvisor/ -llogvisor \ - -L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2d \ + -L$$EXTERNALS_DIR/assimp/lib/Debug -lassimp-vc140-mt \ + -L$$EXTERNALS_DIR/nod/lib/Debug -lnod \ + -L$$EXTERNALS_DIR/nod/logvisor/Debug -llogvisor \ -L$$EXTERNALS_DIR/zlib/lib/ -lzlibd # Debug Target Dependencies @@ -48,11 +49,9 @@ CONFIG (release, debug|release) { # Release Libs LIBS += -L$$BUILD_DIR/Common/ -lCommon \ -L$$BUILD_DIR/Math/ -lMath \ - -L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc140-mt \ - -L$$EXTERNALS_DIR/lzo-2.09/lib/ -llzo2 \ - -L$$EXTERNALS_DIR/nodtool/build/release/lib/ -lnod \ - -L$$EXTERNALS_DIR/nodtool/build/release/logvisor -llogvisor \ - -L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2 \ + -L$$EXTERNALS_DIR/assimp/lib/Release -lassimp-vc140-mt \ + -L$$EXTERNALS_DIR/nod/lib/Release -lnod \ + -L$$EXTERNALS_DIR/nod/logvisor/Release -llogvisor \ -L$$EXTERNALS_DIR/zlib/lib/ -lzlib # Release Target Dependencies @@ -63,18 +62,18 @@ CONFIG (release, debug|release) { } # Debug/Release Libs -LIBS += -L$$EXTERNALS_DIR/glew-2.0.0/lib/Release/x64 -lglew32s \ +LIBS += -L$$EXTERNALS_DIR/glew-2.1.0/lib/Release/x64 -lglew32s \ -lopengl32 # Include Paths INCLUDEPATH += $$PWE_MAIN_INCLUDE \ $$EXTERNALS_DIR/assimp/include \ - $$EXTERNALS_DIR/glew-2.0.0/include \ - $$EXTERNALS_DIR/lzo-2.09/include \ - $$EXTERNALS_DIR/nodtool/include \ - $$EXTERNALS_DIR/nodtool/logvisor/include \ - $$EXTERNALS_DIR/tinyxml2/include \ - $$EXTERNALS_DIR/zlib/include + $$EXTERNALS_DIR/glew-2.1.0/include \ + $$EXTERNALS_DIR/lzo-2.10/include \ + $$EXTERNALS_DIR/nod/include \ + $$EXTERNALS_DIR/nod/logvisor/include \ + $$EXTERNALS_DIR/tinyxml2 \ + $$EXTERNALS_DIR/zlib # Header Files HEADERS += \ @@ -368,3 +367,8 @@ SOURCES += \ IProgressNotifier.cpp \ Resource/Script/CPropertyNameGenerator.cpp \ Resource/Script/IPropertyNew.cpp + +# Library Sources +SOURCES += $$EXTERNALS_DIR/lzo-2.10/src/lzo_init.c \ + $$EXTERNALS_DIR/lzo-2.10/src/lzo1x_9x.c \ + $$EXTERNALS_DIR/lzo-2.10/src/lzo1x_d1.c diff --git a/src/Core/GameProject/CGameExporter.cpp b/src/Core/GameProject/CGameExporter.cpp index 4c5c81b9..09b2b4e7 100644 --- a/src/Core/GameProject/CGameExporter.cpp +++ b/src/Core/GameProject/CGameExporter.cpp @@ -10,6 +10,8 @@ #include #include #include + +#include #include #define LOAD_PAKS 1 @@ -178,11 +180,11 @@ bool CGameExporter::ExtractDiscData() FileUtil::MakeDirectory(AbsDiscDir); // Extract disc filesystem - nod::Partition *pDataPartition = mpDisc->getDataPartition(); + nod::IPartition *pDataPartition = mpDisc->getDataPartition(); nod::ExtractionContext Context; Context.force = false; - Context.progressCB = [&](const std::string& rkDesc, float ProgressPercent) { - mpProgress->Report((int) (ProgressPercent * 10000), 10000, rkDesc); + Context.progressCB = [&](const std::string_view rkDesc, float ProgressPercent) { + mpProgress->Report((int) (ProgressPercent * 10000), 10000, rkDesc.data()); }; TString FilesDir = AbsDiscDir + "files/"; @@ -225,7 +227,7 @@ bool CGameExporter::ExtractDiscNodeRecursive(const nod::Node *pkNode, const TStr if (Iter->getKind() == nod::Node::Kind::File) { - TString FilePath = rkDir + Iter->getName(); + TString FilePath = rkDir + Iter->getName().data(); bool Success = Iter->extractToDirectory(*rkDir.ToUTF16(), rkContext); if (!Success) return false; @@ -239,7 +241,7 @@ bool CGameExporter::ExtractDiscNodeRecursive(const nod::Node *pkNode, const TStr else { - TString Subdir = rkDir + Iter->getName() + "/"; + TString Subdir = rkDir + Iter->getName().data() + "/"; bool Success = FileUtil::MakeDirectory(Subdir); if (!Success) return false; diff --git a/src/Core/GameProject/CGameProject.cpp b/src/Core/GameProject/CGameProject.cpp index 2f0fa61c..cb08bbda 100644 --- a/src/Core/GameProject/CGameProject.cpp +++ b/src/Core/GameProject/CGameProject.cpp @@ -82,9 +82,9 @@ bool CGameProject::BuildISO(const TString& rkIsoPath, IProgressNotifier *pProgre ASSERT( FileUtil::IsValidPath(rkIsoPath, false) ); ASSERT( !IsWiiDeAsobu() && !IsTrilogy() ); - auto ProgressCallback = [&](float ProgressPercent, const nod::SystemString& rkInfoString, size_t) + auto ProgressCallback = [&](float ProgressPercent, const nod::SystemStringView& rkInfoString, size_t) { - pProgress->Report((int) (ProgressPercent * 10000), 10000, TWideString(rkInfoString).ToUTF8()); + pProgress->Report((int) (ProgressPercent * 10000), 10000, TWideString(rkInfoString.data()).ToUTF8()); }; pProgress->SetTask(0, "Building " + rkIsoPath.GetFileName()); @@ -108,9 +108,9 @@ bool CGameProject::MergeISO(const TString& rkIsoPath, nod::DiscWii *pOriginalIso ASSERT( IsWiiDeAsobu() || IsTrilogy() ); ASSERT( pOriginalIso != nullptr ); - auto ProgressCallback = [&](float ProgressPercent, const nod::SystemString& rkInfoString, size_t) + auto ProgressCallback = [&](float ProgressPercent, const nod::SystemStringView& rkInfoString, size_t) { - pProgress->Report((int) (ProgressPercent * 10000), 10000, TWideString(rkInfoString).ToUTF8()); + pProgress->Report((int) (ProgressPercent * 10000), 10000, TWideString(rkInfoString.data()).ToUTF8()); }; pProgress->SetTask(0, "Building " + rkIsoPath.GetFileName()); diff --git a/src/Core/Resource/Factory/CTemplateLoader.cpp b/src/Core/Resource/Factory/CTemplateLoader.cpp index 22ce2f6d..1f22698a 100644 --- a/src/Core/Resource/Factory/CTemplateLoader.cpp +++ b/src/Core/Resource/Factory/CTemplateLoader.cpp @@ -1092,10 +1092,8 @@ TString CTemplateLoader::ErrorName(XMLError Error) case XML_ERROR_FILE_NOT_FOUND: return "File not found"; case XML_ERROR_FILE_COULD_NOT_BE_OPENED: return "File could not be opened"; case XML_ERROR_FILE_READ_ERROR: return "File read error"; - case XML_ERROR_ELEMENT_MISMATCH: return "Element mismatch"; case XML_ERROR_PARSING_ELEMENT: return "Parsing element"; case XML_ERROR_PARSING_ATTRIBUTE: return "Parsing attribute"; - case XML_ERROR_IDENTIFYING_TAG: return "Identifying tag"; case XML_ERROR_PARSING_TEXT: return "Parsing text"; case XML_ERROR_PARSING_CDATA: return "Parsing CData"; case XML_ERROR_PARSING_COMMENT: return "Parsing comment"; @@ -1106,6 +1104,7 @@ TString CTemplateLoader::ErrorName(XMLError Error) case XML_ERROR_PARSING: return "Parsing"; case XML_CAN_NOT_CONVERT_TEXT: return "Cannot convert text"; case XML_NO_TEXT_NODE: return "No text node"; + case XML_ELEMENT_DEPTH_EXCEEDED: return "Element depth exceeded"; default: return "Unknown error"; } } diff --git a/src/Editor/CExportGameDialog.cpp b/src/Editor/CExportGameDialog.cpp index 6492f468..3988658d 100644 --- a/src/Editor/CExportGameDialog.cpp +++ b/src/Editor/CExportGameDialog.cpp @@ -89,7 +89,7 @@ void CExportGameDialog::InitUI(QString ExportDir) mRegion == eRegion_PAL ? "PAL" : "JPN" ); // Disc tree widget - nod::Partition *pPartition = mpDisc->getDataPartition(); + nod::IPartition *pPartition = mpDisc->getDataPartition(); ASSERT(pPartition); QTreeWidgetItem *pTreeRoot = new QTreeWidgetItem((QTreeWidgetItem*) nullptr, QStringList(QString("Disc"))); @@ -314,7 +314,7 @@ void CExportGameDialog::RecursiveAddToTree(const nod::Node *pkNode, QTreeWidgetI if (pkLeft->getKind() != pkRight->getKind()) return pkLeft->getKind() == nod::Node::Kind::Directory; else - return TString(pkLeft->getName()).ToUpper() < TString(pkRight->getName()).ToUpper(); + return TString(pkLeft->getName().data()).ToUpper() < TString(pkRight->getName().data()).ToUpper(); }); // Add nodes to tree @@ -330,7 +330,7 @@ void CExportGameDialog::RecursiveAddToTree(const nod::Node *pkNode, QTreeWidgetI bool IsDir = pkNode->getKind() == nod::Node::Kind::Directory; - QTreeWidgetItem *pItem = new QTreeWidgetItem(pParent, QStringList(QString::fromStdString(pkNode->getName())) ); + QTreeWidgetItem *pItem = new QTreeWidgetItem(pParent, QStringList(QString::fromStdString(pkNode->getName().data())) ); pItem->setIcon(0, QIcon(IsDir ? skDirIcon : skFileIcon)); if (IsDir) diff --git a/src/Editor/Editor.pro b/src/Editor/Editor.pro index c3d94feb..cdc6ce27 100644 --- a/src/Editor/Editor.pro +++ b/src/Editor/Editor.pro @@ -9,7 +9,9 @@ DEFINES += PWE_EDITOR RESOURCES += Icons.qrc win32: { - QMAKE_CXXFLAGS += /WX + QMAKE_CXXFLAGS += /WX \ + -std:c++17 + RC_ICONS += icons/AppIcon.ico QT += winextras } @@ -34,12 +36,9 @@ CONFIG(debug, debug|release) { LIBS += -L$$BUILD_DIR/Common/ -lCommond \ -L$$BUILD_DIR/Math/ -lMathd \ -L$$BUILD_DIR/Core/ -lCored \ - -L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc140-mtd \ - -L$$EXTERNALS_DIR/boost_1_63_0/lib64-msvc-14.0 -llibboost_filesystem-vc140-mt-gd-1_63 \ - -L$$EXTERNALS_DIR/lzo-2.09/lib/ -llzo2d \ - -L$$EXTERNALS_DIR/nodtool/build/debug/lib/ -lnod \ - -L$$EXTERNALS_DIR/nodtool/build/debug/logvisor/ -llogvisor \ - -L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2d \ + -L$$EXTERNALS_DIR/assimp/lib/Debug -lassimp-vc140-mt \ + -L$$EXTERNALS_DIR/nod/lib/Debug -lnod \ + -L$$EXTERNALS_DIR/nod/logvisor/Debug -llogvisor \ -L$$EXTERNALS_DIR/zlib/lib/ -lzlibd # Debug Target Dependencies @@ -61,12 +60,9 @@ CONFIG(release, debug|release) { LIBS += -L$$BUILD_DIR/Common/ -lCommon \ -L$$BUILD_DIR/Math/ -lMath \ -L$$BUILD_DIR/Core/ -lCore \ - -L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc140-mt \ - -L$$EXTERNALS_DIR/boost_1_63_0/lib64-msvc-14.0 -llibboost_filesystem-vc140-mt-1_63 \ - -L$$EXTERNALS_DIR/lzo-2.09/lib/ -llzo2 \ - -L$$EXTERNALS_DIR/nodtool/build/release/lib/ -lnod \ - -L$$EXTERNALS_DIR/nodtool/build/release/logvisor -llogvisor \ - -L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2 \ + -L$$EXTERNALS_DIR/assimp/lib/Release -lassimp-vc140-mt \ + -L$$EXTERNALS_DIR/nod/lib/Release -lnod \ + -L$$EXTERNALS_DIR/nod/logvisor/Release -llogvisor \ -L$$EXTERNALS_DIR/zlib/lib/ -lzlib # Release Target Dependencies @@ -78,18 +74,18 @@ CONFIG(release, debug|release) { } # Debug/Release Libs -LIBS += -L$$EXTERNALS_DIR/glew-2.0.0/lib/Release/x64 -lglew32s \ +LIBS += -L$$EXTERNALS_DIR/glew-2.1.0/lib/Release/x64 -lglew32s \ -lopengl32 # Include Paths INCLUDEPATH += $$PWE_MAIN_INCLUDE \ $$EXTERNALS_DIR/assimp/include \ - $$EXTERNALS_DIR/glew-2.0.0/include \ - $$EXTERNALS_DIR/lzo-2.09/include \ - $$EXTERNALS_DIR/nodtool/include \ - $$EXTERNALS_DIR/nodtool/logvisor/include \ - $$EXTERNALS_DIR/tinyxml2/include \ - $$EXTERNALS_DIR/zlib/include + $$EXTERNALS_DIR/glew-2.1.0/include \ + $$EXTERNALS_DIR/lzo-2.10/include \ + $$EXTERNALS_DIR/nod/include \ + $$EXTERNALS_DIR/nod/logvisor/include \ + $$EXTERNALS_DIR/tinyxml2 \ + $$EXTERNALS_DIR/zlib # Header Files HEADERS += \ diff --git a/src/Math/Math.pro b/src/Math/Math.pro index 1966ed70..a8ed131e 100644 --- a/src/Math/Math.pro +++ b/src/Math/Math.pro @@ -23,8 +23,7 @@ CONFIG (debug, debug|release) { TARGET = Mathd # Debug Libs - LIBS += -L$$BUILD_DIR/Common/ -lCommond \ - -L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2d + LIBS += -L$$BUILD_DIR/Common/ -lCommond # Debug Target Dependencies win32 { @@ -38,8 +37,7 @@ CONFIG (release, debug|release) { TARGET = Math # Release Libs - LIBS += -L$$BUILD_DIR/Common/ -lCommon \ - -L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2 + LIBS += -L$$BUILD_DIR/Common/ -lCommon # Release Target Dependencies win32 { @@ -49,7 +47,7 @@ CONFIG (release, debug|release) { # Include Paths INCLUDEPATH += $$PWE_MAIN_INCLUDE \ - $$EXTERNALS_DIR/tinyxml2/include + $$EXTERNALS_DIR/tinyxml2 # Header Files HEADERS += \