diff options
| author | jacob1 <jfu614@gmail.com> | 2012-11-17 04:35:34 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2012-11-17 04:35:34 (GMT) |
| commit | 7a21ae192fe19868539956f3fe28e62b2c7c4429 (patch) | |
| tree | ad303f091f9a08b209b91eb34a9fcad996a3de69 /src/simulation/elements/VINE.cpp | |
| parent | 9e72a619ab7a4b0aee928811923e675c19d1a569 (diff) | |
| download | powder-7a21ae192fe19868539956f3fe28e62b2c7c4429.zip powder-7a21ae192fe19868539956f3fe28e62b2c7c4429.tar.gz | |
VINE cool/burn effects like in PLNT, less sharp burn lines, fix infinite smoke from TNT
Diffstat (limited to 'src/simulation/elements/VINE.cpp')
| -rw-r--r-- | src/simulation/elements/VINE.cpp | 20 |
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; } |
