DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ GetTemperatureColor()

int GetTemperatureColor ( int temperature)
protected

См. определение в файле 3_Game/DayZ/tools/tools.c строка 990

991{
992 int alpha = 255;
993 int red = 153;
994 int green = 153;
995 int blue = 153;
996
998 {
999 temperature = temperature - 20;
1000 temperature = Math.Clamp( temperature, -50, 50);
1001 temperature = Math.AbsInt(temperature);
1002
1003 red = Math.Clamp ( red - ((red/50 )*temperature), 0, 255);
1004 green = Math.Clamp ( green - ((green/50 )*temperature), 0, 255);
1005 blue = Math.Clamp ( blue+((blue/50)*temperature), 0, 255);
1006 }
1008 {
1009 temperature = Math.Clamp(temperature, -100, 100);
1010 blue = Math.Clamp (blue - ((blue / 100) * temperature), 0, 255);
1011 green = Math.Clamp (green - ((green / 100) * temperature), 0, 255);
1012 red = Math.Clamp (red + ((red / 100) * temperature), 0, 255);
1013 }
1014
1015 return ARGB(alpha, red, green, blue);
1016}
Определения EnMath.c:7
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT
Определения 3_Game/DayZ/constants.c:807
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT
damage per second dealt to attachment by fire
Определения 3_Game/DayZ/constants.c:806
static proto int AbsInt(int i)
Returns absolute value.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
int ARGB(int a, int r, int g, int b)
Определения proto.c:322

Перекрестные ссылки Math::AbsInt(), ARGB(), Math::Clamp(), GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT и GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT.

Используется в UIScriptedMenu::UpdateItemInfoQuantity().