Use forward declaration for context and sol

This commit is contained in:
elsid 2025-04-20 17:53:29 +02:00
parent eeca0b13b0
commit e87b95f642
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40
29 changed files with 79 additions and 60 deletions

View File

@ -3,10 +3,10 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
struct Context;
sol::table initBirthSignRecordBindings(const Context& context);
}

View File

@ -1,12 +1,12 @@
#ifndef MWLUA_CELLBINDINGS_H
#define MWLUA_CELLBINDINGS_H
#include "context.hpp"
namespace MWLua
{
void initCellBindingsForLocalScripts(const Context&);
void initCellBindingsForGlobalScripts(const Context&);
struct Context;
void initCellBindingsForLocalScripts(const Context& context);
void initCellBindingsForGlobalScripts(const Context& context);
}
#endif // MWLUA_CELLBINDINGS_H

View File

@ -3,10 +3,10 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
struct Context;
sol::table initClassRecordBindings(const Context& context);
}

View File

@ -19,6 +19,7 @@
#include "../mwworld/datetimemanager.hpp"
#include "../mwworld/esmstore.hpp"
#include "context.hpp"
#include "coremwscriptbindings.hpp"
#include "dialoguebindings.hpp"
#include "factionbindings.hpp"

View File

@ -3,13 +3,13 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
struct Context;
void addCoreTimeBindings(sol::table& api, const Context& context);
sol::table initCorePackage(const Context&);
sol::table initCorePackage(const Context& context);
}
#endif // MWLUA_COREBINDINGS_H

View File

@ -1,7 +1,7 @@
#ifndef OPENMW_MWLUA_DEBUGBINDINGS_H
#define OPENMW_MWLUA_DEBUGBINDINGS_H
#include <sol/sol.hpp>
#include <sol/forward.hpp>
namespace MWLua
{

View File

@ -3,10 +3,10 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
struct Context;
sol::table initCoreFactionBindings(const Context& context);
}

View File

@ -13,6 +13,7 @@
#include "../mwbase/windowmanager.hpp"
#include "../mwinput/actions.hpp"
#include "context.hpp"
#include "luamanagerimp.hpp"
namespace sol

View File

@ -3,11 +3,11 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
sol::table initInputPackage(const Context&);
struct Context;
sol::table initInputPackage(const Context& context);
}
#endif // MWLUA_INPUTBINDINGS_H

View File

@ -1,14 +1,24 @@
#include "landbindings.hpp"
#include <span>
#include <string>
#include <sol/object.hpp>
#include <sol/table.hpp>
#include <sol/variadic_results.hpp>
#include <components/esm/refid.hpp>
#include <components/esm/util.hpp>
#include <components/esmterrain/storage.hpp>
#include <components/lua/luastate.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwworld/esmstore.hpp"
#include "../mwworld/worldmodel.hpp"
#include "context.hpp"
#include "object.hpp"
namespace

View File

@ -1,10 +1,12 @@
#ifndef MWLUA_LANDBINDINGS_H
#define MWLUA_LANDBINDINGS_H
#include "context.hpp"
#include <sol/forward.hpp>
namespace MWLua
{
struct Context;
sol::table initCoreLandBindings(const Context& context);
}

View File

@ -1,29 +1,30 @@
#ifndef MWLUA_LUABINDINGS_H
#define MWLUA_LUABINDINGS_H
#include <map>
#include <sol/forward.hpp>
#include <string>
#include "context.hpp"
#include <map>
#include <string>
namespace MWLua
{
struct Context;
// Initialize Lua packages that are available for all scripts.
std::map<std::string, sol::object> initCommonPackages(const Context&);
std::map<std::string, sol::object> initCommonPackages(const Context& context);
// Initialize Lua packages that are available for global scripts (additionally to common packages).
std::map<std::string, sol::object> initGlobalPackages(const Context&);
std::map<std::string, sol::object> initGlobalPackages(const Context& context);
// Initialize Lua packages that are available for local scripts (additionally to common packages).
std::map<std::string, sol::object> initLocalPackages(const Context&);
std::map<std::string, sol::object> initLocalPackages(const Context& context);
// Initialize Lua packages that are available only for local scripts on the player (additionally to common and local
// packages).
std::map<std::string, sol::object> initPlayerPackages(const Context&);
std::map<std::string, sol::object> initPlayerPackages(const Context& context);
// Initialize Lua packages that are available only for menu scripts (additionally to common packages).
std::map<std::string, sol::object> initMenuPackages(const Context&);
std::map<std::string, sol::object> initMenuPackages(const Context& context);
}
#endif // MWLUA_LUABINDINGS_H

