summaryrefslogtreecommitdiff
path: root/src/simulation/elements/VINE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/elements/VINE.cpp')
-rw-r--r--src/simulation/elements/VINE.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/simulation/elements/VINE.cpp b/src/simulation/elements/VINE.cpp
index 04c90bf..e31c8cd 100644
--- a/src/simulation/elements/VINE.cpp
+++ b/src/simulation/elements/VINE.cpp
@@ -64,6 +64,26 @@ int Element_VINE::update(UPDATE_FUNC_ARGS)
sim->part_change_type(i,x,y,PT_PLNT);
}
}
+ if (parts[i].temp > 350 && parts[i].temp > parts[i].tmp2)
+ parts[i].tmp2 = (int)parts[i].temp;
+ return 0;
+}
+
+//#TPT-Directive ElementHeader Element_VINE static int graphics(GRAPHICS_FUNC_ARGS)
+int Element_VINE::graphics(GRAPHICS_FUNC_ARGS)
+{
+ float maxtemp = std::max((float)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;
}