From 7e360df6c0213d57cc164c387e526dc9fbd040d0 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Sun, 24 Sep 2023 09:08:02 +0300 Subject: [PATCH] Place ESM4::Flora instances to the scene --- apps/openmw/mwclass/classes.cpp | 2 ++ apps/openmw/mwlua/cellbindings.cpp | 4 ++++ apps/openmw/mwlua/types/types.cpp | 3 +++ apps/openmw/mwworld/cellstore.cpp | 1 + apps/openmw/mwworld/cellstore.hpp | 3 ++- apps/openmw/mwworld/esmstore.cpp | 1 + apps/openmw/mwworld/esmstore.hpp | 12 +++++++----- apps/openmw/mwworld/store.cpp | 1 + components/esm/records.hpp | 1 + files/lua_api/openmw/types.lua | 3 +++ 10 files changed, 25 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwclass/classes.cpp b/apps/openmw/mwclass/classes.cpp index 071389c22c..392cc45b6e 100644 --- a/apps/openmw/mwclass/classes.cpp +++ b/apps/openmw/mwclass/classes.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,7 @@ namespace MWClass ESM4Named::registerSelf(); ESM4Named::registerSelf(); ESM4Named::registerSelf(); + ESM4Named::registerSelf(); ESM4Named::registerSelf(); ESM4Named::registerSelf(); ESM4Named::registerSelf(); diff --git a/apps/openmw/mwlua/cellbindings.cpp b/apps/openmw/mwlua/cellbindings.cpp index 48c7141ab8..d857288979 100644 --- a/apps/openmw/mwlua/cellbindings.cpp +++ b/apps/openmw/mwlua/cellbindings.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -220,6 +221,9 @@ namespace MWLua case ESM::REC_DOOR4: cell.mStore->template forEachType(visitor); break; + case ESM::REC_FLOR4: + cell.mStore->template forEachType(visitor); + break; case ESM::REC_FURN4: cell.mStore->template forEachType(visitor); break; diff --git a/apps/openmw/mwlua/types/types.cpp b/apps/openmw/mwlua/types/types.cpp index 6095053eee..eeb7061cc3 100644 --- a/apps/openmw/mwlua/types/types.cpp +++ b/apps/openmw/mwlua/types/types.cpp @@ -42,6 +42,7 @@ namespace MWLua constexpr std::string_view ESM4Clothing = "ESM4Clothing"; constexpr std::string_view ESM4Container = "ESM4Container"; constexpr std::string_view ESM4Door = "ESM4Door"; + constexpr std::string_view ESM4Flora = "ESM4Flora"; constexpr std::string_view ESM4Furniture = "ESM4Furniture"; constexpr std::string_view ESM4Ingredient = "ESM4Ingredient"; constexpr std::string_view ESM4Light = "ESM4Light"; @@ -85,6 +86,7 @@ namespace MWLua { ESM::REC_CLOT4, ObjectTypeName::ESM4Clothing }, { ESM::REC_CONT4, ObjectTypeName::ESM4Container }, { ESM::REC_DOOR4, ObjectTypeName::ESM4Door }, + { ESM::REC_FLOR4, ObjectTypeName::ESM4Flora }, { ESM::REC_FURN4, ObjectTypeName::ESM4Furniture }, { ESM::REC_INGR4, ObjectTypeName::ESM4Ingredient }, { ESM::REC_LIGH4, ObjectTypeName::ESM4Light }, @@ -223,6 +225,7 @@ namespace MWLua addType(ObjectTypeName::ESM4Clothing, { ESM::REC_CLOT4 }); addType(ObjectTypeName::ESM4Container, { ESM::REC_CONT4 }); addESM4DoorBindings(addType(ObjectTypeName::ESM4Door, { ESM::REC_DOOR4 }, ObjectTypeName::Lockable), context); + addType(ObjectTypeName::ESM4Flora, { ESM::REC_FLOR4 }); addType(ObjectTypeName::ESM4Furniture, { ESM::REC_FURN4 }); addType(ObjectTypeName::ESM4Ingredient, { ESM::REC_INGR4 }); addType(ObjectTypeName::ESM4Light, { ESM::REC_LIGH4 }); diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index f7ec3ddcba..a13accf7c8 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include diff --git a/apps/openmw/mwworld/cellstore.hpp b/apps/openmw/mwworld/cellstore.hpp index 23bd071ff1..2543f24aa7 100644 --- a/apps/openmw/mwworld/cellstore.hpp +++ b/apps/openmw/mwworld/cellstore.hpp @@ -70,6 +70,7 @@ namespace ESM4 struct Container; struct Door; struct Furniture; + struct Flora; struct Ingredient; struct MiscItem; struct Terminal; @@ -93,7 +94,7 @@ namespace MWWorld CellRefList, CellRefList, CellRefList, CellRefList, CellRefList, CellRefList, CellRefList, CellRefList, - CellRefList, CellRefList, CellRefList, + CellRefList, CellRefList, CellRefList, CellRefList, CellRefList, CellRefList, CellRefList, CellRefList, CellRefList, CellRefList, CellRefList>; diff --git a/apps/openmw/mwworld/esmstore.cpp b/apps/openmw/mwworld/esmstore.cpp index 209fc39b42..f9b53cf21f 100644 --- a/apps/openmw/mwworld/esmstore.cpp +++ b/apps/openmw/mwworld/esmstore.cpp @@ -284,6 +284,7 @@ namespace MWWorld case ESM::REC_CONT4: case ESM::REC_CREA4: case ESM::REC_DOOR4: + case ESM::REC_FLOR4: case ESM::REC_FURN4: case ESM::REC_INGR4: case ESM::REC_LIGH4: diff --git a/apps/openmw/mwworld/esmstore.hpp b/apps/openmw/mwworld/esmstore.hpp index 80cd5719e2..821ca6f488 100644 --- a/apps/openmw/mwworld/esmstore.hpp +++ b/apps/openmw/mwworld/esmstore.hpp @@ -86,6 +86,7 @@ namespace ESM4 struct Container; struct Creature; struct Door; + struct Flora; struct Furniture; struct Hair; struct HeadPart; @@ -136,11 +137,12 @@ namespace MWWorld Store, Store, Store, Store, Store, Store, Store, Store, Store, - Store, Store, Store, Store, Store, - Store, Store, Store, Store, - Store, Store, Store, Store, - Store, Store, Store, Store, Store, - Store, Store, Store, Store, Store>; + Store, Store, Store, Store, + Store, Store, Store, Store, Store, + Store, Store, Store, Store, + Store, Store, Store, Store, Store, + Store, Store, Store, Store, Store, + Store>; private: template diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index 6e5b56d9ff..22f6857a24 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -1357,6 +1357,7 @@ template class MWWorld::TypedDynamicStore; template class MWWorld::TypedDynamicStore; template class MWWorld::TypedDynamicStore; template class MWWorld::TypedDynamicStore; +template class MWWorld::TypedDynamicStore; template class MWWorld::TypedDynamicStore; template class MWWorld::TypedDynamicStore; template class MWWorld::TypedDynamicStore; diff --git a/components/esm/records.hpp b/components/esm/records.hpp index 4af60db8b5..ccd03a05b9 100644 --- a/components/esm/records.hpp +++ b/components/esm/records.hpp @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include diff --git a/files/lua_api/openmw/types.lua b/files/lua_api/openmw/types.lua index 03efe885b5..df6e17c6f4 100644 --- a/files/lua_api/openmw/types.lua +++ b/files/lua_api/openmw/types.lua @@ -1803,6 +1803,9 @@ --- Functions for @{#ESM4Door} objects -- @field [parent=#types] #ESM4Door ESM4Door +--- Functions for @{#ESM4Flora} objects +-- @field [parent=#types] #ESM4Flora ESM4Flora + --- Functions for @{#ESM4Terminal} objects -- @field [parent=#types] #ESM4Terminal ESM4Terminal