Merge branch 'staticcollections' into 'master'

Place static collections to the scene and fix item modification record loading

See merge request OpenMW/openmw!4085
i-have-no-land-and-i-must-scream
psi29a 8 months ago
commit 919d1e366e

@ -17,6 +17,7 @@
#include <components/esm4/loadmisc.hpp>
#include <components/esm4/loadmstt.hpp>
#include <components/esm4/loadnpc.hpp>
#include <components/esm4/loadscol.hpp>
#include <components/esm4/loadstat.hpp>
#include <components/esm4/loadterm.hpp>
#include <components/esm4/loadtree.hpp>
@ -92,6 +93,7 @@ namespace MWClass
ESM4Npc::registerSelf();
ESM4Named<ESM4::Potion>::registerSelf();
ESM4Static::registerSelf();
ESM4Named<ESM4::StaticCollection>::registerSelf();
ESM4Named<ESM4::Terminal>::registerSelf();
ESM4Tree::registerSelf();
ESM4Named<ESM4::Weapon>::registerSelf();

@ -39,6 +39,7 @@
#include <components/esm4/loadmisc.hpp>
#include <components/esm4/loadmstt.hpp>
#include <components/esm4/loadrefr.hpp>
#include <components/esm4/loadscol.hpp>
#include <components/esm4/loadstat.hpp>
#include <components/esm4/loadtree.hpp>
#include <components/esm4/loadweap.hpp>
@ -260,6 +261,9 @@ namespace MWLua
case ESM::REC_ALCH4:
cell.mStore->template forEachType<ESM4::Potion>(visitor);
break;
case ESM::REC_SCOL4:
cell.mStore->template forEachType<ESM4::StaticCollection>(visitor);
break;
case ESM::REC_STAT4:
cell.mStore->template forEachType<ESM4::Static>(visitor);
break;

@ -51,6 +51,7 @@ namespace MWLua
constexpr std::string_view ESM4MovableStatic = "ESM4MovableStatic";
constexpr std::string_view ESM4Potion = "ESM4Potion";
constexpr std::string_view ESM4Static = "ESM4Static";
constexpr std::string_view ESM4StaticCollection = "ESM4StaticCollection";
constexpr std::string_view ESM4Terminal = "ESM4Terminal";
constexpr std::string_view ESM4Tree = "ESM4Tree";
constexpr std::string_view ESM4Weapon = "ESM4Weapon";
@ -97,6 +98,7 @@ namespace MWLua
{ ESM::REC_MSTT4, ObjectTypeName::ESM4MovableStatic },
{ ESM::REC_ALCH4, ObjectTypeName::ESM4Potion },
{ ESM::REC_STAT4, ObjectTypeName::ESM4Static },
{ ESM::REC_SCOL4, ObjectTypeName::ESM4StaticCollection },
{ ESM::REC_TERM4, ObjectTypeName::ESM4Terminal },
{ ESM::REC_TREE4, ObjectTypeName::ESM4Tree },
{ ESM::REC_WEAP4, ObjectTypeName::ESM4Weapon },
@ -244,6 +246,7 @@ namespace MWLua
addType(ObjectTypeName::ESM4MovableStatic, { ESM::REC_MSTT4 });
addType(ObjectTypeName::ESM4Potion, { ESM::REC_ALCH4 });
addType(ObjectTypeName::ESM4Static, { ESM::REC_STAT4 });
addType(ObjectTypeName::ESM4StaticCollection, { ESM::REC_SCOL4 });
addESM4TerminalBindings(addType(ObjectTypeName::ESM4Terminal, { ESM::REC_TERM4 }), context);
addType(ObjectTypeName::ESM4Tree, { ESM::REC_TREE4 });
addType(ObjectTypeName::ESM4Weapon, { ESM::REC_WEAP4 });

@ -61,6 +61,7 @@
#include <components/esm4/loadmstt.hpp>
#include <components/esm4/loadnpc.hpp>
#include <components/esm4/loadrefr.hpp>
#include <components/esm4/loadscol.hpp>
#include <components/esm4/loadstat.hpp>
#include <components/esm4/loadterm.hpp>
#include <components/esm4/loadtree.hpp>

