Set up libraries as submodules, updated all libraries, updated to Visual Studio 2017 compiler

This commit is contained in:
Aruki 2018-07-06 16:50:17 -06:00
parent ce3dfdc397
commit 6c866f4580
17 changed files with 146 additions and 124 deletions

12
.gitmodules vendored Normal file
View File

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

1
externals/assimp vendored Submodule

@ -0,0 +1 @@
Subproject commit bca41ceba5a76936807ea4d23d14a98444ed89b0

1
externals/nod vendored Submodule

@ -0,0 +1 @@
Subproject commit 6f777ebb481f58a4e05d7323176335b450ea8d42

1
externals/tinyxml2 vendored Submodule

@ -0,0 +1 @@
Subproject commit c483646db00a6a9ac3a8e93f7c490aecb589979d

1
externals/zlib vendored Submodule

@ -0,0 +1 @@
Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f

View File

@ -72,7 +72,7 @@ public:
inline void Reverse() const inline void Reverse() const
{ {
IOUtil::SwapBytes((u32) mFourCC); IOUtil::SwapBytes((u32&) mFourCC);
} }
// Operators // Operators

View File

@ -21,26 +21,17 @@ CONFIG (debug, debug|release) {
# Debug Config # Debug Config
OBJECTS_DIR = $$BUILD_DIR/Common/debug OBJECTS_DIR = $$BUILD_DIR/Common/debug
TARGET = Commond 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) { CONFIG (release, debug|release) {
# Release Config # Release Config
OBJECTS_DIR = $$BUILD_DIR/build/Common/release OBJECTS_DIR = $$BUILD_DIR/build/Common/release
TARGET = Common 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 # Include Paths
INCLUDEPATH += $$PWE_MAIN_INCLUDE \ INCLUDEPATH += $$PWE_MAIN_INCLUDE \
$$EXTERNALS_DIR/boost_1_63_0 \ $$EXTERNALS_DIR/tinyxml2
$$EXTERNALS_DIR/tinyxml2/include
# Header Files # Header Files
HEADERS += \ HEADERS += \
@ -109,3 +100,6 @@ SOURCES += \
FileIO\IOutputStream.cpp \ FileIO\IOutputStream.cpp \
FileIO\CBitStreamInWrapper.cpp \ FileIO\CBitStreamInWrapper.cpp \
Hash/CCRC32.cpp Hash/CCRC32.cpp
# Library Sources
SOURCES += $$EXTERNALS_DIR/tinyxml2/tinyxml2.cpp

View File

@ -1,22 +1,19 @@
#include "FileUtil.h" #include "FileUtil.h"
#include "AssertMacro.h" #include "AssertMacro.h"
#include <boost/filesystem.hpp> #include "Common/FileIO/CFileInStream.h"
#include <boost/system/error_code.hpp>
// These are mostly just wrappers around boost::filesystem functions. #include <experimental/filesystem>
using namespace boost::filesystem; #include <system_error>
// Macro encapsulating a TString -> boost::filesystem::path conversion // These are mostly just wrappers around std::filesystem functions.
// boost does not handle conversion from UTF-8 correctly so we need to do it manually using namespace std::experimental::filesystem::v1;
#define TO_PATH(String) path( *String.ToUTF16() )
#define FROM_PATH(Path) TWideString( Path.native() ).ToUTF8()
namespace FileUtil namespace FileUtil
{ {
bool Exists(const TString &rkFilePath) bool Exists(const TString &rkFilePath)
{ {
return exists( TO_PATH(rkFilePath) ); return exists(*rkFilePath);
} }
bool IsRoot(const TString& rkPath) bool IsRoot(const TString& rkPath)
@ -29,22 +26,22 @@ bool IsRoot(const TString& rkPath)
bool IsFile(const TString& rkFilePath) bool IsFile(const TString& rkFilePath)
{ {
return is_regular_file( TO_PATH(rkFilePath) ); return is_regular_file(*rkFilePath);
} }
bool IsDirectory(const TString& rkDirPath) bool IsDirectory(const TString& rkDirPath)
{ {
return is_directory( TO_PATH(rkDirPath) ); return is_directory(*rkDirPath);
} }
bool IsAbsolute(const TString& 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) bool IsRelative(const TString& rkDirPath)
{ {
return boost::filesystem::path( TO_PATH(rkDirPath) ).is_relative(); return path(*rkDirPath).is_relative();
} }
bool IsEmpty(const TString& rkDirPath) bool IsEmpty(const TString& rkDirPath)
@ -52,11 +49,10 @@ bool IsEmpty(const TString& rkDirPath)
if (!IsDirectory(rkDirPath)) if (!IsDirectory(rkDirPath))
{ {
Log::Error("Non-directory path passed to IsEmpty(): " + rkDirPath); Log::Error("Non-directory path passed to IsEmpty(): " + rkDirPath);
DEBUG_BREAK;
return false; return false;
} }
return is_empty( TO_PATH(rkDirPath) ); return is_empty(*rkDirPath);
} }
bool MakeDirectory(const TString& rkNewDir) bool MakeDirectory(const TString& rkNewDir)
@ -67,7 +63,7 @@ bool MakeDirectory(const TString& rkNewDir)
return false; return false;
} }
return create_directories( TO_PATH(rkNewDir) ); return create_directories(*rkNewDir);
} }
bool CopyFile(const TString& rkOrigPath, const TString& rkNewPath) bool CopyFile(const TString& rkOrigPath, const TString& rkNewPath)
@ -79,9 +75,10 @@ bool CopyFile(const TString& rkOrigPath, const TString& rkNewPath)
} }
MakeDirectory(rkNewPath.GetFileDirectory()); MakeDirectory(rkNewPath.GetFileDirectory());
boost::system::error_code Error; std::error_code Error;
copy(TO_PATH(rkOrigPath), TO_PATH(rkNewPath), Error); // call std::filesystem::copy, not std::copy
return (Error == boost::system::errc::success); std::experimental::filesystem::copy(*rkOrigPath, *rkNewPath, Error);
return (Error.value() == 0);
} }
bool CopyDirectory(const TString& rkOrigPath, const TString& rkNewPath) bool CopyDirectory(const TString& rkOrigPath, const TString& rkNewPath)
@ -93,9 +90,10 @@ bool CopyDirectory(const TString& rkOrigPath, const TString& rkNewPath)
} }
MakeDirectory(rkNewPath.GetFileDirectory()); MakeDirectory(rkNewPath.GetFileDirectory());
boost::system::error_code Error; std::error_code Error;
copy_directory(TO_PATH(rkOrigPath), TO_PATH(rkNewPath), Error); // call std::filesystem::copy, not std::copy
return (Error == boost::system::errc::success); std::experimental::filesystem::copy(*rkOrigPath, *rkNewPath, Error);
return (Error.value() == 0);
} }
bool MoveFile(const TString& rkOldPath, const TString& rkNewPath) bool MoveFile(const TString& rkOldPath, const TString& rkNewPath)
@ -126,7 +124,7 @@ bool MoveDirectory(const TString& rkOldPath, const TString& rkNewPath)
if (Exists(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; return false;
} }
@ -137,7 +135,7 @@ bool MoveDirectory(const TString& rkOldPath, const TString& rkNewPath)
bool DeleteFile(const TString& rkFilePath) bool DeleteFile(const TString& rkFilePath)
{ {
if (!IsFile(rkFilePath)) return false; if (!IsFile(rkFilePath)) return false;
return remove( TO_PATH(rkFilePath) ) == 1; return remove(*rkFilePath) == 1;
} }
bool DeleteDirectory(const TString& rkDirPath, bool FailIfNotEmpty) bool DeleteDirectory(const TString& rkDirPath, bool FailIfNotEmpty)
@ -151,7 +149,7 @@ bool DeleteDirectory(const TString& rkDirPath, bool FailIfNotEmpty)
if (Root) if (Root)
{ {
ASSERT(false); ASSERT(false);
Log::Error("Attempted to delete root directory!"); Log::Fatal("Attempted to delete root directory!");
return false; return false;
} }
@ -160,9 +158,9 @@ bool DeleteDirectory(const TString& rkDirPath, bool FailIfNotEmpty)
return false; return false;
// Delete directory // Delete directory
boost::system::error_code Error; std::error_code Error;
remove_all(TO_PATH(rkDirPath), Error); remove_all(*rkDirPath, Error);
return (Error == boost::system::errc::success); return (Error.value() == 0);
} }
bool ClearDirectory(const TString& rkDirPath) bool ClearDirectory(const TString& rkDirPath)
@ -176,7 +174,7 @@ bool ClearDirectory(const TString& rkDirPath)
if (Root) if (Root)
{ {
ASSERT(false); ASSERT(false);
Log::Error("Attempted to clear root directory!"); Log::Fatal("Attempted to clear root directory!");
return false; return false;
} }
@ -202,22 +200,22 @@ bool ClearDirectory(const TString& rkDirPath)
u64 FileSize(const TString &rkFilePath) 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) 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() TString WorkingDirectory()
{ {
return FROM_PATH( boost::filesystem::current_path() ); return current_path().string();
} }
TString MakeAbsolute(TString Path) TString MakeAbsolute(TString Path)
{ {
if (!TO_PATH(Path).has_root_name()) if (!path(*Path).has_root_name())
Path = WorkingDirectory() + "/" + Path; Path = WorkingDirectory() + "/" + Path;
TStringList Components = Path.Split("/\\"); TStringList Components = Path.Split("/\\");
@ -474,26 +472,26 @@ void GetDirectoryContents(TString DirPath, TStringList& rOut, bool Recursive /*=
DirPath.Replace("\\", "/"); DirPath.Replace("\\", "/");
bool IncludeAll = IncludeFiles && IncludeDirs; bool IncludeAll = IncludeFiles && IncludeDirs;
auto AddFileLambda = [IncludeFiles, IncludeDirs, IncludeAll, &rOut](TString Path) -> void { auto AddFileLambda = [IncludeFiles, IncludeDirs, IncludeAll, &rOut](const TString& rkPath) -> void {
bool ShouldAddFile = IncludeAll || (IncludeFiles && IsFile(Path)) || (IncludeDirs && IsDirectory(Path)); bool ShouldAddFile = IncludeAll || (IncludeFiles && IsFile(rkPath)) || (IncludeDirs && IsDirectory(rkPath));
if (ShouldAddFile) if (ShouldAddFile)
rOut.push_back(Path); rOut.push_back(rkPath);
}; };
if (Recursive) 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 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) 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(); if (Name.GetFileName(false) == rkName) return Name.GetFileExtension();
} }
return ""; 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;
}
} }

View File

@ -36,6 +36,7 @@ bool IsValidName(const TString& rkName, bool Directory, bool RootDir = false);
bool IsValidPath(const TString& rkPath, bool Directory); bool IsValidPath(const TString& rkPath, bool Directory);
void GetDirectoryContents(TString DirPath, TStringList& rOut, bool Recursive = true, bool IncludeFiles = true, bool IncludeDirs = true); void GetDirectoryContents(TString DirPath, TStringList& rOut, bool Recursive = true, bool IncludeFiles = true, bool IncludeDirs = true);
TString FindFileExtension(const TString& rkDir, const TString& rkName); TString FindFileExtension(const TString& rkDir, const TString& rkName);
bool LoadFileToString(const TString& rkFilePath, TString& rOut);
} }

View File

@ -201,7 +201,7 @@ public:
// Serialize primitives // Serialize primitives
template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Primitive)> template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Primitive)>
inline IArchive& operator<<(TSerialParameter<ValType>& rParam) inline IArchive& operator<<(TSerialParameter<ValType> rParam)
{ {
if (ParamBegin(rParam.pkName)) if (ParamBegin(rParam.pkName))
{ {
@ -213,7 +213,7 @@ public:
// Serialize pointers to primitives // Serialize pointers to primitives
template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Primitive)> template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Primitive)>
inline IArchive& operator<<(TSerialParameter<ValType*>& rParam) inline IArchive& operator<<(TSerialParameter<ValType*> rParam)
{ {
if (ParamBegin(rParam.pkName)) if (ParamBegin(rParam.pkName))
{ {
@ -226,7 +226,7 @@ public:
// Serialize hex primitives // Serialize hex primitives
template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Primitive)> template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Primitive)>
inline IArchive& operator<<(THexSerialParameter<ValType>& rParam) inline IArchive& operator<<(THexSerialParameter<ValType> rParam)
{ {
if (ParamBegin(rParam.pkName)) if (ParamBegin(rParam.pkName))
{ {
@ -238,7 +238,7 @@ public:
// Serialize pointers to hex primitives // Serialize pointers to hex primitives
template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Primitive)> template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Primitive)>
inline IArchive& operator<<(THexSerialParameter<ValType*>& rParam) inline IArchive& operator<<(THexSerialParameter<ValType*> rParam)
{ {
if (ParamBegin(rParam.pkName)) if (ParamBegin(rParam.pkName))
{ {
@ -251,7 +251,7 @@ public:
// Serialize objects with member Serialize methods // Serialize objects with member Serialize methods
template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Member)> template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Member)>
inline IArchive& operator<<(TSerialParameter<ValType>& rParam) inline IArchive& operator<<(TSerialParameter<ValType> rParam)
{ {
if (ParamBegin(rParam.pkName)) if (ParamBegin(rParam.pkName))
{ {
@ -263,7 +263,7 @@ public:
// Serialize pointers to objects with member Serialize methods // Serialize pointers to objects with member Serialize methods
template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Member)> template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Member)>
inline IArchive& operator<<(TSerialParameter<ValType*>& rParam) inline IArchive& operator<<(TSerialParameter<ValType*> rParam)
{ {
if (ParamBegin(rParam.pkName)) if (ParamBegin(rParam.pkName))
{ {
@ -276,7 +276,7 @@ public:
// Serialize objects with global Serialize functions // Serialize objects with global Serialize functions
template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Global)> template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Global)>
inline IArchive& operator<<(TSerialParameter<ValType>& rParam) inline IArchive& operator<<(TSerialParameter<ValType> rParam)
{ {
if (ParamBegin(rParam.pkName)) if (ParamBegin(rParam.pkName))
{ {
@ -288,7 +288,7 @@ public:
// Serialize pointers to objects with global Serialize functions // Serialize pointers to objects with global Serialize functions
template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Global)> template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Global)>
inline IArchive& operator<<(TSerialParameter<ValType*>& rParam) inline IArchive& operator<<(TSerialParameter<ValType*> rParam)
{ {
if (ParamBegin(rParam.pkName)) if (ParamBegin(rParam.pkName))
{ {
@ -301,7 +301,7 @@ public:
// Serialize abstract objects (global methods for abstract objects not supported) // Serialize abstract objects (global methods for abstract objects not supported)
template<typename ValType, typename FactoryType, ENABLE_FOR_SERIAL_TYPE(Member)> template<typename ValType, typename FactoryType, ENABLE_FOR_SERIAL_TYPE(Member)>
inline IArchive& operator<<(TAbstractSerialParameter<ValType, FactoryType>& rParam) inline IArchive& operator<<(TAbstractSerialParameter<ValType, FactoryType> rParam)
{ {
if (ParamBegin(rParam.pkName)) if (ParamBegin(rParam.pkName))
{ {
@ -326,7 +326,7 @@ public:
// Serialize containers (member methods for containers not supported) // Serialize containers (member methods for containers not supported)
template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Global)> template<typename ValType, ENABLE_FOR_SERIAL_TYPE(Global)>
inline IArchive& operator<<(TContainerSerialParameter<ValType>& rParam) inline IArchive& operator<<(TContainerSerialParameter<ValType> rParam)
{ {
if (ParamBegin(rParam.pkName)) if (ParamBegin(rParam.pkName))
{ {
@ -339,7 +339,7 @@ public:
// Serialize abstract containers (member methods for containers not supported) // Serialize abstract containers (member methods for containers not supported)
template<typename ValType, typename FactoryType, ENABLE_FOR_SERIAL_TYPE(Global)> template<typename ValType, typename FactoryType, ENABLE_FOR_SERIAL_TYPE(Global)>
inline IArchive& operator<<(TAbstractContainerSerialParameter<ValType, FactoryType>& rParam) inline IArchive& operator<<(TAbstractContainerSerialParameter<ValType, FactoryType> rParam)
{ {
if (ParamBegin(rParam.pkName)) if (ParamBegin(rParam.pkName))
{ {
@ -352,25 +352,25 @@ public:
// Generate compiler errors for classes with no valid Serialize function defined // Generate compiler errors for classes with no valid Serialize function defined
template<typename ValType, ENABLE_FOR_SERIAL_TYPE(None)> template<typename ValType, ENABLE_FOR_SERIAL_TYPE(None)>
inline IArchive& operator<<(TSerialParameter<ValType>&) inline IArchive& operator<<(TSerialParameter<ValType>)
{ {
static_assert(false, "Object being serialized has no valid Serialize method defined."); static_assert(false, "Object being serialized has no valid Serialize method defined.");
} }
template<typename ValType, typename FactoryType, ENABLE_FOR_SERIAL_TYPE(None)> template<typename ValType, typename FactoryType, ENABLE_FOR_SERIAL_TYPE(None)>
inline IArchive& operator<<(TAbstractSerialParameter<ValType, FactoryType>&) inline IArchive& operator<<(TAbstractSerialParameter<ValType, FactoryType>)
{ {
static_assert(false, "Abstract object being serialized must have a virtual Serialize method defined."); static_assert(false, "Abstract object being serialized must have a virtual Serialize method defined.");
} }
template<typename ValType, ENABLE_FOR_SERIAL_TYPE(None)> template<typename ValType, ENABLE_FOR_SERIAL_TYPE(None)>
inline IArchive& operator<<(TContainerSerialParameter<ValType>&) inline IArchive& operator<<(TContainerSerialParameter<ValType>)
{ {
static_assert(false, "Container being serialized has no valid Serialize method defined."); static_assert(false, "Container being serialized has no valid Serialize method defined.");
} }
template<typename ValType, typename FactoryType, ENABLE_FOR_SERIAL_TYPE(None)> template<typename ValType, typename FactoryType, ENABLE_FOR_SERIAL_TYPE(None)>
inline IArchive& operator<<(TAbstractContainerSerialParameter<ValType, FactoryType>&) inline IArchive& operator<<(TAbstractContainerSerialParameter<ValType, FactoryType>)
{ {
static_assert(false, "Container being serialized has no valid Serialize method defined."); static_assert(false, "Container being serialized has no valid Serialize method defined.");
} }

View File

@ -12,6 +12,9 @@ TEMPLATE = lib
DESTDIR = $$BUILD_DIR/Core DESTDIR = $$BUILD_DIR/Core
DEFINES += GLEW_STATIC DEFINES += GLEW_STATIC
win32 {
QMAKE_CXXFLAGS += -std:c++17
}
unix { unix {
target.path = /usr/lib target.path = /usr/lib
QMAKE_CXXFLAGS += /WX QMAKE_CXXFLAGS += /WX
@ -26,11 +29,9 @@ CONFIG (debug, debug|release) {
# Debug Libs # Debug Libs
LIBS += -L$$BUILD_DIR/Common/ -lCommond \ LIBS += -L$$BUILD_DIR/Common/ -lCommond \
-L$$BUILD_DIR/Math/ -lMathd \ -L$$BUILD_DIR/Math/ -lMathd \
-L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc140-mtd \ -L$$EXTERNALS_DIR/assimp/lib/Debug -lassimp-vc140-mt \
-L$$EXTERNALS_DIR/lzo-2.09/lib/ -llzo2d \ -L$$EXTERNALS_DIR/nod/lib/Debug -lnod \
-L$$EXTERNALS_DIR/nodtool/build/debug/lib/ -lnod \ -L$$EXTERNALS_DIR/nod/logvisor/Debug -llogvisor \
-L$$EXTERNALS_DIR/nodtool/build/debug/logvisor/ -llogvisor \
-L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2d \
-L$$EXTERNALS_DIR/zlib/lib/ -lzlibd -L$$EXTERNALS_DIR/zlib/lib/ -lzlibd
# Debug Target Dependencies # Debug Target Dependencies
@ -48,11 +49,9 @@ CONFIG (release, debug|release) {
# Release Libs # Release Libs
LIBS += -L$$BUILD_DIR/Common/ -lCommon \ LIBS += -L$$BUILD_DIR/Common/ -lCommon \
-L$$BUILD_DIR/Math/ -lMath \ -L$$BUILD_DIR/Math/ -lMath \
-L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc140-mt \ -L$$EXTERNALS_DIR/assimp/lib/Release -lassimp-vc140-mt \
-L$$EXTERNALS_DIR/lzo-2.09/lib/ -llzo2 \ -L$$EXTERNALS_DIR/nod/lib/Release -lnod \
-L$$EXTERNALS_DIR/nodtool/build/release/lib/ -lnod \ -L$$EXTERNALS_DIR/nod/logvisor/Release -llogvisor \
-L$$EXTERNALS_DIR/nodtool/build/release/logvisor -llogvisor \
-L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2 \
-L$$EXTERNALS_DIR/zlib/lib/ -lzlib -L$$EXTERNALS_DIR/zlib/lib/ -lzlib
# Release Target Dependencies # Release Target Dependencies
@ -63,18 +62,18 @@ CONFIG (release, debug|release) {
} }
# Debug/Release Libs # 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 -lopengl32
# Include Paths # Include Paths
INCLUDEPATH += $$PWE_MAIN_INCLUDE \ INCLUDEPATH += $$PWE_MAIN_INCLUDE \
$$EXTERNALS_DIR/assimp/include \ $$EXTERNALS_DIR/assimp/include \
$$EXTERNALS_DIR/glew-2.0.0/include \ $$EXTERNALS_DIR/glew-2.1.0/include \
$$EXTERNALS_DIR/lzo-2.09/include \ $$EXTERNALS_DIR/lzo-2.10/include \
$$EXTERNALS_DIR/nodtool/include \ $$EXTERNALS_DIR/nod/include \
$$EXTERNALS_DIR/nodtool/logvisor/include \ $$EXTERNALS_DIR/nod/logvisor/include \
$$EXTERNALS_DIR/tinyxml2/include \ $$EXTERNALS_DIR/tinyxml2 \
$$EXTERNALS_DIR/zlib/include $$EXTERNALS_DIR/zlib
# Header Files # Header Files
HEADERS += \ HEADERS += \
@ -368,3 +367,8 @@ SOURCES += \
IProgressNotifier.cpp \ IProgressNotifier.cpp \
Resource/Script/CPropertyNameGenerator.cpp \ Resource/Script/CPropertyNameGenerator.cpp \
Resource/Script/IPropertyNew.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

View File

@ -10,6 +10,8 @@
#include <Common/FileIO.h> #include <Common/FileIO.h>
#include <Common/FileUtil.h> #include <Common/FileUtil.h>
#include <Common/Serialization/CXMLWriter.h> #include <Common/Serialization/CXMLWriter.h>
#include <nod/nod.hpp>
#include <tinyxml2.h> #include <tinyxml2.h>
#define LOAD_PAKS 1 #define LOAD_PAKS 1
@ -178,11 +180,11 @@ bool CGameExporter::ExtractDiscData()
FileUtil::MakeDirectory(AbsDiscDir); FileUtil::MakeDirectory(AbsDiscDir);
// Extract disc filesystem // Extract disc filesystem
nod::Partition *pDataPartition = mpDisc->getDataPartition(); nod::IPartition *pDataPartition = mpDisc->getDataPartition();
nod::ExtractionContext Context; nod::ExtractionContext Context;
Context.force = false; Context.force = false;
Context.progressCB = [&](const std::string& rkDesc, float ProgressPercent) { Context.progressCB = [&](const std::string_view rkDesc, float ProgressPercent) {
mpProgress->Report((int) (ProgressPercent * 10000), 10000, rkDesc); mpProgress->Report((int) (ProgressPercent * 10000), 10000, rkDesc.data());
}; };
TString FilesDir = AbsDiscDir + "files/"; TString FilesDir = AbsDiscDir + "files/";
@ -225,7 +227,7 @@ bool CGameExporter::ExtractDiscNodeRecursive(const nod::Node *pkNode, const TStr
if (Iter->getKind() == nod::Node::Kind::File) 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); bool Success = Iter->extractToDirectory(*rkDir.ToUTF16(), rkContext);
if (!Success) return false; if (!Success) return false;
@ -239,7 +241,7 @@ bool CGameExporter::ExtractDiscNodeRecursive(const nod::Node *pkNode, const TStr
else else
{ {
TString Subdir = rkDir + Iter->getName() + "/"; TString Subdir = rkDir + Iter->getName().data() + "/";
bool Success = FileUtil::MakeDirectory(Subdir); bool Success = FileUtil::MakeDirectory(Subdir);
if (!Success) return false; if (!Success) return false;

View File

@ -82,9 +82,9 @@ bool CGameProject::BuildISO(const TString& rkIsoPath, IProgressNotifier *pProgre
ASSERT( FileUtil::IsValidPath(rkIsoPath, false) ); ASSERT( FileUtil::IsValidPath(rkIsoPath, false) );
ASSERT( !IsWiiDeAsobu() && !IsTrilogy() ); 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()); pProgress->SetTask(0, "Building " + rkIsoPath.GetFileName());
@ -108,9 +108,9 @@ bool CGameProject::MergeISO(const TString& rkIsoPath, nod::DiscWii *pOriginalIso
ASSERT( IsWiiDeAsobu() || IsTrilogy() ); ASSERT( IsWiiDeAsobu() || IsTrilogy() );
ASSERT( pOriginalIso != nullptr ); 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()); pProgress->SetTask(0, "Building " + rkIsoPath.GetFileName());

View File

@ -1092,10 +1092,8 @@ TString CTemplateLoader::ErrorName(XMLError Error)
case XML_ERROR_FILE_NOT_FOUND: return "File not found"; 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_COULD_NOT_BE_OPENED: return "File could not be opened";
case XML_ERROR_FILE_READ_ERROR: return "File read error"; 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_ELEMENT: return "Parsing element";
case XML_ERROR_PARSING_ATTRIBUTE: return "Parsing attribute"; 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_TEXT: return "Parsing text";
case XML_ERROR_PARSING_CDATA: return "Parsing CData"; case XML_ERROR_PARSING_CDATA: return "Parsing CData";
case XML_ERROR_PARSING_COMMENT: return "Parsing comment"; 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_ERROR_PARSING: return "Parsing";
case XML_CAN_NOT_CONVERT_TEXT: return "Cannot convert text"; case XML_CAN_NOT_CONVERT_TEXT: return "Cannot convert text";
case XML_NO_TEXT_NODE: return "No text node"; case XML_NO_TEXT_NODE: return "No text node";
case XML_ELEMENT_DEPTH_EXCEEDED: return "Element depth exceeded";
default: return "Unknown error"; default: return "Unknown error";
} }
} }

View File

@ -89,7 +89,7 @@ void CExportGameDialog::InitUI(QString ExportDir)
mRegion == eRegion_PAL ? "PAL" : "JPN" ); mRegion == eRegion_PAL ? "PAL" : "JPN" );
// Disc tree widget // Disc tree widget
nod::Partition *pPartition = mpDisc->getDataPartition(); nod::IPartition *pPartition = mpDisc->getDataPartition();
ASSERT(pPartition); ASSERT(pPartition);
QTreeWidgetItem *pTreeRoot = new QTreeWidgetItem((QTreeWidgetItem*) nullptr, QStringList(QString("Disc"))); 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()) if (pkLeft->getKind() != pkRight->getKind())
return pkLeft->getKind() == nod::Node::Kind::Directory; return pkLeft->getKind() == nod::Node::Kind::Directory;
else 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 // Add nodes to tree
@ -330,7 +330,7 @@ void CExportGameDialog::RecursiveAddToTree(const nod::Node *pkNode, QTreeWidgetI
bool IsDir = pkNode->getKind() == nod::Node::Kind::Directory; 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)); pItem->setIcon(0, QIcon(IsDir ? skDirIcon : skFileIcon));
if (IsDir) if (IsDir)

View File

@ -9,7 +9,9 @@ DEFINES += PWE_EDITOR
RESOURCES += Icons.qrc RESOURCES += Icons.qrc
win32: { win32: {
QMAKE_CXXFLAGS += /WX QMAKE_CXXFLAGS += /WX \
-std:c++17
RC_ICONS += icons/AppIcon.ico RC_ICONS += icons/AppIcon.ico
QT += winextras QT += winextras
} }
@ -34,12 +36,9 @@ CONFIG(debug, debug|release) {
LIBS += -L$$BUILD_DIR/Common/ -lCommond \ LIBS += -L$$BUILD_DIR/Common/ -lCommond \
-L$$BUILD_DIR/Math/ -lMathd \ -L$$BUILD_DIR/Math/ -lMathd \
-L$$BUILD_DIR/Core/ -lCored \ -L$$BUILD_DIR/Core/ -lCored \
-L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc140-mtd \ -L$$EXTERNALS_DIR/assimp/lib/Debug -lassimp-vc140-mt \
-L$$EXTERNALS_DIR/boost_1_63_0/lib64-msvc-14.0 -llibboost_filesystem-vc140-mt-gd-1_63 \ -L$$EXTERNALS_DIR/nod/lib/Debug -lnod \
-L$$EXTERNALS_DIR/lzo-2.09/lib/ -llzo2d \ -L$$EXTERNALS_DIR/nod/logvisor/Debug -llogvisor \
-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/zlib/lib/ -lzlibd -L$$EXTERNALS_DIR/zlib/lib/ -lzlibd
# Debug Target Dependencies # Debug Target Dependencies
@ -61,12 +60,9 @@ CONFIG(release, debug|release) {
LIBS += -L$$BUILD_DIR/Common/ -lCommon \ LIBS += -L$$BUILD_DIR/Common/ -lCommon \
-L$$BUILD_DIR/Math/ -lMath \ -L$$BUILD_DIR/Math/ -lMath \
-L$$BUILD_DIR/Core/ -lCore \ -L$$BUILD_DIR/Core/ -lCore \
-L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc140-mt \ -L$$EXTERNALS_DIR/assimp/lib/Release -lassimp-vc140-mt \
-L$$EXTERNALS_DIR/boost_1_63_0/lib64-msvc-14.0 -llibboost_filesystem-vc140-mt-1_63 \ -L$$EXTERNALS_DIR/nod/lib/Release -lnod \
-L$$EXTERNALS_DIR/lzo-2.09/lib/ -llzo2 \ -L$$EXTERNALS_DIR/nod/logvisor/Release -llogvisor \
-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/zlib/lib/ -lzlib -L$$EXTERNALS_DIR/zlib/lib/ -lzlib
# Release Target Dependencies # Release Target Dependencies
@ -78,18 +74,18 @@ CONFIG(release, debug|release) {
} }
# Debug/Release Libs # 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 -lopengl32
# Include Paths # Include Paths
INCLUDEPATH += $$PWE_MAIN_INCLUDE \ INCLUDEPATH += $$PWE_MAIN_INCLUDE \
$$EXTERNALS_DIR/assimp/include \ $$EXTERNALS_DIR/assimp/include \
$$EXTERNALS_DIR/glew-2.0.0/include \ $$EXTERNALS_DIR/glew-2.1.0/include \
$$EXTERNALS_DIR/lzo-2.09/include \ $$EXTERNALS_DIR/lzo-2.10/include \
$$EXTERNALS_DIR/nodtool/include \ $$EXTERNALS_DIR/nod/include \
$$EXTERNALS_DIR/nodtool/logvisor/include \ $$EXTERNALS_DIR/nod/logvisor/include \
$$EXTERNALS_DIR/tinyxml2/include \ $$EXTERNALS_DIR/tinyxml2 \
$$EXTERNALS_DIR/zlib/include $$EXTERNALS_DIR/zlib
# Header Files # Header Files
HEADERS += \ HEADERS += \

View File

@ -23,8 +23,7 @@ CONFIG (debug, debug|release) {
TARGET = Mathd TARGET = Mathd
# Debug Libs # Debug Libs
LIBS += -L$$BUILD_DIR/Common/ -lCommond \ LIBS += -L$$BUILD_DIR/Common/ -lCommond
-L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2d
# Debug Target Dependencies # Debug Target Dependencies
win32 { win32 {
@ -38,8 +37,7 @@ CONFIG (release, debug|release) {
TARGET = Math TARGET = Math
# Release Libs # Release Libs
LIBS += -L$$BUILD_DIR/Common/ -lCommon \ LIBS += -L$$BUILD_DIR/Common/ -lCommon
-L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2
# Release Target Dependencies # Release Target Dependencies
win32 { win32 {
@ -49,7 +47,7 @@ CONFIG (release, debug|release) {
# Include Paths # Include Paths
INCLUDEPATH += $$PWE_MAIN_INCLUDE \ INCLUDEPATH += $$PWE_MAIN_INCLUDE \
$$EXTERNALS_DIR/tinyxml2/include $$EXTERNALS_DIR/tinyxml2
# Header Files # Header Files
HEADERS += \ HEADERS += \