feat(world): stub Weather

This commit is contained in:
fallenoak 2025-11-30 17:08:19 -06:00
parent 03c5ad860b
commit 0df9908ce8
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
4 changed files with 51 additions and 1 deletions

View File

@ -3,9 +3,12 @@
#include "gx/Shader.hpp" #include "gx/Shader.hpp"
#include "model/Model2.hpp" #include "model/Model2.hpp"
#include "world/Map.hpp" #include "world/Map.hpp"
#include "world/Weather.hpp"
#include <storm/Memory.hpp>
uint32_t CWorld::s_enables; uint32_t CWorld::s_enables;
uint32_t CWorld::s_enables2; uint32_t CWorld::s_enables2;
Weather* CWorld::s_weather;
void CWorld::Initialize() { void CWorld::Initialize() {
CWorld::s_enables |= CWorld::s_enables |=
@ -42,6 +45,10 @@ void CWorld::Initialize() {
); );
// TODO // TODO
CWorld::s_weather = STORM_NEW(Weather);
// TODO
} }
void CWorld::LoadMap(const char* mapName, const C3Vector& position, int32_t zoneID) { void CWorld::LoadMap(const char* mapName, const C3Vector& position, int32_t zoneID) {

View File

@ -2,9 +2,10 @@
#define WORLD_C_WORLD_HPP #define WORLD_C_WORLD_HPP
#include <tempest/Vector.hpp> #include <tempest/Vector.hpp>
#include <cstdint> #include <cstdint>
class Weather;
class CWorld { class CWorld {
public: public:
enum Enables { enum Enables {
@ -46,6 +47,7 @@ class CWorld {
// Static variables // Static variables
static uint32_t s_enables; static uint32_t s_enables;
static uint32_t s_enables2; static uint32_t s_enables2;
static Weather* s_weather;
// Static functions // Static functions
static void Initialize(void); static void Initialize(void);

31
src/world/Weather.cpp Normal file
View File

@ -0,0 +1,31 @@
#include "world/Weather.hpp"
#include "console/CVar.hpp"
static CVar* s_useShadersCvar;
bool WeatherDensityCallback(CVar* var, const char* oldValue, const char* value, void* arg) {
// TODO
return true;
}
Weather::Weather() {
// TODO
CVar::Register(
"weatherDensity",
nullptr,
0x0,
"2",
&WeatherDensityCallback,
DEFAULT
);
s_useShadersCvar = CVar::Register(
"useWeatherShaders",
nullptr,
0x0,
"1",
nullptr,
DEFAULT
);
}

10
src/world/Weather.hpp Normal file
View File

@ -0,0 +1,10 @@
#ifndef WORLD_WEATHER_HPP
#define WORLD_WEATHER_HPP
class Weather {
public:
// Member functions
Weather();
};
#endif