-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New effect: Low Draw Distance (#268)
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/gtasa/effects/custom/unsorted/LowDrawDistanceEffect.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "util/EffectBase.h" | ||
|
||
#include <CTimeCycle.h> | ||
|
||
class LowDrawDistanceEffect : public EffectBase | ||
{ | ||
public: | ||
void | ||
OnTick (EffectInstance *inst) override | ||
{ | ||
CTimeCycle::m_CurrentColours.m_fFarClip = 200.0f; | ||
} | ||
}; | ||
|
||
DEFINE_EFFECT (LowDrawDistanceEffect, "effect_low_draw_distance", | ||
GROUP_NPC_SPAWNS | GROUP_CAMERA | GROUP_VISION | ||
| GROUP_VEHICLE_RARITY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "util/EffectBase.h" | ||
|
||
#include <CClock.h> | ||
#include <CTimeCycle.h> | ||
#include <CWeather.h> | ||
|
||
class MistEffect : public EffectBase | ||
{ | ||
private: | ||
int forceWeather = WEATHER_FOGGY_SF; | ||
|
||
public: | ||
void | ||
OnStart (EffectInstance *inst) override | ||
{ | ||
constexpr int weathers[] | ||
= {WEATHER_RAINY_SF, WEATHER_FOGGY_SF, WEATHER_RAINY_COUNTRYSIDE, | ||
WEATHER_SANDSTORM_DESERT}; | ||
|
||
auto idx = inst->Random (0, 10000) % std::size (weathers); | ||
forceWeather = weathers[idx]; | ||
} | ||
|
||
void | ||
OnTick (EffectInstance *inst) override | ||
{ | ||
CClock::ms_nGameClockHours = 0; | ||
CClock::ms_nGameClockMinutes = 0; | ||
CClock::ms_nGameClockSeconds = 0; | ||
CWeather::ForceWeatherNow (forceWeather); | ||
CTimeCycle::m_CurrentColours.m_fFarClip = 150.0f; | ||
} | ||
}; | ||
|
||
DEFINE_EFFECT (MistEffect, "effect_mist", | ||
GROUP_NPC_SPAWNS | GROUP_CAMERA | GROUP_VISION | GROUP_WEATHER | ||
| GROUP_VEHICLE_RARITY); |