mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-05 10:11:32 +00:00
[Lua] Change behavior of obj.type
This commit is contained in:
parent
af93ebf433
commit
d251c4e2a1
10 changed files with 461 additions and 374 deletions
|
@ -17,14 +17,6 @@
|
||||||
namespace MWLua
|
namespace MWLua
|
||||||
{
|
{
|
||||||
|
|
||||||
static sol::table definitionList(LuaUtil::LuaState& lua, std::initializer_list<std::string_view> values)
|
|
||||||
{
|
|
||||||
sol::table res(lua.sol(), sol::create);
|
|
||||||
for (const std::string_view& v : values)
|
|
||||||
res[v] = v;
|
|
||||||
return LuaUtil::makeReadOnly(res);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void addTimeBindings(sol::table& api, const Context& context, bool global)
|
static void addTimeBindings(sol::table& api, const Context& context, bool global)
|
||||||
{
|
{
|
||||||
api["getSimulationTime"] = [world=context.mWorldView]() { return world->getSimulationTime(); };
|
api["getSimulationTime"] = [world=context.mWorldView]() { return world->getSimulationTime(); };
|
||||||
|
@ -46,52 +38,6 @@ namespace MWLua
|
||||||
// api["resume"] = []() {};
|
// api["resume"] = []() {};
|
||||||
}
|
}
|
||||||
|
|
||||||
sol::table initTypesPackage(const Context& context)
|
|
||||||
{
|
|
||||||
auto* lua = context.mLua;
|
|
||||||
sol::table types(lua->sol(), sol::create);
|
|
||||||
auto addType = [&](std::string_view name, std::optional<std::string_view> base = std::nullopt) -> sol::table
|
|
||||||
{
|
|
||||||
sol::table t(lua->sol(), sol::create);
|
|
||||||
sol::table ro = LuaUtil::makeReadOnly(t);
|
|
||||||
sol::table meta = ro[sol::metatable_key];
|
|
||||||
meta[sol::meta_function::to_string] = [name]() { return name; };
|
|
||||||
if (base)
|
|
||||||
{
|
|
||||||
t[sol::metatable_key] = LuaUtil::getMutableFromReadOnly(types[*base]);
|
|
||||||
t["baseType"] = types[*base];
|
|
||||||
}
|
|
||||||
types[name] = ro;
|
|
||||||
return t;
|
|
||||||
};
|
|
||||||
|
|
||||||
addActorBindings(addType("Actor"), context);
|
|
||||||
addType("Item");
|
|
||||||
|
|
||||||
addType(ObjectTypeName::Creature, "Actor");
|
|
||||||
addType(ObjectTypeName::NPC, "Actor");
|
|
||||||
addType(ObjectTypeName::Player, ObjectTypeName::NPC);
|
|
||||||
|
|
||||||
addType(ObjectTypeName::Armor, "Item");
|
|
||||||
addType(ObjectTypeName::Book, "Item");
|
|
||||||
addType(ObjectTypeName::Clothing, "Item");
|
|
||||||
addType(ObjectTypeName::Ingredient, "Item");
|
|
||||||
addType(ObjectTypeName::Light, "Item");
|
|
||||||
addType(ObjectTypeName::MiscItem, "Item");
|
|
||||||
addType(ObjectTypeName::Potion, "Item");
|
|
||||||
addType(ObjectTypeName::Weapon, "Item");
|
|
||||||
addType(ObjectTypeName::Apparatus, "Item");
|
|
||||||
addType(ObjectTypeName::Lockpick, "Item");
|
|
||||||
addType(ObjectTypeName::Probe, "Item");
|
|
||||||
addType(ObjectTypeName::Repair, "Item");
|
|
||||||
|
|
||||||
addType(ObjectTypeName::Activator);
|
|
||||||
addDoorBindings(addType(ObjectTypeName::Door), context);
|
|
||||||
addType(ObjectTypeName::Static);
|
|
||||||
|
|
||||||
return LuaUtil::makeReadOnly(types);
|
|
||||||
}
|
|
||||||
|
|
||||||
sol::table initCorePackage(const Context& context)
|
sol::table initCorePackage(const Context& context)
|
||||||
{
|
{
|
||||||
auto* lua = context.mLua;
|
auto* lua = context.mLua;
|
||||||
|
@ -107,14 +53,6 @@ namespace MWLua
|
||||||
context.mGlobalEventQueue->push_back({std::move(eventName), LuaUtil::serialize(eventData, context.mSerializer)});
|
context.mGlobalEventQueue->push_back({std::move(eventName), LuaUtil::serialize(eventData, context.mSerializer)});
|
||||||
};
|
};
|
||||||
addTimeBindings(api, context, false);
|
addTimeBindings(api, context, false);
|
||||||
api["OBJECT_TYPE"] = definitionList(*lua, // TODO: remove, use require('openmw.types') instead
|
|
||||||
{
|
|
||||||
ObjectTypeName::Activator, ObjectTypeName::Armor, ObjectTypeName::Book, ObjectTypeName::Clothing,
|
|
||||||
ObjectTypeName::Creature, ObjectTypeName::Door, ObjectTypeName::Ingredient, ObjectTypeName::Light,
|
|
||||||
ObjectTypeName::MiscItem, ObjectTypeName::NPC, ObjectTypeName::Player, ObjectTypeName::Potion,
|
|
||||||
ObjectTypeName::Static, ObjectTypeName::Weapon, ObjectTypeName::Apparatus, ObjectTypeName::Lockpick,
|
|
||||||
ObjectTypeName::Probe, ObjectTypeName::Repair
|
|
||||||
});
|
|
||||||
api["i18n"] = [i18n=context.mI18n](const std::string& context) { return i18n->getContext(context); };
|
api["i18n"] = [i18n=context.mI18n](const std::string& context) { return i18n->getContext(context); };
|
||||||
const MWWorld::Store<ESM::GameSetting>* gmst = &MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
const MWWorld::Store<ESM::GameSetting>* gmst = &MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||||
api["getGMST"] = [lua=context.mLua, gmst](const std::string& setting) -> sol::object
|
api["getGMST"] = [lua=context.mLua, gmst](const std::string& setting) -> sol::object
|
||||||
|
|
|
@ -23,7 +23,6 @@ namespace MWLua
|
||||||
sol::table initCorePackage(const Context&);
|
sol::table initCorePackage(const Context&);
|
||||||
sol::table initWorldPackage(const Context&);
|
sol::table initWorldPackage(const Context&);
|
||||||
sol::table initQueryPackage(const Context&);
|
sol::table initQueryPackage(const Context&);
|
||||||
sol::table initTypesPackage(const Context&);
|
|
||||||
|
|
||||||
sol::table initFieldGroup(const Context&, const QueryFieldGroup&);
|
sol::table initFieldGroup(const Context&, const QueryFieldGroup&);
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "luabindings.hpp"
|
#include "luabindings.hpp"
|
||||||
#include "userdataserializer.hpp"
|
#include "userdataserializer.hpp"
|
||||||
|
#include "types/types.hpp"
|
||||||
|
|
||||||
namespace MWLua
|
namespace MWLua
|
||||||
{
|
{
|
||||||
|
@ -86,6 +87,7 @@ namespace MWLua
|
||||||
mGlobalScripts.addPackage("openmw.world", initWorldPackage(context));
|
mGlobalScripts.addPackage("openmw.world", initWorldPackage(context));
|
||||||
mGlobalScripts.addPackage("openmw.settings", initGlobalSettingsPackage(context));
|
mGlobalScripts.addPackage("openmw.settings", initGlobalSettingsPackage(context));
|
||||||
mGlobalScripts.addPackage("openmw.storage", initGlobalStoragePackage(context, &mGlobalStorage));
|
mGlobalScripts.addPackage("openmw.storage", initGlobalStoragePackage(context, &mGlobalStorage));
|
||||||
|
|
||||||
mCameraPackage = initCameraPackage(localContext);
|
mCameraPackage = initCameraPackage(localContext);
|
||||||
mUserInterfacePackage = initUserInterfacePackage(localContext);
|
mUserInterfacePackage = initUserInterfacePackage(localContext);
|
||||||
mInputPackage = initInputPackage(localContext);
|
mInputPackage = initInputPackage(localContext);
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "types/types.hpp"
|
||||||
|
|
||||||
namespace MWLua
|
namespace MWLua
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -10,88 +12,12 @@ namespace MWLua
|
||||||
return std::to_string(id.mIndex) + "_" + std::to_string(id.mContentFile);
|
return std::to_string(id.mIndex) + "_" + std::to_string(id.mContentFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct LuaObjectTypeInfo
|
|
||||||
{
|
|
||||||
std::string_view mName;
|
|
||||||
ESM::LuaScriptCfg::Flags mFlag = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
const static std::unordered_map<ESM::RecNameInts, LuaObjectTypeInfo> luaObjectTypeInfo = {
|
|
||||||
{ESM::REC_ACTI, {ObjectTypeName::Activator, ESM::LuaScriptCfg::sActivator}},
|
|
||||||
{ESM::REC_ARMO, {ObjectTypeName::Armor, ESM::LuaScriptCfg::sArmor}},
|
|
||||||
{ESM::REC_BOOK, {ObjectTypeName::Book, ESM::LuaScriptCfg::sBook}},
|
|
||||||
{ESM::REC_CLOT, {ObjectTypeName::Clothing, ESM::LuaScriptCfg::sClothing}},
|
|
||||||
{ESM::REC_CONT, {ObjectTypeName::Container, ESM::LuaScriptCfg::sContainer}},
|
|
||||||
{ESM::REC_CREA, {ObjectTypeName::Creature, ESM::LuaScriptCfg::sCreature}},
|
|
||||||
{ESM::REC_DOOR, {ObjectTypeName::Door, ESM::LuaScriptCfg::sDoor}},
|
|
||||||
{ESM::REC_INGR, {ObjectTypeName::Ingredient, ESM::LuaScriptCfg::sIngredient}},
|
|
||||||
{ESM::REC_LIGH, {ObjectTypeName::Light, ESM::LuaScriptCfg::sLight}},
|
|
||||||
{ESM::REC_MISC, {ObjectTypeName::MiscItem, ESM::LuaScriptCfg::sMiscItem}},
|
|
||||||
{ESM::REC_NPC_, {ObjectTypeName::NPC, ESM::LuaScriptCfg::sNPC}},
|
|
||||||
{ESM::REC_ALCH, {ObjectTypeName::Potion, ESM::LuaScriptCfg::sPotion}},
|
|
||||||
{ESM::REC_STAT, {ObjectTypeName::Static}},
|
|
||||||
{ESM::REC_WEAP, {ObjectTypeName::Weapon, ESM::LuaScriptCfg::sWeapon}},
|
|
||||||
{ESM::REC_APPA, {ObjectTypeName::Apparatus}},
|
|
||||||
{ESM::REC_LOCK, {ObjectTypeName::Lockpick}},
|
|
||||||
{ESM::REC_PROB, {ObjectTypeName::Probe}},
|
|
||||||
{ESM::REC_REPA, {ObjectTypeName::Repair}},
|
|
||||||
};
|
|
||||||
|
|
||||||
std::string_view getLuaObjectTypeName(ESM::RecNameInts type, std::string_view fallback)
|
|
||||||
{
|
|
||||||
auto it = luaObjectTypeInfo.find(type);
|
|
||||||
if (it != luaObjectTypeInfo.end())
|
|
||||||
return it->second.mName;
|
|
||||||
else
|
|
||||||
return fallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isMarker(const MWWorld::Ptr& ptr)
|
bool isMarker(const MWWorld::Ptr& ptr)
|
||||||
{
|
{
|
||||||
std::string_view id = ptr.getCellRef().getRefId();
|
std::string_view id = ptr.getCellRef().getRefId();
|
||||||
return id == "prisonmarker" || id == "divinemarker" || id == "templemarker" || id == "northmarker";
|
return id == "prisonmarker" || id == "divinemarker" || id == "templemarker" || id == "northmarker";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view getLuaObjectTypeName(const MWWorld::Ptr& ptr)
|
|
||||||
{
|
|
||||||
// Behaviour of this function is a part of OpenMW Lua API. We can not just return
|
|
||||||
// `ptr.getTypeDescription()` because its implementation is distributed over many files
|
|
||||||
// and can be accidentally changed. We use `ptr.getTypeDescription()` only as a fallback
|
|
||||||
// for types that are not present in `luaObjectTypeInfo` (for such types result stability
|
|
||||||
// is not necessary because they are not listed in OpenMW Lua documentation).
|
|
||||||
if (ptr.getCellRef().getRefId() == "player")
|
|
||||||
return ObjectTypeName::Player;
|
|
||||||
if (isMarker(ptr))
|
|
||||||
return "Marker";
|
|
||||||
return getLuaObjectTypeName(static_cast<ESM::RecNameInts>(ptr.getType()), /*fallback=*/ptr.getTypeDescription());
|
|
||||||
}
|
|
||||||
|
|
||||||
ESM::LuaScriptCfg::Flags getLuaScriptFlag(const MWWorld::Ptr& ptr)
|
|
||||||
{
|
|
||||||
if (ptr.getCellRef().getRefId() == "player")
|
|
||||||
return ESM::LuaScriptCfg::sPlayer;
|
|
||||||
if (isMarker(ptr))
|
|
||||||
return 0;
|
|
||||||
auto it = luaObjectTypeInfo.find(static_cast<ESM::RecNameInts>(ptr.getType()));
|
|
||||||
if (it != luaObjectTypeInfo.end())
|
|
||||||
return it->second.mFlag;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MWWorld::Ptr& verifyType(ESM::RecNameInts recordType, const MWWorld::Ptr& ptr)
|
|
||||||
{
|
|
||||||
if (ptr.getType() != recordType)
|
|
||||||
{
|
|
||||||
std::string msg = "Requires type '";
|
|
||||||
msg.append(getLuaObjectTypeName(recordType));
|
|
||||||
msg.append("', but applied to ");
|
|
||||||
msg.append(ptrToString(ptr));
|
|
||||||
throw std::runtime_error(msg);
|
|
||||||
}
|
|
||||||
return ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string ptrToString(const MWWorld::Ptr& ptr)
|
std::string ptrToString(const MWWorld::Ptr& ptr)
|
||||||
{
|
{
|
||||||
std::string res = "object";
|
std::string res = "object";
|
||||||
|
|
|
@ -16,31 +16,6 @@
|
||||||
|
|
||||||
namespace MWLua
|
namespace MWLua
|
||||||
{
|
{
|
||||||
namespace ObjectTypeName
|
|
||||||
{
|
|
||||||
// Names of object types in Lua.
|
|
||||||
// These names are part of OpenMW Lua API.
|
|
||||||
constexpr std::string_view Activator = "Activator";
|
|
||||||
constexpr std::string_view Armor = "Armor";
|
|
||||||
constexpr std::string_view Book = "Book";
|
|
||||||
constexpr std::string_view Clothing = "Clothing";
|
|
||||||
constexpr std::string_view Container = "Container";
|
|
||||||
constexpr std::string_view Creature = "Creature";
|
|
||||||
constexpr std::string_view Door = "Door";
|
|
||||||
constexpr std::string_view Ingredient = "Ingredient";
|
|
||||||
constexpr std::string_view Light = "Light";
|
|
||||||
constexpr std::string_view MiscItem = "Miscellaneous";
|
|
||||||
constexpr std::string_view NPC = "NPC";
|
|
||||||
constexpr std::string_view Player = "Player";
|
|
||||||
constexpr std::string_view Potion = "Potion";
|
|
||||||
constexpr std::string_view Static = "Static";
|
|
||||||
constexpr std::string_view Weapon = "Weapon";
|
|
||||||
constexpr std::string_view Apparatus = "Apparatus";
|
|
||||||
constexpr std::string_view Lockpick = "Lockpick";
|
|
||||||
constexpr std::string_view Probe = "Probe";
|
|
||||||
constexpr std::string_view Repair = "Repair";
|
|
||||||
}
|
|
||||||
|
|
||||||
// ObjectId is a unique identifier of a game object.
|
// ObjectId is a unique identifier of a game object.
|
||||||
// It can change only if the order of content files was change.
|
// It can change only if the order of content files was change.
|
||||||
using ObjectId = ESM::RefNum;
|
using ObjectId = ESM::RefNum;
|
||||||
|
@ -48,13 +23,6 @@ namespace MWLua
|
||||||
std::string idToString(const ObjectId& id);
|
std::string idToString(const ObjectId& id);
|
||||||
std::string ptrToString(const MWWorld::Ptr& ptr);
|
std::string ptrToString(const MWWorld::Ptr& ptr);
|
||||||
bool isMarker(const MWWorld::Ptr& ptr);
|
bool isMarker(const MWWorld::Ptr& ptr);
|
||||||
std::string_view getLuaObjectTypeName(ESM::RecNameInts recordType, std::string_view fallback = "Unknown");
|
|
||||||
std::string_view getLuaObjectTypeName(const MWWorld::Ptr& ptr);
|
|
||||||
const MWWorld::Ptr& verifyType(ESM::RecNameInts recordType, const MWWorld::Ptr& ptr);
|
|
||||||
|
|
||||||
// Each script has a set of flags that controls to which objects the script should be
|
|
||||||
// automatically attached. This function maps each object types to one of the flags.
|
|
||||||
ESM::LuaScriptCfg::Flags getLuaScriptFlag(const MWWorld::Ptr& ptr);
|
|
||||||
|
|
||||||
// Holds a mapping ObjectId -> MWWord::Ptr.
|
// Holds a mapping ObjectId -> MWWord::Ptr.
|
||||||
class ObjectRegistry
|
class ObjectRegistry
|
||||||
|
@ -98,7 +66,6 @@ namespace MWLua
|
||||||
ObjectId id() const { return mId; }
|
ObjectId id() const { return mId; }
|
||||||
|
|
||||||
std::string toString() const;
|
std::string toString() const;
|
||||||
std::string_view type() const { return getLuaObjectTypeName(ptr()); }
|
|
||||||
|
|
||||||
// Updates and returns the underlying Ptr. Throws an exception if object is not available.
|
// Updates and returns the underlying Ptr. Throws an exception if object is not available.
|
||||||
const MWWorld::Ptr& ptr() const;
|
const MWWorld::Ptr& ptr() const;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include "eventqueue.hpp"
|
#include "eventqueue.hpp"
|
||||||
#include "luamanagerimp.hpp"
|
#include "luamanagerimp.hpp"
|
||||||
|
#include "types/types.hpp"
|
||||||
|
|
||||||
namespace MWLua
|
namespace MWLua
|
||||||
{
|
{
|
||||||
|
@ -39,11 +40,13 @@ namespace sol
|
||||||
namespace MWLua
|
namespace MWLua
|
||||||
{
|
{
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
template <typename ObjT>
|
template <typename ObjT>
|
||||||
using Cell = std::conditional_t<std::is_same_v<ObjT, LObject>, LCell, GCell>;
|
using Cell = std::conditional_t<std::is_same_v<ObjT, LObject>, LCell, GCell>;
|
||||||
|
|
||||||
template <class ObjectT>
|
template <class ObjectT>
|
||||||
static void registerObjectList(const std::string& prefix, const Context& context)
|
void registerObjectList(const std::string& prefix, const Context& context)
|
||||||
{
|
{
|
||||||
using ListT = ObjectList<ObjectT>;
|
using ListT = ObjectList<ObjectT>;
|
||||||
sol::state& lua = context.mLua->sol();
|
sol::state& lua = context.mLua->sol();
|
||||||
|
@ -59,17 +62,30 @@ namespace MWLua
|
||||||
else
|
else
|
||||||
throw std::runtime_error("Index out of range");
|
throw std::runtime_error("Index out of range");
|
||||||
};
|
};
|
||||||
listT[sol::meta_function::ipairs] = [registry](const ListT& list)
|
if constexpr (std::is_same_v<ObjectT, GObject>)
|
||||||
{
|
{
|
||||||
auto iter = [registry](const ListT& l, int64_t i) -> sol::optional<std::tuple<int64_t, ObjectT>>
|
// GObject and LObject iterators are in separate branches because if they share source code
|
||||||
|
// there is a collision in sol and only one iterator can be mapped to Lua.
|
||||||
|
auto iter = sol::make_object(lua, [registry](const GObjectList& l, int64_t i) -> sol::optional<std::tuple<int64_t, GObject>>
|
||||||
{
|
{
|
||||||
if (i >= 0 && i < static_cast<int64_t>(l.mIds->size()))
|
if (i >= 0 && i < static_cast<int64_t>(l.mIds->size()))
|
||||||
return std::make_tuple(i + 1, ObjectT((*l.mIds)[i], registry));
|
return std::make_tuple(i + 1, GObject((*l.mIds)[i], registry));
|
||||||
else
|
else
|
||||||
return sol::nullopt;
|
return sol::nullopt;
|
||||||
};
|
});
|
||||||
return std::make_tuple(iter, list, 0);
|
listT[sol::meta_function::ipairs] = [iter](const GObjectList& list) { return std::make_tuple(iter, list, 0); };
|
||||||
};
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto iter = sol::make_object(lua, [registry](const LObjectList& l, int64_t i) -> sol::optional<std::tuple<int64_t, LObject>>
|
||||||
|
{
|
||||||
|
if (i >= 0 && i < static_cast<int64_t>(l.mIds->size()))
|
||||||
|
return std::make_tuple(i + 1, LObject((*l.mIds)[i], registry));
|
||||||
|
else
|
||||||
|
return sol::nullopt;
|
||||||
|
});
|
||||||
|
listT[sol::meta_function::ipairs] = [iter](const LObjectList& list) { return std::make_tuple(iter, list, 0); };
|
||||||
|
}
|
||||||
listT["select"] = [context](const ListT& list, const Queries::Query& query)
|
listT["select"] = [context](const ListT& list, const Queries::Query& query)
|
||||||
{
|
{
|
||||||
return ListT{selectObjectsFromList(query, list.mIds, context)};
|
return ListT{selectObjectsFromList(query, list.mIds, context)};
|
||||||
|
@ -77,7 +93,7 @@ namespace MWLua
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class ObjectT>
|
template <class ObjectT>
|
||||||
static void addBasicBindings(sol::usertype<ObjectT>& objectT, const Context& context)
|
void addBasicBindings(sol::usertype<ObjectT>& objectT, const Context& context)
|
||||||
{
|
{
|
||||||
objectT["isValid"] = [](const ObjectT& o) { return o.isValid(); };
|
objectT["isValid"] = [](const ObjectT& o) { return o.isValid(); };
|
||||||
objectT["recordId"] = sol::readonly_property([](const ObjectT& o) -> std::string
|
objectT["recordId"] = sol::readonly_property([](const ObjectT& o) -> std::string
|
||||||
|
@ -100,7 +116,12 @@ namespace MWLua
|
||||||
{
|
{
|
||||||
return o.ptr().getRefData().getPosition().asRotationVec3();
|
return o.ptr().getRefData().getPosition().asRotationVec3();
|
||||||
});
|
});
|
||||||
objectT["type"] = sol::readonly_property(&ObjectT::type);
|
|
||||||
|
objectT["type"] = sol::readonly_property([types=getTypeToPackageTable(context.mLua->sol())](const ObjectT& o) mutable
|
||||||
|
{
|
||||||
|
return types[o.ptr().getLuaType()];
|
||||||
|
});
|
||||||
|
|
||||||
objectT["count"] = sol::readonly_property([](const ObjectT& o) { return o.ptr().getRefData().getCount(); });
|
objectT["count"] = sol::readonly_property([](const ObjectT& o) { return o.ptr().getRefData().getCount(); });
|
||||||
objectT[sol::meta_function::equal_to] = [](const ObjectT& a, const ObjectT& b) { return a.id() == b.id(); };
|
objectT[sol::meta_function::equal_to] = [](const ObjectT& a, const ObjectT& b) { return a.id() == b.id(); };
|
||||||
objectT[sol::meta_function::to_string] = &ObjectT::toString;
|
objectT[sol::meta_function::to_string] = &ObjectT::toString;
|
||||||
|
@ -174,7 +195,7 @@ namespace MWLua
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class ObjectT>
|
template <class ObjectT>
|
||||||
static void addInventoryBindings(sol::usertype<ObjectT>& objectT, const std::string& prefix, const Context& context)
|
void addInventoryBindings(sol::usertype<ObjectT>& objectT, const std::string& prefix, const Context& context)
|
||||||
{
|
{
|
||||||
using InventoryT = Inventory<ObjectT>;
|
using InventoryT = Inventory<ObjectT>;
|
||||||
sol::usertype<InventoryT> inventoryT = context.mLua->sol().new_usertype<InventoryT>(prefix + "Inventory");
|
sol::usertype<InventoryT> inventoryT = context.mLua->sol().new_usertype<InventoryT>(prefix + "Inventory");
|
||||||
|
@ -183,37 +204,38 @@ namespace MWLua
|
||||||
inventoryT[sol::meta_function::to_string] =
|
inventoryT[sol::meta_function::to_string] =
|
||||||
[](const InventoryT& inv) { return "Inventory[" + inv.mObj.toString() + "]"; };
|
[](const InventoryT& inv) { return "Inventory[" + inv.mObj.toString() + "]"; };
|
||||||
|
|
||||||
inventoryT["getAll"] = [worldView=context.mWorldView](const InventoryT& inventory, sol::optional<std::string_view> type)
|
inventoryT["getAll"] = [worldView=context.mWorldView, ids=getPackageToTypeTable(context.mLua->sol())](
|
||||||
|
const InventoryT& inventory, sol::optional<sol::table> type)
|
||||||
{
|
{
|
||||||
int mask;
|
int mask = -1;
|
||||||
if (!type.has_value())
|
sol::optional<uint32_t> typeId = sol::nullopt;
|
||||||
mask = MWWorld::ContainerStore::Type_All;
|
if (type.has_value())
|
||||||
else if (*type == ObjectTypeName::Potion)
|
typeId = ids[*type];
|
||||||
mask = MWWorld::ContainerStore::Type_Potion;
|
|
||||||
else if (*type == ObjectTypeName::Armor)
|
|
||||||
mask = MWWorld::ContainerStore::Type_Armor;
|
|
||||||
else if (*type == ObjectTypeName::Book)
|
|
||||||
mask = MWWorld::ContainerStore::Type_Book;
|
|
||||||
else if (*type == ObjectTypeName::Clothing)
|
|
||||||
mask = MWWorld::ContainerStore::Type_Clothing;
|
|
||||||
else if (*type == ObjectTypeName::Ingredient)
|
|
||||||
mask = MWWorld::ContainerStore::Type_Ingredient;
|
|
||||||
else if (*type == ObjectTypeName::Light)
|
|
||||||
mask = MWWorld::ContainerStore::Type_Light;
|
|
||||||
else if (*type == ObjectTypeName::MiscItem)
|
|
||||||
mask = MWWorld::ContainerStore::Type_Miscellaneous;
|
|
||||||
else if (*type == ObjectTypeName::Weapon)
|
|
||||||
mask = MWWorld::ContainerStore::Type_Weapon;
|
|
||||||
else if (*type == ObjectTypeName::Apparatus)
|
|
||||||
mask = MWWorld::ContainerStore::Type_Apparatus;
|
|
||||||
else if (*type == ObjectTypeName::Lockpick)
|
|
||||||
mask = MWWorld::ContainerStore::Type_Lockpick;
|
|
||||||
else if (*type == ObjectTypeName::Probe)
|
|
||||||
mask = MWWorld::ContainerStore::Type_Probe;
|
|
||||||
else if (*type == ObjectTypeName::Repair)
|
|
||||||
mask = MWWorld::ContainerStore::Type_Repair;
|
|
||||||
else
|
else
|
||||||
throw std::runtime_error(std::string("inventory:getAll doesn't support type " + std::string(*type)));
|
mask = MWWorld::ContainerStore::Type_All;
|
||||||
|
|
||||||
|
if (typeId.has_value())
|
||||||
|
{
|
||||||
|
switch (*typeId)
|
||||||
|
{
|
||||||
|
case ESM::REC_ALCH: mask = MWWorld::ContainerStore::Type_Potion; break;
|
||||||
|
case ESM::REC_ARMO: mask = MWWorld::ContainerStore::Type_Armor; break;
|
||||||
|
case ESM::REC_BOOK: mask = MWWorld::ContainerStore::Type_Book; break;
|
||||||
|
case ESM::REC_CLOT: mask = MWWorld::ContainerStore::Type_Clothing; break;
|
||||||
|
case ESM::REC_INGR: mask = MWWorld::ContainerStore::Type_Ingredient; break;
|
||||||
|
case ESM::REC_LIGH: mask = MWWorld::ContainerStore::Type_Light; break;
|
||||||
|
case ESM::REC_MISC: mask = MWWorld::ContainerStore::Type_Miscellaneous; break;
|
||||||
|
case ESM::REC_WEAP: mask = MWWorld::ContainerStore::Type_Weapon; break;
|
||||||
|
case ESM::REC_APPA: mask = MWWorld::ContainerStore::Type_Apparatus; break;
|
||||||
|
case ESM::REC_LOCK: mask = MWWorld::ContainerStore::Type_Lockpick; break;
|
||||||
|
case ESM::REC_PROB: mask = MWWorld::ContainerStore::Type_Probe; break;
|
||||||
|
case ESM::REC_REPA: mask = MWWorld::ContainerStore::Type_Repair; break;
|
||||||
|
default:;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mask == -1)
|
||||||
|
throw std::runtime_error(std::string("Incorrect type argument in inventory:getAll: " + LuaUtil::toString(*type)));
|
||||||
|
|
||||||
const MWWorld::Ptr& ptr = inventory.mObj.ptr();
|
const MWWorld::Ptr& ptr = inventory.mObj.ptr();
|
||||||
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore(ptr);
|
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore(ptr);
|
||||||
|
@ -250,7 +272,7 @@ namespace MWLua
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class ObjectT>
|
template <class ObjectT>
|
||||||
static void initObjectBindings(const std::string& prefix, const Context& context)
|
void initObjectBindings(const std::string& prefix, const Context& context)
|
||||||
{
|
{
|
||||||
sol::usertype<ObjectT> objectT = context.mLua->sol().new_usertype<ObjectT>(
|
sol::usertype<ObjectT> objectT = context.mLua->sol().new_usertype<ObjectT>(
|
||||||
prefix + "Object", sol::base_classes, sol::bases<Object>());
|
prefix + "Object", sol::base_classes, sol::bases<Object>());
|
||||||
|
@ -259,6 +281,7 @@ namespace MWLua
|
||||||
|
|
||||||
registerObjectList<ObjectT>(prefix, context);
|
registerObjectList<ObjectT>(prefix, context);
|
||||||
}
|
}
|
||||||
|
} // namespace
|
||||||
|
|
||||||
void initObjectBindingsForLocalScripts(const Context& context)
|
void initObjectBindingsForLocalScripts(const Context& context)
|
||||||
{
|
{
|
||||||
|
|
193
apps/openmw/mwlua/types/types.cpp
Normal file
193
apps/openmw/mwlua/types/types.cpp
Normal file
|
@ -0,0 +1,193 @@
|
||||||
|
#include "types.hpp"
|
||||||
|
|
||||||
|
#include <components/lua/luastate.hpp>
|
||||||
|
|
||||||
|
namespace MWLua
|
||||||
|
{
|
||||||
|
namespace ObjectTypeName
|
||||||
|
{
|
||||||
|
// Names of object types in Lua.
|
||||||
|
// These names are part of OpenMW Lua API.
|
||||||
|
constexpr std::string_view Actor = "Actor"; // base type for NPC, Creature, Player
|
||||||
|
constexpr std::string_view Item = "Item"; // base type for all items
|
||||||
|
|
||||||
|
constexpr std::string_view Activator = "Activator";
|
||||||
|
constexpr std::string_view Armor = "Armor";
|
||||||
|
constexpr std::string_view Book = "Book";
|
||||||
|
constexpr std::string_view Clothing = "Clothing";
|
||||||
|
constexpr std::string_view Container = "Container";
|
||||||
|
constexpr std::string_view Creature = "Creature";
|
||||||
|
constexpr std::string_view Door = "Door";
|
||||||
|
constexpr std::string_view Ingredient = "Ingredient";
|
||||||
|
constexpr std::string_view Light = "Light";
|
||||||
|
constexpr std::string_view MiscItem = "Miscellaneous";
|
||||||
|
constexpr std::string_view NPC = "NPC";
|
||||||
|
constexpr std::string_view Player = "Player";
|
||||||
|
constexpr std::string_view Potion = "Potion";
|
||||||
|
constexpr std::string_view Static = "Static";
|
||||||
|
constexpr std::string_view Weapon = "Weapon";
|
||||||
|
constexpr std::string_view Apparatus = "Apparatus";
|
||||||
|
constexpr std::string_view Lockpick = "Lockpick";
|
||||||
|
constexpr std::string_view Probe = "Probe";
|
||||||
|
constexpr std::string_view Repair = "Repair";
|
||||||
|
constexpr std::string_view Marker = "Marker";
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
struct LuaObjectTypeInfo
|
||||||
|
{
|
||||||
|
std::string_view mName;
|
||||||
|
ESM::LuaScriptCfg::Flags mFlag = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
const static std::unordered_map<ESM::RecNameInts, LuaObjectTypeInfo> luaObjectTypeInfo = {
|
||||||
|
{ESM::REC_INTERNAL_PLAYER, {ObjectTypeName::Player, ESM::LuaScriptCfg::sPlayer}},
|
||||||
|
{ESM::REC_INTERNAL_MARKER, {ObjectTypeName::Marker}},
|
||||||
|
{ESM::REC_ACTI, {ObjectTypeName::Activator, ESM::LuaScriptCfg::sActivator}},
|
||||||
|
{ESM::REC_ARMO, {ObjectTypeName::Armor, ESM::LuaScriptCfg::sArmor}},
|
||||||
|
{ESM::REC_BOOK, {ObjectTypeName::Book, ESM::LuaScriptCfg::sBook}},
|
||||||
|
{ESM::REC_CLOT, {ObjectTypeName::Clothing, ESM::LuaScriptCfg::sClothing}},
|
||||||
|
{ESM::REC_CONT, {ObjectTypeName::Container, ESM::LuaScriptCfg::sContainer}},
|
||||||
|
{ESM::REC_CREA, {ObjectTypeName::Creature, ESM::LuaScriptCfg::sCreature}},
|
||||||
|
{ESM::REC_DOOR, {ObjectTypeName::Door, ESM::LuaScriptCfg::sDoor}},
|
||||||
|
{ESM::REC_INGR, {ObjectTypeName::Ingredient, ESM::LuaScriptCfg::sIngredient}},
|
||||||
|
{ESM::REC_LIGH, {ObjectTypeName::Light, ESM::LuaScriptCfg::sLight}},
|
||||||
|
{ESM::REC_MISC, {ObjectTypeName::MiscItem, ESM::LuaScriptCfg::sMiscItem}},
|
||||||
|
{ESM::REC_NPC_, {ObjectTypeName::NPC, ESM::LuaScriptCfg::sNPC}},
|
||||||
|
{ESM::REC_ALCH, {ObjectTypeName::Potion, ESM::LuaScriptCfg::sPotion}},
|
||||||
|
{ESM::REC_STAT, {ObjectTypeName::Static}},
|
||||||
|
{ESM::REC_WEAP, {ObjectTypeName::Weapon, ESM::LuaScriptCfg::sWeapon}},
|
||||||
|
{ESM::REC_APPA, {ObjectTypeName::Apparatus}},
|
||||||
|
{ESM::REC_LOCK, {ObjectTypeName::Lockpick}},
|
||||||
|
{ESM::REC_PROB, {ObjectTypeName::Probe}},
|
||||||
|
{ESM::REC_REPA, {ObjectTypeName::Repair}},
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string_view getLuaObjectTypeName(ESM::RecNameInts type, std::string_view fallback)
|
||||||
|
{
|
||||||
|
auto it = luaObjectTypeInfo.find(type);
|
||||||
|
if (it != luaObjectTypeInfo.end())
|
||||||
|
return it->second.mName;
|
||||||
|
else
|
||||||
|
return fallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string_view getLuaObjectTypeName(const MWWorld::Ptr& ptr)
|
||||||
|
{
|
||||||
|
return getLuaObjectTypeName(static_cast<ESM::RecNameInts>(ptr.getLuaType()), /*fallback=*/ptr.getTypeDescription());
|
||||||
|
}
|
||||||
|
|
||||||
|
ESM::LuaScriptCfg::Flags getLuaScriptFlag(const MWWorld::Ptr& ptr)
|
||||||
|
{
|
||||||
|
auto it = luaObjectTypeInfo.find(static_cast<ESM::RecNameInts>(ptr.getLuaType()));
|
||||||
|
if (it != luaObjectTypeInfo.end())
|
||||||
|
return it->second.mFlag;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const MWWorld::Ptr& verifyType(ESM::RecNameInts recordType, const MWWorld::Ptr& ptr)
|
||||||
|
{
|
||||||
|
if (ptr.getType() != recordType)
|
||||||
|
{
|
||||||
|
std::string msg = "Requires type '";
|
||||||
|
msg.append(getLuaObjectTypeName(recordType));
|
||||||
|
msg.append("', but applied to ");
|
||||||
|
msg.append(ptrToString(ptr));
|
||||||
|
throw std::runtime_error(msg);
|
||||||
|
}
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
sol::table getTypeToPackageTable(lua_State* L)
|
||||||
|
{
|
||||||
|
constexpr std::string_view key = "typeToPackage";
|
||||||
|
sol::state_view lua(L);
|
||||||
|
if (lua[key] == sol::nil)
|
||||||
|
lua[key] = sol::table(lua, sol::create);
|
||||||
|
return lua[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
sol::table getPackageToTypeTable(lua_State* L)
|
||||||
|
{
|
||||||
|
constexpr std::string_view key = "packageToType";
|
||||||
|
sol::state_view lua(L);
|
||||||
|
if (lua[key] == sol::nil)
|
||||||
|
lua[key] = sol::table(lua, sol::create);
|
||||||
|
return lua[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
sol::table initTypesPackage(const Context& context)
|
||||||
|
{
|
||||||
|
auto* lua = context.mLua;
|
||||||
|
sol::table types(lua->sol(), sol::create);
|
||||||
|
auto addType = [&](std::string_view name, std::vector<ESM::RecNameInts> recTypes,
|
||||||
|
std::optional<std::string_view> base = std::nullopt) -> sol::table
|
||||||
|
{
|
||||||
|
sol::table t(lua->sol(), sol::create);
|
||||||
|
sol::table ro = LuaUtil::makeReadOnly(t);
|
||||||
|
sol::table meta = ro[sol::metatable_key];
|
||||||
|
meta[sol::meta_function::to_string] = [name]() { return name; };
|
||||||
|
if (base)
|
||||||
|
{
|
||||||
|
t["baseType"] = types[*base];
|
||||||
|
sol::table baseMeta(lua->sol(), sol::create);
|
||||||
|
baseMeta[sol::meta_function::index] = LuaUtil::getMutableFromReadOnly(types[*base]);
|
||||||
|
t[sol::metatable_key] = baseMeta;
|
||||||
|
}
|
||||||
|
t["objectIsInstance"] = [types=recTypes](const Object& o)
|
||||||
|
{
|
||||||
|
unsigned int type = o.ptr().getLuaType();
|
||||||
|
for (ESM::RecNameInts t : types)
|
||||||
|
if (t == type)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
types[name] = ro;
|
||||||
|
return t;
|
||||||
|
};
|
||||||
|
|
||||||
|
addActorBindings(addType(ObjectTypeName::Actor, {ESM::REC_INTERNAL_PLAYER, ESM::REC_CREA, ESM::REC_NPC_}), context);
|
||||||
|
addType(ObjectTypeName::Item, {ESM::REC_ARMO, ESM::REC_BOOK, ESM::REC_CLOT, ESM::REC_INGR,
|
||||||
|
ESM::REC_LIGH, ESM::REC_MISC, ESM::REC_ALCH, ESM::REC_WEAP,
|
||||||
|
ESM::REC_APPA, ESM::REC_LOCK, ESM::REC_PROB, ESM::REC_REPA});
|
||||||
|
|
||||||
|
addType(ObjectTypeName::Creature, {ESM::REC_CREA}, ObjectTypeName::Actor);
|
||||||
|
addType(ObjectTypeName::NPC, {ESM::REC_INTERNAL_PLAYER, ESM::REC_NPC_}, ObjectTypeName::Actor);
|
||||||
|
addType(ObjectTypeName::Player, {ESM::REC_INTERNAL_PLAYER}, ObjectTypeName::NPC);
|
||||||
|
|
||||||
|
addType(ObjectTypeName::Armor, {ESM::REC_ARMO}, ObjectTypeName::Item);
|
||||||
|
addType(ObjectTypeName::Book, {ESM::REC_BOOK}, ObjectTypeName::Item);
|
||||||
|
addType(ObjectTypeName::Clothing, {ESM::REC_CLOT}, ObjectTypeName::Item);
|
||||||
|
addType(ObjectTypeName::Ingredient, {ESM::REC_INGR}, ObjectTypeName::Item);
|
||||||
|
addType(ObjectTypeName::Light, {ESM::REC_LIGH}, ObjectTypeName::Item);
|
||||||
|
addType(ObjectTypeName::MiscItem, {ESM::REC_MISC}, ObjectTypeName::Item);
|
||||||
|
addType(ObjectTypeName::Potion, {ESM::REC_ALCH}, ObjectTypeName::Item);
|
||||||
|
addType(ObjectTypeName::Weapon, {ESM::REC_WEAP}, ObjectTypeName::Item);
|
||||||
|
addType(ObjectTypeName::Apparatus, {ESM::REC_APPA}, ObjectTypeName::Item);
|
||||||
|
addType(ObjectTypeName::Lockpick, {ESM::REC_LOCK}, ObjectTypeName::Item);
|
||||||
|
addType(ObjectTypeName::Probe, {ESM::REC_PROB}, ObjectTypeName::Item);
|
||||||
|
addType(ObjectTypeName::Repair, {ESM::REC_REPA}, ObjectTypeName::Item);
|
||||||
|
|
||||||
|
addType(ObjectTypeName::Activator, {ESM::REC_ACTI});
|
||||||
|
addType(ObjectTypeName::Container, {ESM::REC_CONT});
|
||||||
|
addDoorBindings(addType(ObjectTypeName::Door, {ESM::REC_DOOR}), context);
|
||||||
|
addType(ObjectTypeName::Static, {ESM::REC_STAT});
|
||||||
|
|
||||||
|
sol::table typeToPackage = getTypeToPackageTable(context.mLua->sol());
|
||||||
|
sol::table packageToType = getPackageToTypeTable(context.mLua->sol());
|
||||||
|
for (const auto& [type, v] : luaObjectTypeInfo)
|
||||||
|
{
|
||||||
|
sol::object t = types[v.mName];
|
||||||
|
if (t == sol::nil)
|
||||||
|
continue;
|
||||||
|
typeToPackage[type] = t;
|
||||||
|
packageToType[t] = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
return LuaUtil::makeReadOnly(types);
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,10 +3,27 @@
|
||||||
|
|
||||||
#include <sol/sol.hpp>
|
#include <sol/sol.hpp>
|
||||||
|
|
||||||
|
#include <components/esm/defs.hpp>
|
||||||
|
#include <components/esm/luascripts.hpp>
|
||||||
|
|
||||||
#include "../context.hpp"
|
#include "../context.hpp"
|
||||||
|
|
||||||
namespace MWLua
|
namespace MWLua
|
||||||
{
|
{
|
||||||
|
std::string_view getLuaObjectTypeName(ESM::RecNameInts type, std::string_view fallback = "Unknown");
|
||||||
|
std::string_view getLuaObjectTypeName(const MWWorld::Ptr& ptr);
|
||||||
|
const MWWorld::Ptr& verifyType(ESM::RecNameInts type, const MWWorld::Ptr& ptr);
|
||||||
|
|
||||||
|
sol::table getTypeToPackageTable(lua_State* L);
|
||||||
|
sol::table getPackageToTypeTable(lua_State* L);
|
||||||
|
|
||||||
|
// Each script has a set of flags that controls to which objects the script should be
|
||||||
|
// automatically attached. This function maps each object types to one of the flags.
|
||||||
|
ESM::LuaScriptCfg::Flags getLuaScriptFlag(const MWWorld::Ptr& ptr);
|
||||||
|
|
||||||
|
sol::table initTypesPackage(const Context& context);
|
||||||
|
|
||||||
|
// used in initTypesPackage
|
||||||
void addDoorBindings(sol::table door, const Context& context);
|
void addDoorBindings(sol::table door, const Context& context);
|
||||||
void addActorBindings(sol::table actor, const Context& context);
|
void addActorBindings(sol::table actor, const Context& context);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,23 @@ namespace MWWorld
|
||||||
throw std::runtime_error("Can't get type name from an empty object.");
|
throw std::runtime_error("Can't get type name from an empty object.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// `getType()` is not exactly what we usually mean by "type" because some refids have special meaning.
|
||||||
|
// This function handles these special refids (and by this adds some performance overhead).
|
||||||
|
// We use this "fixed" type in Lua because we don't want to expose the weirdness of Morrowind internals to our API.
|
||||||
|
// TODO: Implement https://gitlab.com/OpenMW/openmw/-/issues/6617 and make `getType` work the same as `getLuaType`.
|
||||||
|
unsigned int getLuaType() const
|
||||||
|
{
|
||||||
|
if(mRef == nullptr)
|
||||||
|
throw std::runtime_error("Can't get type name from an empty object.");
|
||||||
|
std::string_view id = mRef->mRef.getRefId();
|
||||||
|
if (id == "player")
|
||||||
|
return ESM::REC_INTERNAL_PLAYER;
|
||||||
|
else if (id == "prisonmarker" || id == "divinemarker" || id == "templemarker" || id == "northmarker")
|
||||||
|
return ESM::REC_INTERNAL_MARKER;
|
||||||
|
else
|
||||||
|
return mRef->getType();
|
||||||
|
}
|
||||||
|
|
||||||
std::string_view getTypeDescription() const
|
std::string_view getTypeDescription() const
|
||||||
{
|
{
|
||||||
return mRef ? mRef->getTypeDescription() : "nullptr";
|
return mRef ? mRef->getTypeDescription() : "nullptr";
|
||||||
|
|
|
@ -94,6 +94,11 @@ constexpr unsigned int fourCC(const char(&name)[len]) {
|
||||||
|
|
||||||
enum RecNameInts : unsigned int
|
enum RecNameInts : unsigned int
|
||||||
{
|
{
|
||||||
|
// Special values. Can not be used in any ESM.
|
||||||
|
// Added to this enum to guarantee that the values don't collide with any records.
|
||||||
|
REC_INTERNAL_PLAYER = 0,
|
||||||
|
REC_INTERNAL_MARKER = 1,
|
||||||
|
|
||||||
// format 0 / legacy
|
// format 0 / legacy
|
||||||
REC_ACTI = fourCC("ACTI"),
|
REC_ACTI = fourCC("ACTI"),
|
||||||
REC_ALCH = fourCC("ALCH"),
|
REC_ALCH = fourCC("ALCH"),
|
||||||
|
|
Loading…
Reference in a new issue