more less preprocessed code lines

This commit is contained in:
Sebastian Fieber 2025-07-25 01:13:43 +02:00
parent 3f54d3e569
commit f1447207b2
6 changed files with 24 additions and 8 deletions

View File

@ -222,12 +222,16 @@ namespace MWBase
virtual const std::vector<MWWorld::Weather>& getAllWeather() const = 0; virtual const std::vector<MWWorld::Weather>& getAllWeather() const = 0;
virtual int getCurrentWeatherScriptId() const = 0;
virtual const MWWorld::Weather& getCurrentWeather() const = 0; virtual const MWWorld::Weather& getCurrentWeather() const = 0;
virtual const MWWorld::Weather* getWeather(size_t index) const = 0; virtual const MWWorld::Weather* getWeather(size_t index) const = 0;
virtual const MWWorld::Weather* getWeather(const ESM::RefId& id) const = 0; virtual const MWWorld::Weather* getWeather(const ESM::RefId& id) const = 0;
virtual int getNextWeatherScriptId() const = 0;
virtual const MWWorld::Weather* getNextWeather() const = 0; virtual const MWWorld::Weather* getNextWeather() const = 0;
virtual float getWeatherTransition() const = 0; virtual float getWeatherTransition() const = 0;

View File

@ -18,7 +18,6 @@
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/esmstore.hpp" #include "../mwworld/esmstore.hpp"
#include "../mwworld/inventorystore.hpp" #include "../mwworld/inventorystore.hpp"
#include "../mwworld/weather.hpp"
#include "../mwmechanics/actorutil.hpp" #include "../mwmechanics/actorutil.hpp"
#include "../mwmechanics/creaturestats.hpp" #include "../mwmechanics/creaturestats.hpp"
@ -502,7 +501,7 @@ int MWDialogue::Filter::getSelectStructInteger(const SelectWrapper& select) cons
case ESM::DialogueCondition::Function_Weather: case ESM::DialogueCondition::Function_Weather:
return MWBase::Environment::get().getWorld()->getCurrentWeather().mScriptId; return MWBase::Environment::get().getWorld()->getCurrentWeatherScriptId();
case ESM::DialogueCondition::Function_Reputation: case ESM::DialogueCondition::Function_Reputation:
if (!mActor.getClass().isNpc()) if (!mActor.getClass().isNpc())

View File

@ -60,7 +60,6 @@
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/groundcoverstore.hpp" #include "../mwworld/groundcoverstore.hpp"
#include "../mwworld/scene.hpp" #include "../mwworld/scene.hpp"
#include "../mwworld/weather.hpp"
#include "../mwgui/postprocessorhud.hpp" #include "../mwgui/postprocessorhud.hpp"
@ -944,8 +943,8 @@ namespace MWRender
stateUpdater->setIsUnderwater(isUnderwater); stateUpdater->setIsUnderwater(isUnderwater);
stateUpdater->setFogColor(fogColor); stateUpdater->setFogColor(fogColor);
stateUpdater->setGameHour(world->getTimeStamp().getHour()); stateUpdater->setGameHour(world->getTimeStamp().getHour());
stateUpdater->setWeatherId(world->getCurrentWeather().mScriptId); stateUpdater->setWeatherId(world->getCurrentWeatherScriptId());
stateUpdater->setNextWeatherId(world->getNextWeather() != nullptr ? world->getNextWeather()->mScriptId : -1); stateUpdater->setNextWeatherId(world->getNextWeatherScriptId());
stateUpdater->setWeatherTransition(world->getWeatherTransition()); stateUpdater->setWeatherTransition(world->getWeatherTransition());
stateUpdater->setWindSpeed(world->getWindSpeed()); stateUpdater->setWindSpeed(world->getWindSpeed());
stateUpdater->setSkyColor(mSky->getSkyColor()); stateUpdater->setSkyColor(mSky->getSkyColor());

View File

@ -14,7 +14,6 @@
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwworld/esmstore.hpp" #include "../mwworld/esmstore.hpp"
#include "../mwworld/weather.hpp"
namespace MWScript namespace MWScript
{ {
@ -72,7 +71,7 @@ namespace MWScript
public: public:
void execute(Interpreter::Runtime& runtime) override void execute(Interpreter::Runtime& runtime) override
{ {
runtime.push(MWBase::Environment::get().getWorld()->getCurrentWeather().mScriptId); runtime.push(MWBase::Environment::get().getWorld()->getCurrentWeatherScriptId());
} }
}; };

View File

@ -1873,6 +1873,11 @@ namespace MWWorld
return mWeatherManager->getAllWeather(); return mWeatherManager->getAllWeather();
} }
int World::getCurrentWeatherScriptId() const
{
return mWeatherManager->getWeather().mScriptId;
}
const MWWorld::Weather& World::getCurrentWeather() const const MWWorld::Weather& World::getCurrentWeather() const
{ {
return mWeatherManager->getWeather(); return mWeatherManager->getWeather();
@ -1888,6 +1893,15 @@ namespace MWWorld
return mWeatherManager->getWeather(id); return mWeatherManager->getWeather(id);
} }
int World::getNextWeatherScriptId() const
{
auto next = mWeatherManager->getNextWeather();
if (next == nullptr)
return -1;
return next->mScriptId;
}
const MWWorld::Weather* World::getNextWeather() const const MWWorld::Weather* World::getNextWeather() const
{ {
return mWeatherManager->getNextWeather(); return mWeatherManager->getNextWeather();

View File

@ -321,10 +321,11 @@ namespace MWWorld
const std::vector<MWWorld::Weather>& getAllWeather() const override; const std::vector<MWWorld::Weather>& getAllWeather() const override;
int getCurrentWeatherScriptId() const override;
const MWWorld::Weather& getCurrentWeather() const override; const MWWorld::Weather& getCurrentWeather() const override;
const MWWorld::Weather* getWeather(size_t index) const override; const MWWorld::Weather* getWeather(size_t index) const override;
const MWWorld::Weather* getWeather(const ESM::RefId& id) const override; const MWWorld::Weather* getWeather(const ESM::RefId& id) const override;
int getNextWeatherScriptId() const override;
const MWWorld::Weather* getNextWeather() const override; const MWWorld::Weather* getNextWeather() const override;
float getWeatherTransition() const override; float getWeatherTransition() const override;