diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..6098e1f --- /dev/null +++ b/.clang-format @@ -0,0 +1,41 @@ +--- +# We'll use defaults from the LLVM style, but with 4 columns indentation. +BasedOnStyle: LLVM +IndentWidth: 2 +--- +Language: Cpp +DeriveLineEnding: false +UseCRLF: true +DerivePointerAlignment: false +PointerAlignment: Left +AlignConsecutiveAssignments: true +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: Empty +AlwaysBreakTemplateDeclarations: Yes +AccessModifierOffset: -2 +AlignTrailingComments: true +SpacesBeforeTrailingComments: 2 +NamespaceIndentation: Inner +MaxEmptyLinesToKeep: 1 +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: true + AfterControlStatement: false + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true + AfterUnion: true + AfterExternBlock: true + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: true +ColumnLimit: 88 +ForEachMacros: ['Q_FOREACH', 'foreach'] diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f869712 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.cpp text eol=crlf +*.h text eol=crlf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..54468d5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,17 @@ +name: Build Nehrim Plugin + +on: + push: + branches: master + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + runs-on: windows-2022 + steps: + - name: Build Nehrim Plugin + uses: ModOrganizer2/build-with-mob-action@master + with: + mo2-third-parties: fmt gtest spdlog boost lz4 + mo2-dependencies: cmake_common uibase game_gamebryo diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..006464f --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,17 @@ +name: Lint Nehrim Plugin + +on: + push: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run clang-format + uses: jidicula/clang-format-action@v4.11.0 + with: + clang-format-version: "15" + check-path: "." diff --git a/src/gamenehrim.cpp b/src/gamenehrim.cpp index 3554838..084efe9 100644 --- a/src/gamenehrim.cpp +++ b/src/gamenehrim.cpp @@ -2,17 +2,17 @@ #include "nehrimbsainvalidation.h" #include "nehrimdataarchives.h" -#include "nehrimscriptextender.h" #include "nehrimmoddatachecker.h" #include "nehrimmoddatacontent.h" #include "nehrimsavegame.h" +#include "nehrimscriptextender.h" -#include "pluginsetting.h" #include "executableinfo.h" -#include +#include "pluginsetting.h" #include -#include +#include #include +#include #include #include @@ -22,174 +22,180 @@ using namespace MOBase; -GameNehrim::GameNehrim() -{ -} +GameNehrim::GameNehrim() {} bool GameNehrim::init(IOrganizer* moInfo) { - if (!GameGamebryo::init(moInfo)) { - return false; - } - registerFeature(new NehrimScriptExtender(this)); - registerFeature(new NehrimDataArchives(myGamesPath())); - registerFeature(new NehrimBSAInvalidation(feature(), this)); - registerFeature(new GamebryoSaveGameInfo(this)); - registerFeature(new GamebryoLocalSavegames(myGamesPath(), "oblivion.ini")); - registerFeature(new NehrimModDataChecker(this)); - registerFeature(new NehrimModDataContent(this)); - registerFeature(new GamebryoGamePlugins(moInfo)); - registerFeature(new GamebryoUnmangedMods(this)); - return true; + if (!GameGamebryo::init(moInfo)) { + return false; + } + registerFeature(new NehrimScriptExtender(this)); + registerFeature(new NehrimDataArchives(myGamesPath())); + registerFeature( + new NehrimBSAInvalidation(feature(), this)); + registerFeature(new GamebryoSaveGameInfo(this)); + registerFeature( + new GamebryoLocalSavegames(myGamesPath(), "oblivion.ini")); + registerFeature(new NehrimModDataChecker(this)); + registerFeature(new NehrimModDataContent(this)); + registerFeature(new GamebryoGamePlugins(moInfo)); + registerFeature(new GamebryoUnmangedMods(this)); + return true; } QString GameNehrim::gameName() const { - return "Nehrim"; + return "Nehrim"; } QList GameNehrim::executables() const { - return QList() - << ExecutableInfo("Nehrim", findInGameFolder("Oblivion.exe")) - << ExecutableInfo("Nehrim Launcher", findInGameFolder("NehrimLauncher.exe")) - << ExecutableInfo("Oblivion Mod Manager", findInGameFolder("OblivionModManager.exe")) - << ExecutableInfo("BOSS", findInGameFolder("BOSS/BOSS.exe")) - << ExecutableInfo("LOOT", QFileInfo(getLootPath())).withArgument("--game=\"Nehrim\"") - << ExecutableInfo("Construction Set", findInGameFolder("TESConstructionSet.exe")) - ; + return QList() + << ExecutableInfo("Nehrim", findInGameFolder("Oblivion.exe")) + << ExecutableInfo("Nehrim Launcher", findInGameFolder("NehrimLauncher.exe")) + << ExecutableInfo("Oblivion Mod Manager", + findInGameFolder("OblivionModManager.exe")) + << ExecutableInfo("BOSS", findInGameFolder("BOSS/BOSS.exe")) + << ExecutableInfo("LOOT", QFileInfo(getLootPath())) + .withArgument("--game=\"Nehrim\"") + << ExecutableInfo("Construction Set", + findInGameFolder("TESConstructionSet.exe")); } QList GameNehrim::executableForcedLoads() const { - //TODO Search game directory for OBSE DLLs - return QList() - << ExecutableForcedLoadSetting("Oblvion.exe", "obse_1_2_416.dll").withForced().withEnabled() - << ExecutableForcedLoadSetting("TESConstructionSet.exe", "obse_editor_1_2.dll").withForced().withEnabled() - ; + // TODO Search game directory for OBSE DLLs + return QList() + << ExecutableForcedLoadSetting("Oblvion.exe", "obse_1_2_416.dll") + .withForced() + .withEnabled() + << ExecutableForcedLoadSetting("TESConstructionSet.exe", "obse_editor_1_2.dll") + .withForced() + .withEnabled(); } QString GameNehrim::name() const { - return "Nehrim Support Plugin"; + return "Nehrim Support Plugin"; } QString GameNehrim::localizedName() const { - return tr("Nehrim Support Plugin"); + return tr("Nehrim Support Plugin"); } QString GameNehrim::author() const { - return "Tannin"; + return "Tannin"; } QString GameNehrim::description() const { - return tr("Adds support for the game Nehrim"); + return tr("Adds support for the game Nehrim"); } MOBase::VersionInfo GameNehrim::version() const { - return VersionInfo(1, 1, 0, VersionInfo::RELEASE_FINAL); + return VersionInfo(1, 1, 0, VersionInfo::RELEASE_FINAL); } QList GameNehrim::settings() const { - return QList(); + return QList(); } void GameNehrim::initializeProfile(const QDir& path, ProfileSettings settings) const { - if (settings.testFlag(IPluginGame::MODS)) { - copyToProfile(localAppFolder() + "/Oblvion", path, "plugins.txt"); - } + if (settings.testFlag(IPluginGame::MODS)) { + copyToProfile(localAppFolder() + "/Oblvion", path, "plugins.txt"); + } - if (settings.testFlag(IPluginGame::CONFIGURATION)) { - if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) - || !QFileInfo(myGamesPath() + "/oblivion.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "oblivion_default.ini", "oblivion.ini"); - } - else { - copyToProfile(myGamesPath(), path, "oblivion.ini"); - } + if (settings.testFlag(IPluginGame::CONFIGURATION)) { + if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || + !QFileInfo(myGamesPath() + "/oblivion.ini").exists()) { + copyToProfile(gameDirectory().absolutePath(), path, "oblivion_default.ini", + "oblivion.ini"); + } else { + copyToProfile(myGamesPath(), path, "oblivion.ini"); + } - copyToProfile(myGamesPath(), path, "oblivionprefs.ini"); - } + copyToProfile(myGamesPath(), path, "oblivionprefs.ini"); + } } QString GameNehrim::savegameExtension() const { - return "ess"; + return "ess"; } QString GameNehrim::savegameSEExtension() const { - return "obse"; + return "obse"; } std::shared_ptr GameNehrim::makeSaveGame(QString filePath) const { - return std::make_shared(filePath, this); + return std::make_shared(filePath, this); } QString GameNehrim::steamAPPId() const { - return "22330"; + return "22330"; } QStringList GameNehrim::primaryPlugins() const { - return { "Nehrim.esm", "Translation.esp" }; + return {"Nehrim.esm", "Translation.esp"}; } QString GameNehrim::gameShortName() const { - return "Nehrim"; + return "Nehrim"; } QString GameNehrim::gameNexusName() const { - return "Nehrim"; + return "Nehrim"; } QStringList GameNehrim::iniFiles() const { - return { "oblivion.ini", "oblivionprefs.ini" }; + return {"oblivion.ini", "oblivionprefs.ini"}; } QStringList GameNehrim::DLCPlugins() const { - return {}; + return {}; } int GameNehrim::nexusModOrganizerID() const { - return -1; + return -1; } int GameNehrim::nexusGameID() const { - return 3312; + return 3312; } QStringList GameNehrim::primarySources() const { - return { "Oblivion" }; + return {"Oblivion"}; } QStringList GameNehrim::validShortNames() const { - return { "Oblivion" }; + return {"Oblivion"}; } QString GameNehrim::identifyGamePath() const { - QString path = "Software\\Bethesda Softworks\\Oblivion"; - return findInRegistry(HKEY_LOCAL_MACHINE, path.toStdWString().c_str(), L"Installed Path"); + QString path = "Software\\Bethesda Softworks\\Oblivion"; + return findInRegistry(HKEY_LOCAL_MACHINE, path.toStdWString().c_str(), + L"Installed Path"); } QString GameNehrim::binaryName() const { - return "NehrimLauncher.exe"; + return "NehrimLauncher.exe"; } diff --git a/src/gamenehrim.h b/src/gamenehrim.h index f08447b..a8af24c 100644 --- a/src/gamenehrim.h +++ b/src/gamenehrim.h @@ -12,17 +12,17 @@ class GameNehrim : public GameGamebryo Q_PLUGIN_METADATA(IID "org.tannin.GameNehrim" FILE "gamenehrim.json") public: - GameNehrim(); - virtual bool init(MOBase::IOrganizer *moInfo) override; - -public: // IPluginGame interface + virtual bool init(MOBase::IOrganizer* moInfo) override; +public: // IPluginGame interface virtual QString gameName() const override; virtual QList executables() const override; - virtual QList executableForcedLoads() const override; - virtual void initializeProfile(const QDir &path, ProfileSettings settings) const override; + virtual QList + executableForcedLoads() const override; + virtual void initializeProfile(const QDir& path, + ProfileSettings settings) const override; virtual QString steamAPPId() const override; virtual QStringList primaryPlugins() const override; virtual QString gameShortName() const override; @@ -34,13 +34,12 @@ public: // IPluginGame interface virtual QStringList primarySources() const override; virtual QStringList validShortNames() const override; - // Weird stuff happens in these functions due to Nehrim + // Weird stuff happens in these functions due to Nehrim // technically being in the Oblivion folder virtual QString identifyGamePath() const override; virtual QString binaryName() const override; -public: // IPlugin interface - +public: // IPlugin interface virtual QString name() const override; virtual QString localizedName() const override; virtual QString author() const override; @@ -49,11 +48,9 @@ public: // IPlugin interface virtual QList settings() const override; protected: - std::shared_ptr makeSaveGame(QString filePath) const override; QString savegameExtension() const override; QString savegameSEExtension() const override; - }; -#endif // GAMENEHRIM_H +#endif // GAMENEHRIM_H diff --git a/src/nehrimbsainvalidation.cpp b/src/nehrimbsainvalidation.cpp index 0af89fc..7830da0 100644 --- a/src/nehrimbsainvalidation.cpp +++ b/src/nehrimbsainvalidation.cpp @@ -1,10 +1,9 @@ #include "nehrimbsainvalidation.h" - -NehrimBSAInvalidation::NehrimBSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game) - : GamebryoBSAInvalidation(dataArchives, "oblivion.ini", game) -{ -} +NehrimBSAInvalidation::NehrimBSAInvalidation(DataArchives* dataArchives, + MOBase::IPluginGame const* game) + : GamebryoBSAInvalidation(dataArchives, "oblivion.ini", game) +{} QString NehrimBSAInvalidation::invalidationBSAName() const { diff --git a/src/nehrimbsainvalidation.h b/src/nehrimbsainvalidation.h index 59f471d..51fcd9a 100644 --- a/src/nehrimbsainvalidation.h +++ b/src/nehrimbsainvalidation.h @@ -1,7 +1,6 @@ #ifndef NEHRIMBSAINVALIDATION_H #define NEHRIMBSAINVALIDATION_H - #include "gamebryobsainvalidation.h" #include "nehrimdataarchives.h" @@ -10,14 +9,11 @@ class NehrimBSAInvalidation : public GamebryoBSAInvalidation { public: - - NehrimBSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game); + NehrimBSAInvalidation(DataArchives* dataArchives, MOBase::IPluginGame const* game); private: - virtual QString invalidationBSAName() const override; virtual unsigned long bsaVersion() const override; - }; -#endif // NEHRIMBSAINVALIDATION_H +#endif // NEHRIMBSAINVALIDATION_H diff --git a/src/nehrimdataarchives.cpp b/src/nehrimdataarchives.cpp index 28e09f0..8673bb8 100644 --- a/src/nehrimdataarchives.cpp +++ b/src/nehrimdataarchives.cpp @@ -1,37 +1,35 @@ #include "nehrimdataarchives.h" #include -NehrimDataArchives::NehrimDataArchives(const QDir &myGamesDir) : - GamebryoDataArchives(myGamesDir) -{ -} +NehrimDataArchives::NehrimDataArchives(const QDir& myGamesDir) + : GamebryoDataArchives(myGamesDir) +{} QStringList NehrimDataArchives::vanillaArchives() const { - return { "N - Meshes.bsa" - , "N - Textures1.bsa" - , "N - Textures2.bsa" - , "N - Misc.bsa" - , "N - Sounds.bsa" - , "L - Voices.bsa" - , "L - Misc.bsa" - }; + return {"N - Meshes.bsa", "N - Textures1.bsa", "N - Textures2.bsa", "N - Misc.bsa", + "N - Sounds.bsa", "L - Voices.bsa", "L - Misc.bsa"}; } -QStringList NehrimDataArchives::archives(const MOBase::IProfile *profile) const +QStringList NehrimDataArchives::archives(const MOBase::IProfile* profile) const { QStringList result; - QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini") : m_LocalGameDir.absoluteFilePath("oblivion.ini"); + QString iniFile = profile->localSettingsEnabled() + ? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini") + : m_LocalGameDir.absoluteFilePath("oblivion.ini"); result.append(getArchivesFromKey(iniFile, "SArchiveList")); return result; } -void NehrimDataArchives::writeArchiveList(MOBase::IProfile *profile, const QStringList &before) +void NehrimDataArchives::writeArchiveList(MOBase::IProfile* profile, + const QStringList& before) { QString list = before.join(", "); - QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini") : m_LocalGameDir.absoluteFilePath("oblivion.ini"); + QString iniFile = profile->localSettingsEnabled() + ? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini") + : m_LocalGameDir.absoluteFilePath("oblivion.ini"); setArchivesToKey(iniFile, "SArchiveList", list); } diff --git a/src/nehrimdataarchives.h b/src/nehrimdataarchives.h index beed56e..9bfd590 100644 --- a/src/nehrimdataarchives.h +++ b/src/nehrimdataarchives.h @@ -1,28 +1,25 @@ #ifndef NEHRIMDATAARCHIVES_H #define NEHRIMDATAARCHIVES_H - -#include -#include +#include #include #include -#include +#include +#include class NehrimDataArchives : public GamebryoDataArchives { public: - NehrimDataArchives(const QDir &myGamesDir); + NehrimDataArchives(const QDir& myGamesDir); public: - virtual QStringList vanillaArchives() const override; - virtual QStringList archives(const MOBase::IProfile *profile) const override; + virtual QStringList archives(const MOBase::IProfile* profile) const override; private: - - virtual void writeArchiveList(MOBase::IProfile *profile, const QStringList &before) override; - + virtual void writeArchiveList(MOBase::IProfile* profile, + const QStringList& before) override; }; -#endif // NEHRIMDATAARCHIVES_H +#endif // NEHRIMDATAARCHIVES_H diff --git a/src/nehrimmoddatachecker.cpp b/src/nehrimmoddatachecker.cpp index 4507782..6ca6121 100644 --- a/src/nehrimmoddatachecker.cpp +++ b/src/nehrimmoddatachecker.cpp @@ -1,7 +1,7 @@ #include "nehrimmoddatachecker.h" ModDataChecker::CheckReturn NehrimModDataChecker::dataLooksValid( - std::shared_ptr fileTree) const + std::shared_ptr fileTree) const { // Check with Gamebryo stuff: auto check = GamebryoModDataChecker::dataLooksValid(fileTree); @@ -19,8 +19,8 @@ ModDataChecker::CheckReturn NehrimModDataChecker::dataLooksValid( return CheckReturn::FIXABLE; } -std::shared_ptr NehrimModDataChecker::fix( - std::shared_ptr fileTree) const +std::shared_ptr +NehrimModDataChecker::fix(std::shared_ptr fileTree) const { // If we arrive here, it means all files starts with OBSE. auto data = fileTree->createOrphanTree(); diff --git a/src/nehrimmoddatachecker.h b/src/nehrimmoddatachecker.h index ddf6a55..c8717dd 100644 --- a/src/nehrimmoddatachecker.h +++ b/src/nehrimmoddatachecker.h @@ -8,25 +8,28 @@ class NehrimModDataChecker : public GamebryoModDataChecker public: using GamebryoModDataChecker::GamebryoModDataChecker; - CheckReturn dataLooksValid(std::shared_ptr fileTree) const override; - std::shared_ptr fix(std::shared_ptr fileTree) const override; + CheckReturn + dataLooksValid(std::shared_ptr fileTree) const override; + std::shared_ptr + fix(std::shared_ptr fileTree) const override; protected: - virtual const FileNameSet& possibleFolderNames() const override { - static FileNameSet result{ - "fonts", "interface", "menus", "meshes", "music", "scripts", "shaders", - "sound", "strings", "textures", "trees", "video", "facegen", - "obse", "distantlod", "asi", "distantland", "mits", "dllplugins", "CalienteTools", - "NetScriptFramework" - }; + virtual const FileNameSet& possibleFolderNames() const override + { + static FileNameSet result{"fonts", "interface", "menus", + "meshes", "music", "scripts", + "shaders", "sound", "strings", + "textures", "trees", "video", + "facegen", "obse", "distantlod", + "asi", "distantland", "mits", + "dllplugins", "CalienteTools", "NetScriptFramework"}; return result; } - virtual const FileNameSet& possibleFileExtensions() const override { - static FileNameSet result{ - "esp", "esm", "bsa", "modgroups", "ini" - }; + virtual const FileNameSet& possibleFileExtensions() const override + { + static FileNameSet result{"esp", "esm", "bsa", "modgroups", "ini"}; return result; } }; -#endif // NEHRIM_MODATACHECKER_H +#endif // NEHRIM_MODATACHECKER_H diff --git a/src/nehrimmoddatacontent.h b/src/nehrimmoddatacontent.h index b6768d1..02391df 100644 --- a/src/nehrimmoddatacontent.h +++ b/src/nehrimmoddatacontent.h @@ -4,18 +4,19 @@ #include #include -class NehrimModDataContent : public GamebryoModDataContent { +class NehrimModDataContent : public GamebryoModDataContent +{ public: - /** * */ - NehrimModDataContent(GameGamebryo const* gamePlugin) : GamebryoModDataContent(gamePlugin) { + NehrimModDataContent(GameGamebryo const* gamePlugin) + : GamebryoModDataContent(gamePlugin) + { // Just need to disable some contents: - m_Enabled[CONTENT_MCM] = false; + m_Enabled[CONTENT_MCM] = false; m_Enabled[CONTENT_SKYPROC] = false; } - }; -#endif // NEHRIM_MODDATACONTENT_H +#endif // NEHRIM_MODDATACONTENT_H diff --git a/src/nehrimsavegame.cpp b/src/nehrimsavegame.cpp index 1cb574d..8835632 100644 --- a/src/nehrimsavegame.cpp +++ b/src/nehrimsavegame.cpp @@ -2,31 +2,32 @@ #include -NehrimSaveGame::NehrimSaveGame(QString const &fileName, GameNehrim const *game) : - GamebryoSaveGame(fileName, game) +NehrimSaveGame::NehrimSaveGame(QString const& fileName, GameNehrim const* game) + : GamebryoSaveGame(fileName, game) { FileWrapper file(getFilepath(), "TES4SAVEGAME"); file.setPluginString(GamebryoSaveGame::StringType::TYPE_BSTRING); SYSTEMTIME creationTime; - fetchInformationFields(file, m_SaveNumber, m_PCName, m_PCLevel, m_PCLocation, creationTime); + fetchInformationFields(file, m_SaveNumber, m_PCName, m_PCLevel, m_PCLocation, + creationTime); setCreationTime(creationTime); } void NehrimSaveGame::fetchInformationFields(FileWrapper& file, - unsigned long& saveNumber, - QString& playerName, - unsigned short& playerLevel, - QString& playerLocation, - SYSTEMTIME& creationTime) const + unsigned long& saveNumber, + QString& playerName, + unsigned short& playerLevel, + QString& playerLocation, + SYSTEMTIME& creationTime) const { - file.skip(); //Major version - file.skip(); //Minor version + file.skip(); // Major version + file.skip(); // Minor version file.skip(); // exe last modified (!) - file.skip(); //Header version - file.skip(); //Header size + file.skip(); // Header version + file.skip(); // Header size file.read(saveNumber); @@ -34,13 +35,13 @@ void NehrimSaveGame::fetchInformationFields(FileWrapper& file, file.read(playerLevel); file.read(playerLocation); - file.skip(); //game days - file.skip(); //game ticks + file.skip(); // game days + file.skip(); // game ticks - //there is a save time stored here. So use it rather than the file time, which - //could have been copied. - //Note: This says it uses getlocaltime api to obtain it which is u/s - if so - //we should ignore this. + // there is a save time stored here. So use it rather than the file time, which + // could have been copied. + // Note: This says it uses getlocaltime api to obtain it which is u/s - if so + // we should ignore this. file.read(creationTime); } @@ -57,13 +58,13 @@ std::unique_ptr NehrimSaveGame::fetchDataFields() unsigned long dummySaveNumber; SYSTEMTIME dummyTime; - fetchInformationFields(file, dummySaveNumber, dummyName, dummyLevel, - dummyLocation, dummyTime); + fetchInformationFields(file, dummySaveNumber, dummyName, dummyLevel, dummyLocation, + dummyTime); } - //Note that screenshot size, width, height and data are apparently the same - //structure - file.skip(); //Screenshot size. + // Note that screenshot size, width, height and data are apparently the same + // structure + file.skip(); // Screenshot size. fields->Screenshot = file.readImage(); diff --git a/src/nehrimsavegame.h b/src/nehrimsavegame.h index ef8c1af..be3d2a9 100644 --- a/src/nehrimsavegame.h +++ b/src/nehrimsavegame.h @@ -7,19 +7,15 @@ class NehrimSaveGame : public GamebryoSaveGame { public: - NehrimSaveGame(QString const &fileName, GameNehrim const *game); + NehrimSaveGame(QString const& fileName, GameNehrim const* game); protected: - // Fetch easy-to-access information. - void fetchInformationFields(FileWrapper& wrapper, - unsigned long& saveNumber, - QString& playerName, - unsigned short& playerLevel, - QString& playerLocation, - SYSTEMTIME& creationTime) const; + void fetchInformationFields(FileWrapper& wrapper, unsigned long& saveNumber, + QString& playerName, unsigned short& playerLevel, + QString& playerLocation, SYSTEMTIME& creationTime) const; std::unique_ptr fetchDataFields() const override; }; -#endif // NEHRIMSAVEGAME_H +#endif // NEHRIMSAVEGAME_H diff --git a/src/nehrimscriptextender.cpp b/src/nehrimscriptextender.cpp index e1b7e7d..c50c59e 100644 --- a/src/nehrimscriptextender.cpp +++ b/src/nehrimscriptextender.cpp @@ -3,14 +3,11 @@ #include #include -NehrimScriptExtender::NehrimScriptExtender(GameGamebryo const *game) : - GamebryoScriptExtender(game) -{ -} +NehrimScriptExtender::NehrimScriptExtender(GameGamebryo const* game) + : GamebryoScriptExtender(game) +{} -NehrimScriptExtender::~NehrimScriptExtender() -{ -} +NehrimScriptExtender::~NehrimScriptExtender() {} QString NehrimScriptExtender::BinaryName() const { diff --git a/src/nehrimscriptextender.h b/src/nehrimscriptextender.h index 95977ee..3bdac2a 100644 --- a/src/nehrimscriptextender.h +++ b/src/nehrimscriptextender.h @@ -8,12 +8,11 @@ class GameGamebryo; class NehrimScriptExtender : public GamebryoScriptExtender { public: - NehrimScriptExtender(const GameGamebryo *game); + NehrimScriptExtender(const GameGamebryo* game); ~NehrimScriptExtender(); virtual QString BinaryName() const override; virtual QString PluginPath() const override; - }; -#endif // NEHRIMSCRIPTEXTENDER_H +#endif // NEHRIMSCRIPTEXTENDER_H