MCPcopy Create free account
hub / github.com/crossuo/crossuo / Draw

Method Draw

src/Weather.cpp:75–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void CWeather::Draw(int x, int y)
76{
77 ScopedPerfMarker(__FUNCTION__);
78 bool removeEffects = false;
79
80 if (Timer < g_Ticks)
81 {
82 //if (CurrentCount) Reset();
83 if (CurrentCount == 0u)
84 {
85 return;
86 }
87
88 removeEffects = true;
89 }
90 else if (Type == 0xFF || Type == 0xFE)
91 {
92 return;
93 }
94
95 uint32_t passed = g_Ticks - LastTick;
96
97 if (passed > 7000) // если времени слишком много прошло со старой симуляции
98 {
99 LastTick = g_Ticks;
100 passed = 25;
101 }
102
103 bool windChanged = false;
104
105 if (WindTimer < g_Ticks)
106 {
107 if (WindTimer == 0u)
108 {
109 windChanged = true; //Для установки стартовых значений снежинок
110 }
111
112 WindTimer = g_Ticks + (RandomIntMinMax(7, 13) * 1000);
113
114 char lastWind = Wind;
115
116 Wind = RandomInt(4);
117
118 if (RandomInt(2) != 0)
119 {
120 Wind *= (-1);
121 }
122
123 if (Wind < 0 && lastWind > 0)
124 {
125 Wind = 0;
126 }
127 else if (Wind > 0 && lastWind < 0)
128 {
129 Wind = 0;
130 }
131
132 if (lastWind != Wind)

Callers

nothing calls this directly

Calls 14

ScopedPerfMarkerClass · 0.85
RandomIntMinMaxFunction · 0.85
RandomIntFunction · 0.85
RenderAdd_SetColorFunction · 0.85
rad2degfFunction · 0.85
SinOscillateFunction · 0.85
deg2radfFunction · 0.85
RenderAdd_DrawLineFunction · 0.85
eraseMethod · 0.80
DrawLineMethod · 0.80
DrawPolygoneMethod · 0.80

Tested by

no test coverage detected