diff options
Diffstat (limited to 'src/shared')
| -rw-r--r-- | src/shared/appconfig.inc | 1 | ||||
| -rw-r--r-- | src/shared/directoryentry.cpp | 24 | ||||
| -rw-r--r-- | src/shared/directoryentry.h | 13 | ||||
| -rw-r--r-- | src/shared/fallout3info.cpp | 21 | ||||
| -rw-r--r-- | src/shared/fallout3info.h | 6 | ||||
| -rw-r--r-- | src/shared/falloutnvinfo.cpp | 12 | ||||
| -rw-r--r-- | src/shared/falloutnvinfo.h | 5 | ||||
| -rw-r--r-- | src/shared/gameinfo.cpp | 41 | ||||
| -rw-r--r-- | src/shared/gameinfo.h | 11 | ||||
| -rw-r--r-- | src/shared/leaktrace.cpp | 39 | ||||
| -rw-r--r-- | src/shared/leaktrace.h | 4 | ||||
| -rw-r--r-- | src/shared/oblivioninfo.cpp | 12 | ||||
| -rw-r--r-- | src/shared/oblivioninfo.h | 5 | ||||
| -rw-r--r-- | src/shared/shared.pro | 10 | ||||
| -rw-r--r-- | src/shared/shared.qbs | 20 | ||||
| -rw-r--r-- | src/shared/skyriminfo.cpp | 17 | ||||
| -rw-r--r-- | src/shared/skyriminfo.h | 7 | ||||
| -rw-r--r-- | src/shared/util.cpp | 3 |
18 files changed, 186 insertions, 65 deletions
diff --git a/src/shared/appconfig.inc b/src/shared/appconfig.inc index 7710925a..080d3655 100644 --- a/src/shared/appconfig.inc +++ b/src/shared/appconfig.inc @@ -1,6 +1,7 @@ APPPARAM(std::wstring, translationPrefix, L"organizer")
APPPARAM(std::wstring, pluginPath, L"plugins")
APPPARAM(std::wstring, stylesheetsPath, L"stylesheets")
+APPPARAM(std::wstring, profileTweakIni, L"profile_tweaks.ini")
APPPARAM(std::wstring, logFile, L"ModOrganizer.log")
APPPARAM(std::wstring, proxyDLLTarget, L"steam_api.dll")
APPPARAM(std::wstring, proxyDLLOrig, L"steam_api_orig.dll") // needs to be identical to the value used in proxydll-project
diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index bd33fef6..a232ea19 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -492,6 +492,12 @@ static bool SupportOptimizedFind() }
+static bool DirCompareByName(const DirectoryEntry *lhs, const DirectoryEntry *rhs)
+{
+ return _wcsicmp(lhs->getName().c_str(), rhs->getName().c_str()) < 0;
+}
+
+
void DirectoryEntry::addFiles(FilesOrigin &origin, wchar_t *buffer, int bufferOffset)
{
WIN32_FIND_DATAW findData;
@@ -523,6 +529,7 @@ void DirectoryEntry::addFiles(FilesOrigin &origin, wchar_t *buffer, int bufferOf result = ::FindNextFileW(searchHandle, &findData);
}
}
+ std::sort(m_SubDirectories.begin(), m_SubDirectories.end(), &DirCompareByName);
::FindClose(searchHandle);
}
@@ -568,8 +575,9 @@ void DirectoryEntry::removeDirRecursive() for (auto iter = m_SubDirectories.begin(); iter != m_SubDirectories.end(); ++iter) {
(*iter)->removeDirRecursive();
+ delete *iter;
}
- m_SubDirectories.clear();
+ m_SubDirectories.clear();
}
void DirectoryEntry::removeDir(const std::wstring &path)
@@ -578,8 +586,10 @@ void DirectoryEntry::removeDir(const std::wstring &path) if (pos == std::string::npos) {
for (auto iter = m_SubDirectories.begin(); iter != m_SubDirectories.end(); ++iter) {
if (_wcsicmp((*iter)->getName().c_str(), path.c_str()) == 0) {
- (*iter)->removeDirRecursive();
+ DirectoryEntry *entry = *iter;
+ entry->removeDirRecursive();
m_SubDirectories.erase(iter);
+ delete entry;
break;
}
}
@@ -743,7 +753,13 @@ DirectoryEntry *DirectoryEntry::findSubDirectory(const std::wstring &name) const }
-const FileEntry::Ptr DirectoryEntry::findFile(const std::wstring &name)
+DirectoryEntry *DirectoryEntry::findSubDirectoryRecursive(const std::wstring &path)
+{
+ return getSubDirectoryRecursive(path, false, -1);
+}
+
+
+const FileEntry::Ptr DirectoryEntry::findFile(const std::wstring &name) const
{
auto iter = m_Files.find(name);
if (iter != m_Files.end()) {
@@ -824,7 +840,7 @@ FileEntry::Ptr FileRegister::createFile(const std::wstring &name, DirectoryEntry }
-FileEntry::Ptr FileRegister::getFile(FileEntry::Index index)
+FileEntry::Ptr FileRegister::getFile(FileEntry::Index index) const
{
auto iter = m_Files.find(index);
if (iter != m_Files.end()) {
diff --git a/src/shared/directoryentry.h b/src/shared/directoryentry.h index 498ebfe1..15af5e9e 100644 --- a/src/shared/directoryentry.h +++ b/src/shared/directoryentry.h @@ -71,6 +71,7 @@ public: const std::vector<int> &getAlternatives() const { return m_Alternatives; }
const std::wstring &getName() const { return m_Name; }
+ int getOrigin() const { return m_Origin; }
int getOrigin(bool &archive) const { archive = (m_Archive.length() != 0); return m_Origin; }
const std::wstring &getArchive() const { return m_Archive; }
bool isFromArchive() const { return m_Archive.length() != 0; }
@@ -168,7 +169,7 @@ public: bool indexValid(FileEntry::Index index) const;
FileEntry::Ptr createFile(const std::wstring &name, DirectoryEntry *parent);
- FileEntry::Ptr getFile(FileEntry::Index index);
+ FileEntry::Ptr getFile(FileEntry::Index index) const;
void removeFile(FileEntry::Index index);
void removeOrigin(FileEntry::Index index, int originID);
@@ -204,6 +205,8 @@ public: void clear();
bool isPopulated() const { return m_Populated; }
+ bool isEmpty() const { return (m_Files.size() == 0) && (m_SubDirectories.size() == 0); }
+
const DirectoryEntry *getParent() const { return m_Parent; }
// add files to this directory (and subdirectories) from the specified origin. That origin may exist or not
@@ -227,16 +230,16 @@ public: }
DirectoryEntry *findSubDirectory(const std::wstring &name) const;
+ DirectoryEntry *findSubDirectoryRecursive(const std::wstring &path);
/** retrieve a file in this directory by name.
* @param name name of the file
* @return fileentry object for the file or NULL if no file matches
*/
- const FileEntry::Ptr findFile(const std::wstring &name);
+ const FileEntry::Ptr findFile(const std::wstring &name) const;
- /** search through this directory and all subdirectories for a file by the specified name.
- if directory is not NULL, the referenced variable will be set to true if the path refers to a directory.
- the returned pointer is NULL in that case */
+ /** search through this directory and all subdirectories for a file by the specified name (relative path).
+ if directory is not NULL, the referenced variable will be set to the path containing the file */
const FileEntry::Ptr searchFile(const std::wstring &path, const DirectoryEntry **directory) const;
void insertFile(const std::wstring &filePath, FilesOrigin &origin, FILETIME fileTime);
diff --git a/src/shared/fallout3info.cpp b/src/shared/fallout3info.cpp index 79dd90c9..1808d1d9 100644 --- a/src/shared/fallout3info.cpp +++ b/src/shared/fallout3info.cpp @@ -133,10 +133,17 @@ std::wstring Fallout3Info::getOMODExt() return L"fomod";
}
+std::vector<std::wstring> Fallout3Info::getSteamVariants() const
+{
+ return boost::assign::list_of(L"Regular")(L"Game Of The Year");
+}
-std::wstring Fallout3Info::getSteamAPPId()
+std::wstring Fallout3Info::getSteamAPPId(int variant) const
{
- return L"22300";
+ switch (variant) {
+ case 1: return L"22370";
+ default: return L"22300";
+ }
}
@@ -146,15 +153,19 @@ std::wstring Fallout3Info::getSEName() }
-std::wstring Fallout3Info::getNexusPage()
+std::wstring Fallout3Info::getNexusPage(bool nmmScheme)
{
- return L"http://fallout3.nexusmods.com";
+ if (nmmScheme) {
+ return L"http://nmm.nexusmods.com/fallout3";
+ } else {
+ return L"http://www.nexusmods.com/fallout3";
+ }
}
std::wstring Fallout3Info::getNexusInfoUrlStatic()
{
- return L"http://fallout3.nexusmods.com";
+ return L"http://nmm.nexusmods.com/fallout3";
}
diff --git a/src/shared/fallout3info.h b/src/shared/fallout3info.h index 95a76471..9575103b 100644 --- a/src/shared/fallout3info.h +++ b/src/shared/fallout3info.h @@ -66,15 +66,17 @@ public: virtual std::wstring getReferenceDataFile();
virtual std::wstring getOMODExt();
- virtual std::wstring getSteamAPPId();
+ virtual std::vector<std::wstring> getSteamVariants() const;
+ virtual std::wstring getSteamAPPId(int variant = 0) const;
virtual std::wstring getSEName();
- virtual std::wstring getNexusPage();
+ virtual std::wstring getNexusPage(bool nmmScheme = true);
static std::wstring getNexusInfoUrlStatic();
virtual std::wstring getNexusInfoUrl() { return Fallout3Info::getNexusInfoUrlStatic(); }
static int getNexusModIDStatic();
virtual int getNexusModID() { return Fallout3Info::getNexusModIDStatic(); }
+ virtual int getNexusGameID() { return 120; }
virtual void createProfile(const std::wstring &directory, bool useDefaults);
virtual void repairProfile(const std::wstring &directory);
diff --git a/src/shared/falloutnvinfo.cpp b/src/shared/falloutnvinfo.cpp index 6da454ee..e7e747e2 100644 --- a/src/shared/falloutnvinfo.cpp +++ b/src/shared/falloutnvinfo.cpp @@ -136,7 +136,7 @@ std::wstring FalloutNVInfo::getOMODExt() }
-std::wstring FalloutNVInfo::getSteamAPPId()
+std::wstring FalloutNVInfo::getSteamAPPId(int) const
{
return L"22380";
}
@@ -207,15 +207,19 @@ std::wstring FalloutNVInfo::getSEName() }
-std::wstring FalloutNVInfo::getNexusPage()
+std::wstring FalloutNVInfo::getNexusPage(bool nmmScheme)
{
- return L"http://newvegas.nexusmods.com";
+ if (nmmScheme) {
+ return L"http://nmm.nexusmods.com/newvegas";
+ } else {
+ return L"http://www.nexusmods.com/newvegas";
+ }
}
std::wstring FalloutNVInfo::getNexusInfoUrlStatic()
{
- return L"http://newvegas.nexusmods.com";
+ return L"http://nmm.nexusmods.com/newvegas";
}
diff --git a/src/shared/falloutnvinfo.h b/src/shared/falloutnvinfo.h index 2f6cba7b..8767fdb0 100644 --- a/src/shared/falloutnvinfo.h +++ b/src/shared/falloutnvinfo.h @@ -68,15 +68,16 @@ public: virtual std::wstring getReferenceDataFile();
virtual std::wstring getOMODExt();
- virtual std::wstring getSteamAPPId();
+ virtual std::wstring getSteamAPPId(int variant = 0) const;
virtual std::wstring getSEName();
- virtual std::wstring getNexusPage();
+ virtual std::wstring getNexusPage(bool nmmScheme = true);
static std::wstring getNexusInfoUrlStatic();
virtual std::wstring getNexusInfoUrl() { return FalloutNVInfo::getNexusInfoUrlStatic(); }
static int getNexusModIDStatic();
virtual int getNexusModID() { return FalloutNVInfo::getNexusModIDStatic(); }
+ virtual int getNexusGameID() { return 130; }
virtual void createProfile(const std::wstring &directory, bool useDefaults);
virtual void repairProfile(const std::wstring &directory);
diff --git a/src/shared/gameinfo.cpp b/src/shared/gameinfo.cpp index fd5072bf..b580a226 100644 --- a/src/shared/gameinfo.cpp +++ b/src/shared/gameinfo.cpp @@ -30,6 +30,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include <shlobj.h>
#include <sstream>
#include <cassert>
+#include <boost/assign.hpp>
namespace MOShared {
@@ -40,6 +41,13 @@ GameInfo* GameInfo::s_Instance = NULL; GameInfo::GameInfo(const std::wstring &omoDirectory, const std::wstring &gameDirectory)
: m_GameDirectory(gameDirectory), m_OrganizerDirectory(omoDirectory)
{
+ atexit(&cleanup);
+}
+
+
+void GameInfo::cleanup() {
+ delete GameInfo::s_Instance;
+ GameInfo::s_Instance = NULL;
}
@@ -62,36 +70,36 @@ void GameInfo::identifyMyGamesDirectory(const std::wstring &file) }
-bool GameInfo::identifyGame(const std::wstring &omoDirectory, const std::wstring &searchPath)
+bool GameInfo::identifyGame(const std::wstring &moDirectory, const std::wstring &searchPath)
{
if (OblivionInfo::identifyGame(searchPath)) {
- s_Instance = new OblivionInfo(omoDirectory, searchPath);
+ s_Instance = new OblivionInfo(moDirectory, searchPath);
} else if (Fallout3Info::identifyGame(searchPath)) {
- s_Instance = new Fallout3Info(omoDirectory, searchPath);
+ s_Instance = new Fallout3Info(moDirectory, searchPath);
} else if (FalloutNVInfo::identifyGame(searchPath)) {
- s_Instance = new FalloutNVInfo(omoDirectory, searchPath);
+ s_Instance = new FalloutNVInfo(moDirectory, searchPath);
} else if (SkyrimInfo::identifyGame(searchPath)) {
- s_Instance = new SkyrimInfo(omoDirectory, searchPath);
+ s_Instance = new SkyrimInfo(moDirectory, searchPath);
}
return s_Instance != NULL;
}
-bool GameInfo::init(const std::wstring &omoDirectory, const std::wstring &gamePath)
+bool GameInfo::init(const std::wstring &moDirectory, const std::wstring &gamePath)
{
if (s_Instance == NULL) {
if (gamePath.length() == 0) {
// search upward in the directory until a recognized game-binary is found
- std::wstring searchPath(omoDirectory);
- while (!identifyGame(omoDirectory, searchPath)) {
+ std::wstring searchPath(moDirectory);
+ while (!identifyGame(moDirectory, searchPath)) {
size_t lastSep = searchPath.find_last_of(L"/\\");
if (lastSep == std::string::npos) {
return false;
}
searchPath.erase(lastSep);
}
- } else if (!identifyGame(omoDirectory, gamePath)) {
+ } else if (!identifyGame(moDirectory, gamePath)) {
return false;
}
}
@@ -164,6 +172,14 @@ std::wstring GameInfo::getLogDir() const }
+std::wstring GameInfo::getLootDir() const
+{
+ std::wostringstream temp;
+ temp << m_OrganizerDirectory << "\\loot";
+ return temp.str();
+}
+
+
std::wstring GameInfo::getTutorialDir() const
{
std::wostringstream temp;
@@ -177,6 +193,11 @@ bool GameInfo::requiresSteam() const return FileExists(getGameDirectory().append(L"\\steam_api.dll"));
}
+std::vector<std::wstring> GameInfo::getSteamVariants() const
+{
+ return boost::assign::list_of(L"Regular");
+}
+
std::wstring GameInfo::getLocalAppFolder() const
{
@@ -204,4 +225,4 @@ std::wstring GameInfo::getSpecialPath(LPCWSTR name) const return temp;
}
-} // namespace MOShared +} // namespace MOShared
diff --git a/src/shared/gameinfo.h b/src/shared/gameinfo.h index 3e022ef4..89c9402d 100644 --- a/src/shared/gameinfo.h +++ b/src/shared/gameinfo.h @@ -113,6 +113,7 @@ public: virtual std::wstring getCacheDir() const;
virtual std::wstring getOverwriteDir() const;
virtual std::wstring getLogDir() const;
+ virtual std::wstring getLootDir() const;
virtual std::wstring getTutorialDir() const;
virtual bool requiresBSAInvalidation() const { return true; }
@@ -137,13 +138,15 @@ public: virtual std::wstring getOMODExt() = 0;
- virtual std::wstring getSteamAPPId() = 0;
+ virtual std::vector<std::wstring> getSteamVariants() const;
+ virtual std::wstring getSteamAPPId(int variant = 0) const = 0;
virtual std::wstring getSEName() = 0;
- virtual std::wstring getNexusPage() = 0;
+ virtual std::wstring getNexusPage(bool nmmScheme = true) = 0;
virtual std::wstring getNexusInfoUrl() = 0;
virtual int getNexusModID() = 0;
+ virtual int getNexusGameID() = 0;
// clone relevant files to the specified directory
virtual void createProfile(const std::wstring &directory, bool useDefaults) = 0;
@@ -176,9 +179,11 @@ private: static bool identifyGame(const std::wstring &omoDirectory, const std::wstring &searchPath);
std::wstring getSpecialPath(LPCWSTR name) const;
+ static void cleanup();
+
private:
- static GameInfo* s_Instance;
+ static GameInfo *s_Instance;
std::wstring m_MyGamesDirectory;
diff --git a/src/shared/leaktrace.cpp b/src/shared/leaktrace.cpp index 0c618b68..68e57609 100644 --- a/src/shared/leaktrace.cpp +++ b/src/shared/leaktrace.cpp @@ -3,7 +3,9 @@ #include <DbgHelp.h>
#include <set>
#include <map>
+#include <vector>
#include <sstream>
+#include <algorithm>
static const int FRAMES_TO_SKIP = 3; // StackData::StackData(), __TraceData::regTrace(), TraceAlloc()
@@ -32,8 +34,18 @@ class StackData { friend bool operator==(const StackData &LHS, const StackData &RHS);
friend bool operator<(const StackData &LHS, const StackData &RHS);
public:
- StackData() {
+
+ StackData()
+ : m_FunctionName("Dummy"), m_CodeLine(0)
+ {}
+ StackData(const char *functionName, int line) {
m_Count = ::CaptureStackBackTrace(FRAMES_TO_SKIP, FRAMES_TO_CAPTURE, m_Stack, &m_Hash);
+ m_FunctionName = functionName;
+ m_CodeLine = line;
+ if (m_Count == 0) {
+ // TODO in this case the hash doesn't seem to be set. This is of course not a good solution
+ m_Hash = reinterpret_cast<unsigned long>(m_FunctionName) + m_CodeLine;
+ }
}
std::string toString() const {
initDbgIfNecessary();
@@ -45,6 +57,8 @@ public: std::ostringstream stackStream;
+ stackStream << m_FunctionName << " [" << m_CodeLine << "]\n";
+
for(unsigned int i = 0; i < m_Count; ++i) {
DWORD64 displacement = 0;
if (!::SymFromAddr(::GetCurrentProcess(), (DWORD64)m_Stack[i], &displacement, symbol)) {
@@ -59,6 +73,8 @@ private: LPVOID m_Stack[FRAMES_TO_CAPTURE];
USHORT m_Count;
ULONG m_Hash;
+ const char *m_FunctionName;
+ int m_CodeLine;
};
bool operator==(const StackData &LHS, const StackData &RHS) {
@@ -70,10 +86,9 @@ bool operator<(const StackData &LHS, const StackData &RHS) { }
-
static struct __TraceData {
- void regTrace(void *pointer) {
- m_Traces[reinterpret_cast<unsigned long>(pointer)] = StackData();
+ void regTrace(void *pointer, const char *functionName, int line) {
+ m_Traces[reinterpret_cast<unsigned long>(pointer)] = StackData(functionName, line);
}
void deregTrace(void *pointer) {
auto iter = m_Traces.find(reinterpret_cast<unsigned long>(pointer));
@@ -83,24 +98,30 @@ static struct __TraceData { }
~__TraceData() {
- std::map<StackData, int> result;
+ std::map<StackData, std::vector<unsigned long> > result;
for (auto iter = m_Traces.begin(); iter != m_Traces.end(); ++iter) {
- result[iter->second] += 1;
+ result[iter->second].push_back(iter->first);
}
for (auto iter = result.begin(); iter != result.end(); ++iter) {
printf("-----------------------------------\n"
"%d objects not freed, allocated at:\n%s",
- iter->second, iter->first.toString().c_str());
+ iter->second.size(), iter->first.toString().c_str());
+ printf("Addresses: ");
+ for (int i = 0; i < (std::min<int>)(5, iter->second.size()); ++i) {
+ printf("%p, ", iter->second[i]);
+ }
+ printf("\n");
}
}
std::map<unsigned long, StackData> m_Traces;
+
} __trace;
-void LeakTrace::TraceAlloc(void *ptr)
+void LeakTrace::TraceAlloc(void *ptr, const char *functionName, int line)
{
- __trace.regTrace(ptr);
+ __trace.regTrace(ptr, functionName, line);
}
void LeakTrace::TraceDealloc(void *ptr)
diff --git a/src/shared/leaktrace.h b/src/shared/leaktrace.h index 78764260..4985925e 100644 --- a/src/shared/leaktrace.h +++ b/src/shared/leaktrace.h @@ -4,14 +4,14 @@ namespace LeakTrace {
-void TraceAlloc(void *ptr);
+void TraceAlloc(void *ptr, const char *functionName, int line);
void TraceDealloc(void *ptr);
};
#ifdef TRACE_LEAKS
-#define LEAK_TRACE LeakTrace::TraceAlloc(this)
+#define LEAK_TRACE LeakTrace::TraceAlloc(this, __FUNCTION__, __LINE__)
#define LEAK_UNTRACE LeakTrace::TraceDealloc(this)
#else // TRACE_LEAKS
diff --git a/src/shared/oblivioninfo.cpp b/src/shared/oblivioninfo.cpp index 7c6d5cbb..d8daa0f7 100644 --- a/src/shared/oblivioninfo.cpp +++ b/src/shared/oblivioninfo.cpp @@ -189,15 +189,19 @@ std::wstring OblivionInfo::getSEName() }
-std::wstring OblivionInfo::getNexusPage()
+std::wstring OblivionInfo::getNexusPage(bool nmmScheme)
{
- return L"http://oblivion.nexusmods.com";
+ if (nmmScheme) {
+ return L"http://nmm.nexusmods.com/oblivion";
+ } else {
+ return L"http://www.nexusmods.com/oblivion";
+ }
}
std::wstring OblivionInfo::getNexusInfoUrlStatic()
{
- return L"http://oblivion.nexusmods.com";
+ return L"http://nmm.nexusmods.com/oblivion";
}
@@ -243,7 +247,7 @@ std::wstring OblivionInfo::getOMODExt() }
-std::wstring OblivionInfo::getSteamAPPId()
+std::wstring OblivionInfo::getSteamAPPId(int) const
{
return L"22330";
}
diff --git a/src/shared/oblivioninfo.h b/src/shared/oblivioninfo.h index 13374aa3..ba27aa40 100644 --- a/src/shared/oblivioninfo.h +++ b/src/shared/oblivioninfo.h @@ -64,15 +64,16 @@ public: virtual std::wstring getReferenceDataFile();
virtual std::wstring getOMODExt();
- virtual std::wstring getSteamAPPId();
+ virtual std::wstring getSteamAPPId(int variant = 0) const;
virtual std::wstring getSEName();
- virtual std::wstring getNexusPage();
+ virtual std::wstring getNexusPage(bool nmmScheme = true);
static std::wstring getNexusInfoUrlStatic();
virtual std::wstring getNexusInfoUrl() { return OblivionInfo::getNexusInfoUrlStatic(); }
static int getNexusModIDStatic();
virtual int getNexusModID() { return OblivionInfo::getNexusModIDStatic(); }
+ virtual int getNexusGameID() { return 101; }
virtual void createProfile(const std::wstring &directory, bool useDefaults);
virtual void repairProfile(const std::wstring &directory);
diff --git a/src/shared/shared.pro b/src/shared/shared.pro index ab0bd8a0..992fd7f2 100644 --- a/src/shared/shared.pro +++ b/src/shared/shared.pro @@ -13,9 +13,17 @@ CONFIG += staticlib INCLUDEPATH += ../bsatk "$(BOOSTPATH)"
+
+# only for custom leak detection
+#DEFINES += TRACE_LEAKS
+#LIBS += -lDbgHelp
+
+
CONFIG(debug, debug|release) {
- LIBS += -L$$OUT_PWD/../bsatk/debug
+ LIBS += -L$$OUT_PWD/../bsatk/debug
LIBS += -lDbgHelp
+ QMAKE_CXXFLAGS_DEBUG -= -Zi
+ QMAKE_CXXFLAGS += -Z7
} else {
LIBS += -L$$OUT_PWD/../bsatk/release
}
diff --git a/src/shared/shared.qbs b/src/shared/shared.qbs new file mode 100644 index 00000000..1fa471a0 --- /dev/null +++ b/src/shared/shared.qbs @@ -0,0 +1,20 @@ +import qbs.base 1.0
+
+StaticLibrary {
+ name: {
+ print(qbs.getenv("BOOSTPATH") + "/stage/lib")
+ return 'Shared'
+ }
+
+ Depends { name: 'cpp' }
+ Depends { name: 'BSAToolkit' }
+
+ cpp.defines: []
+ cpp.libraryPaths: [ qbs.getenv("BOOSTPATH") + "/stage/lib" ]
+ cpp.includePaths: [ '../bsatk', qbs.getenv("BOOSTPATH") ]
+ files: [
+ '*.h',
+ '*.cpp',
+ '*.inc'
+ ]
+}
diff --git a/src/shared/skyriminfo.cpp b/src/shared/skyriminfo.cpp index 80cf4c80..1620bcc3 100644 --- a/src/shared/skyriminfo.cpp +++ b/src/shared/skyriminfo.cpp @@ -33,8 +33,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. namespace MOShared {
-SkyrimInfo::SkyrimInfo(const std::wstring &omoDirectory, const std::wstring &gameDirectory)
- : GameInfo(omoDirectory, gameDirectory)
+SkyrimInfo::SkyrimInfo(const std::wstring &moDirectory, const std::wstring &gameDirectory)
+ : GameInfo(moDirectory, gameDirectory)
{
identifyMyGamesDirectory(L"skyrim");
@@ -169,7 +169,7 @@ std::wstring SkyrimInfo::getOMODExt() }
-std::wstring SkyrimInfo::getSteamAPPId()
+std::wstring SkyrimInfo::getSteamAPPId(int) const
{
return L"72850";
}
@@ -181,15 +181,19 @@ std::wstring SkyrimInfo::getSEName() }
-std::wstring SkyrimInfo::getNexusPage()
+std::wstring SkyrimInfo::getNexusPage(bool nmmScheme)
{
- return L"http://skyrim.nexusmods.com";
+ if (nmmScheme) {
+ return L"http://nmm.nexusmods.com/skyrim";
+ } else {
+ return L"http://www.nexusmods.com/skyrim";
+ }
}
std::wstring SkyrimInfo::getNexusInfoUrlStatic()
{
- return L"http://skyrim.nexusmods.com";
+ return L"http://nmm.nexusmods.com/skyrim";
}
@@ -295,6 +299,7 @@ std::vector<ExecutableInfo> SkyrimInfo::getExecutables() result.push_back(ExecutableInfo(L"SKSE", L"skse_loader.exe", L"", L"", DEFAULT_CLOSE));
result.push_back(ExecutableInfo(L"SBW", L"SBW.exe", L"", L"", DEFAULT_CLOSE));
result.push_back(ExecutableInfo(L"Skyrim", L"TESV.exe", L"", L"", DEFAULT_CLOSE));
+ result.push_back(ExecutableInfo(L"Skyrim Launcher", L"SkyrimLauncher.exe", L"", L"", DEFAULT_CLOSE));
result.push_back(ExecutableInfo(L"BOSS", L"BOSS/BOSS.exe", L"", L"", DEFAULT_STAY));
result.push_back(ExecutableInfo(L"Creation Kit", L"CreationKit.exe", L"", L"", DEFAULT_STAY, L"202480"));
diff --git a/src/shared/skyriminfo.h b/src/shared/skyriminfo.h index 4760c38b..438beb41 100644 --- a/src/shared/skyriminfo.h +++ b/src/shared/skyriminfo.h @@ -71,16 +71,17 @@ public: virtual std::wstring getReferenceDataFile();
virtual std::wstring getOMODExt();
- virtual std::wstring getSteamAPPId();
+ virtual std::wstring getSteamAPPId(int variant = 0) const;
virtual std::wstring getSEName();
- virtual std::wstring getNexusPage();
+ virtual std::wstring getNexusPage(bool nmmScheme = true);
static std::wstring getNexusInfoUrlStatic();
virtual std::wstring getNexusInfoUrl() { return SkyrimInfo::getNexusInfoUrlStatic(); }
static int getNexusModIDStatic();
virtual int getNexusModID() { return SkyrimInfo::getNexusModIDStatic(); }
+ virtual int getNexusGameID() { return 110; }
virtual void createProfile(const std::wstring &directory, bool useDefaults);
virtual void repairProfile(const std::wstring &directory);
@@ -95,7 +96,7 @@ public: private:
- SkyrimInfo(const std::wstring &omoDirectory, const std::wstring &gameDirectory);
+ SkyrimInfo(const std::wstring &moDirectory, const std::wstring &gameDirectory);
static bool identifyGame(const std::wstring &searchPath);
diff --git a/src/shared/util.cpp b/src/shared/util.cpp index 4378e03c..22657e6c 100644 --- a/src/shared/util.cpp +++ b/src/shared/util.cpp @@ -69,7 +69,6 @@ std::string ToString(const std::wstring &source, bool utf8) ::WideCharToMultiByte(CP_UTF8, 0, source.c_str(), -1, buffer, MAX_PATH, NULL, NULL);
} else {
::WideCharToMultiByte(GetACP(), 0, source.c_str(), -1, buffer, MAX_PATH, NULL, NULL);
-// wcstombs(buffer, source.c_str(), MAX_PATH);
}
return std::string(buffer);
}
@@ -80,9 +79,7 @@ std::wstring ToWString(const std::string &source, bool utf8) if (utf8) {
::MultiByteToWideChar(CP_UTF8, 0, source.c_str(), -1, buffer, MAX_PATH);
} else {
- // codepage encoding
::MultiByteToWideChar(GetACP(), 0, source.c_str(), -1, buffer, MAX_PATH);
-// mbstowcs(buffer, source.c_str(), MAX_PATH);
}
return std::wstring(buffer);
}
|