View File

@ -3,10 +3,10 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
struct Context;
sol::table initCoreMagicBindings(const Context& context);
void addActorMagicBindings(sol::table& actor, const Context& context);
}

View File

@ -3,11 +3,11 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
sol::table initMarkupPackage(const Context&);
struct Context;
sol::table initMarkupPackage(const Context& context);
}
#endif // MWLUA_MARKUPBINDINGS_H

View File

@ -7,6 +7,8 @@
#include "../mwbase/statemanager.hpp"
#include "../mwstate/character.hpp"
#include "context.hpp"
namespace MWLua
{
static const MWState::Character* findCharacter(std::string_view characterDir)

View File

@ -9,11 +9,11 @@
#include "../mwbase/luamanager.hpp"
#include "context.hpp"
#include "inputprocessor.hpp"
namespace MWLua
{
struct Context;
sol::table initMenuPackage(const Context& context);

View File

@ -12,6 +12,7 @@
#include "../mwworld/esmstore.hpp"
#include "../mwworld/worldimp.hpp"
#include "context.hpp"
#include "object.hpp"
#include <stdexcept>

View File

@ -3,13 +3,11 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
struct Context;
sol::table initMWScriptBindings(const Context&);
sol::table initMWScriptBindings(const Context& context);
}
#endif // MWLUA_MWSCRIPTBINDINGS_H

View File

@ -13,6 +13,7 @@
#include "../mwworld/cellstore.hpp"
#include "../mwworld/scene.hpp"
#include "context.hpp"
#include "luamanagerimp.hpp"
#include "objectlists.hpp"

View File

@ -3,11 +3,11 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
sol::table initNearbyPackage(const Context&);
struct Context;
sol::table initNearbyPackage(const Context& context);
}
#endif // MWLUA_NEARBYBINDINGS_H

View File

@ -1,12 +1,12 @@
#ifndef MWLUA_OBJECTBINDINGS_H
#define MWLUA_OBJECTBINDINGS_H
#include "context.hpp"
namespace MWLua
{
void initObjectBindingsForLocalScripts(const Context&);
void initObjectBindingsForGlobalScripts(const Context&);
struct Context;
void initObjectBindingsForLocalScripts(const Context& context);
void initObjectBindingsForGlobalScripts(const Context& context);
}
#endif // MWLUA_OBJECTBINDINGS_H

View File

@ -8,6 +8,7 @@
#include "../mwbase/world.hpp"
#include "../mwrender/postprocessor.hpp"
#include "context.hpp"
#include "luamanagerimp.hpp"
namespace

View File

@ -3,11 +3,11 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
sol::table initPostprocessingPackage(const Context&);
struct Context;
sol::table initPostprocessingPackage(const Context& context);
}
#endif // MWLUA_POSTPROCESSINGBINDINGS_H

View File

@ -3,10 +3,10 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
struct Context;
sol::table initRaceRecordBindings(const Context& context);
}

View File

@ -3,11 +3,11 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
sol::table initCoreSoundBindings(const Context&);
struct Context;
sol::table initCoreSoundBindings(const Context& context);
sol::table initAmbientPackage(const Context& context);
}

View File

@ -3,11 +3,11 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
sol::table initUserInterfacePackage(const Context&);
struct Context;
sol::table initUserInterfacePackage(const Context& context);
}
#endif // MWLUA_UIBINDINGS_H

View File

@ -3,11 +3,11 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
sol::table initVFSPackage(const Context&);
struct Context;
sol::table initVFSPackage(const Context& context);
}
#endif // MWLUA_VFSBINDINGS_H

View File

@ -26,6 +26,7 @@
#include "luamanagerimp.hpp"
#include "animationbindings.hpp"
#include "context.hpp"
#include "corebindings.hpp"
#include "mwscriptbindings.hpp"

View File

@ -3,11 +3,11 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
sol::table initWorldPackage(const Context&);
struct Context;
sol::table initWorldPackage(const Context& context);
}
#endif // MWLUA_WORLDBINDINGS_H