1 /*****************************************************************************
2  * Copyright (c) 2014-2020 OpenRCT2 developers
3  *
4  * For a complete list of all authors, please refer to contributors.md
5  * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
6  *
7  * OpenRCT2 is licensed under the GNU General Public License version 3.
8  *****************************************************************************/
9 
10 #pragma once
11 
12 #include "../common.h"
13 #include "../drawing/Drawing.h"
14 #include "../util/Util.h"
15 
16 enum class ClimateType : uint8_t
17 {
18     CoolAndWet,
19     Warm,
20     HotAndDry,
21     Cold,
22     Count
23 };
24 
25 enum class WeatherType : uint8_t
26 {
27     Sunny,
28     PartiallyCloudy,
29     Cloudy,
30     Rain,
31     HeavyRain,
32     Thunder,
33     Snow,
34     HeavySnow,
35     Blizzard,
36     Count
37 };
38 
39 enum class WeatherEffectType : uint8_t
40 {
41     None,
42     Rain,
43     Storm,
44     Snow,
45     Blizzard,
46 };
47 
48 enum class WeatherLevel
49 {
50     None,
51     Light,
52     Heavy,
53 };
54 
55 struct WeatherState
56 {
57     int8_t TemperatureDelta;
58     WeatherEffectType EffectLevel;
59     int8_t GloomLevel;
60     WeatherLevel Level;
61     uint32_t SpriteId;
62 };
63 
64 struct ClimateState
65 {
66     WeatherType Weather;
67     int8_t Temperature;
68     WeatherEffectType WeatherEffect;
69     uint8_t WeatherGloom;
70     WeatherLevel Level;
71 };
72 
73 extern ClimateType gClimate;
74 extern ClimateState gClimateCurrent;
75 extern ClimateState gClimateNext;
76 extern uint16_t gClimateUpdateTimer;
77 extern uint16_t gClimateLightningFlash;
78 
79 int32_t climate_celsius_to_fahrenheit(int32_t celsius);
80 void climate_reset(ClimateType climate);
81 void climate_update();
82 void climate_update_sound();
83 void climate_force_weather(WeatherType weather);
84 
85 bool climate_is_raining();
86 bool climate_is_snowing();
87 bool WeatherIsDry(WeatherType);
88 FilterPaletteID climate_get_weather_gloom_palette_id(const ClimateState& state);
89 uint32_t climate_get_weather_sprite_id(const ClimateState& state);
90