1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Fix build

apps/openmw/mwlua/soundbindings.cpp:166:78: error: member access into incomplete type 'MWBase::World'
        const SoundStore* soundStore = &MWBase::Environment::get().getWorld()->getStore().get<ESM::Sound>();
                                                                             ^
apps/openmw/mwlua/../mwbase/environment.hpp:27:11: note: forward declaration of 'MWBase::World'
    class World;
          ^
This commit is contained in:
elsid 2023-08-18 12:13:59 +02:00
parent 4211665ede
commit 57bcb3e89d
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

View File

@ -1,16 +1,15 @@
#include "soundbindings.hpp" #include "soundbindings.hpp"
#include "luabindings.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp" #include "../mwbase/world.hpp"
#include "../mwworld/esmstore.hpp"
#include <components/esm3/loadsoun.hpp> #include <components/esm3/loadsoun.hpp>
#include <components/misc/resourcehelpers.hpp> #include <components/misc/resourcehelpers.hpp>
#include <components/vfs/pathutil.hpp> #include <components/vfs/pathutil.hpp>
#include "../mwworld/esmstore.hpp"
#include "luamanagerimp.hpp" #include "luamanagerimp.hpp"
namespace MWLua namespace MWLua
@ -161,9 +160,7 @@ namespace MWLua
}, },
[]() { return MWBase::Environment::get().getSoundManager()->sayActive(MWWorld::ConstPtr()); }); []() { return MWBase::Environment::get().getSoundManager()->sayActive(MWWorld::ConstPtr()); });
// Sound store
using SoundStore = MWWorld::Store<ESM::Sound>; using SoundStore = MWWorld::Store<ESM::Sound>;
const SoundStore* soundStore = &MWBase::Environment::get().getWorld()->getStore().get<ESM::Sound>();
sol::usertype<SoundStore> soundStoreT = lua.new_usertype<SoundStore>("ESM3_SoundStore"); sol::usertype<SoundStore> soundStoreT = lua.new_usertype<SoundStore>("ESM3_SoundStore");
soundStoreT[sol::meta_function::to_string] soundStoreT[sol::meta_function::to_string]
= [](const SoundStore& store) { return "ESM3_SoundStore{" + std::to_string(store.getSize()) + " sounds}"; }; = [](const SoundStore& store) { return "ESM3_SoundStore{" + std::to_string(store.getSize()) + " sounds}"; };
@ -176,7 +173,7 @@ namespace MWLua
soundStoreT[sol::meta_function::pairs] = lua["ipairsForArray"].template get<sol::function>(); soundStoreT[sol::meta_function::pairs] = lua["ipairsForArray"].template get<sol::function>();
soundStoreT[sol::meta_function::ipairs] = lua["ipairsForArray"].template get<sol::function>(); soundStoreT[sol::meta_function::ipairs] = lua["ipairsForArray"].template get<sol::function>();
api["sounds"] = soundStore; api["sounds"] = &MWBase::Environment::get().getWorld()->getStore().get<ESM::Sound>();
// Sound record // Sound record
auto soundT = lua.new_usertype<ESM::Sound>("ESM3_Sound"); auto soundT = lua.new_usertype<ESM::Sound>("ESM3_Sound");