diff options
Diffstat (limited to 'src/simulation/elements/PLNT.cpp')
| -rw-r--r-- | src/simulation/elements/PLNT.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/simulation/elements/PLNT.cpp b/src/simulation/elements/PLNT.cpp index 9c87e22..84a83c2 100644 --- a/src/simulation/elements/PLNT.cpp +++ b/src/simulation/elements/PLNT.cpp @@ -43,7 +43,7 @@ Element_PLNT::Element_PLNT() HighTemperatureTransition = PT_FIRE; Update = &Element_PLNT::update; - + Graphics = &Element_PLNT::graphics; } //#TPT-Directive ElementHeader Element_PLNT static int update(UPDATE_FUNC_ARGS) @@ -99,6 +99,26 @@ int Element_PLNT::update(UPDATE_FUNC_ARGS) } parts[i].life = 0; } + if (parts[i].temp > 400 && parts[i].temp > parts[i].tmp2) + parts[i].tmp2 = (int)parts[i].temp; + return 0; +} + +//#TPT-Directive ElementHeader Element_PLNT static int graphics(GRAPHICS_FUNC_ARGS) +int Element_PLNT::graphics(GRAPHICS_FUNC_ARGS) +{ + float maxtemp = fmax(cpart->tmp2, cpart->temp); + if (maxtemp > 300) + { + *colr += (int)restrict_flt((maxtemp-300)/5,0,58); + *colg -= (int)restrict_flt((maxtemp-300)/2,0,102); + *colb += (int)restrict_flt((maxtemp-300)/5,0,70); + } + if (maxtemp < 273) + { + *colg += (int)restrict_flt((273-maxtemp)/4,0,255); + *colb += (int)restrict_flt((273-maxtemp)/1.5,0,255); + } return 0; } |
