diff --git a/.mailmap b/.mailmap deleted file mode 100644 index 50ff0928d..000000000 --- a/.mailmap +++ /dev/null @@ -1,139 +0,0 @@ -Adam Hogan -Aleksandar Jovanov -Alexander Olofsson -Alex McKibben -Alex "rainChu" Haddad -Ardekantur -Armin Preiml -Artem Kotsynyak -Arthur Moore -Arthur Moore -athile -athile -Stefan Galowicz -Bret Curtis -Britt Mathis -Sandy Carter -Sandy Carter -Carl Maxwell -cc9cii -Cory F. Cohen -Chris Robinson -Cris Mihalache -darkf -Diggory Hardy -Thomas Luppi -Thomas Luppi -Dmitriy 'Endorph' Shkurskiy -Dmitry Marakasov -Douglas Diniz -Douglas Mencken -Edmondo Tommasina -Eduard Cot -Eli2 -Emanuel Guével -Leon Saunders -Fil Krynicki -John Blomberg -Gašper Sedej -Michał Bień -Joel Graff -Paul McElroy -Artem Kotsynyak -Artem Kotsynyak -gugus -guidoj -gus -Hallfaer Tuilinn -Julian Ospald -Jacob Essex -Jan Borsodi -Jan-Peter Nilsson -Jason Hooks -Jason Hooks -Jason Hooks -Jeffrey Haines -Jeffrey Haines -Jordan Ayers -Jordan Milne -Josua Grawitter -Julien Voisin -Karl-Felix Glatzer -Chris Robinson -Kevin Poitra -Roman Proskuryakov -Lars Söderberg -lazydev -lazydev -Lukasz Gromanowski -Marc Bouvier -Marcin Hulist -Marc Zinnschlag -Marek Kochanowicz -Marek Kochanowicz -Marek Kochanowicz -Mark Siewert -Mark Siewert -megaton <9megaton6@gmail.com> -Michael Mc Donnell -Michael Papageorgiou -Michal Sciubidlo -Michał Ściubidło -Nathan Jeffords -Nicolay Korslund -Nicolay Korslund -Nikolay Kasyanov -pchan3 -Pieter van der Kloet -Mateusz Kołaczek -Bret Curtis -Pieter van der Kloet -Rohit Nirmal -Roman Melnik -Radu-Marius Popovici -Sandy Carter -Scott Howard -Jannik Heller -Jannik Heller -Sebastian Wick -Sebastian Wick -Sergey Shambir -sergoz -Chris Boyce -Star-Demon -Sylvain Thesnieres -Thomas Luppi -Thomas Luppi -Thoronador -TomKoenderink -Tom Mason -Torben Carrington -Vincent Heuken -Manuel Edelmann -Manuel Edelmann -Alexander Nadeau -Michael Hogan -Jacob Essex -Yuri Krupenin -Bret Curtis - -sirherrbatka -sirherrbatka -sergei -riothamus -nobrakal -nkorslund -mrcheko -Miroslav Puda -MiroslavR -mckibbenta -jeaye -eroen -eroen -dreamer-dead -crysthala -Berulacks -Axujen -root -unknown - diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 638237f34..1c6e69023 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -33,7 +33,11 @@ QString getAspect(int x, int y) } Launcher::GraphicsPage::GraphicsPage(Files::ConfigurationManager &cfg, GraphicsSettings &graphicsSetting, QWidget *parent) - : mCfgMgr(cfg) + : mOgre(NULL) + , mSelectedRenderSystem(NULL) + , mOpenGLRenderSystem(NULL) + , mDirect3DRenderSystem(NULL) + , mCfgMgr(cfg) , mGraphicsSettings(graphicsSetting) , QWidget(parent) { diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index ff28dfce4..eb15a953d 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -26,11 +26,12 @@ opencs_units (model/world opencs_units_noqt (model/world universalid record commands columnbase scriptcontext cell refidcollection - refidadapter refiddata refidadapterimp ref collectionbase refcollection columns infocollection tablemimedata cellcoordinates cellselection resources resourcesmanager scope landtexture land + refidadapter refiddata refidadapterimp ref collectionbase refcollection columns infocollection tablemimedata cellcoordinates cellselection resources resourcesmanager scope + pathgrid landtexture land ) opencs_hdrs_noqt (model/world - columnimp idcollection collection info + columnimp idcollection collection info subcellcollection ) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index 20763beea..63406cb86 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -21,7 +21,7 @@ CS::Editor::Editor (OgreInit::OgreInit& ogreInit) : mUserSettings (mCfgMgr), mDocumentManager (mCfgMgr), mViewManager (mDocumentManager), - mIpcServerName ("org.openmw.OpenCS") + mIpcServerName ("org.openmw.OpenCS"), mServer(NULL), mClientSocket(NULL) { std::pair > config = readConfig(); diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index 9a174d9d5..4fdfd2e5e 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -2023,6 +2023,7 @@ void CSMDoc::Document::addOptionalGmsts() { ESM::GameSetting gmst; gmst.mId = sFloats[i]; + gmst.blank(); gmst.mValue.setType (ESM::VT_Float); addOptionalGmst (gmst); } @@ -2031,6 +2032,7 @@ void CSMDoc::Document::addOptionalGmsts() { ESM::GameSetting gmst; gmst.mId = sIntegers[i]; + gmst.blank(); gmst.mValue.setType (ESM::VT_Int); addOptionalGmst (gmst); } @@ -2039,6 +2041,7 @@ void CSMDoc::Document::addOptionalGmsts() { ESM::GameSetting gmst; gmst.mId = sStrings[i]; + gmst.blank(); gmst.mValue.setType (ESM::VT_String); gmst.mValue.setString (""); addOptionalGmst (gmst); @@ -2059,6 +2062,7 @@ void CSMDoc::Document::addOptionalGlobals() { ESM::Global global; global.mId = sGlobals[i]; + global.blank(); global.mValue.setType (ESM::VT_Long); if (i==0) @@ -2068,6 +2072,19 @@ void CSMDoc::Document::addOptionalGlobals() } } +void CSMDoc::Document::addOptionalMagicEffects() +{ + for (int i=ESM::MagicEffect::SummonFabricant; i<=ESM::MagicEffect::SummonCreature05; ++i) + { + ESM::MagicEffect effect; + effect.mIndex = i; + effect.mId = ESM::MagicEffect::indexToId (i); + effect.blank(); + + addOptionalMagicEffect (effect); + } +} + void CSMDoc::Document::addOptionalGmst (const ESM::GameSetting& gmst) { if (getData().getGmsts().searchId (gmst.mId)==-1) @@ -2090,6 +2107,17 @@ void CSMDoc::Document::addOptionalGlobal (const ESM::Global& global) } } +void CSMDoc::Document::addOptionalMagicEffect (const ESM::MagicEffect& magicEffect) +{ + if (getData().getMagicEffects().searchId (magicEffect.mId)==-1) + { + CSMWorld::Record record; + record.mBase = magicEffect; + record.mState = CSMWorld::RecordBase::State_BaseOnly; + getData().getMagicEffects().appendRecord (record); + } +} + void CSMDoc::Document::createBase() { static const char *sGlobals[] = @@ -2201,6 +2229,18 @@ void CSMDoc::Document::createBase() getData().getTopics().add (record); } + + for (int i=0; i >()), mCurrentStage(mStages.begin()), + mCurrentStep(0), mCurrentStepTotal(0), mTotalSteps(0), mOrdered (ordered), + mFinalAlways (finalAlways), mError(false) { connect (this, SIGNAL (finished()), this, SLOT (operationDone())); } @@ -120,4 +122,4 @@ void CSMDoc::Operation::executeStage() void CSMDoc::Operation::operationDone() { emit done (mType, mError); -} \ No newline at end of file +} diff --git a/apps/opencs/model/doc/saving.cpp b/apps/opencs/model/doc/saving.cpp index 9c6932941..70e9e1d87 100644 --- a/apps/opencs/model/doc/saving.cpp +++ b/apps/opencs/model/doc/saving.cpp @@ -72,6 +72,12 @@ CSMDoc::Saving::Saving (Document& document, const boost::filesystem::path& proje appendStage (new WriteCollectionStage > (mDocument.getData().getBodyParts(), mState)); + appendStage (new WriteCollectionStage > + (mDocument.getData().getSoundGens(), mState)); + + appendStage (new WriteCollectionStage > + (mDocument.getData().getMagicEffects(), mState)); + appendStage (new WriteDialogueCollectionStage (mDocument, mState, false)); appendStage (new WriteDialogueCollectionStage (mDocument, mState, true)); @@ -82,6 +88,8 @@ CSMDoc::Saving::Saving (Document& document, const boost::filesystem::path& proje appendStage (new WriteCellCollectionStage (mDocument, mState)); + appendStage (new WritePathgridCollectionStage (mDocument, mState)); + // close file and clean up appendStage (new CloseSaveStage (mState)); diff --git a/apps/opencs/model/doc/savingstages.cpp b/apps/opencs/model/doc/savingstages.cpp index d62947df6..08f8c9eaa 100644 --- a/apps/opencs/model/doc/savingstages.cpp +++ b/apps/opencs/model/doc/savingstages.cpp @@ -311,6 +311,48 @@ void CSMDoc::WriteCellCollectionStage::perform (int stage, Messages& messages) } +CSMDoc::WritePathgridCollectionStage::WritePathgridCollectionStage (Document& document, + SavingState& state) +: mDocument (document), mState (state) +{} + +int CSMDoc::WritePathgridCollectionStage::setup() +{ + return mDocument.getData().getPathgrids().getSize(); +} + +void CSMDoc::WritePathgridCollectionStage::perform (int stage, Messages& messages) +{ + const CSMWorld::Record& pathgrid = + mDocument.getData().getPathgrids().getRecord (stage); + + if (pathgrid.mState==CSMWorld::RecordBase::State_Modified || + pathgrid.mState==CSMWorld::RecordBase::State_ModifiedOnly) + { + CSMWorld::Pathgrid record = pathgrid.get(); + + if (record.mId.substr (0, 1)=="#") + { + std::istringstream stream (record.mId.c_str()); + char ignore; + stream >> ignore >> record.mData.mX >> record.mData.mY; + } + else + record.mCell = record.mId; + + mState.getWriter().startRecord (record.sRecordId); + + record.save (mState.getWriter()); + + mState.getWriter().endRecord (record.sRecordId); + } + else if (pathgrid.mState==CSMWorld::RecordBase::State_Deleted) + { + /// \todo write record with delete flag + } +} + + CSMDoc::CloseSaveStage::CloseSaveStage (SavingState& state) : mState (state) {} diff --git a/apps/opencs/model/doc/savingstages.hpp b/apps/opencs/model/doc/savingstages.hpp index 54e877ef3..87c9ba7eb 100644 --- a/apps/opencs/model/doc/savingstages.hpp +++ b/apps/opencs/model/doc/savingstages.hpp @@ -183,6 +183,23 @@ namespace CSMDoc ///< Messages resulting from this stage will be appended to \a messages. }; + + class WritePathgridCollectionStage : public Stage + { + Document& mDocument; + SavingState& mState; + + public: + + WritePathgridCollectionStage (Document& document, SavingState& state); + + virtual int setup(); + ///< \return number of steps + + virtual void perform (int stage, Messages& messages); + ///< Messages resulting from this stage will be appended to \a messages. + }; + class CloseSaveStage : public Stage { SavingState& mState; diff --git a/apps/opencs/model/world/columnbase.hpp b/apps/opencs/model/world/columnbase.hpp index 45cb47ba0..db9b8b3c6 100644 --- a/apps/opencs/model/world/columnbase.hpp +++ b/apps/opencs/model/world/columnbase.hpp @@ -101,7 +101,9 @@ namespace CSMWorld Display_Texture, Display_Video, Display_Colour, - Display_ScriptLines // console context + Display_ScriptLines, // console context + Display_SoundGeneratorType, + Display_School }; int mColumnId; @@ -125,8 +127,6 @@ namespace CSMWorld template struct Column : public ColumnBase { - int mFlags; - Column (int columnId, Display displayType, int flags = Flag_Table | Flag_Dialogue) : ColumnBase (columnId, displayType, flags) {} diff --git a/apps/opencs/model/world/columnimp.hpp b/apps/opencs/model/world/columnimp.hpp index b93deccb7..a25e36fc1 100644 --- a/apps/opencs/model/world/columnimp.hpp +++ b/apps/opencs/model/world/columnimp.hpp @@ -1,7 +1,9 @@ #ifndef CSM_WOLRD_COLUMNIMP_H #define CSM_WOLRD_COLUMNIMP_H +#include #include +#include #include @@ -1982,6 +1984,287 @@ namespace CSMWorld return false; } }; + + template + struct SoundColumn : public Column + { + SoundColumn() + : Column (Columns::ColumnId_Sound, ColumnBase::Display_Sound) + {} + + virtual QVariant get (const Record& record) const + { + return QString::fromUtf8 (record.get().mSound.c_str()); + } + + virtual void set (Record& record, const QVariant& data) + { + ESXRecordT record2 = record.get(); + + record2.mSound = data.toString().toUtf8().constData(); + + record.setModified (record2); + } + + virtual bool isEditable() const + { + return true; + } + }; + + template + struct CreatureColumn : public Column + { + CreatureColumn() + : Column (Columns::ColumnId_Creature, ColumnBase::Display_Creature) + {} + + virtual QVariant get (const Record& record) const + { + return QString::fromUtf8 (record.get().mCreature.c_str()); + } + + virtual void set (Record& record, const QVariant& data) + { + ESXRecordT record2 = record.get(); + + record2.mCreature = data.toString().toUtf8().constData(); + + record.setModified (record2); + } + + virtual bool isEditable() const + { + return true; + } + }; + + template + struct SoundGeneratorTypeColumn : public Column + { + SoundGeneratorTypeColumn() + : Column (Columns::ColumnId_SoundGeneratorType, ColumnBase::Display_SoundGeneratorType) + {} + + virtual QVariant get (const Record& record) const + { + return static_cast (record.get().mType); + } + + virtual void set (Record& record, const QVariant& data) + { + ESXRecordT record2 = record.get(); + + record2.mType = data.toInt(); + + record.setModified (record2); + } + + virtual bool isEditable() const + { + return true; + } + }; + + template + struct BaseCostColumn : public Column + { + BaseCostColumn() : Column (Columns::ColumnId_BaseCost, ColumnBase::Display_Float) {} + + virtual QVariant get (const Record& record) const + { + return record.get().mData.mBaseCost; + } + + virtual void set (Record& record, const QVariant& data) + { + ESXRecordT record2 = record.get(); + record2.mData.mBaseCost = data.toFloat(); + record.setModified (record2); + } + + virtual bool isEditable() const + { + return true; + } + }; + + template + struct SchoolColumn : public Column + { + SchoolColumn() + : Column (Columns::ColumnId_School, ColumnBase::Display_School) + {} + + virtual QVariant get (const Record& record) const + { + return record.get().mData.mSchool; + } + + virtual void set (Record& record, const QVariant& data) + { + ESXRecordT record2 = record.get(); + + record2.mData.mSchool = data.toInt(); + + record.setModified (record2); + } + + virtual bool isEditable() const + { + return true; + } + }; + + template + struct EffectTextureColumn : public Column + { + EffectTextureColumn (Columns::ColumnId columnId) + : Column (columnId, ColumnBase::Display_Texture) + { + assert (this->mColumnId==Columns::ColumnId_Icon || + this->mColumnId==Columns::ColumnId_Particle); + } + + virtual QVariant get (const Record& record) const + { + return QString::fromUtf8 ( + (this->mColumnId==Columns::ColumnId_Icon ? + record.get().mIcon : record.get().mParticle).c_str()); + } + + virtual void set (Record& record, const QVariant& data) + { + ESXRecordT record2 = record.get(); + + (this->mColumnId==Columns::ColumnId_Icon ? + record2.mIcon : record2.mParticle) + = data.toString().toUtf8().constData(); + + record.setModified (record2); + } + + virtual bool isEditable() const + { + return true; + } + }; + + template + struct EffectObjectColumn : public Column + { + EffectObjectColumn (Columns::ColumnId columnId) + : Column (columnId, columnId==Columns::ColumnId_BoltObject ? ColumnBase::Display_Weapon : ColumnBase::Display_Static) + { + assert (this->mColumnId==Columns::ColumnId_CastingObject || + this->mColumnId==Columns::ColumnId_HitObject || + this->mColumnId==Columns::ColumnId_AreaObject || + this->mColumnId==Columns::ColumnId_BoltObject); + } + + virtual QVariant get (const Record& record) const + { + const std::string *string = 0; + + switch (this->mColumnId) + { + case Columns::ColumnId_CastingObject: string = &record.get().mCasting; break; + case Columns::ColumnId_HitObject: string = &record.get().mHit; break; + case Columns::ColumnId_AreaObject: string = &record.get().mArea; break; + case Columns::ColumnId_BoltObject: string = &record.get().mBolt; break; + } + + if (!string) + throw std::logic_error ("Unsupported column ID"); + + return QString::fromUtf8 (string->c_str()); + } + + virtual void set (Record& record, const QVariant& data) + { + std::string *string = 0; + + ESXRecordT record2 = record.get(); + + switch (this->mColumnId) + { + case Columns::ColumnId_CastingObject: string = &record2.mCasting; break; + case Columns::ColumnId_HitObject: string = &record2.mHit; break; + case Columns::ColumnId_AreaObject: string = &record2.mArea; break; + case Columns::ColumnId_BoltObject: string = &record2.mBolt; break; + } + + if (!string) + throw std::logic_error ("Unsupported column ID"); + + *string = data.toString().toUtf8().constData(); + + record.setModified (record2); + } + + virtual bool isEditable() const + { + return true; + } + }; + + template + struct EffectSoundColumn : public Column + { + EffectSoundColumn (Columns::ColumnId columnId) + : Column (columnId, ColumnBase::Display_Sound) + { + assert (this->mColumnId==Columns::ColumnId_CastingSound || + this->mColumnId==Columns::ColumnId_HitSound || + this->mColumnId==Columns::ColumnId_AreaSound || + this->mColumnId==Columns::ColumnId_BoltSound); + } + + virtual QVariant get (const Record& record) const + { + const std::string *string = 0; + + switch (this->mColumnId) + { + case Columns::ColumnId_CastingSound: string = &record.get().mCastSound; break; + case Columns::ColumnId_HitSound: string = &record.get().mHitSound; break; + case Columns::ColumnId_AreaSound: string = &record.get().mAreaSound; break; + case Columns::ColumnId_BoltSound: string = &record.get().mBoltSound; break; + } + + if (!string) + throw std::logic_error ("Unsupported column ID"); + + return QString::fromUtf8 (string->c_str()); + } + + virtual void set (Record& record, const QVariant& data) + { + std::string *string = 0; + + ESXRecordT record2 = record.get(); + + switch (this->mColumnId) + { + case Columns::ColumnId_CastingSound: string = &record2.mCastSound; break; + case Columns::ColumnId_HitSound: string = &record2.mHitSound; break; + case Columns::ColumnId_AreaSound: string = &record2.mAreaSound; break; + case Columns::ColumnId_BoltSound: string = &record2.mBoltSound; break; + } + + if (!string) + throw std::logic_error ("Unsupported column ID"); + + *string = data.toString().toUtf8().constData(); + + record.setModified (record2); + } + + virtual bool isEditable() const + { + return true; + } + }; } #endif diff --git a/apps/opencs/model/world/columns.cpp b/apps/opencs/model/world/columns.cpp index 90af20059..8349eb515 100644 --- a/apps/opencs/model/world/columns.cpp +++ b/apps/opencs/model/world/columns.cpp @@ -186,6 +186,21 @@ namespace CSMWorld { ColumnId_GlobalProfile, "Global Profile" }, { ColumnId_RefNumCounter, "RefNum Counter" }, { ColumnId_RefNum, "RefNum" }, + { ColumnId_Creature, "Creature" }, + { ColumnId_SoundGeneratorType, "Sound Generator Type" }, + { ColumnId_AllowSpellmaking, "Allow Spellmaking" }, + { ColumnId_AllowEnchanting, "Allow Enchanting" }, + { ColumnId_BaseCost, "Base Cost" }, + { ColumnId_School, "School" }, + { ColumnId_Particle, "Particle" }, + { ColumnId_CastingObject, "Casting Object" }, + { ColumnId_HitObject, "Hit Object" }, + { ColumnId_AreaObject, "Area Object" }, + { ColumnId_BoltObject, "Bolt Object" }, + { ColumnId_CastingSound, "Casting Sound" }, + { ColumnId_HitSound, "Hit Sound" }, + { ColumnId_AreaSound, "Area Sound" }, + { ColumnId_BoltSound, "Bolt Sound" }, { ColumnId_UseValue1, "Use value 1" }, { ColumnId_UseValue2, "Use value 2" }, @@ -327,6 +342,17 @@ namespace "Skin", "Clothing", "Armour", 0 }; + static const char *sSoundGeneratorType[] = + { + "Left Foot", "Right Foot", "Swim Left", "Swim Right", "Moan", "Roar", "Scream", + "Land", 0 + }; + + static const char *sSchools[] = + { + "Alteration", "Conjuration", "Destruction", "Illusion", "Mysticism", "Restoration", 0 + }; + const char **getEnumNames (CSMWorld::Columns::ColumnId column) { switch (column) @@ -347,6 +373,8 @@ namespace case CSMWorld::Columns::ColumnId_EnchantmentType: return sEnchantmentTypes; case CSMWorld::Columns::ColumnId_BodyPartType: return sBodyPartTypes; case CSMWorld::Columns::ColumnId_MeshType: return sMeshTypes; + case CSMWorld::Columns::ColumnId_SoundGeneratorType: return sSoundGeneratorType; + case CSMWorld::Columns::ColumnId_School: return sSchools; default: return 0; } diff --git a/apps/opencs/model/world/columns.hpp b/apps/opencs/model/world/columns.hpp index 5da1765a4..ca0326655 100644 --- a/apps/opencs/model/world/columns.hpp +++ b/apps/opencs/model/world/columns.hpp @@ -179,7 +179,21 @@ namespace CSMWorld ColumnId_GlobalProfile = 167, ColumnId_RefNumCounter = 168, ColumnId_RefNum = 169, - + ColumnId_Creature = 170, + ColumnId_SoundGeneratorType = 171, + ColumnId_AllowSpellmaking = 172, + ColumnId_AllowEnchanting = 173, + ColumnId_BaseCost = 174, + ColumnId_School = 175, + ColumnId_Particle = 176, + ColumnId_CastingObject = 177, + ColumnId_HitObject = 178, + ColumnId_AreaObject = 179, + ColumnId_BoltObject = 180, + ColumnId_CastingSound = 177, + ColumnId_HitSound = 178, + ColumnId_AreaSound = 179, + ColumnId_BoltSound = 180, // Allocated to a separate value range, so we don't get a collision should we ever need // to extend the number of use values. ColumnId_UseValue1 = 0x10000, diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index 78349a8db..c11594207 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -59,8 +59,8 @@ int CSMWorld::Data::count (RecordBase::State state, const CollectionBase& collec } CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourcesManager) -: mEncoder (encoding), mRefs (mCells), mResourcesManager (resourcesManager), mReader (0), - mDialogue (0) +: mEncoder (encoding), mPathgrids (mCells), mRefs (mCells), + mResourcesManager (resourcesManager), mReader (0), mDialogue (0) { mGlobals.addColumn (new StringIdColumn); mGlobals.addColumn (new RecordStateColumn); @@ -71,7 +71,6 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mGmsts.addColumn (new StringIdColumn); mGmsts.addColumn (new RecordStateColumn); mGmsts.addColumn (new FixedRecordTypeColumn (UniversalId::Type_Gmst)); - mGmsts.addColumn (new FixedRecordTypeColumn (UniversalId::Type_Gmst)); mGmsts.addColumn (new VarTypeColumn (ColumnBase::Display_GmstVarType)); mGmsts.addColumn (new VarValueColumn); @@ -221,6 +220,40 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mBodyParts.addColumn (new ModelColumn); mBodyParts.addColumn (new RaceColumn); + mSoundGens.addColumn (new StringIdColumn); + mSoundGens.addColumn (new RecordStateColumn); + mSoundGens.addColumn (new FixedRecordTypeColumn (UniversalId::Type_SoundGen)); + mSoundGens.addColumn (new CreatureColumn); + mSoundGens.addColumn (new SoundColumn); + mSoundGens.addColumn (new SoundGeneratorTypeColumn); + + mMagicEffects.addColumn (new StringIdColumn); + mMagicEffects.addColumn (new RecordStateColumn); + mMagicEffects.addColumn (new FixedRecordTypeColumn (UniversalId::Type_MagicEffect)); + mMagicEffects.addColumn (new SchoolColumn); + mMagicEffects.addColumn (new BaseCostColumn); + mMagicEffects.addColumn (new EffectTextureColumn (Columns::ColumnId_Icon)); + mMagicEffects.addColumn (new EffectTextureColumn (Columns::ColumnId_Particle)); + mMagicEffects.addColumn (new EffectObjectColumn (Columns::ColumnId_CastingObject)); + mMagicEffects.addColumn (new EffectObjectColumn (Columns::ColumnId_HitObject)); + mMagicEffects.addColumn (new EffectObjectColumn (Columns::ColumnId_AreaObject)); + mMagicEffects.addColumn (new EffectObjectColumn (Columns::ColumnId_BoltObject)); + mMagicEffects.addColumn (new EffectSoundColumn (Columns::ColumnId_CastingSound)); + mMagicEffects.addColumn (new EffectSoundColumn (Columns::ColumnId_HitSound)); + mMagicEffects.addColumn (new EffectSoundColumn (Columns::ColumnId_AreaSound)); + mMagicEffects.addColumn (new EffectSoundColumn (Columns::ColumnId_BoltSound)); + mMagicEffects.addColumn (new FlagColumn ( + Columns::ColumnId_AllowSpellmaking, ESM::MagicEffect::AllowSpellmaking)); + mMagicEffects.addColumn (new FlagColumn ( + Columns::ColumnId_AllowEnchanting, ESM::MagicEffect::AllowEnchanting)); + mMagicEffects.addColumn (new FlagColumn ( + Columns::ColumnId_NegativeLight, ESM::MagicEffect::NegativeLight)); + mMagicEffects.addColumn (new DescriptionColumn); + + mPathgrids.addColumn (new StringIdColumn); + mPathgrids.addColumn (new RecordStateColumn); + mPathgrids.addColumn (new FixedRecordTypeColumn (UniversalId::Type_Pathgrid)); + mRefs.addColumn (new StringIdColumn (true)); mRefs.addColumn (new RecordStateColumn); mRefs.addColumn (new FixedRecordTypeColumn (UniversalId::Type_Reference)); @@ -291,6 +324,9 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc addModel (new IdTable (&mCells, IdTable::Feature_ViewId), UniversalId::Type_Cell); addModel (new IdTable (&mEnchantments), UniversalId::Type_Enchantment); addModel (new IdTable (&mBodyParts), UniversalId::Type_BodyPart); + addModel (new IdTable (&mSoundGens), UniversalId::Type_SoundGen); + addModel (new IdTable (&mMagicEffects), UniversalId::Type_MagicEffect); + addModel (new IdTable (&mPathgrids), UniversalId::Type_Pathgrid); addModel (new IdTable (&mReferenceables, IdTable::Feature_Preview), UniversalId::Type_Referenceable); addModel (new IdTable (&mRefs, IdTable::Feature_ViewCell | IdTable::Feature_Preview), UniversalId::Type_Reference); @@ -549,6 +585,36 @@ const CSMWorld::IdCollection& CSMWorld::Data::getLandText return mLandTextures; } +const CSMWorld::IdCollection& CSMWorld::Data::getSoundGens() const +{ + return mSoundGens; +} + +CSMWorld::IdCollection& CSMWorld::Data::getSoundGens() +{ + return mSoundGens; +} + +const CSMWorld::IdCollection& CSMWorld::Data::getMagicEffects() const +{ + return mMagicEffects; +} + +CSMWorld::IdCollection& CSMWorld::Data::getMagicEffects() +{ + return mMagicEffects; +} + +const CSMWorld::SubCellCollection& CSMWorld::Data::getPathgrids() const +{ + return mPathgrids; +} + +CSMWorld::SubCellCollection& CSMWorld::Data::getPathgrids() +{ + return mPathgrids; +} + const CSMWorld::Resources& CSMWorld::Data::getResources (const UniversalId& id) const { return mResourcesManager.get (id.getType()); @@ -641,6 +707,9 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Stage::Messages& messages) case ESM::REC_SPEL: mSpells.load (*mReader, mBase); break; case ESM::REC_ENCH: mEnchantments.load (*mReader, mBase); break; case ESM::REC_BODY: mBodyParts.load (*mReader, mBase); break; + case ESM::REC_SNDG: mSoundGens.load (*mReader, mBase); break; + case ESM::REC_MGEF: mMagicEffects.load (*mReader, mBase); break; + case ESM::REC_PGRD: mPathgrids.load (*mReader, mBase); break; case ESM::REC_LTEX: mLandTextures.load (*mReader, mBase); break; case ESM::REC_LAND: mLand.load(*mReader, mBase); break; @@ -794,9 +863,9 @@ bool CSMWorld::Data::hasId (const std::string& id) const getCells().searchId (id)!=-1 || getEnchantments().searchId (id)!=-1 || getBodyParts().searchId (id)!=-1 || - getReferenceables().searchId (id)!=-1 || - getLand().searchId (id) != -1 || - getLandTextures().searchId (id) != -1; + getSoundGens().searchId (id)!=-1 || + getMagicEffects().searchId (id)!=-1 || + getReferenceables().searchId (id)!=-1; } int CSMWorld::Data::count (RecordBase::State state) const @@ -816,9 +885,12 @@ int CSMWorld::Data::count (RecordBase::State state) const count (state, mCells) + count (state, mEnchantments) + count (state, mBodyParts) + - count (state, mReferenceables) + count (state, mLand) + - count (state, mLandTextures); + count (state, mLandTextures) + + count (state, mSoundGens) + + count (state, mMagicEffects) + + count (state, mReferenceables) + + count (state, mPathgrids); } void CSMWorld::Data::setDescription (const std::string& description) @@ -860,9 +932,9 @@ std::vector CSMWorld::Data::getIds (bool listDeleted) const appendIds (ids, mCells, listDeleted); appendIds (ids, mEnchantments, listDeleted); appendIds (ids, mBodyParts, listDeleted); + appendIds (ids, mSoundGens, listDeleted); + appendIds (ids, mMagicEffects, listDeleted); appendIds (ids, mReferenceables, listDeleted); - appendIds (ids, mLand, listDeleted); - appendIds (ids, mLandTextures, listDeleted); std::sort (ids.begin(), ids.end()); diff --git a/apps/opencs/model/world/data.hpp b/apps/opencs/model/world/data.hpp index aa4e640c2..70a02656b 100644 --- a/apps/opencs/model/world/data.hpp +++ b/apps/opencs/model/world/data.hpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include @@ -38,6 +40,8 @@ #include "refidcollection.hpp" #include "refcollection.hpp" #include "infocollection.hpp" +#include "pathgrid.hpp" +#include "subcellcollection.hpp" class QAbstractItemModel; @@ -72,7 +76,10 @@ namespace CSMWorld IdCollection mJournals; IdCollection mEnchantments; IdCollection mBodyParts; + IdCollection mMagicEffects; + SubCellCollection mPathgrids; IdCollection mDebugProfiles; + IdCollection mSoundGens; InfoCollection mTopicInfos; InfoCollection mJournalInfos; IdCollection mCells; @@ -205,6 +212,18 @@ namespace CSMWorld const IdCollection& getLandTextures() const; + const IdCollection& getSoundGens() const; + + IdCollection& getSoundGens(); + + const IdCollection& getMagicEffects() const; + + IdCollection& getMagicEffects(); + + const SubCellCollection& getPathgrids() const; + + SubCellCollection& getPathgrids(); + /// Throws an exception, if \a id does not match a resources list. const Resources& getResources (const UniversalId& id) const; diff --git a/apps/opencs/model/world/idcollection.hpp b/apps/opencs/model/world/idcollection.hpp index 940181c24..0129ba3d8 100644 --- a/apps/opencs/model/world/idcollection.hpp +++ b/apps/opencs/model/world/idcollection.hpp @@ -11,6 +11,8 @@ namespace CSMWorld template > class IdCollection : public Collection { + virtual void loadRecord (ESXRecordT& record, ESM::ESMReader& reader); + public: void load (ESM::ESMReader& reader, bool base); @@ -26,6 +28,13 @@ namespace CSMWorld /// \return Has the ID been deleted? }; + template + void IdCollection::loadRecord (ESXRecordT& record, + ESM::ESMReader& reader) + { + record.load (reader); + } + template void IdCollection::load (ESM::ESMReader& reader, bool base) { @@ -69,7 +78,7 @@ namespace CSMWorld record = this->getRecord (index).get(); } - record.load (reader); + loadRecord (record, reader); if (index==-1) { diff --git a/apps/opencs/model/world/pathgrid.cpp b/apps/opencs/model/world/pathgrid.cpp new file mode 100644 index 000000000..1c82585df --- /dev/null +++ b/apps/opencs/model/world/pathgrid.cpp @@ -0,0 +1,35 @@ + +#include "pathgrid.hpp" + +#include + +void CSMWorld::Pathgrid::load (ESM::ESMReader &esm, const IdCollection& cells) +{ + load (esm); + + // correct ID + if (!mId.empty() && mId[0]!='#' && cells.searchId (mId)==-1) + { + std::ostringstream stream; + + stream << "#" << mData.mX << " " << mData.mY; + + mId = stream.str(); + } +} + +void CSMWorld::Pathgrid::load (ESM::ESMReader &esm) +{ + ESM::Pathgrid::load (esm); + + if (mCell.empty()) + { + std::ostringstream stream; + + stream << "#" << mData.mX << " " << mData.mY; + + mId = stream.str(); + } + else + mId = mCell; +} diff --git a/apps/opencs/model/world/pathgrid.hpp b/apps/opencs/model/world/pathgrid.hpp new file mode 100644 index 000000000..3c9fcff50 --- /dev/null +++ b/apps/opencs/model/world/pathgrid.hpp @@ -0,0 +1,28 @@ +#ifndef CSM_WOLRD_PATHGRID_H +#define CSM_WOLRD_PATHGRID_H + +#include +#include + +#include + +#include "idcollection.hpp" +#include "cell.hpp" + +namespace CSMWorld +{ + /// \brief Wrapper for Pathgrid record + /// + /// \attention The mData.mX and mData.mY fields of the ESM::Pathgrid struct are not used. + /// Exterior cell coordinates are encoded in the pathgrid ID. + struct Pathgrid : public ESM::Pathgrid + { + std::string mId; + + void load (ESM::ESMReader &esm, const IdCollection& cells); + + void load (ESM::ESMReader &esm); + }; +} + +#endif \ No newline at end of file diff --git a/apps/opencs/model/world/subcellcollection.hpp b/apps/opencs/model/world/subcellcollection.hpp new file mode 100644 index 000000000..28f0de695 --- /dev/null +++ b/apps/opencs/model/world/subcellcollection.hpp @@ -0,0 +1,38 @@ +#ifndef CSM_WOLRD_SUBCOLLECTION_H +#define CSM_WOLRD_SUBCOLLECTION_H + +#include "idcollection.hpp" + +namespace CSMWorld +{ + /// \brief Single type collection of top level records that are associated with cells + template > + class SubCellCollection : public IdCollection + { + const IdCollection& mCells; + + virtual void loadRecord (ESXRecordT& record, ESM::ESMReader& reader); + + public: + + SubCellCollection (const IdCollection& cells); + + + }; + + template + void SubCellCollection::loadRecord (ESXRecordT& record, + ESM::ESMReader& reader) + { + record.load (reader, mCells); + } + + template + SubCellCollection::SubCellCollection ( + const IdCollection& cells) + : mCells (cells) + {} + +} + +#endif diff --git a/apps/opencs/model/world/universalid.cpp b/apps/opencs/model/world/universalid.cpp index 816dbc4fb..f2ed87d61 100644 --- a/apps/opencs/model/world/universalid.cpp +++ b/apps/opencs/model/world/universalid.cpp @@ -52,6 +52,9 @@ namespace { CSMWorld::UniversalId::Class_ResourceList, CSMWorld::UniversalId::Type_Videos, "Videos", 0 }, { CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_DebugProfiles, "Debug Profiles", 0 }, { CSMWorld::UniversalId::Class_Transient, CSMWorld::UniversalId::Type_RunLog, "Run Log", 0 }, + { CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_SoundGens, "Sound Generators", 0 }, + { CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_MagicEffects, "Magic Effects", 0 }, + { CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Pathgrids, "Pathgrids", 0 }, { CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker }; @@ -112,6 +115,9 @@ namespace { CSMWorld::UniversalId::Class_Resource, CSMWorld::UniversalId::Type_Texture, "Texture", 0 }, { CSMWorld::UniversalId::Class_Resource, CSMWorld::UniversalId::Type_Video, "Video", 0 }, { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_DebugProfile, "Debug Profile", 0 }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_SoundGen, "Sound Generator", 0 }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_MagicEffect, "Magic Effect", 0 }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Pathgrid, "Pathgrid", 0 }, { CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker }; diff --git a/apps/opencs/model/world/universalid.hpp b/apps/opencs/model/world/universalid.hpp index 069beed4b..ce2d021d0 100644 --- a/apps/opencs/model/world/universalid.hpp +++ b/apps/opencs/model/world/universalid.hpp @@ -122,10 +122,16 @@ namespace CSMWorld Type_Video, Type_DebugProfiles, Type_DebugProfile, + Type_SoundGens, + Type_SoundGen, + Type_MagicEffects, + Type_MagicEffect, + Type_Pathgrids, + Type_Pathgrid, Type_RunLog }; - enum { NumberOfTypes = Type_DebugProfile+1 }; + enum { NumberOfTypes = Type_RunLog+1 }; private: diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index 73beee60c..67c76d026 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -135,6 +135,10 @@ void CSVDoc::View::setupWorldMenu() connect (references, SIGNAL (triggered()), this, SLOT (addReferencesSubView())); world->addAction (references); + QAction *grid = new QAction (tr ("Pathgrid"), this); + connect (grid, SIGNAL (triggered()), this, SLOT (addPathgridSubView())); + world->addAction (grid); + world->addSeparator(); // items that don't represent single record lists follow here QAction *regionMap = new QAction (tr ("Region Map"), this); @@ -165,6 +169,10 @@ void CSVDoc::View::setupMechanicsMenu() QAction *enchantments = new QAction (tr ("Enchantments"), this); connect (enchantments, SIGNAL (triggered()), this, SLOT (addEnchantmentsSubView())); mechanics->addAction (enchantments); + + QAction *effects = new QAction (tr ("Magic Effects"), this); + connect (effects, SIGNAL (triggered()), this, SLOT (addMagicEffectsSubView())); + mechanics->addAction (effects); } void CSVDoc::View::setupCharacterMenu() @@ -220,6 +228,10 @@ void CSVDoc::View::setupAssetsMenu() connect (sounds, SIGNAL (triggered()), this, SLOT (addSoundsSubView())); assets->addAction (sounds); + QAction *soundGens = new QAction (tr ("Sound Generators"), this); + connect (soundGens, SIGNAL (triggered()), this, SLOT (addSoundGensSubView())); + assets->addAction (soundGens); + assets->addSeparator(); // resources follow here QAction *meshes = new QAction (tr ("Meshes"), this); @@ -634,6 +646,11 @@ void CSVDoc::View::addBodyPartsSubView() addSubView (CSMWorld::UniversalId::Type_BodyParts); } +void CSVDoc::View::addSoundGensSubView() +{ + addSubView (CSMWorld::UniversalId::Type_SoundGens); +} + void CSVDoc::View::addMeshesSubView() { addSubView (CSMWorld::UniversalId::Type_Meshes); @@ -654,6 +671,11 @@ void CSVDoc::View::addSoundsResSubView() addSubView (CSMWorld::UniversalId::Type_SoundsRes); } +void CSVDoc::View::addMagicEffectsSubView() +{ + addSubView (CSMWorld::UniversalId::Type_MagicEffects); +} + void CSVDoc::View::addTexturesSubView() { addSubView (CSMWorld::UniversalId::Type_Textures); @@ -674,6 +696,11 @@ void CSVDoc::View::addRunLogSubView() addSubView (CSMWorld::UniversalId::Type_RunLog); } +void CSVDoc::View::addPathgridSubView() +{ + addSubView (CSMWorld::UniversalId::Type_Pathgrids); +} + void CSVDoc::View::abortOperation (int type) { mDocument->abortOperation (type); diff --git a/apps/opencs/view/doc/view.hpp b/apps/opencs/view/doc/view.hpp index eab274a59..e3ada1f2e 100644 --- a/apps/opencs/view/doc/view.hpp +++ b/apps/opencs/view/doc/view.hpp @@ -193,6 +193,10 @@ namespace CSVDoc void addBodyPartsSubView(); + void addSoundGensSubView(); + + void addMagicEffectsSubView(); + void addMeshesSubView(); void addIconsSubView(); @@ -209,6 +213,8 @@ namespace CSVDoc void addRunLogSubView(); + void addPathgridSubView(); + void toggleShowStatusBar (bool show); void loadErrorLog(); diff --git a/apps/opencs/view/doc/viewmanager.cpp b/apps/opencs/view/doc/viewmanager.cpp index 2b46eecd2..4229ab531 100644 --- a/apps/opencs/view/doc/viewmanager.cpp +++ b/apps/opencs/view/doc/viewmanager.cpp @@ -82,7 +82,9 @@ CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager) { CSMWorld::ColumnBase::Display_EnchantmentType, CSMWorld::Columns::ColumnId_EnchantmentType, false }, { CSMWorld::ColumnBase::Display_BodyPartType, CSMWorld::Columns::ColumnId_BodyPartType, false }, { CSMWorld::ColumnBase::Display_MeshType, CSMWorld::Columns::ColumnId_MeshType, false }, - { CSMWorld::ColumnBase::Display_Gender, CSMWorld::Columns::ColumnId_Gender, true } + { CSMWorld::ColumnBase::Display_Gender, CSMWorld::Columns::ColumnId_Gender, true }, + { CSMWorld::ColumnBase::Display_SoundGeneratorType, CSMWorld::Columns::ColumnId_SoundGeneratorType, false }, + { CSMWorld::ColumnBase::Display_School, CSMWorld::Columns::ColumnId_School, true } }; for (std::size_t i=0; i); + manager.add (CSMWorld::UniversalId::Type_MagicEffects, + new CSVDoc::SubViewFactoryWithCreator); + static const CSMWorld::UniversalId::Type sTableTypes[] = { CSMWorld::UniversalId::Type_Globals, @@ -38,6 +41,8 @@ void CSVWorld::addSubViewFactories (CSVDoc::SubViewFactoryManager& manager) CSMWorld::UniversalId::Type_Spells, CSMWorld::UniversalId::Type_Enchantments, CSMWorld::UniversalId::Type_BodyParts, + CSMWorld::UniversalId::Type_SoundGens, + CSMWorld::UniversalId::Type_Pathgrids, CSMWorld::UniversalId::Type_None // end marker }; @@ -116,6 +121,8 @@ void CSVWorld::addSubViewFactories (CSVDoc::SubViewFactoryManager& manager) CSMWorld::UniversalId::Type_Faction, CSMWorld::UniversalId::Type_Enchantment, CSMWorld::UniversalId::Type_BodyPart, + CSMWorld::UniversalId::Type_SoundGen, + CSMWorld::UniversalId::Type_Pathgrid, CSMWorld::UniversalId::Type_None // end marker }; @@ -128,6 +135,9 @@ void CSVWorld::addSubViewFactories (CSVDoc::SubViewFactoryManager& manager) manager.add (CSMWorld::UniversalId::Type_Skill, new CSVDoc::SubViewFactoryWithCreator (false)); + manager.add (CSMWorld::UniversalId::Type_MagicEffect, + new CSVDoc::SubViewFactoryWithCreator (false)); + manager.add (CSMWorld::UniversalId::Type_Gmst, new CSVDoc::SubViewFactoryWithCreator (false)); diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 7aac65bd3..58f23c175 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -34,7 +34,7 @@ namespace MWGui , mSourceModel(NULL) , mSourceView(NULL) , mSourceSortModel(NULL) - , mIsOnDragAndDrop(NULL) + , mIsOnDragAndDrop(false) { } diff --git a/apps/openmw/mwgui/hud.hpp b/apps/openmw/mwgui/hud.hpp index b41a374b6..ca68d907a 100644 --- a/apps/openmw/mwgui/hud.hpp +++ b/apps/openmw/mwgui/hud.hpp @@ -74,8 +74,6 @@ namespace MWGui MyGUI::TextBox* mWeaponSpellBox; MyGUI::Widget *mDrowningFrame, *mDrowningFlash; - MyGUI::Widget* mDummy; - MyGUI::Widget* mFpsBox; MyGUI::TextBox* mFpsCounter; MyGUI::TextBox* mTriangleCounter; diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 2786f6bd3..d1eeba157 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -39,6 +39,8 @@ namespace MWGui , mPreviewDirty(true) , mPreviewResize(true) , mDragAndDrop(dragAndDrop) + , mSortModel(NULL) + , mTradeModel(NULL) , mSelectedItem(-1) , mGuiMode(GM_Inventory) { diff --git a/apps/openmw/mwgui/mainmenu.cpp b/apps/openmw/mwgui/mainmenu.cpp index 81b082568..bb003c481 100644 --- a/apps/openmw/mwgui/mainmenu.cpp +++ b/apps/openmw/mwgui/mainmenu.cpp @@ -29,6 +29,7 @@ namespace MWGui , mButtonBox(0), mWidth (w), mHeight (h) , mSaveGameDialog(NULL) , mBackground(NULL) + , mVideoBackground(NULL) , mVideo(NULL) { getWidget(mVersionText, "VersionText"); @@ -43,7 +44,7 @@ namespace MWGui rev = rev.substr(0,10); sstream << "\nRevision: " << rev; } - + std::string output = sstream.str(); mVersionText->setCaption(output); diff --git a/apps/openmw/mwgui/spellcreationdialog.cpp b/apps/openmw/mwgui/spellcreationdialog.cpp index e2fac9d6d..00cab6c45 100644 --- a/apps/openmw/mwgui/spellcreationdialog.cpp +++ b/apps/openmw/mwgui/spellcreationdialog.cpp @@ -447,8 +447,12 @@ namespace MWGui EffectEditorBase::EffectEditorBase(Type type) : mAddEffectDialog() + , mAvailableEffectsList(NULL) + , mUsedEffectsView(NULL) , mSelectAttributeDialog(NULL) , mSelectSkillDialog(NULL) + , mSelectedEffect(0) + , mSelectedKnownEffectId(0) , mType(type) { mAddEffectDialog.eventEffectAdded += MyGUI::newDelegate(this, &EffectEditorBase::onEffectAdded); diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index 1dae77641..d473988f9 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -79,7 +79,6 @@ namespace MWGui class SpellCreationDialog; class EnchantingDialog; class TrainingWindow; - class Cursor; class SpellIcons; class MerchantRepair; class Repair; @@ -392,7 +391,6 @@ namespace MWGui DebugWindow* mDebugWindow; Translation::Storage& mTranslationDataStorage; - Cursor* mSoftwareCursor; CharacterCreation* mCharGen; diff --git a/apps/openmw/mwrender/occlusionquery.cpp b/apps/openmw/mwrender/occlusionquery.cpp index 92a49acc0..2693d68b2 100644 --- a/apps/openmw/mwrender/occlusionquery.cpp +++ b/apps/openmw/mwrender/occlusionquery.cpp @@ -19,14 +19,14 @@ using namespace Ogre; OcclusionQuery::OcclusionQuery(OEngine::Render::OgreRenderer* renderer, SceneNode* sunNode) : mSunTotalAreaQuery(0), mSunVisibleAreaQuery(0), mActiveQuery(0), - mDoQuery(0), mSunVisibility(0), + mBBQueryVisible(0), mBBQueryTotal(0), mSunNode(sunNode), mBBNodeReal(0), + mSunVisibility(0), mWasVisible(false), mActive(false), - mFirstFrame(true) + mFirstFrame(true), + mDoQuery(0), + mRendering(renderer) { - mRendering = renderer; - mSunNode = sunNode; - try { RenderSystem* renderSystem = Root::getSingleton().getRenderSystem(); diff --git a/apps/openmw/mwrender/shadows.cpp b/apps/openmw/mwrender/shadows.cpp index 596c6697a..5a6ccaca6 100644 --- a/apps/openmw/mwrender/shadows.cpp +++ b/apps/openmw/mwrender/shadows.cpp @@ -20,10 +20,9 @@ using namespace Ogre; using namespace MWRender; Shadows::Shadows(OEngine::Render::OgreRenderer* rend) : + mRendering(rend), mSceneMgr(rend->getScene()), mPSSMSetup(NULL), mShadowFar(1000), mFadeStart(0.9) { - mRendering = rend; - mSceneMgr = mRendering->getScene(); recreate(); } diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 8e7bd3d89..ccef74efb 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -69,6 +69,7 @@ BillboardObject::BillboardObject( const String& textureName, } BillboardObject::BillboardObject() +: mNode(NULL), mMaterial(NULL), mEntity(NULL) { } @@ -222,6 +223,7 @@ SkyManager::SkyManager(Ogre::SceneNode *root, Ogre::Camera *pCamera) , mCloudOpacity(0.0f) , mCloudSpeed(0.0f) , mStarsOpacity(0.0f) + , mLightning(NULL) , mRemainingTransitionTime(0.0f) , mGlareFade(0.0f) , mGlare(0.0f) diff --git a/apps/openmw/mwworld/store.hpp b/apps/openmw/mwworld/store.hpp index 9a442387b..107db68b1 100644 --- a/apps/openmw/mwworld/store.hpp +++ b/apps/openmw/mwworld/store.hpp @@ -590,6 +590,7 @@ namespace MWWorld typedef SharedIterator iterator; Store() + : mEsmStore(NULL) {} const ESM::Cell *search(const std::string &id) const { diff --git a/components/compiler/fileparser.cpp b/components/compiler/fileparser.cpp index e90e9a8f6..37ad1f258 100644 --- a/components/compiler/fileparser.cpp +++ b/components/compiler/fileparser.cpp @@ -65,6 +65,7 @@ namespace Compiler if (mState==BeginState && keyword==Scanner::K_begin) { mState = NameState; + scanner.allowNameStartingwithDigit(); return true; } diff --git a/components/compiler/scanner.cpp b/components/compiler/scanner.cpp index dd8fb431b..e73477ee7 100644 --- a/components/compiler/scanner.cpp +++ b/components/compiler/scanner.cpp @@ -48,6 +48,9 @@ namespace Compiler bool Scanner::scanToken (Parser& parser) { + bool allowDigit = mNameStartingWithDigit; + mNameStartingWithDigit = false; + switch (mPutback) { case Putback_Special: @@ -112,6 +115,7 @@ namespace Compiler else if (isWhitespace (c)) { mLoc.mLiteral.clear(); + mNameStartingWithDigit = allowDigit; return true; } else if (c==':') @@ -120,21 +124,21 @@ namespace Compiler mLoc.mLiteral.clear(); return true; } - else if (std::isdigit (c)) + else if (std::isalpha (c) || c=='_' || c=='"' || (allowDigit && std::isdigit (c))) { bool cont = false; - if (scanInt (c, parser, cont)) + if (scanName (c, parser, cont)) { mLoc.mLiteral.clear(); return cont; } } - else if (std::isalpha (c) || c=='_' || c=='"') + else if (std::isdigit (c)) { bool cont = false; - if (scanName (c, parser, cont)) + if (scanInt (c, parser, cont)) { mLoc.mLiteral.clear(); return cont; @@ -516,7 +520,8 @@ namespace Compiler Scanner::Scanner (ErrorHandler& errorHandler, std::istream& inputStream, const Extensions *extensions) : mErrorHandler (errorHandler), mStream (inputStream), mExtensions (extensions), - mPutback (Putback_None), mPutbackCode(0), mPutbackInteger(0), mPutbackFloat(0) + mPutback (Putback_None), mPutbackCode(0), mPutbackInteger(0), mPutbackFloat(0), + mNameStartingWithDigit (false) { } @@ -568,4 +573,9 @@ namespace Compiler if (mExtensions) mExtensions->listKeywords (keywords); } + + void Scanner::allowNameStartingwithDigit() + { + mNameStartingWithDigit = true; + } } diff --git a/components/compiler/scanner.hpp b/components/compiler/scanner.hpp index 7f6609f76..349a8afb6 100644 --- a/components/compiler/scanner.hpp +++ b/components/compiler/scanner.hpp @@ -37,6 +37,7 @@ namespace Compiler float mPutbackFloat; std::string mPutbackName; TokenLoc mPutbackLoc; + bool mNameStartingWithDigit; public: @@ -122,6 +123,9 @@ namespace Compiler void listKeywords (std::vector& keywords); ///< Append all known keywords to \a kaywords. + + /// For the next token allow names to start with a digit. + void allowNameStartingwithDigit(); }; } diff --git a/components/esm/loadmgef.cpp b/components/esm/loadmgef.cpp index 04d55c828..cbdca3e31 100644 --- a/components/esm/loadmgef.cpp +++ b/components/esm/loadmgef.cpp @@ -1,6 +1,7 @@ #include "loadmgef.hpp" #include +#include #include @@ -10,6 +11,157 @@ namespace { + static const char *sIds[ESM::MagicEffect::Length] = + { + "WaterBreathing", + "SwiftSwim", + "WaterWalking", + "Shield", + "FireShield", + "LightningShield", + "FrostShield", + "Burden", + "Feather", + "Jump", + "Levitate", + "SlowFall", + "Lock", + "Open", + "FireDamage", + "ShockDamage", + "FrostDamage", + "DrainAttribute", + "DrainHealth", + "DrainMagicka", + "DrainFatigue", + "DrainSkill", + "DamageAttribute", + "DamageHealth", + "DamageMagicka", + "DamageFatigue", + "DamageSkill", + "Poison", + "WeaknessToFire", + "WeaknessToFrost", + "WeaknessToShock", + "WeaknessToMagicka", + "WeaknessToCommonDisease", + "WeaknessToBlightDisease", + "WeaknessToCorprusDisease", + "WeaknessToPoison", + "WeaknessToNormalWeapons", + "DisintegrateWeapon", + "DisintegrateArmor", + "Invisibility", + "Chameleon", + "Light", + "Sanctuary", + "NightEye", + "Charm", + "Paralyze", + "Silence", + "Blind", + "Sound", + "CalmHumanoid", + "CalmCreature", + "FrenzyHumanoid", + "FrenzyCreature", + "DemoralizeHumanoid", + "DemoralizeCreature", + "RallyHumanoid", + "RallyCreature", + "Dispel", + "Soultrap", + "Telekinesis", + "Mark", + "Recall", + "DivineIntervention", + "AlmsiviIntervention", + "DetectAnimal", + "DetectEnchantment", + "DetectKey", + "SpellAbsorption", + "Reflect", + "CureCommonDisease", + "CureBlightDisease", + "CureCorprusDisease", + "CurePoison", + "CureParalyzation", + "RestoreAttribute", + "RestoreHealth", + "RestoreMagicka", + "RestoreFatigue", + "RestoreSkill", + "FortifyAttribute", + "FortifyHealth", + "FortifyMagicka", + "FortifyFatigue", + "FortifySkill", + "FortifyMaximumMagicka", + "AbsorbAttribute", + "AbsorbHealth", + "AbsorbMagicka", + "AbsorbFatigue", + "AbsorbSkill", + "ResistFire", + "ResistFrost", + "ResistShock", + "ResistMagicka", + "ResistCommonDisease", + "ResistBlightDisease", + "ResistCorprusDisease", + "ResistPoison", + "ResistNormalWeapons", + "ResistParalysis", + "RemoveCurse", + "TurnUndead", + "SummonScamp", + "SummonClannfear", + "SummonDaedroth", + "SummonDremora", + "SummonAncestralGhost", + "SummonSkeletalMinion", + "SummonBonewalker", + "SummonGreaterBonewalker", + "SummonBonelord", + "SummonWingedTwilight", + "SummonHunger", + "SummonGoldenSaint", + "SummonFlameAtronach", + "SummonFrostAtronach", + "SummonStormAtronach", + "FortifyAttack", + "CommandCreature", + "CommandHumanoid", + "BoundDagger", + "BoundLongsword", + "BoundMace", + "BoundBattleAxe", + "BoundSpear", + "BoundLongbow", + "ExtraSpell", + "BoundCuirass", + "BoundHelm", + "BoundBoots", + "BoundShield", + "BoundGloves", + "Corprus", + "Vampirism", + "SummonCenturionSphere", + "SunDamage", + "StuntedMagicka", + + // Tribunal only + "SummonFabricant", + + // Bloodmoon only + "SummonWolf", + "SummonBear", + "SummonBonewolf", + "SummonCreature04", + "SummonCreature05" + }; + const int NumberOfHardcodedFlags = 143; const int HardcodedFlags[NumberOfHardcodedFlags] = { 0x11c8, 0x11c0, 0x11c8, 0x11e0, 0x11e0, 0x11e0, 0x11e0, 0x11d0, @@ -41,6 +193,8 @@ void MagicEffect::load(ESMReader &esm) { esm.getHNT(mIndex, "INDX"); + mId = indexToId (mIndex); + esm.getHNT(mData, "MEDT", 36); if (esm.getFormat() == 0) { @@ -388,4 +542,51 @@ MagicEffect::MagnitudeDisplayType MagicEffect::getMagnitudeDisplayType() const { return MDT_Points; } + void MagicEffect::blank() + { + mData.mSchool = 0; + mData.mBaseCost = 0; + mData.mFlags = 0; + mData.mRed = 0; + mData.mGreen = 0; + mData.mBlue = 0; + mData.mSpeed = 0; + + mIcon.clear(); + mParticle.clear(); + mCasting.clear(); + mHit.clear(); + mArea.clear(); + mBolt.clear(); + mCastSound.clear(); + mBoltSound.clear(); + mHitSound.clear(); + mAreaSound.clear(); + mDescription.clear(); + } + + std::string MagicEffect::indexToId (int index) + { + std::ostringstream stream; + + if (index!=-1) + { + stream << "#"; + + if (index<100) + { + stream << "0"; + + if (index<10) + stream << "0"; + } + + stream << index; + + if (index>=0 && index