From b1f9e17ab01be6be62734f224697cf2f51919a0a Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Tue, 4 Aug 2015 02:11:24 +0200 Subject: [PATCH] Updated parameterization in Weather module. --- addons/weather/functions/fnc_calculateAirDensity.sqf | 4 ++-- .../weather/functions/fnc_calculateBarometricPressure.sqf | 4 ++-- addons/weather/functions/fnc_calculateDewPoint.sqf | 4 ++-- addons/weather/functions/fnc_calculateHeatIndex.sqf | 6 +++--- addons/weather/functions/fnc_calculateRoughnessLength.sqf | 4 ++-- .../weather/functions/fnc_calculateTemperatureAtHeight.sqf | 4 ++-- addons/weather/functions/fnc_calculateWetBulb.sqf | 4 ++-- addons/weather/functions/fnc_calculateWindChill.sqf | 6 +++--- addons/weather/functions/fnc_calculateWindSpeed.sqf | 4 ++-- addons/weather/functions/fnc_getWind.sqf | 5 +++-- addons/weather/functions/fnc_initModuleSettings.sqf | 7 +++---- addons/weather/functions/fnc_updateRain.sqf | 4 ++-- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/addons/weather/functions/fnc_calculateAirDensity.sqf b/addons/weather/functions/fnc_calculateAirDensity.sqf index 921bff3bf3..f3de65f99d 100644 --- a/addons/weather/functions/fnc_calculateAirDensity.sqf +++ b/addons/weather/functions/fnc_calculateAirDensity.sqf @@ -9,14 +9,14 @@ * 2: relativeHumidity - value between 0.0 and 1.0 * * Return Value: - * 0: density of air - kg * m^(-3) + * density of air - kg * m^(-3) * * Return value: * None */ #include "script_component.hpp" -PARAMS_3(_temperature,_pressure,_relativeHumidity); +params ["_temperature", "_pressure", "_relativeHumidity"]; _pressure = _pressure * 100; // hPa to Pa diff --git a/addons/weather/functions/fnc_calculateBarometricPressure.sqf b/addons/weather/functions/fnc_calculateBarometricPressure.sqf index 869deb93cb..134a741127 100644 --- a/addons/weather/functions/fnc_calculateBarometricPressure.sqf +++ b/addons/weather/functions/fnc_calculateBarometricPressure.sqf @@ -4,10 +4,10 @@ * Calculates the barometric pressure based on altitude and weather * * Arguments: - * 0: altitude - meters + * altitude - meters * * Return Value: - * 0: barometric pressure - hPA + * barometric pressure - hPA * * Return value: * None diff --git a/addons/weather/functions/fnc_calculateDewPoint.sqf b/addons/weather/functions/fnc_calculateDewPoint.sqf index 76656b1f55..cbfc606054 100644 --- a/addons/weather/functions/fnc_calculateDewPoint.sqf +++ b/addons/weather/functions/fnc_calculateDewPoint.sqf @@ -8,7 +8,7 @@ * 2: relativeHumidity - value between 0.0 and 1.0 * * Return Value: - * 0: dew point + * dew point * * Return value: * None @@ -18,7 +18,7 @@ #define __b 17.67 #define __c 243.5 -PARAMS_2(_t,_rh); +params ["_t", "_rh"]; if (_rh == 0) exitWith { CELSIUS(0) }; diff --git a/addons/weather/functions/fnc_calculateHeatIndex.sqf b/addons/weather/functions/fnc_calculateHeatIndex.sqf index 473360c867..057c13d7ad 100644 --- a/addons/weather/functions/fnc_calculateHeatIndex.sqf +++ b/addons/weather/functions/fnc_calculateHeatIndex.sqf @@ -5,10 +5,10 @@ * * Arguments: * 0: temperature - degrees celcius - * 2: relativeHumidity - value between 0.0 and 1.0 + * 1: relativeHumidity - value between 0.0 and 1.0 * * Return Value: - * 0: heat index + * heat index * * Return value: * None @@ -24,7 +24,7 @@ #define __C7 0.000687678 #define __C8 0.000274954 -PARAMS_2(_t,_rh); +params ["_t", "_rh"]; // Source: https://en.wikipedia.org/wiki/Heat_index diff --git a/addons/weather/functions/fnc_calculateRoughnessLength.sqf b/addons/weather/functions/fnc_calculateRoughnessLength.sqf index 08ae44cc74..4fd0d18fb3 100644 --- a/addons/weather/functions/fnc_calculateRoughnessLength.sqf +++ b/addons/weather/functions/fnc_calculateRoughnessLength.sqf @@ -4,10 +4,10 @@ * Calculates the terrain roughness length at a given world position * * Arguments: - * 0: _this - world position + * world position * * Return Value: - * 0: roughness length + * roughness length * * Public: No */ diff --git a/addons/weather/functions/fnc_calculateTemperatureAtHeight.sqf b/addons/weather/functions/fnc_calculateTemperatureAtHeight.sqf index dd31dfe05e..5e02795d59 100644 --- a/addons/weather/functions/fnc_calculateTemperatureAtHeight.sqf +++ b/addons/weather/functions/fnc_calculateTemperatureAtHeight.sqf @@ -4,10 +4,10 @@ * Calculates the temperature based on altitude and weather * * Arguments: - * 0: height - meters + * height - meters * * Return Value: - * 0: temperature - degrees celsius + * temperature - degrees celsius * * Return value: * None diff --git a/addons/weather/functions/fnc_calculateWetBulb.sqf b/addons/weather/functions/fnc_calculateWetBulb.sqf index c180cf8384..94e96cd11b 100644 --- a/addons/weather/functions/fnc_calculateWetBulb.sqf +++ b/addons/weather/functions/fnc_calculateWetBulb.sqf @@ -9,7 +9,7 @@ * 2: relativeHumidity - value between 0.0 and 1.0 * * Return Value: - * 0: wet bulb + * wet bulb * * Return value: * None @@ -18,7 +18,7 @@ private ["_es", "_e", "_eDiff", "_eGuessPrev", "_cTempDelta", "_twGuess", "_eguess"]; -PARAMS_3(_temperature,_pressure,_relativeHumidity); +params ["_temperature", "_pressure", "_relativeHumidity"]; // Source: http://cosmoquest.org/forum/showthread.php?155366-Calculating-Wet-Bulb-Temperature-from-RH-amp-Dry-Bulb _es = 6.112 * exp((17.67 * _temperature) / (_temperature + 243.5)); diff --git a/addons/weather/functions/fnc_calculateWindChill.sqf b/addons/weather/functions/fnc_calculateWindChill.sqf index 021d2f8b99..ee3a20283b 100644 --- a/addons/weather/functions/fnc_calculateWindChill.sqf +++ b/addons/weather/functions/fnc_calculateWindChill.sqf @@ -5,16 +5,16 @@ * * Arguments: * 0: temperature - degrees celcius - * 2: wind speed - m/s + * 1: wind speed - m/s * * Return Value: - * 0: wind chill + * wind chill * * Public: No */ #include "script_component.hpp" -PARAMS_2(_t,_v); +params ["_t", "_v"]; // Source: https://en.wikipedia.org/wiki/Wind_chill diff --git a/addons/weather/functions/fnc_calculateWindSpeed.sqf b/addons/weather/functions/fnc_calculateWindSpeed.sqf index d991897b97..fc1ac81a57 100644 --- a/addons/weather/functions/fnc_calculateWindSpeed.sqf +++ b/addons/weather/functions/fnc_calculateWindSpeed.sqf @@ -10,7 +10,7 @@ * 3: Account for obstacles * * Return Value: - * 0: wind speed - m/s + * wind speed - m/s * * Public: No */ @@ -18,7 +18,7 @@ private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"]; -PARAMS_4(_position,_windGradientEnabled,_terrainEffectEnabled,_obstacleEffectEnabled); +params ["_position", "_windGradientEnabled", "_terrainEffectEnabled", "_obstacleEffectEnabled"]; fnc_polar2vect = { private ["_mag2D"]; diff --git a/addons/weather/functions/fnc_getWind.sqf b/addons/weather/functions/fnc_getWind.sqf index 5b123afaa0..7e133896a6 100644 --- a/addons/weather/functions/fnc_getWind.sqf +++ b/addons/weather/functions/fnc_getWind.sqf @@ -11,11 +11,12 @@ */ #include "script_component.hpp" +private ["_periodPercent", "_periodPosition"]; + if (isNil "ACE_WIND_PARAMS") exitWith { [0, 0, 0] }; -EXPLODE_5_PVT(ACE_WIND_PARAMS,_dir,_dirChange,_spd,_spdChange,_period); +ACE_WIND_PARAMS params ["_dir", "_dirChange", "_spd", "_spdChange", "_period"]; -private ["_periodPercent", "_periodPosition"]; _periodPosition = (ACE_time - GVAR(wind_period_start_time)) min _period; _periodPercent = _periodPosition / _period; diff --git a/addons/weather/functions/fnc_initModuleSettings.sqf b/addons/weather/functions/fnc_initModuleSettings.sqf index eb0eaafc31..e6977f01f9 100644 --- a/addons/weather/functions/fnc_initModuleSettings.sqf +++ b/addons/weather/functions/fnc_initModuleSettings.sqf @@ -16,9 +16,8 @@ #include "script_component.hpp" private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; + +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; @@ -36,4 +35,4 @@ if !(_activated) exitWith {}; // Server weather update interval [_logic, QGVAR(serverUpdateInterval), "serverUpdateInterval"] call EFUNC(common,readSettingFromModule); -GVAR(serverUpdateInterval) = 1 max GVAR(serverUpdateInterval) min 600; \ No newline at end of file +GVAR(serverUpdateInterval) = 1 max GVAR(serverUpdateInterval) min 600; diff --git a/addons/weather/functions/fnc_updateRain.sqf b/addons/weather/functions/fnc_updateRain.sqf index ced8641f61..6c4c829747 100644 --- a/addons/weather/functions/fnc_updateRain.sqf +++ b/addons/weather/functions/fnc_updateRain.sqf @@ -14,8 +14,8 @@ if (!GVAR(syncRain)) exitWith {}; if (!isNil "ACE_RAIN_PARAMS") then { - EXPLODE_3_PVT(ACE_RAIN_PARAMS,_oldRain,_newRain,_period); - + ACE_RAIN_PARAMS params ["_oldRain", "_newRain", "_period"]; + private ["_periodPosition", "_periodPercent"]; _periodPosition = (ACE_time - GVAR(rain_period_start_time)) min _period; _periodPercent = (_periodPosition / _period) min 1;