mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-07-04 12:15:58 +00:00
Implemented filesystem handling functions in Common
This commit is contained in:
parent
b362a23e4b
commit
3009f06d11
@ -1,5 +1,9 @@
|
|||||||
# CONFIG += PUBLIC_RELEASE
|
# CONFIG += PUBLIC_RELEASE
|
||||||
|
|
||||||
|
BUILD_DIR = $$PWD/../build
|
||||||
|
EXTERNALS_DIR = $$PWD/../externals
|
||||||
|
PWE_MAIN_INCLUDE = $$PWD
|
||||||
|
|
||||||
DEFINES += 'APP_NAME=\"\\\"Prime World Editor\\\"\"' \
|
DEFINES += 'APP_NAME=\"\\\"Prime World Editor\\\"\"' \
|
||||||
'APP_VERSION=\"\\\"1.1.0\\\"\"'
|
'APP_VERSION=\"\\\"1.1.0\\\"\"'
|
||||||
|
|
||||||
|
@ -6,6 +6,18 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
/* This header declares a macro, ASSERT(Expression). ASSERT evaluates the input expression and verifies that
|
||||||
|
* it is true. If the expression is false, an error message will be printed to the log with info on what went
|
||||||
|
* wrong and (in debug builds) trigger a debug break. Application execution is not aborted, but if an assert
|
||||||
|
* fails then there is usually a decent chance of the application crashing regardless.
|
||||||
|
*
|
||||||
|
* Note that in public release builds, asserts are compiled out entirely, so neither log messages nor debug breaks
|
||||||
|
* will occur.
|
||||||
|
*
|
||||||
|
* There are two other macros defined which can be useful for debugging, but shouldn't be used as permanent error
|
||||||
|
* checks: BREAK_ONLY_ASSERT, which doesn't write the error to the log, and LOG_ONLY_ASSERT, which doesn't trigger
|
||||||
|
* a debug break.
|
||||||
|
*/
|
||||||
#define __FILE_SHORT__ strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__
|
#define __FILE_SHORT__ strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__
|
||||||
|
|
||||||
#if _DEBUG
|
#if _DEBUG
|
@ -10,7 +10,7 @@ DEFINES += PWE_COMMON
|
|||||||
|
|
||||||
CONFIG += staticlib
|
CONFIG += staticlib
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
DESTDIR = $$PWD/../../build/Common
|
DESTDIR = $$BUILD_DIR/Common
|
||||||
|
|
||||||
unix {
|
unix {
|
||||||
target.path = /usr/lib
|
target.path = /usr/lib
|
||||||
@ -19,40 +19,43 @@ unix {
|
|||||||
|
|
||||||
CONFIG (debug, debug|release) {
|
CONFIG (debug, debug|release) {
|
||||||
# Debug Config
|
# Debug Config
|
||||||
OBJECTS_DIR = $$PWD/../../build/Common/debug
|
OBJECTS_DIR = $$BUILD_DIR/Common/debug
|
||||||
TARGET = Commond
|
TARGET = Commond
|
||||||
|
|
||||||
# Debug Libs
|
# Debug Libs
|
||||||
LIBS += -L$$PWD/../../build/FileIO/ -lFileIOd
|
LIBS += -L$$BUILD_DIR/FileIO/ -lFileIOd \
|
||||||
|
-L$$EXTERNALS_DIR/boost_1_56_0/lib32-msvc-12.0 -llibboost_filesystem-vc120-mt-gd-1_56
|
||||||
|
|
||||||
# Debug Target Dependencies
|
# Debug Target Dependencies
|
||||||
win32 {
|
win32 {
|
||||||
PRE_TARGETDEPS += $$PWD/../../build/FileIO/FileIOd.lib
|
PRE_TARGETDEPS += $$BUILD_DIR/FileIO/FileIOd.lib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG (release, debug|release) {
|
CONFIG (release, debug|release) {
|
||||||
# Release Config
|
# Release Config
|
||||||
OBJECTS_DIR = $$PWD/../../build/Common/release
|
OBJECTS_DIR = $$BUILD_DIR/build/Common/release
|
||||||
TARGET = Common
|
TARGET = Common
|
||||||
|
|
||||||
# Release Libs
|
# Release Libs
|
||||||
LIBS += -L$$PWD/../../build/FileIO/ -lFileIO
|
LIBS += -L$$BUILD_DIR/FileIO/ -lFileIO \
|
||||||
|
-L$$EXTERNALS_DIR/boost_1_56_0/lib32-msvc-12.0 -llibboost_filesystem-vc120-mt-1_56
|
||||||
|
|
||||||
# Release Target Dependencies
|
# Release Target Dependencies
|
||||||
win32 {
|
win32 {
|
||||||
PRE_TARGETDEPS += $$PWD/../../build/FileIO/FileIO.lib
|
PRE_TARGETDEPS += $$BUILD_DIR/FileIO/FileIO.lib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Debug/Release Libs
|
# Debug/Release Libs
|
||||||
LIBS += -L$$PWD/../../externals/lzo-2.08/lib -llzo-2.08 \
|
LIBS += -L$$EXTERNALS_DIR/lzo-2.08/lib -llzo-2.08 \
|
||||||
-L$$PWD/../../externals/zlib/lib -lzdll
|
-L$$EXTERNALS_DIR/zlib/lib -lzdll
|
||||||
|
|
||||||
# Include Paths
|
# Include Paths
|
||||||
INCLUDEPATH += $$PWD/.. \
|
INCLUDEPATH += $$PWE_MAIN_INCLUDE \
|
||||||
$$PWD/../../externals/lzo-2.08/include \
|
$$EXTERNALS_DIR/boost_1_56_0 \
|
||||||
$$PWD/../../externals/zlib/include
|
$$EXTERNALS_DIR/lzo-2.08/include \
|
||||||
|
$$EXTERNALS_DIR/zlib/include
|
||||||
|
|
||||||
# Header Files
|
# Header Files
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
@ -69,7 +72,8 @@ HEADERS += \
|
|||||||
TString.h \
|
TString.h \
|
||||||
types.h \
|
types.h \
|
||||||
Log.h \
|
Log.h \
|
||||||
Assert.h
|
FileUtil.h \
|
||||||
|
AssertMacro.h
|
||||||
|
|
||||||
# Source Files
|
# Source Files
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
@ -78,4 +82,5 @@ SOURCES += \
|
|||||||
CTimer.cpp \
|
CTimer.cpp \
|
||||||
CUniqueID.cpp \
|
CUniqueID.cpp \
|
||||||
TString.cpp \
|
TString.cpp \
|
||||||
Log.cpp
|
Log.cpp \
|
||||||
|
FileUtil.cpp
|
||||||
|
237
src/Common/FileUtil.cpp
Normal file
237
src/Common/FileUtil.cpp
Normal file
@ -0,0 +1,237 @@
|
|||||||
|
#include "FileUtil.h"
|
||||||
|
#include "AssertMacro.h"
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
|
#include <boost/system/error_code.hpp>
|
||||||
|
|
||||||
|
// These are mostly just wrappers around boost::filesystem functions.
|
||||||
|
using namespace boost::filesystem;
|
||||||
|
|
||||||
|
namespace FileUtil
|
||||||
|
{
|
||||||
|
|
||||||
|
bool Exists(const TWideString &rkFilePath)
|
||||||
|
{
|
||||||
|
return exists(*rkFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsRoot(const TWideString& rkPath)
|
||||||
|
{
|
||||||
|
// todo: verify that this is actually a good way of checking for root
|
||||||
|
TWideString AbsPath = MakeAbsolute(rkPath);
|
||||||
|
TWideStringList Split = AbsPath.Split(L"\\/");
|
||||||
|
return (Split.size() <= 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsFile(const TWideString& rkFilePath)
|
||||||
|
{
|
||||||
|
return is_regular_file(*rkFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsDirectory(const TWideString& rkDirPath)
|
||||||
|
{
|
||||||
|
return is_directory(*rkDirPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CreateDirectory(const TWideString& rkNewDir)
|
||||||
|
{
|
||||||
|
return create_directories(*rkNewDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CopyFile(const TWideString& rkOrigPath, const TWideString& rkNewPath)
|
||||||
|
{
|
||||||
|
boost::system::error_code Error;
|
||||||
|
copy(*rkOrigPath, *rkNewPath, Error);
|
||||||
|
return (Error == boost::system::errc::success);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CopyDirectory(const TWideString& rkOrigPath, const TWideString& rkNewPath)
|
||||||
|
{
|
||||||
|
boost::system::error_code Error;
|
||||||
|
copy_directory(*rkOrigPath, *rkNewPath, Error);
|
||||||
|
return (Error == boost::system::errc::success);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MoveFile(const TWideString& rkOldPath, const TWideString& rkNewPath)
|
||||||
|
{
|
||||||
|
if (CopyFile(rkOldPath, rkNewPath))
|
||||||
|
return DeleteFile(rkOldPath);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MoveDirectory(const TWideString& rkOldPath, const TWideString& rkNewPath)
|
||||||
|
{
|
||||||
|
if (CopyDirectory(rkOldPath, rkNewPath))
|
||||||
|
return DeleteDirectory(rkOldPath);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DeleteFile(const TWideString& rkFilePath)
|
||||||
|
{
|
||||||
|
if (!IsFile(rkFilePath)) return false;
|
||||||
|
return remove(*rkFilePath) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DeleteDirectory(const TWideString& rkDirPath)
|
||||||
|
{
|
||||||
|
if (!IsDirectory(rkDirPath)) return false;
|
||||||
|
|
||||||
|
// Sanity check - don't delete root
|
||||||
|
bool Root = IsRoot(rkDirPath);
|
||||||
|
|
||||||
|
if (Root)
|
||||||
|
{
|
||||||
|
ASSERT(false);
|
||||||
|
Log::Error("Attempted to delete root directory!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::system::error_code Error;
|
||||||
|
remove_all(*rkDirPath, Error);
|
||||||
|
return (Error == boost::system::errc::success);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ClearDirectory(const TWideString& rkDirPath)
|
||||||
|
{
|
||||||
|
if (!IsDirectory(rkDirPath)) return false;
|
||||||
|
|
||||||
|
// Sanity check - don't clear root
|
||||||
|
bool Root = IsRoot(rkDirPath);
|
||||||
|
|
||||||
|
if (Root)
|
||||||
|
{
|
||||||
|
ASSERT(false);
|
||||||
|
Log::Error("Attempted to clear root directory!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete directory contents
|
||||||
|
TWideStringList DirContents;
|
||||||
|
GetDirectoryContents(rkDirPath, DirContents, false);
|
||||||
|
|
||||||
|
for (auto It = DirContents.begin(); It != DirContents.end(); It++)
|
||||||
|
{
|
||||||
|
bool Success = false;
|
||||||
|
|
||||||
|
if (IsFile(*It))
|
||||||
|
Success = DeleteFile(*It);
|
||||||
|
else if (IsDirectory(*It))
|
||||||
|
Success = DeleteDirectory(*It);
|
||||||
|
|
||||||
|
if (!Success)
|
||||||
|
Log::Error("Failed to delete filesystem object: " + TWideString(*It).ToUTF8());
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int FileSize(const TWideString &rkFilePath)
|
||||||
|
{
|
||||||
|
return (int) (Exists(*rkFilePath) ? file_size(*rkFilePath) : -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
TWideString WorkingDirectory()
|
||||||
|
{
|
||||||
|
return boost::filesystem::current_path().string();
|
||||||
|
}
|
||||||
|
|
||||||
|
TWideString MakeAbsolute(TWideString Path)
|
||||||
|
{
|
||||||
|
if (!boost::filesystem::path(*Path).has_root_name())
|
||||||
|
Path = WorkingDirectory() + L"\\" + Path;
|
||||||
|
|
||||||
|
TWideStringList Components = Path.Split(L"/\\");
|
||||||
|
TWideStringList::iterator Prev;
|
||||||
|
|
||||||
|
for (TWideStringList::iterator Iter = Components.begin(); Iter != Components.end(); Iter++)
|
||||||
|
{
|
||||||
|
if (*Iter == L".")
|
||||||
|
Iter = Components.erase(Iter);
|
||||||
|
else if (*Iter == L"..")
|
||||||
|
Iter = std::prev(Components.erase(Prev, std::next(Iter)));
|
||||||
|
|
||||||
|
Prev = Iter;
|
||||||
|
}
|
||||||
|
|
||||||
|
TWideString Out;
|
||||||
|
for (auto it = Components.begin(); it != Components.end(); it++)
|
||||||
|
Out += *it + L"\\";
|
||||||
|
|
||||||
|
return Out;
|
||||||
|
}
|
||||||
|
|
||||||
|
TWideString MakeRelative(const TWideString& rkPath, const TWideString& rkRelativeTo /*= WorkingDirectory()*/)
|
||||||
|
{
|
||||||
|
TWideString AbsPath = MakeAbsolute(rkPath);
|
||||||
|
TWideString AbsRelTo = MakeAbsolute(rkRelativeTo);
|
||||||
|
TWideStringList PathComponents = AbsPath.Split(L"/\\");
|
||||||
|
TWideStringList RelToComponents = AbsRelTo.Split(L"/\\");
|
||||||
|
|
||||||
|
// Find furthest common parent
|
||||||
|
TWideStringList::iterator PathIter = PathComponents.begin();
|
||||||
|
TWideStringList::iterator RelToIter = RelToComponents.begin();
|
||||||
|
|
||||||
|
for (; PathIter != PathComponents.end() && RelToIter != RelToComponents.end(); PathIter++, RelToIter++)
|
||||||
|
{
|
||||||
|
if (*PathIter != *RelToIter)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there's no common components, then we can't construct a relative path...
|
||||||
|
if (PathIter == PathComponents.begin())
|
||||||
|
return AbsPath;
|
||||||
|
|
||||||
|
// Construct output path
|
||||||
|
TWideString Out;
|
||||||
|
|
||||||
|
for (; RelToIter != RelToComponents.end(); RelToIter++)
|
||||||
|
Out += L"..\\";
|
||||||
|
|
||||||
|
for (; PathIter != PathComponents.end(); PathIter++)
|
||||||
|
Out += *PathIter + L"\\";
|
||||||
|
|
||||||
|
return Out;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GetDirectoryContents(TWideString DirPath, TWideStringList& rOut, bool Recursive /*= true*/, bool IncludeFiles /*= true*/, bool IncludeDirs /*= true*/)
|
||||||
|
{
|
||||||
|
if (IsDirectory(DirPath))
|
||||||
|
{
|
||||||
|
DirPath.Replace(L"/", L"\\");
|
||||||
|
bool IncludeAll = IncludeFiles && IncludeDirs;
|
||||||
|
|
||||||
|
auto AddFileLambda = [IncludeFiles, IncludeDirs, IncludeAll, &rOut](std::wstring Path) -> void {
|
||||||
|
bool ShouldAddFile = IncludeAll || (IncludeFiles && IsFile(Path)) || (IncludeDirs && IsDirectory(Path));
|
||||||
|
|
||||||
|
if (ShouldAddFile)
|
||||||
|
rOut.push_back(Path);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (Recursive)
|
||||||
|
{
|
||||||
|
for (recursive_directory_iterator It(*DirPath); It != recursive_directory_iterator(); ++It)
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
AddFileLambda( It->path().native() );
|
||||||
|
#else
|
||||||
|
AddFileLambda( TString(It->path().native()).ToUTF16().ToStdString() );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (directory_iterator It(*DirPath); It != directory_iterator(); ++It)
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
AddFileLambda( It->path().native() );
|
||||||
|
#else
|
||||||
|
AddFileLambda( TString(It->path().native()).ToUTF16().ToStdString() );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
31
src/Common/FileUtil.h
Normal file
31
src/Common/FileUtil.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#ifndef FILEUTIL
|
||||||
|
#define FILEUTIL
|
||||||
|
|
||||||
|
#include "Flags.h"
|
||||||
|
#include "TString.h"
|
||||||
|
|
||||||
|
namespace FileUtil
|
||||||
|
{
|
||||||
|
|
||||||
|
bool Exists(const TWideString& rkFilePath);
|
||||||
|
bool IsRoot(const TWideString& rkPath);
|
||||||
|
bool IsFile(const TWideString& rkFilePath);
|
||||||
|
bool IsDirectory(const TWideString& rkDirPath);
|
||||||
|
bool CreateDirectory(const TWideString& rkNewDir);
|
||||||
|
bool CopyFile(const TWideString& rkOrigPath, const TWideString& rkNewPath);
|
||||||
|
bool CopyDirectory(const TWideString& rkOrigPath, const TWideString& rkNewPath);
|
||||||
|
bool MoveFile(const TWideString& rkOldPath, const TWideString& rkNewPath);
|
||||||
|
bool MoveDirectory(const TWideString& rkOldPath, const TWideString& rkNewPath);
|
||||||
|
bool DeleteFile(const TWideString& rkFilePath);
|
||||||
|
bool DeleteDirectory(const TWideString& rkDirPath);
|
||||||
|
bool ClearDirectory(const TWideString& rkDirPath);
|
||||||
|
int FileSize(const TWideString& rkFilePath);
|
||||||
|
TWideString WorkingDirectory();
|
||||||
|
TWideString MakeAbsolute(TWideString Path);
|
||||||
|
TWideString MakeRelative(const TWideString& rkPath, const TWideString& rkRelativeTo = WorkingDirectory());
|
||||||
|
void GetDirectoryContents(TWideString DirPath, TWideStringList& rOut, bool Recursive = true, bool IncludeFiles = true, bool IncludeDirs = true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // FILEUTIL
|
||||||
|
|
@ -1,5 +1,7 @@
|
|||||||
#include "TString.h"
|
#include "TString.h"
|
||||||
#include <FileIO/IOUtil.h>
|
#include <FileIO/IOUtil.h>
|
||||||
|
#include <codecvt>
|
||||||
|
#include <locale>
|
||||||
|
|
||||||
// ************ TString ************
|
// ************ TString ************
|
||||||
TString::TString(const wchar_t* pkText)
|
TString::TString(const wchar_t* pkText)
|
||||||
@ -19,7 +21,7 @@ TString::TString(const TWideString& rkText)
|
|||||||
|
|
||||||
TWideString TString::ToUTF16() const
|
TWideString TString::ToUTF16() const
|
||||||
{
|
{
|
||||||
TWideString out;
|
TWideString Out;
|
||||||
const char *pkCStr = CString();
|
const char *pkCStr = CString();
|
||||||
|
|
||||||
while (pkCStr[0])
|
while (pkCStr[0])
|
||||||
@ -87,10 +89,10 @@ TWideString TString::ToUTF16() const
|
|||||||
// Step 2: Append to output string
|
// Step 2: Append to output string
|
||||||
if ( ((CodePoint >= 0) && (CodePoint <= 0xD7FF)) ||
|
if ( ((CodePoint >= 0) && (CodePoint <= 0xD7FF)) ||
|
||||||
((CodePoint >= 0xE000) && (CodePoint <= 0xFFFF)) )
|
((CodePoint >= 0xE000) && (CodePoint <= 0xFFFF)) )
|
||||||
out.Append((wchar_t) (CodePoint & 0xFFFF));
|
Out.Append((wchar_t) (CodePoint & 0xFFFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
return out;
|
return Out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************ TWideString ************
|
// ************ TWideString ************
|
||||||
@ -111,5 +113,6 @@ TWideString::TWideString(const TString& rkText)
|
|||||||
|
|
||||||
TString TWideString::ToUTF8() const
|
TString TWideString::ToUTF8() const
|
||||||
{
|
{
|
||||||
return "UTF16 to UTF8 currently unsupported";
|
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> Convert;
|
||||||
|
return TString( Convert.to_bytes(ToStdString()) );
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ DEFINES += PWE_CORE
|
|||||||
|
|
||||||
CONFIG += staticlib
|
CONFIG += staticlib
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
DESTDIR = $$PWD/../../build/Core
|
DESTDIR = $$BUILD_DIR/Core
|
||||||
DEFINES += GLEW_STATIC
|
DEFINES += GLEW_STATIC
|
||||||
|
|
||||||
unix {
|
unix {
|
||||||
@ -20,60 +20,57 @@ unix {
|
|||||||
|
|
||||||
CONFIG (debug, debug|release) {
|
CONFIG (debug, debug|release) {
|
||||||
# Debug Config
|
# Debug Config
|
||||||
OBJECTS_DIR = $$PWD/../../build/Core/debug
|
OBJECTS_DIR = $$BUILD_DIR/Core/debug
|
||||||
TARGET = Cored
|
TARGET = Cored
|
||||||
|
|
||||||
# Debug Libs
|
# Debug Libs
|
||||||
LIBS += -L$$PWD/../../build/FileIO/ -lFileIOd \
|
LIBS += -L$$BUILD_DIR/FileIO/ -lFileIOd \
|
||||||
-L$$PWD/../../build/Common/ -lCommond \
|
-L$$BUILD_DIR/Common/ -lCommond \
|
||||||
-L$$PWD/../../build/Math/ -lMathd \
|
-L$$BUILD_DIR/Math/ -lMathd \
|
||||||
-L$$PWD/../../externals/assimp/lib/ -lassimp-vc120-mtd \
|
-L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc120-mtd \
|
||||||
-L$$PWD/../../externals/boost_1_56_0/lib32-msvc-12.0 -llibboost_filesystem-vc120-mt-gd-1_56 \
|
-L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2d
|
||||||
-L$$PWD/../../externals/tinyxml2/lib/ -ltinyxml2d
|
|
||||||
|
|
||||||
# Debug Target Dependencies
|
# Debug Target Dependencies
|
||||||
win32 {
|
win32 {
|
||||||
PRE_TARGETDEPS += $$PWD/../../build/FileIO/FileIOd.lib \
|
PRE_TARGETDEPS += $$BUILD_DIR/FileIO/FileIOd.lib \
|
||||||
$$PWD/../../build/Common/Commond.lib \
|
$$BUILD_DIR/Common/Commond.lib \
|
||||||
$$PWD/../../build/Math/Mathd.lib
|
$$BUILD_DIR/Math/Mathd.lib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG (release, debug|release) {
|
CONFIG (release, debug|release) {
|
||||||
# Release Config
|
# Release Config
|
||||||
OBJECTS_DIR = $$PWD/../../build/Core/release
|
OBJECTS_DIR = $$BUILD_DIR/Core/release
|
||||||
TARGET = Core
|
TARGET = Core
|
||||||
|
|
||||||
# Release Libs
|
# Release Libs
|
||||||
LIBS += -L$$PWD/../../build/FileIO/ -lFileIO \
|
LIBS += -L$$BUILD_DIR/FileIO/ -lFileIO \
|
||||||
-L$$PWD/../../build/Common/ -lCommon \
|
-L$$BUILD_DIR/Common/ -lCommon \
|
||||||
-L$$PWD/../../build/Math/ -lMath \
|
-L$$BUILD_DIR/Math/ -lMath \
|
||||||
-L$$PWD/../../externals/assimp/lib/ -lassimp-vc120-mt \
|
-L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc120-mt \
|
||||||
-L$$PWD/../../externals/boost_1_56_0/lib32-msvc-12.0 -llibboost_filesystem-vc120-mt-1_56 \
|
-L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2
|
||||||
-L$$PWD/../../externals/tinyxml2/lib/ -ltinyxml2
|
|
||||||
|
|
||||||
# Release Target Dependencies
|
# Release Target Dependencies
|
||||||
win32 {
|
win32 {
|
||||||
PRE_TARGETDEPS += $$PWD/../../build/FileIO/FileIO.lib \
|
PRE_TARGETDEPS += $$BUILD_DIR/FileIO/FileIO.lib \
|
||||||
$$PWD/../../build/Common/Common.lib \
|
$$BUILD_DIR/Common/Common.lib \
|
||||||
$$PWD/../../build/Math/Math.lib
|
$$BUILD_DIR/Math/Math.lib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Debug/Release Libs
|
# Debug/Release Libs
|
||||||
LIBS += -L$$PWD/../../externals/glew-1.9.0/lib/ -lglew32s \
|
LIBS += -L$$EXTERNALS_DIR/glew-1.9.0/lib/ -lglew32s \
|
||||||
-L$$PWD/../../externals/lzo-2.08/lib -llzo-2.08 \
|
-L$$EXTERNALS_DIR/lzo-2.08/lib -llzo-2.08 \
|
||||||
-L$$PWD/../../externals/zlib/lib -lzdll
|
-L$$EXTERNALS_DIR/zlib/lib -lzdll
|
||||||
|
|
||||||
# Include Paths
|
# Include Paths
|
||||||
INCLUDEPATH += $$PWD/../ \
|
INCLUDEPATH += $$PWE_MAIN_INCLUDE \
|
||||||
$$PWD/../../externals/assimp/include \
|
$$EXTERNALS_DIR/assimp/include \
|
||||||
$$PWD/../../externals/boost_1_56_0 \
|
$$EXTERNALS_DIR/glew-1.9.0/include \
|
||||||
$$PWD/../../externals/glew-1.9.0/include \
|
$$EXTERNALS_DIR/glm/glm \
|
||||||
$$PWD/../../externals/glm/glm \
|
$$EXTERNALS_DIR/lzo-2.08/include \
|
||||||
$$PWD/../../externals/lzo-2.08/include \
|
$$EXTERNALS_DIR/tinyxml2/include \
|
||||||
$$PWD/../../externals/tinyxml2/include \
|
$$EXTERNALS_DIR/zlib/include
|
||||||
$$PWD/../../externals/zlib/include
|
|
||||||
|
|
||||||
# Header Files
|
# Header Files
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "CShaderGenerator.h"
|
#include "CShaderGenerator.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -12,15 +12,14 @@
|
|||||||
#include "Core/Resource/Factory/CStringLoader.h"
|
#include "Core/Resource/Factory/CStringLoader.h"
|
||||||
#include "Core/Resource/Factory/CTextureDecoder.h"
|
#include "Core/Resource/Factory/CTextureDecoder.h"
|
||||||
#include "Core/Resource/Factory/CWorldLoader.h"
|
#include "Core/Resource/Factory/CWorldLoader.h"
|
||||||
#include <Common/Log.h>
|
|
||||||
|
|
||||||
#include <Common/TString.h>
|
|
||||||
#include <FileIO/FileIO.h>
|
#include <FileIO/FileIO.h>
|
||||||
|
#include <Common/FileUtil.h>
|
||||||
|
#include <Common/Log.h>
|
||||||
|
#include <Common/TString.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/filesystem.hpp>
|
|
||||||
|
|
||||||
CResCache::CResCache()
|
CResCache::CResCache()
|
||||||
: mpPak(nullptr)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,127 +59,33 @@ void CResCache::Clean()
|
|||||||
void CResCache::SetFolder(TString Path)
|
void CResCache::SetFolder(TString Path)
|
||||||
{
|
{
|
||||||
Path.EnsureEndsWith("/");
|
Path.EnsureEndsWith("/");
|
||||||
mResSource.Path = Path;
|
mResDir = Path;
|
||||||
mResSource.Source = SResSource::eFolder;
|
|
||||||
Log::Write("Set resource folder: " + Path);
|
Log::Write("Set resource folder: " + Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CResCache::SetPak(const TString& rkPath)
|
|
||||||
{
|
|
||||||
CFileInStream *pPakFile = new CFileInStream(rkPath.ToStdString(), IOUtil::eBigEndian);
|
|
||||||
|
|
||||||
if (!pPakFile->IsValid())
|
|
||||||
{
|
|
||||||
Log::Error("Couldn't load pak file: " + rkPath);
|
|
||||||
delete pPakFile;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mpPak) delete mpPak;
|
|
||||||
mpPak = new CPakFile(pPakFile);
|
|
||||||
mResSource.Path = rkPath;
|
|
||||||
mResSource.Source = SResSource::ePakFile;
|
|
||||||
Log::Write("Loaded pak file: " + rkPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CResCache::SetResSource(SResSource& rResSource)
|
|
||||||
{
|
|
||||||
mResSource = rResSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
SResSource CResCache::GetResSource()
|
|
||||||
{
|
|
||||||
return mResSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
TString CResCache::GetSourcePath()
|
TString CResCache::GetSourcePath()
|
||||||
{
|
{
|
||||||
return mResSource.Path;
|
return mResDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
CResource* CResCache::GetResource(CUniqueID ResID, CFourCC Type)
|
CResource* CResCache::GetResource(CUniqueID ResID, CFourCC Type)
|
||||||
{
|
{
|
||||||
if (!ResID.IsValid()) return nullptr;
|
if (!ResID.IsValid()) return nullptr;
|
||||||
|
TString Source = mResDir + ResID.ToString() + "." + Type.ToString();
|
||||||
auto got = mResourceCache.find(ResID.ToLongLong());
|
return GetResource(Source);
|
||||||
|
|
||||||
if (got != mResourceCache.end())
|
|
||||||
return got->second;
|
|
||||||
|
|
||||||
std::vector<u8> *pBuffer = nullptr;
|
|
||||||
TString Source;
|
|
||||||
|
|
||||||
// Load from pak
|
|
||||||
if (mResSource.Source == SResSource::ePakFile)
|
|
||||||
{
|
|
||||||
pBuffer = mpPak->Resource(ResID.ToLongLong(), Type);
|
|
||||||
Source = ResID.ToString() + "." + Type.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load from folder
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Source = mResSource.Path + ResID.ToString() + "." + Type.ToString();
|
|
||||||
CFileInStream File(Source.ToStdString(), IOUtil::eBigEndian);
|
|
||||||
|
|
||||||
if (!File.IsValid())
|
|
||||||
{
|
|
||||||
Log::Error("Couldn't open resource: " + ResID.ToString() + "." + Type.ToString());
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
pBuffer = new std::vector<u8>;
|
|
||||||
pBuffer->resize(File.Size());
|
|
||||||
File.ReadBytes(pBuffer->data(), pBuffer->size());
|
|
||||||
}
|
|
||||||
if (!pBuffer) return nullptr;
|
|
||||||
|
|
||||||
// Load resource
|
|
||||||
CMemoryInStream Mem(pBuffer->data(), pBuffer->size(), IOUtil::eBigEndian);
|
|
||||||
Mem.SetSourceString(*Source.GetFileName());
|
|
||||||
CResource *pRes = nullptr;
|
|
||||||
bool SupportedFormat = true;
|
|
||||||
|
|
||||||
if (Type == "CMDL") pRes = CModelLoader::LoadCMDL(Mem);
|
|
||||||
else if (Type == "TXTR") pRes = CTextureDecoder::LoadTXTR(Mem);
|
|
||||||
else if (Type == "ANCS") pRes = CAnimSetLoader::LoadANCS(Mem);
|
|
||||||
else if (Type == "CHAR") pRes = CAnimSetLoader::LoadCHAR(Mem);
|
|
||||||
else if (Type == "MREA") pRes = CAreaLoader::LoadMREA(Mem);
|
|
||||||
else if (Type == "MLVL") pRes = CWorldLoader::LoadMLVL(Mem);
|
|
||||||
else if (Type == "STRG") pRes = CStringLoader::LoadSTRG(Mem);
|
|
||||||
else if (Type == "FONT") pRes = CFontLoader::LoadFONT(Mem);
|
|
||||||
else if (Type == "SCAN") pRes = CScanLoader::LoadSCAN(Mem);
|
|
||||||
else if (Type == "DCLN") pRes = CCollisionLoader::LoadDCLN(Mem);
|
|
||||||
else if (Type == "EGMC") pRes = CPoiToWorldLoader::LoadEGMC(Mem);
|
|
||||||
else if (Type == "CINF") pRes = CSkeletonLoader::LoadCINF(Mem);
|
|
||||||
else if (Type == "ANIM") pRes = CAnimationLoader::LoadANIM(Mem);
|
|
||||||
else if (Type == "CSKR") pRes = CSkinLoader::LoadCSKR(Mem);
|
|
||||||
else SupportedFormat = false;
|
|
||||||
|
|
||||||
// Log errors
|
|
||||||
if (!SupportedFormat)
|
|
||||||
Log::Write("Unsupported format; unable to load " + Type.ToString() + " " + ResID.ToString());
|
|
||||||
|
|
||||||
if (!pRes) pRes = new CResource(); // Default for invalid resource or unsupported format
|
|
||||||
|
|
||||||
// Add to cache and cleanup
|
|
||||||
pRes->mID = ResID;
|
|
||||||
pRes->mResSource = Source;
|
|
||||||
mResourceCache[ResID.ToLongLong()] = pRes;
|
|
||||||
delete pBuffer;
|
|
||||||
return pRes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CResource* CResCache::GetResource(const TString& rkResPath)
|
CResource* CResCache::GetResource(const TString& rkResPath)
|
||||||
{
|
{
|
||||||
// Since this function takes a string argument it always loads directly from a file - no pak
|
|
||||||
CUniqueID ResID = rkResPath.Hash64();
|
CUniqueID ResID = rkResPath.Hash64();
|
||||||
|
|
||||||
|
// Check if resource already exists
|
||||||
auto Got = mResourceCache.find(ResID.ToLongLong());
|
auto Got = mResourceCache.find(ResID.ToLongLong());
|
||||||
|
|
||||||
if (Got != mResourceCache.end())
|
if (Got != mResourceCache.end())
|
||||||
return Got->second;
|
return Got->second;
|
||||||
|
|
||||||
|
// Open file
|
||||||
CFileInStream File(rkResPath.ToStdString(), IOUtil::eBigEndian);
|
CFileInStream File(rkResPath.ToStdString(), IOUtil::eBigEndian);
|
||||||
if (!File.IsValid())
|
if (!File.IsValid())
|
||||||
{
|
{
|
||||||
@ -188,10 +93,9 @@ CResource* CResCache::GetResource(const TString& rkResPath)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save old ResSource to restore later
|
// Save old ResDir to restore later
|
||||||
const SResSource OldSource = mResSource;
|
TString OldResDir = mResDir;
|
||||||
mResSource.Source = SResSource::eFolder;
|
mResDir = rkResPath.GetFileDirectory();
|
||||||
mResSource.Path = rkResPath.GetFileDirectory();
|
|
||||||
|
|
||||||
// Load resource
|
// Load resource
|
||||||
CResource *pRes = nullptr;
|
CResource *pRes = nullptr;
|
||||||
@ -220,7 +124,7 @@ CResource* CResCache::GetResource(const TString& rkResPath)
|
|||||||
pRes->mID = *rkResPath;
|
pRes->mID = *rkResPath;
|
||||||
pRes->mResSource = rkResPath;
|
pRes->mResSource = rkResPath;
|
||||||
mResourceCache[ResID.ToLongLong()] = pRes;
|
mResourceCache[ResID.ToLongLong()] = pRes;
|
||||||
mResSource = OldSource;
|
mResDir = OldResDir;
|
||||||
return pRes;
|
return pRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,30 +134,15 @@ CFourCC CResCache::FindResourceType(CUniqueID ResID, const TStringList& rkPossib
|
|||||||
if (rkPossibleTypes.size() == 1)
|
if (rkPossibleTypes.size() == 1)
|
||||||
return CFourCC(rkPossibleTypes.front());
|
return CFourCC(rkPossibleTypes.front());
|
||||||
|
|
||||||
// Determine extension from pak
|
|
||||||
if (mResSource.Source == SResSource::ePakFile)
|
|
||||||
{
|
|
||||||
for (auto it = rkPossibleTypes.begin(); it != rkPossibleTypes.end(); it++)
|
|
||||||
{
|
|
||||||
SResInfo ResInfo = mpPak->ResourceInfo(ResID.ToLongLong(), CFourCC(*it));
|
|
||||||
|
|
||||||
if (ResInfo.Type != "NULL")
|
|
||||||
return CFourCC(*it);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determine extension from filesystem - try every extension until we find one that works
|
// Determine extension from filesystem - try every extension until we find one that works
|
||||||
else
|
TString PathBase = mResDir + ResID.ToString() + ".";
|
||||||
|
|
||||||
|
for (auto it = rkPossibleTypes.begin(); it != rkPossibleTypes.end(); it++)
|
||||||
{
|
{
|
||||||
TString PathBase = mResSource.Path + ResID.ToString() + ".";
|
TString NewPath = PathBase + *it;
|
||||||
|
|
||||||
for (auto it = rkPossibleTypes.begin(); it != rkPossibleTypes.end(); it++)
|
if (FileUtil::Exists(NewPath))
|
||||||
{
|
return CFourCC(*it);
|
||||||
TString NewPath = PathBase + *it;
|
|
||||||
|
|
||||||
if (boost::filesystem::exists(NewPath.ToStdString()))
|
|
||||||
return CFourCC(*it);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "UNKN";
|
return "UNKN";
|
||||||
|
@ -1,34 +1,21 @@
|
|||||||
#ifndef CRESCACHE_H
|
#ifndef CRESCACHE_H
|
||||||
#define CRESCACHE_H
|
#define CRESCACHE_H
|
||||||
|
|
||||||
#include "CPakFile.h"
|
|
||||||
#include "CResource.h"
|
#include "CResource.h"
|
||||||
#include <Common/types.h>
|
#include <Common/types.h>
|
||||||
#include <Common/TString.h>
|
#include <Common/TString.h>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
struct SResSource
|
|
||||||
{
|
|
||||||
TString Path;
|
|
||||||
enum {
|
|
||||||
eFolder, ePakFile
|
|
||||||
} Source;
|
|
||||||
};
|
|
||||||
|
|
||||||
class CResCache
|
class CResCache
|
||||||
{
|
{
|
||||||
std::unordered_map<u64, CResource*> mResourceCache;
|
std::unordered_map<u64, CResource*> mResourceCache;
|
||||||
CPakFile *mpPak;
|
TString mResDir;
|
||||||
SResSource mResSource;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CResCache();
|
CResCache();
|
||||||
~CResCache();
|
~CResCache();
|
||||||
void Clean();
|
void Clean();
|
||||||
void SetFolder(TString Path);
|
void SetFolder(TString Path);
|
||||||
void SetPak(const TString& rkPath);
|
|
||||||
void SetResSource(SResSource& rResSource);
|
|
||||||
SResSource GetResSource();
|
|
||||||
TString GetSourcePath();
|
TString GetSourcePath();
|
||||||
CResource* GetResource(CUniqueID ResID, CFourCC Type);
|
CResource* GetResource(CUniqueID ResID, CFourCC Type);
|
||||||
CResource* GetResource(const TString& rkResPath);
|
CResource* GetResource(const TString& rkResPath);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "CResCache.h"
|
#include "CResCache.h"
|
||||||
#include <Common/CUniqueID.h>
|
#include <Common/CUniqueID.h>
|
||||||
#include <Common/CFourCC.h>
|
#include <Common/CFourCC.h>
|
||||||
#include <boost/filesystem.hpp>
|
#include <Common/FileUtil.h>
|
||||||
|
|
||||||
class CResourceInfo
|
class CResourceInfo
|
||||||
{
|
{
|
||||||
@ -20,7 +20,7 @@ public:
|
|||||||
CResourceInfo(const TString& rkPath)
|
CResourceInfo(const TString& rkPath)
|
||||||
: mPath(rkPath), mIsPath(true)
|
: mPath(rkPath), mIsPath(true)
|
||||||
{
|
{
|
||||||
mIsValidPath = boost::filesystem::exists(rkPath.ToStdString());
|
mIsValidPath = FileUtil::Exists(rkPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
CResourceInfo(const CUniqueID& rkID, CFourCC Type)
|
CResourceInfo(const CUniqueID& rkID, CFourCC Type)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "Core/Render/CBoneTransformData.h"
|
#include "Core/Render/CBoneTransformData.h"
|
||||||
#include "Core/Render/CDrawUtil.h"
|
#include "Core/Render/CDrawUtil.h"
|
||||||
#include "Core/Render/CGraphics.h"
|
#include "Core/Render/CGraphics.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
#include <Math/MathUtil.h>
|
#include <Math/MathUtil.h>
|
||||||
|
|
||||||
// ************ CBone ************
|
// ************ CBone ************
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "CTemplateWriter.h"
|
#include "CTemplateWriter.h"
|
||||||
#include "CAreaCooker.h"
|
#include "CAreaCooker.h"
|
||||||
|
#include <Common/FileUtil.h>
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
|
||||||
#include <tinyxml2.h>
|
#include <tinyxml2.h>
|
||||||
|
|
||||||
using namespace tinyxml2;
|
using namespace tinyxml2;
|
||||||
@ -42,7 +42,7 @@ void CTemplateWriter::SaveAllTemplates()
|
|||||||
{
|
{
|
||||||
// Create directory
|
// Create directory
|
||||||
std::list<CMasterTemplate*> MasterList = CMasterTemplate::MasterList();
|
std::list<CMasterTemplate*> MasterList = CMasterTemplate::MasterList();
|
||||||
boost::filesystem::create_directory(smTemplatesDir.ToStdString());
|
FileUtil::CreateDirectory(smTemplatesDir);
|
||||||
|
|
||||||
// Resave property list
|
// Resave property list
|
||||||
SavePropertyList();
|
SavePropertyList();
|
||||||
@ -95,7 +95,7 @@ void CTemplateWriter::SaveGameTemplates(CMasterTemplate *pMaster)
|
|||||||
// Create directory
|
// Create directory
|
||||||
TString OutFile = smTemplatesDir + pMaster->mSourceFile;
|
TString OutFile = smTemplatesDir + pMaster->mSourceFile;
|
||||||
TString OutDir = OutFile.GetFileDirectory();
|
TString OutDir = OutFile.GetFileDirectory();
|
||||||
boost::filesystem::create_directory(OutDir.ToStdString());
|
FileUtil::CreateDirectory(OutDir);
|
||||||
|
|
||||||
// Resave script templates
|
// Resave script templates
|
||||||
for (auto it = pMaster->mTemplates.begin(); it != pMaster->mTemplates.end(); it++)
|
for (auto it = pMaster->mTemplates.begin(); it != pMaster->mTemplates.end(); it++)
|
||||||
@ -226,7 +226,7 @@ void CTemplateWriter::SaveScriptTemplate(CScriptTemplate *pTemp)
|
|||||||
// Create directory
|
// Create directory
|
||||||
TString OutFile = smTemplatesDir + pMaster->GetDirectory() + pTemp->mSourceFile;
|
TString OutFile = smTemplatesDir + pMaster->GetDirectory() + pTemp->mSourceFile;
|
||||||
TString OutDir = OutFile.GetFileDirectory();
|
TString OutDir = OutFile.GetFileDirectory();
|
||||||
boost::filesystem::create_directory(*OutDir);
|
FileUtil::CreateDirectory(*OutDir);
|
||||||
|
|
||||||
// Create new document
|
// Create new document
|
||||||
XMLDocument ScriptXML;
|
XMLDocument ScriptXML;
|
||||||
@ -418,7 +418,7 @@ void CTemplateWriter::SaveStructTemplate(CStructTemplate *pTemp)
|
|||||||
TString OutFile = smTemplatesDir + pMaster->GetDirectory() + pTemp->mSourceFile;
|
TString OutFile = smTemplatesDir + pMaster->GetDirectory() + pTemp->mSourceFile;
|
||||||
TString OutDir = OutFile.GetFileDirectory();
|
TString OutDir = OutFile.GetFileDirectory();
|
||||||
TString Name = OutFile.GetFileName(false);
|
TString Name = OutFile.GetFileName(false);
|
||||||
boost::filesystem::create_directory(OutDir.ToStdString());
|
FileUtil::CreateDirectory(OutDir);
|
||||||
|
|
||||||
// Create new document and write struct properties to it
|
// Create new document and write struct properties to it
|
||||||
XMLDocument StructXML;
|
XMLDocument StructXML;
|
||||||
@ -442,7 +442,7 @@ void CTemplateWriter::SaveEnumTemplate(CEnumTemplate *pTemp)
|
|||||||
TString OutFile = smTemplatesDir + pMaster->GetDirectory() + pTemp->mSourceFile;
|
TString OutFile = smTemplatesDir + pMaster->GetDirectory() + pTemp->mSourceFile;
|
||||||
TString OutDir = OutFile.GetFileDirectory();
|
TString OutDir = OutFile.GetFileDirectory();
|
||||||
TString Name = OutFile.GetFileName(false);
|
TString Name = OutFile.GetFileName(false);
|
||||||
boost::filesystem::create_directory(*OutDir);
|
FileUtil::CreateDirectory(OutDir);
|
||||||
|
|
||||||
// Create new document and write enumerators to it
|
// Create new document and write enumerators to it
|
||||||
XMLDocument EnumXML;
|
XMLDocument EnumXML;
|
||||||
@ -465,7 +465,7 @@ void CTemplateWriter::SaveBitfieldTemplate(CBitfieldTemplate *pTemp)
|
|||||||
TString OutFile = smTemplatesDir + pMaster->GetDirectory() + pTemp->mSourceFile;
|
TString OutFile = smTemplatesDir + pMaster->GetDirectory() + pTemp->mSourceFile;
|
||||||
TString OutDir = OutFile.GetFileDirectory();
|
TString OutDir = OutFile.GetFileDirectory();
|
||||||
TString Name = pTemp->mSourceFile.GetFileName(false);
|
TString Name = pTemp->mSourceFile.GetFileName(false);
|
||||||
boost::filesystem::create_directory(*OutDir);
|
FileUtil::CreateDirectory(OutDir);
|
||||||
|
|
||||||
// Create new document and write enumerators to it
|
// Create new document and write enumerators to it
|
||||||
XMLDocument BitfieldXML;
|
XMLDocument BitfieldXML;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "CAnimationLoader.h"
|
#include "CAnimationLoader.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
#include <Common/Log.h>
|
#include <Common/Log.h>
|
||||||
#include <Math/MathUtil.h>
|
#include <Math/MathUtil.h>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "CSkeletonLoader.h"
|
#include "CSkeletonLoader.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
#include <Common/Log.h>
|
#include <Common/Log.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "CSkinLoader.h"
|
#include "CSkinLoader.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
|
|
||||||
// ************ STATIC ************
|
// ************ STATIC ************
|
||||||
CSkin* CSkinLoader::LoadCSKR(IInputStream& rCSKR)
|
CSkin* CSkinLoader::LoadCSKR(IInputStream& rCSKR)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#include "CTemplateLoader.h"
|
#include "CTemplateLoader.h"
|
||||||
#include "CAreaLoader.h"
|
#include "CAreaLoader.h"
|
||||||
#include "Core/Resource/Script/IPropertyTemplate.h"
|
#include "Core/Resource/Script/IPropertyTemplate.h"
|
||||||
|
#include <Common/FileUtil.h>
|
||||||
#include <Common/Log.h>
|
#include <Common/Log.h>
|
||||||
#include <boost/filesystem.hpp>
|
|
||||||
|
|
||||||
const TString CTemplateLoader::mskTemplatesDir = "../templates/";
|
const TString CTemplateLoader::mskTemplatesDir = "../templates/";
|
||||||
const TString CTemplateLoader::mskGameListPath = CTemplateLoader::mskTemplatesDir + "GameList.xml";
|
const TString CTemplateLoader::mskGameListPath = CTemplateLoader::mskTemplatesDir + "GameList.xml";
|
||||||
@ -533,7 +533,7 @@ CScriptTemplate* CTemplateLoader::LoadScriptTemplate(XMLDocument *pDoc, const TS
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
TString Path = "../resources/" + ID;
|
TString Path = "../resources/" + ID;
|
||||||
if (!boost::filesystem::exists(*Path))
|
if (!FileUtil::Exists(Path))
|
||||||
{
|
{
|
||||||
Log::Error(rkTemplateName + ": Invalid file for " + Type + " asset: " + ID);
|
Log::Error(rkTemplateName + ": Invalid file for " + Type + " asset: " + ID);
|
||||||
pAsset = pAsset->NextSiblingElement();
|
pAsset = pAsset->NextSiblingElement();
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "Core/Render/CDrawUtil.h"
|
#include "Core/Render/CDrawUtil.h"
|
||||||
#include "Core/Render/CRenderer.h"
|
#include "Core/Render/CRenderer.h"
|
||||||
#include "Core/OpenGL/GLCommon.h"
|
#include "Core/OpenGL/GLCommon.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
|
|
||||||
CModel::CModel()
|
CModel::CModel()
|
||||||
: CBasicModel()
|
: CBasicModel()
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "Core/Render/CDrawUtil.h"
|
#include "Core/Render/CDrawUtil.h"
|
||||||
#include "Core/Resource/CGameArea.h"
|
#include "Core/Resource/CGameArea.h"
|
||||||
#include "Core/Resource/CResCache.h"
|
#include "Core/Resource/CResCache.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
#include <Math/CTransform4f.h>
|
#include <Math/CTransform4f.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "CScriptNode.h"
|
#include "CScriptNode.h"
|
||||||
#include "Core/Render/CRenderer.h"
|
#include "Core/Render/CRenderer.h"
|
||||||
#include "Core/Resource/Script/IProperty.h"
|
#include "Core/Resource/Script/IProperty.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
|
|
||||||
CScriptAttachNode::CScriptAttachNode(CScene *pScene, const SAttachment& rkAttachment, CScriptNode *pParent)
|
CScriptAttachNode::CScriptAttachNode(CScene *pScene, const SAttachment& rkAttachment, CScriptNode *pParent)
|
||||||
: CSceneNode(pScene, -1, pParent)
|
: CSceneNode(pScene, -1, pParent)
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "Core/Resource/Script/CMasterTemplate.h"
|
#include "Core/Resource/Script/CMasterTemplate.h"
|
||||||
#include "Core/Resource/Script/CScriptLayer.h"
|
#include "Core/Resource/Script/CScriptLayer.h"
|
||||||
#include "Core/ScriptExtra/CScriptExtra.h"
|
#include "Core/ScriptExtra/CScriptExtra.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
#include <Math/MathUtil.h>
|
#include <Math/MathUtil.h>
|
||||||
|
|
||||||
CScriptNode::CScriptNode(CScene *pScene, u32 NodeID, CSceneNode *pParent, CScriptObject *pInstance)
|
CScriptNode::CScriptNode(CScene *pScene, u32 NodeID, CSceneNode *pParent, CScriptObject *pInstance)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "CDamageableTriggerExtra.h"
|
#include "CDamageableTriggerExtra.h"
|
||||||
#include "Core/Render/CDrawUtil.h"
|
#include "Core/Render/CDrawUtil.h"
|
||||||
#include "Core/Render/CRenderer.h"
|
#include "Core/Render/CRenderer.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
#include <Math/MathUtil.h>
|
#include <Math/MathUtil.h>
|
||||||
|
|
||||||
CDamageableTriggerExtra::CDamageableTriggerExtra(CScriptObject *pInstance, CScene *pScene, CScriptNode *pParent)
|
CDamageableTriggerExtra::CDamageableTriggerExtra(CScriptObject *pInstance, CScene *pScene, CScriptNode *pParent)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "Core/Scene/CSceneNode.h"
|
#include "Core/Scene/CSceneNode.h"
|
||||||
#include "Core/Scene/CScriptNode.h"
|
#include "Core/Scene/CScriptNode.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
|
|
||||||
/* CScriptExtra is a class that allows for additional coded behavior on any given
|
/* CScriptExtra is a class that allows for additional coded behavior on any given
|
||||||
* script object type. Subclass IScriptExtra, add the new class to CScriptExtra.cpp,
|
* script object type. Subclass IScriptExtra, add the new class to CScriptExtra.cpp,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "CCharacterEditor.h"
|
#include "CCharacterEditor.h"
|
||||||
#include "ui_CCharacterEditor.h"
|
#include "ui_CCharacterEditor.h"
|
||||||
#include "Editor/UICommon.h"
|
#include "Editor/UICommon.h"
|
||||||
#include <Common/Assert.h>
|
#include <Common/AssertMacro.h>
|
||||||
#include <Math/MathUtil.h>
|
#include <Math/MathUtil.h>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
@ -13,7 +13,7 @@ win32: RC_ICONS += icons/AppIcon.ico
|
|||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
DESTDIR = $$PWD/../../bin
|
DESTDIR = $$PWD/../../bin
|
||||||
UI_DIR = $$PWD/../../build/Editor
|
UI_DIR = $$BUILD_DIR/Editor
|
||||||
DEFINES += GLEW_STATIC
|
DEFINES += GLEW_STATIC
|
||||||
|
|
||||||
!PUBLIC_RELEASE {
|
!PUBLIC_RELEASE {
|
||||||
@ -22,68 +22,67 @@ DEFINES += GLEW_STATIC
|
|||||||
|
|
||||||
CONFIG(debug, debug|release) {
|
CONFIG(debug, debug|release) {
|
||||||
# Debug Config
|
# Debug Config
|
||||||
OBJECTS_DIR = $$PWD/../../build/Editor/debug
|
OBJECTS_DIR = $$BUILD_DIR/Editor/debug
|
||||||
MOC_DIR = $$PWD/../../build/Editor/debug
|
MOC_DIR = $$BUILD_DIR/Editor/debug
|
||||||
RCC_DIR = $$PWD/../../build/Editor/debug
|
RCC_DIR = $$BUILD_DIR/Editor/debug
|
||||||
TARGET = PrimeWorldEditor-debug
|
TARGET = PrimeWorldEditor-debug
|
||||||
|
|
||||||
# Debug Libs
|
# Debug Libs
|
||||||
LIBS += -L$$PWD/../../build/FileIO/ -lFileIOd \
|
LIBS += -L$$BUILD_DIR/FileIO/ -lFileIOd \
|
||||||
-L$$PWD/../../build/Common/ -lCommond \
|
-L$$BUILD_DIR/Common/ -lCommond \
|
||||||
-L$$PWD/../../build/Math/ -lMathd \
|
-L$$BUILD_DIR/Math/ -lMathd \
|
||||||
-L$$PWD/../../build/Core/ -lCored \
|
-L$$BUILD_DIR/Core/ -lCored \
|
||||||
-L$$PWD/../../externals/assimp/lib/ -lassimp-vc120-mtd \
|
-L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc120-mtd \
|
||||||
-L$$PWD/../../externals/boost_1_56_0/lib32-msvc-12.0 -llibboost_filesystem-vc120-mt-gd-1_56 \
|
-L$$EXTERNALS_DIR/boost_1_56_0/lib32-msvc-12.0 -llibboost_filesystem-vc120-mt-gd-1_56 \
|
||||||
-L$$PWD/../../externals/tinyxml2/lib/ -ltinyxml2d
|
-L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2d
|
||||||
|
|
||||||
# Debug Target Dependencies
|
# Debug Target Dependencies
|
||||||
win32 {
|
win32 {
|
||||||
PRE_TARGETDEPS += $$PWD/../../build/FileIO/FileIOd.lib \
|
PRE_TARGETDEPS += $$BUILD_DIR/FileIO/FileIOd.lib \
|
||||||
$$PWD/../../build/Common/Commond.lib \
|
$$BUILD_DIR/Common/Commond.lib \
|
||||||
$$PWD/../../build/Math/Mathd.lib \
|
$$BUILD_DIR/Math/Mathd.lib \
|
||||||
$$PWD/../../build/Core/Cored.lib
|
$$BUILD_DIR/Core/Cored.lib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG(release, debug|release) {
|
CONFIG(release, debug|release) {
|
||||||
# Release Config
|
# Release Config
|
||||||
OBJECTS_DIR = $$PWD/../../build/Editor/release
|
OBJECTS_DIR = $$BUILD_DIR/Editor/release
|
||||||
MOC_DIR = $$PWD/../../build/Editor/release
|
MOC_DIR = $$BUILD_DIR/Editor/release
|
||||||
RCC_DIR = $$PWD/../../build/Editor/release
|
RCC_DIR = $$BUILD_DIR/Editor/release
|
||||||
TARGET = PrimeWorldEditor
|
TARGET = PrimeWorldEditor
|
||||||
|
|
||||||
# Release Libs
|
# Release Libs
|
||||||
LIBS += -L$$PWD/../../build/FileIO/ -lFileIO \
|
LIBS += -L$$BUILD_DIR/FileIO/ -lFileIO \
|
||||||
-L$$PWD/../../build/Common/ -lCommon \
|
-L$$BUILD_DIR/Common/ -lCommon \
|
||||||
-L$$PWD/../../build/Math/ -lMath \
|
-L$$BUILD_DIR/Math/ -lMath \
|
||||||
-L$$PWD/../../build/Core/ -lCore \
|
-L$$BUILD_DIR/Core/ -lCore \
|
||||||
-L$$PWD/../../externals/assimp/lib/ -lassimp-vc120-mt \
|
-L$$EXTERNALS_DIR/assimp/lib/ -lassimp-vc120-mt \
|
||||||
-L$$PWD/../../externals/boost_1_56_0/lib32-msvc-12.0 -llibboost_filesystem-vc120-mt-1_56 \
|
-L$$EXTERNALS_DIR/boost_1_56_0/lib32-msvc-12.0 -llibboost_filesystem-vc120-mt-1_56 \
|
||||||
-L$$PWD/../../externals/tinyxml2/lib/ -ltinyxml2
|
-L$$EXTERNALS_DIR/tinyxml2/lib/ -ltinyxml2
|
||||||
|
|
||||||
# Release Target Dependencies
|
# Release Target Dependencies
|
||||||
win32 {
|
win32 {
|
||||||
PRE_TARGETDEPS += $$PWD/../../build/FileIO/FileIO.lib \
|
PRE_TARGETDEPS += $$BUILD_DIR/FileIO/FileIO.lib \
|
||||||
$$PWD/../../build/Common/Common.lib \
|
$$BUILD_DIR/Common/Common.lib \
|
||||||
$$PWD/../../build/Math/Math.lib \
|
$$BUILD_DIR/Math/Math.lib \
|
||||||
$$PWD/../../build/Core/Core.lib
|
$$BUILD_DIR/Core/Core.lib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Debug/Release Libs
|
# Debug/Release Libs
|
||||||
LIBS += -L$$PWD/../../externals/glew-1.9.0/lib/ -lglew32s \
|
LIBS += -L$$EXTERNALS_DIR/glew-1.9.0/lib/ -lglew32s \
|
||||||
-L$$PWD/../../externals/lzo-2.08/lib -llzo-2.08 \
|
-L$$EXTERNALS_DIR/lzo-2.08/lib -llzo-2.08 \
|
||||||
-L$$PWD/../../externals/zlib/lib -lzdll
|
-L$$EXTERNALS_DIR/zlib/lib -lzdll
|
||||||
|
|
||||||
# Include Paths
|
# Include Paths
|
||||||
INCLUDEPATH += $$PWD/../ \
|
INCLUDEPATH += $$PWE_MAIN_INCLUDE \
|
||||||
$$PWD/../../externals/assimp/include \
|
$$EXTERNALS_DIR/assimp/include \
|
||||||
$$PWD/../../externals/boost_1_56_0 \
|
$$EXTERNALS_DIR/glew-1.9.0/include \
|
||||||
$$PWD/../../externals/glew-1.9.0/include \
|
$$EXTERNALS_DIR/glm/glm \
|
||||||
$$PWD/../../externals/glm/glm \
|
$$EXTERNALS_DIR/lzo-2.08/include \
|
||||||
$$PWD/../../externals/lzo-2.08/include \
|
$$EXTERNALS_DIR/tinyxml2/include \
|
||||||
$$PWD/../../externals/tinyxml2/include \
|
$$EXTERNALS_DIR/zlib/include
|
||||||
$$PWD/../../externals/zlib/include
|
|
||||||
|
|
||||||
# Header Files
|
# Header Files
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
@ -164,7 +163,8 @@ HEADERS += \
|
|||||||
CharacterEditor/CCharacterEditorViewport.h \
|
CharacterEditor/CCharacterEditorViewport.h \
|
||||||
CGridRenderable.h \
|
CGridRenderable.h \
|
||||||
CharacterEditor/CSkeletonHierarchyModel.h \
|
CharacterEditor/CSkeletonHierarchyModel.h \
|
||||||
CLineRenderable.h
|
CLineRenderable.h \
|
||||||
|
CGameExporter.h
|
||||||
|
|
||||||
# Source Files
|
# Source Files
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
@ -224,7 +224,8 @@ SOURCES += \
|
|||||||
CAboutDialog.cpp \
|
CAboutDialog.cpp \
|
||||||
CharacterEditor/CCharacterEditor.cpp \
|
CharacterEditor/CCharacterEditor.cpp \
|
||||||
CharacterEditor/CCharacterEditorViewport.cpp \
|
CharacterEditor/CCharacterEditorViewport.cpp \
|
||||||
CharacterEditor/CSkeletonHierarchyModel.cpp
|
CharacterEditor/CSkeletonHierarchyModel.cpp \
|
||||||
|
CGameExporter.cpp
|
||||||
|
|
||||||
# UI Files
|
# UI Files
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
@ -10,7 +10,7 @@ DEFINES += PWE_FILEIO
|
|||||||
|
|
||||||
CONFIG += staticlib
|
CONFIG += staticlib
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
DESTDIR = $$PWD/../../build/FileIO
|
DESTDIR = $$BUILD_DIR/FileIO
|
||||||
|
|
||||||
unix {
|
unix {
|
||||||
target.path = /usr/lib
|
target.path = /usr/lib
|
||||||
@ -19,13 +19,13 @@ unix {
|
|||||||
|
|
||||||
CONFIG (debug, debug|release) {
|
CONFIG (debug, debug|release) {
|
||||||
# Debug Config
|
# Debug Config
|
||||||
OBJECTS_DIR = $$PWD/../../build/FileIO/debug
|
OBJECTS_DIR = $$BUILD_DIR/FileIO/debug
|
||||||
TARGET = FileIOd
|
TARGET = FileIOd
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG (release, debug|release) {
|
CONFIG (release, debug|release) {
|
||||||
# Release Config
|
# Release Config
|
||||||
OBJECTS_DIR = $$PWD/../../build/FileIO/release
|
OBJECTS_DIR = $$BUILD_DIR/FileIO/release
|
||||||
TARGET = FileIO
|
TARGET = FileIO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ DEFINES += PWE_MATH
|
|||||||
|
|
||||||
CONFIG += staticlib
|
CONFIG += staticlib
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
DESTDIR = $$PWD/../../build/Math
|
DESTDIR = $$BUILD_DIR/Math
|
||||||
|
|
||||||
unix {
|
unix {
|
||||||
target.path = /usr/lib
|
target.path = /usr/lib
|
||||||
@ -19,45 +19,45 @@ unix {
|
|||||||
|
|
||||||
CONFIG (debug, debug|release) {
|
CONFIG (debug, debug|release) {
|
||||||
# Debug Config
|
# Debug Config
|
||||||
OBJECTS_DIR = $$PWD/../../build/Math/debug
|
OBJECTS_DIR = $$BUILD_DIR/Math/debug
|
||||||
TARGET = Mathd
|
TARGET = Mathd
|
||||||
|
|
||||||
# Debug Libs
|
# Debug Libs
|
||||||
LIBS += -L$$PWD/../../build/FileIO/ -lFileIOd \
|
LIBS += -L$$BUILD_DIR/FileIO/ -lFileIOd \
|
||||||
-L$$PWD/../../build/Common/ -lCommond
|
-L$$BUILD_DIR/Common/ -lCommond
|
||||||
|
|
||||||
# Debug Target Dependencies
|
# Debug Target Dependencies
|
||||||
win32 {
|
win32 {
|
||||||
PRE_TARGETDEPS += $$PWD/../../build/FileIO/FileIOd.lib \
|
PRE_TARGETDEPS += $$BUILD_DIR/FileIO/FileIOd.lib \
|
||||||
$$PWD/../../build/Common/Commond.lib
|
$$BUILD_DIR/Common/Commond.lib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG (release, debug|release) {
|
CONFIG (release, debug|release) {
|
||||||
# Release Config
|
# Release Config
|
||||||
OBJECTS_DIR = $$PWD/../../build/Math/release
|
OBJECTS_DIR = $$BUILD_DIR/Math/release
|
||||||
TARGET = Math
|
TARGET = Math
|
||||||
|
|
||||||
# Release Libs
|
# Release Libs
|
||||||
LIBS += -L$$PWD/../../build/FileIO/ -lFileIO \
|
LIBS += -L$$BUILD_DIR/FileIO/ -lFileIO \
|
||||||
-L$$PWD/../../build/Common/ -lCommon
|
-L$$BUILD_DIR/Common/ -lCommon
|
||||||
|
|
||||||
# Release Target Dependencies
|
# Release Target Dependencies
|
||||||
win32 {
|
win32 {
|
||||||
PRE_TARGETDEPS += $$PWD/../../build/FileIO/FileIO.lib \
|
PRE_TARGETDEPS += $$BUILD_DIR/FileIO/FileIO.lib \
|
||||||
$$PWD/../../build/Common/Common.lib
|
$$BUILD_DIR/Common/Common.lib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Debug/Release Libs
|
# Debug/Release Libs
|
||||||
LIBS += -L$$PWD/../../externals/lzo-2.08/lib -llzo-2.08 \
|
LIBS += -L$$EXTERNALS_DIR/lzo-2.08/lib -llzo-2.08 \
|
||||||
-L$$PWD/../../externals/zlib/lib -lzdll
|
-L$$EXTERNALS_DIR/zlib/lib -lzdll
|
||||||
|
|
||||||
# Include Paths
|
# Include Paths
|
||||||
INCLUDEPATH += $$PWD/../ \
|
INCLUDEPATH += $$PWE_MAIN_INCLUDE \
|
||||||
$$PWD/../../externals/glm/glm \
|
$$EXTERNALS_DIR/glm/glm \
|
||||||
$$PWD/../../externals/lzo-2.08/include \
|
$$EXTERNALS_DIR/lzo-2.08/include \
|
||||||
$$PWD/../../externals/zlib/include
|
$$EXTERNALS_DIR/zlib/include
|
||||||
|
|
||||||
# Header Files
|
# Header Files
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user