From 8397b6e51aa817f2b33347bc801fdaee0b4d2700 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Mon, 30 Apr 2012 21:49:33 +0100 Subject: [PATCH] Add PROP_NOAMBHEAT to prevent certain elements from being heated by Ambient heat, Add PROP_NOAMBHEAT to FILT to fix http://powdertoy.co.uk/Discussions/Thread/View.html?Thread=13579 --- includes/powder.h | 3 ++- src/elementdata.c | 2 +- src/powder.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index c471aa70f..ea6eb41bb 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -249,8 +249,9 @@ #define PROP_RADIOACTIVE 0x02000 //8192 Radioactive #define PROP_LIFE_DEC 0x04000 //2^14 Life decreases by one every frame if > zero #define PROP_LIFE_KILL 0x08000 //2^15 Kill when life value is <= zero -#define PROP_LIFE_KILL_DEC 0x10000 //2^16 Kill when life value is decremented to <= zero +#define PROP_LIFE_KILL_DEC 0x10000 //2^16 Kill when life value is decremented to<= zero #define PROP_SPARKSETTLE 0x20000 //2^17 Allow Sparks/Embers to settle +#define PROP_NOAMBHEAT 0x40000 //2^18 Don't transfer or receive heat from ambient heat. #define FLAG_STAGNANT 1 #define FLAG_SKIPMOVE 0x2 // skip movement for one frame, only implemented for PHOT diff --git a/src/elementdata.c b/src/elementdata.c index aa2544eb9..ce041f0b1 100644 --- a/src/elementdata.c +++ b/src/elementdata.c @@ -139,7 +139,7 @@ part_type ptypes[PT_NUM] = {"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_SHLD4, NULL}, {"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_CRACKER2, 373.0f, 40, "Lolz", ST_GAS, TYPE_SOLID, &update_MISC, NULL}, {"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 2, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", ST_SOLID, TYPE_SOLID, &update_WIFI, &graphics_WIFI}, - {"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", ST_SOLID, TYPE_SOLID, NULL, &graphics_FILT}, + {"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", ST_SOLID, TYPE_SOLID | PROP_NOAMBHEAT, NULL, &graphics_FILT}, {"ARAY", PIXPACK(0xFFBB00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Ray Emitter. Rays create points when they collide", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_ARAY, NULL}, {"BRAY", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Point. Rays create points when they collide", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL, NULL, &graphics_BRAY}, {"STK2", PIXPACK(0x000000), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, 0.0f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, 1, 50, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Stickman. Don't kill him!", ST_NONE, 0, &update_STKM2, &graphics_STKM2}, diff --git a/src/powder.c b/src/powder.c index 354c788e0..f5b1f2273 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1879,7 +1879,7 @@ void update_particles_i(pixel *vid, int start, int inc) { float c_Cm = 0.0f; #endif - if (aheat_enable) + if (aheat_enable && !(ptypes[t].properties&PROP_NOAMBHEAT)) { #ifdef REALISTIC c_heat = parts[i].temp*96.645/ptypes[t].hconduct*gel_scale*fabs(ptypes[t].weight)