forked from mirror/openmw-tes3mp
[Client] Share WeatherManager to the mwmp::Main class
This commit is contained in:
parent
44dc153ebe
commit
25b7095396
3 changed files with 23 additions and 2 deletions
|
@ -236,7 +236,7 @@ void Main::updateWorld(float dt) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Main &Main::get()
|
Main &Main::get()
|
||||||
{
|
{
|
||||||
return *pMain;
|
return *pMain;
|
||||||
}
|
}
|
||||||
|
@ -345,3 +345,13 @@ bool Main::isValidPacketScript(std::string script)
|
||||||
return true;
|
return true;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Main::setWeatherManager(MWWorld::WeatherManager* manager)
|
||||||
|
{
|
||||||
|
mWeatherManager = manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
MWWorld::WeatherManager *Main::getWeatherManager()
|
||||||
|
{
|
||||||
|
return mWeatherManager;
|
||||||
|
}
|
||||||
|
|
|
@ -5,6 +5,11 @@
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
#include <components/files/collections.hpp>
|
#include <components/files/collections.hpp>
|
||||||
|
|
||||||
|
namespace MWWorld
|
||||||
|
{
|
||||||
|
class WeatherManager;
|
||||||
|
}
|
||||||
|
|
||||||
namespace mwmp
|
namespace mwmp
|
||||||
{
|
{
|
||||||
class GUIController;
|
class GUIController;
|
||||||
|
@ -23,7 +28,7 @@ namespace mwmp
|
||||||
static bool init(std::vector<std::string> &content, Files::Collections &collections);
|
static bool init(std::vector<std::string> &content, Files::Collections &collections);
|
||||||
static void postInit();
|
static void postInit();
|
||||||
static void destroy();
|
static void destroy();
|
||||||
static const Main &get();
|
static Main &get();
|
||||||
static void frame(float dt);
|
static void frame(float dt);
|
||||||
static void pressedKey(int key);
|
static void pressedKey(int key);
|
||||||
|
|
||||||
|
@ -37,6 +42,9 @@ namespace mwmp
|
||||||
|
|
||||||
void updateWorld(float dt) const;
|
void updateWorld(float dt) const;
|
||||||
|
|
||||||
|
void setWeatherManager(MWWorld::WeatherManager* manager);
|
||||||
|
MWWorld::WeatherManager* getWeatherManager();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::string resourceDir;
|
static std::string resourceDir;
|
||||||
static std::string addr;
|
static std::string addr;
|
||||||
|
@ -54,6 +62,7 @@ namespace mwmp
|
||||||
|
|
||||||
std::string server;
|
std::string server;
|
||||||
unsigned short port;
|
unsigned short port;
|
||||||
|
MWWorld::WeatherManager* mWeatherManager;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,7 @@ namespace MWWorld
|
||||||
mSwimHeightScale = mStore.get<ESM::GameSetting>().find("fSwimHeightScale")->getFloat();
|
mSwimHeightScale = mStore.get<ESM::GameSetting>().find("fSwimHeightScale")->getFloat();
|
||||||
|
|
||||||
mWeatherManager = new MWWorld::WeatherManager(*mRendering, mFallback, mStore);
|
mWeatherManager = new MWWorld::WeatherManager(*mRendering, mFallback, mStore);
|
||||||
|
mwmp::Main::get().setWeatherManager(mWeatherManager);
|
||||||
|
|
||||||
mWorldScene = new Scene(*mRendering, mPhysics);
|
mWorldScene = new Scene(*mRendering, mPhysics);
|
||||||
}
|
}
|
||||||
|
@ -246,6 +247,7 @@ namespace MWWorld
|
||||||
// Note that if reset later, the initial ChangeWeather that the chargen script calls will be lost.
|
// Note that if reset later, the initial ChangeWeather that the chargen script calls will be lost.
|
||||||
delete mWeatherManager;
|
delete mWeatherManager;
|
||||||
mWeatherManager = new MWWorld::WeatherManager(*mRendering, mFallback, mStore);
|
mWeatherManager = new MWWorld::WeatherManager(*mRendering, mFallback, mStore);
|
||||||
|
mwmp::Main::get().setWeatherManager(mWeatherManager);
|
||||||
|
|
||||||
if (!bypass)
|
if (!bypass)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue