MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xClimateInitAsset

Function xClimateInitAsset

src/SB/Core/x/xClimate.cpp:42–66  ·  view source on GitHub ↗

Equivalent float ops are being optimized more aggressively

Source from the content-addressed store, hash-verified

40// Equivalent
41// float ops are being optimized more aggressively
42void xClimateInitAsset(_tagClimate* climate, xEnvAsset* asset)
43{
44 sClimate = climate;
45 climate->wind.strength = 0.0f;
46 xClimateVecFromAngle(climate->wind.angle, &climate->wind.dir);
47
48 if (asset->climateFlags == 0)
49 {
50 climate->wind.strength = 0.0f;
51 climate->rain.strength = 0.0f;
52 return;
53 }
54 if (asset->climateFlags & 1)
55 {
56 climate->rain.rain = 1.0f;
57 climate->rain.strength = 0.5f * (asset->climateStrengthMax - asset->climateStrengthMin);
58 climate->rain.strength += asset->climateStrengthMin;
59 }
60 else if (asset->climateFlags & 2)
61 {
62 climate->rain.rain = 0.0f;
63 climate->rain.strength = 0.5f * (asset->climateStrengthMax - asset->climateStrengthMin);
64 climate->rain.strength += asset->climateStrengthMin;
65 }
66}
67
68void xClimateSetSnow(F32 stre)
69{

Callers 2

zSceneResetFunction · 0.50
zSceneSetupFunction · 0.50

Calls 1

xClimateVecFromAngleFunction · 0.85

Tested by

no test coverage detected