@ -75,6 +75,7 @@ namespace ESM4
struct ItemMod;
struct MiscItem;
struct MovableStatic;
struct StaticCollection;
struct Terminal;
struct Tree;
struct Weapon;
@ -99,7 +100,7 @@ namespace MWWorld
CellRefList<ESM4::Container>, CellRefList<ESM4::Door>, CellRefList<ESM4::Flora>, CellRefList<ESM4::Ingredient>,
CellRefList<ESM4::ItemMod>, CellRefList<ESM4::Terminal>, CellRefList<ESM4::Tree>, CellRefList<ESM4::MiscItem>,
CellRefList<ESM4::MovableStatic>, CellRefList<ESM4::Weapon>, CellRefList<ESM4::Furniture>,
CellRefList<ESM4::Creature>, CellRefList<ESM4::Npc>>;
CellRefList<ESM4::Creature>, CellRefList<ESM4::Npc>, CellRefList<ESM4::StaticCollection>>;
/// \brief Mutable state of a cell
class CellStore

@ -366,6 +366,7 @@ namespace MWWorld
case ESM::REC_DOOR4:
case ESM::REC_FLOR4:
case ESM::REC_FURN4:
case ESM::REC_IMOD4:
case ESM::REC_INGR4:
case ESM::REC_LIGH4:
case ESM::REC_LVLI4:
@ -374,6 +375,7 @@ namespace MWWorld
case ESM::REC_MISC4:
case ESM::REC_MSTT4:
case ESM::REC_NPC_4:
case ESM::REC_SCOL4:
case ESM::REC_STAT4:
case ESM::REC_TERM4:
case ESM::REC_TREE4:

@ -106,6 +106,7 @@ namespace ESM4
struct Race;
struct Reference;
struct Static;
struct StaticCollection;
struct Terminal;
struct Tree;
struct Weapon;
@ -145,7 +146,8 @@ namespace MWWorld
Store<ESM4::Land>, Store<ESM4::LandTexture>, Store<ESM4::LevelledCreature>, Store<ESM4::LevelledItem>,
Store<ESM4::LevelledNpc>, Store<ESM4::Light>, Store<ESM4::MiscItem>, Store<ESM4::MovableStatic>,
Store<ESM4::Npc>, Store<ESM4::Outfit>, Store<ESM4::Potion>, Store<ESM4::Race>, Store<ESM4::Reference>,
Store<ESM4::Static>, Store<ESM4::Terminal>, Store<ESM4::Tree>, Store<ESM4::Weapon>, Store<ESM4::World>>;
Store<ESM4::Static>, Store<ESM4::StaticCollection>, Store<ESM4::Terminal>, Store<ESM4::Tree>,
Store<ESM4::Weapon>, Store<ESM4::World>>;
private:
template <typename T>

@ -1376,6 +1376,7 @@ template class MWWorld::TypedDynamicStore<ESM4::Outfit>;
template class MWWorld::TypedDynamicStore<ESM4::Potion>;
template class MWWorld::TypedDynamicStore<ESM4::Race>;
template class MWWorld::TypedDynamicStore<ESM4::Static>;
template class MWWorld::TypedDynamicStore<ESM4::StaticCollection>;
template class MWWorld::TypedDynamicStore<ESM4::Terminal>;
template class MWWorld::TypedDynamicStore<ESM4::Tree>;
template class MWWorld::TypedDynamicStore<ESM4::Weapon>;

@ -73,6 +73,7 @@
#include <components/esm4/loadotft.hpp>
#include <components/esm4/loadrace.hpp>
#include <components/esm4/loadrefr.hpp>
#include <components/esm4/loadscol.hpp>
#include <components/esm4/loadstat.hpp>
#include <components/esm4/loadterm.hpp>
#include <components/esm4/loadtree.hpp>

@ -49,12 +49,14 @@ void ESM4::StaticCollection::load(ESM4::Reader& reader)
case ESM::fourCC("FULL"):
reader.getLocalizedString(mFullName);
break;
case ESM::fourCC("OBND"):
case ESM::fourCC("MODL"): // Model data start
reader.getZString(mModel);
break;
case ESM::fourCC("MODT"):
case ESM::fourCC("MODC"):
case ESM::fourCC("MODS"):
case ESM::fourCC("MODF"): // Model data end
case ESM::fourCC("OBND"):
case ESM::fourCC("ONAM"):
case ESM::fourCC("DATA"):
case ESM::fourCC("FLTR"): // FO4

@ -47,6 +47,7 @@ namespace ESM4
std::string mEditorId;
std::string mFullName;
std::string mModel;
void load(ESM4::Reader& reader);
// void save(ESM4::Writer& writer) const;

@ -2246,6 +2246,9 @@
--- Functions for @{#ESM4Static} objects
-- @field [parent=#types] #ESM4Static ESM4Static
--- Functions for @{#ESM4StaticCollection} objects
-- @field [parent=#types] #ESM4StaticCollection ESM4StaticCollection
--- Functions for @{#ESM4Weapon} objects
-- @field [parent=#types] #ESM4Weapon ESM4Weapon

Loading…
Cancel
Save