From 3486da0fb03a6489e3950681321806cc7a4b5817 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 15 Aug 2014 12:27:08 +0200 Subject: [PATCH] consolidated the debug profile flags into a single and added a global flag --- components/esm/debugprofile.cpp | 27 +++------------------------ components/esm/debugprofile.hpp | 11 ++++++++--- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/components/esm/debugprofile.cpp b/components/esm/debugprofile.cpp index eb6dc2fdc7..bd0fdd80b8 100644 --- a/components/esm/debugprofile.cpp +++ b/components/esm/debugprofile.cpp @@ -11,40 +11,19 @@ void ESM::DebugProfile::load (ESMReader& esm) { mDescription = esm.getHNString ("DESC"); mScript = esm.getHNString ("SCRP"); - - int default_ = 0; - esm.getHNOT (default_, "DEFA"); - - mDefault = default_!=0; - - int bypass = 0; - esm.getHNOT (bypass, "BYNG"); - - mBypassNewGame = bypass!=0; + esm.getHNT (mFlags, "FLAG"); } void ESM::DebugProfile::save (ESMWriter& esm) const { esm.writeHNCString ("DESC", mDescription); esm.writeHNCString ("SCRP", mScript); - - if (mDefault) - { - int default_ = 1; - esm.writeHNT ("DEFA", default_); - } - - if (mBypassNewGame) - { - int bypass = 1; - esm.writeHNT ("BYNG", bypass); - } + esm.writeHNT ("FLAG", mFlags); } void ESM::DebugProfile::blank() { mDescription.clear(); mScript.clear(); - mDefault = false; - mBypassNewGame = false; + mFlags = 0; } diff --git a/components/esm/debugprofile.hpp b/components/esm/debugprofile.hpp index 1e85742993..dc3658f7db 100644 --- a/components/esm/debugprofile.hpp +++ b/components/esm/debugprofile.hpp @@ -12,15 +12,20 @@ namespace ESM { static unsigned int sRecordId; + enum Flags + { + Flag_Default = 1, // add to newly opened scene subviews + Flag_BypassNewGame = 2, // bypass regular game startup + Flag_Global = 4 // make available from main menu (i.e. not location specific) + }; + std::string mId; std::string mDescription; std::string mScript; - bool mDefault; - - bool mBypassNewGame; + unsigned int mFlags; void load (ESMReader& esm); void save (ESMWriter& esm) const;