mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Removed unnecessary enabled flag from fog structure
This commit is contained in:
parent
df3fda8d33
commit
3064535f62
9 changed files with 28 additions and 54 deletions
|
@ -1097,7 +1097,6 @@ const std::vector<byte> SaveGame::Build()
|
|||
|
||||
levelData.add_level_far_view(level->LevelFarView);
|
||||
|
||||
levelData.add_fog_enabled(level->Fog.Enabled);
|
||||
levelData.add_fog_color(level->Fog.GetColor());
|
||||
levelData.add_fog_min_distance(level->Fog.MinDistance);
|
||||
levelData.add_fog_max_distance(level->Fog.MaxDistance);
|
||||
|
@ -1798,7 +1797,6 @@ static void ParseLua(const Save::SaveGame* s, bool hubMode)
|
|||
|
||||
auto* level = (Level*)g_GameFlow->GetLevel(CurrentLevel);
|
||||
|
||||
level->Fog.Enabled = s->level_data()->fog_enabled();
|
||||
level->Fog.MaxDistance = s->level_data()->fog_max_distance();
|
||||
level->Fog.MinDistance = s->level_data()->fog_min_distance();
|
||||
level->Fog.SetColor(s->level_data()->fog_color());
|
||||
|
|
|
@ -1821,7 +1821,7 @@ namespace TEN::Renderer
|
|||
cameraConstantBuffer.CameraUnderwater = g_Level.Rooms[cameraConstantBuffer.RoomNumber].flags & ENV_FLAG_WATER;
|
||||
cameraConstantBuffer.DualParaboloidView = Matrix::CreateLookAt(LaraItem->Pose.Position.ToVector3(), LaraItem->Pose.Position.ToVector3() + Vector3(0, 0, 1024), -Vector3::UnitY);
|
||||
|
||||
if (level.GetFogEnabled())
|
||||
if (level.GetFogMaxDistance() > 0)
|
||||
{
|
||||
auto fogColor = level.GetFogColor();
|
||||
cameraConstantBuffer.FogColor = Vector4(fogColor.GetR() / 255.0f, fogColor.GetG() / 255.0f, fogColor.GetB() / 255.0f, 1.0f);
|
||||
|
|
|
@ -37,7 +37,6 @@ public:
|
|||
virtual float GetWeatherStrength() const = 0;
|
||||
virtual WeatherType GetWeatherType() const = 0;
|
||||
virtual RGBAColor8Byte GetSkyLayerColor(int index) const = 0;
|
||||
virtual bool GetFogEnabled() const = 0;
|
||||
virtual RGBAColor8Byte GetFogColor() const = 0;
|
||||
virtual short GetFogMinDistance() const = 0;
|
||||
virtual short GetFogMaxDistance() const = 0;
|
||||
|
|
|
@ -47,7 +47,6 @@ Fog::Fog(ScriptColor const& col, short minDistance, short maxDistance)
|
|||
SetColor(col);
|
||||
MinDistance = minDistance;
|
||||
MaxDistance = maxDistance;
|
||||
Enabled = true;
|
||||
}
|
||||
|
||||
void Fog::SetColor(ScriptColor const& col)
|
||||
|
|
|
@ -10,7 +10,6 @@ using namespace TEN::Scripting::Types;
|
|||
|
||||
struct Fog
|
||||
{
|
||||
bool Enabled{ false };
|
||||
byte R{ 0 };
|
||||
byte G{ 0 };
|
||||
byte B{ 0 };
|
||||
|
|
|
@ -220,11 +220,6 @@ WeatherType Level::GetWeatherType() const
|
|||
return Weather;
|
||||
}
|
||||
|
||||
bool Level::GetFogEnabled() const
|
||||
{
|
||||
return Fog.Enabled;
|
||||
}
|
||||
|
||||
RGBAColor8Byte Level::GetFogColor() const
|
||||
{
|
||||
return Fog.GetColor();
|
||||
|
|
|
@ -53,7 +53,6 @@ struct Level : public ScriptInterfaceLevel
|
|||
// TODO: Clean up this mess.
|
||||
|
||||
RGBAColor8Byte GetFogColor() const override;
|
||||
bool GetFogEnabled() const override;
|
||||
float GetWeatherStrength() const override;
|
||||
bool GetSkyLayerEnabled(int index) const override;
|
||||
bool GetStormEnabled() const override;
|
||||
|
|
|
@ -548,7 +548,6 @@ struct LevelDataT : public flatbuffers::NativeTable {
|
|||
bool rumble_enabled = false;
|
||||
int32_t weather_type = 0;
|
||||
float weather_strength = 0.0f;
|
||||
bool fog_enabled = false;
|
||||
int32_t fog_color = 0;
|
||||
int32_t fog_min_distance = 0;
|
||||
int32_t fog_max_distance = 0;
|
||||
|
@ -588,34 +587,33 @@ struct LevelData FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
VT_RUMBLE_ENABLED = 8,
|
||||
VT_WEATHER_TYPE = 10,
|
||||
VT_WEATHER_STRENGTH = 12,
|
||||
VT_FOG_ENABLED = 14,
|
||||
VT_FOG_COLOR = 16,
|
||||
VT_FOG_MIN_DISTANCE = 18,
|
||||
VT_FOG_MAX_DISTANCE = 20,
|
||||
VT_SKY_LAYER_1_ENABLED = 22,
|
||||
VT_SKY_LAYER_1_COLOR = 24,
|
||||
VT_SKY_LAYER_1_SPEED = 26,
|
||||
VT_SKY_LAYER_2_ENABLED = 28,
|
||||
VT_SKY_LAYER_2_COLOR = 30,
|
||||
VT_SKY_LAYER_2_SPEED = 32,
|
||||
VT_HORIZON1_ENABLED = 34,
|
||||
VT_HORIZON1_OBJECT_ID = 36,
|
||||
VT_HORIZON1_POSITION = 38,
|
||||
VT_HORIZON1_ORIENTATION = 40,
|
||||
VT_HORIZON1_TRANSPARENCY = 42,
|
||||
VT_HORIZON2_ENABLED = 44,
|
||||
VT_HORIZON2_OBJECT_ID = 46,
|
||||
VT_HORIZON2_POSITION = 48,
|
||||
VT_HORIZON2_ORIENTATION = 50,
|
||||
VT_HORIZON2_TRANSPARENCY = 52,
|
||||
VT_LENSFLARE_SPRITE_ID = 54,
|
||||
VT_LENSFLARE_PITCH = 56,
|
||||
VT_LENSFLARE_YAW = 58,
|
||||
VT_LENSFLARE_COLOR = 60,
|
||||
VT_STARFIELD_STAR_COUNT = 62,
|
||||
VT_STARFIELD_METEOR_COUNT = 64,
|
||||
VT_STARFIELD_METEOR_SPAWN_DENSITY = 66,
|
||||
VT_STARFIELD_METEOR_VELOCITY = 68
|
||||
VT_FOG_COLOR = 14,
|
||||
VT_FOG_MIN_DISTANCE = 16,
|
||||
VT_FOG_MAX_DISTANCE = 18,
|
||||
VT_SKY_LAYER_1_ENABLED = 20,
|
||||
VT_SKY_LAYER_1_COLOR = 22,
|
||||
VT_SKY_LAYER_1_SPEED = 24,
|
||||
VT_SKY_LAYER_2_ENABLED = 26,
|
||||
VT_SKY_LAYER_2_COLOR = 28,
|
||||
VT_SKY_LAYER_2_SPEED = 30,
|
||||
VT_HORIZON1_ENABLED = 32,
|
||||
VT_HORIZON1_OBJECT_ID = 34,
|
||||
VT_HORIZON1_POSITION = 36,
|
||||
VT_HORIZON1_ORIENTATION = 38,
|
||||
VT_HORIZON1_TRANSPARENCY = 40,
|
||||
VT_HORIZON2_ENABLED = 42,
|
||||
VT_HORIZON2_OBJECT_ID = 44,
|
||||
VT_HORIZON2_POSITION = 46,
|
||||
VT_HORIZON2_ORIENTATION = 48,
|
||||
VT_HORIZON2_TRANSPARENCY = 50,
|
||||
VT_LENSFLARE_SPRITE_ID = 52,
|
||||
VT_LENSFLARE_PITCH = 54,
|
||||
VT_LENSFLARE_YAW = 56,
|
||||
VT_LENSFLARE_COLOR = 58,
|
||||
VT_STARFIELD_STAR_COUNT = 60,
|
||||
VT_STARFIELD_METEOR_COUNT = 62,
|
||||
VT_STARFIELD_METEOR_SPAWN_DENSITY = 64,
|
||||
VT_STARFIELD_METEOR_VELOCITY = 66
|
||||
};
|
||||
int32_t level_far_view() const {
|
||||
return GetField<int32_t>(VT_LEVEL_FAR_VIEW, 0);
|
||||
|
@ -632,9 +630,6 @@ struct LevelData FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
float weather_strength() const {
|
||||
return GetField<float>(VT_WEATHER_STRENGTH, 0.0f);
|
||||
}
|
||||
bool fog_enabled() const {
|
||||
return GetField<uint8_t>(VT_FOG_ENABLED, 0) != 0;
|
||||
}
|
||||
int32_t fog_color() const {
|
||||
return GetField<int32_t>(VT_FOG_COLOR, 0);
|
||||
}
|
||||
|
@ -723,7 +718,6 @@ struct LevelData FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
VerifyField<uint8_t>(verifier, VT_RUMBLE_ENABLED) &&
|
||||
VerifyField<int32_t>(verifier, VT_WEATHER_TYPE) &&
|
||||
VerifyField<float>(verifier, VT_WEATHER_STRENGTH) &&
|
||||
VerifyField<uint8_t>(verifier, VT_FOG_ENABLED) &&
|
||||
VerifyField<int32_t>(verifier, VT_FOG_COLOR) &&
|
||||
VerifyField<int32_t>(verifier, VT_FOG_MIN_DISTANCE) &&
|
||||
VerifyField<int32_t>(verifier, VT_FOG_MAX_DISTANCE) &&
|
||||
|
@ -777,9 +771,6 @@ struct LevelDataBuilder {
|
|||
void add_weather_strength(float weather_strength) {
|
||||
fbb_.AddElement<float>(LevelData::VT_WEATHER_STRENGTH, weather_strength, 0.0f);
|
||||
}
|
||||
void add_fog_enabled(bool fog_enabled) {
|
||||
fbb_.AddElement<uint8_t>(LevelData::VT_FOG_ENABLED, static_cast<uint8_t>(fog_enabled), 0);
|
||||
}
|
||||
void add_fog_color(int32_t fog_color) {
|
||||
fbb_.AddElement<int32_t>(LevelData::VT_FOG_COLOR, fog_color, 0);
|
||||
}
|
||||
|
@ -879,7 +870,6 @@ inline flatbuffers::Offset<LevelData> CreateLevelData(
|
|||
bool rumble_enabled = false,
|
||||
int32_t weather_type = 0,
|
||||
float weather_strength = 0.0f,
|
||||
bool fog_enabled = false,
|
||||
int32_t fog_color = 0,
|
||||
int32_t fog_min_distance = 0,
|
||||
int32_t fog_max_distance = 0,
|
||||
|
@ -938,7 +928,6 @@ inline flatbuffers::Offset<LevelData> CreateLevelData(
|
|||
builder_.add_horizon1_enabled(horizon1_enabled);
|
||||
builder_.add_sky_layer_2_enabled(sky_layer_2_enabled);
|
||||
builder_.add_sky_layer_1_enabled(sky_layer_1_enabled);
|
||||
builder_.add_fog_enabled(fog_enabled);
|
||||
builder_.add_rumble_enabled(rumble_enabled);
|
||||
builder_.add_storm_enabled(storm_enabled);
|
||||
return builder_.Finish();
|
||||
|
@ -8943,7 +8932,6 @@ inline void LevelData::UnPackTo(LevelDataT *_o, const flatbuffers::resolver_func
|
|||
{ auto _e = rumble_enabled(); _o->rumble_enabled = _e; }
|
||||
{ auto _e = weather_type(); _o->weather_type = _e; }
|
||||
{ auto _e = weather_strength(); _o->weather_strength = _e; }
|
||||
{ auto _e = fog_enabled(); _o->fog_enabled = _e; }
|
||||
{ auto _e = fog_color(); _o->fog_color = _e; }
|
||||
{ auto _e = fog_min_distance(); _o->fog_min_distance = _e; }
|
||||
{ auto _e = fog_max_distance(); _o->fog_max_distance = _e; }
|
||||
|
@ -8986,7 +8974,6 @@ inline flatbuffers::Offset<LevelData> CreateLevelData(flatbuffers::FlatBufferBui
|
|||
auto _rumble_enabled = _o->rumble_enabled;
|
||||
auto _weather_type = _o->weather_type;
|
||||
auto _weather_strength = _o->weather_strength;
|
||||
auto _fog_enabled = _o->fog_enabled;
|
||||
auto _fog_color = _o->fog_color;
|
||||
auto _fog_min_distance = _o->fog_min_distance;
|
||||
auto _fog_max_distance = _o->fog_max_distance;
|
||||
|
@ -9021,7 +9008,6 @@ inline flatbuffers::Offset<LevelData> CreateLevelData(flatbuffers::FlatBufferBui
|
|||
_rumble_enabled,
|
||||
_weather_type,
|
||||
_weather_strength,
|
||||
_fog_enabled,
|
||||
_fog_color,
|
||||
_fog_min_distance,
|
||||
_fog_max_distance,
|
||||
|
|
|
@ -14,7 +14,6 @@ table LevelData {
|
|||
weather_type: int32;
|
||||
weather_strength: float;
|
||||
|
||||
fog_enabled: bool;
|
||||
fog_color: int32;
|
||||
fog_min_distance: int32;
|
||||
fog_max_distance: int32;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue