summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip <philip@philip-linuxlaptop.(none)>2010-11-05 05:22:43 (GMT)
committer Philip <philip@philip-linuxlaptop.(none)>2010-11-05 05:22:43 (GMT)
commit068076a4aeaa444e72b44f716172e4e583953e2d (patch)
tree69e07c687100982d7713100eb840c07fb56020bc
parent4ed5b47bfffd20c887e422a3997a756cc0066866 (diff)
downloadpowder-068076a4aeaa444e72b44f716172e4e583953e2d.zip
powder-068076a4aeaa444e72b44f716172e4e583953e2d.tar.gz
Made it go faster, once per frame, and cool heat colors.
-rw-r--r--includes/defines.h1
-rw-r--r--includes/powder.h2
-rw-r--r--src/main.c1
-rw-r--r--src/powder.c11
4 files changed, 11 insertions, 4 deletions
diff --git a/includes/defines.h b/includes/defines.h
index 1827eca..4e0304a 100644
--- a/includes/defines.h
+++ b/includes/defines.h
@@ -106,6 +106,7 @@ typedef struct stamp stamp;
int MSIGN;
int NGOL;
int CGOL;
+int GSPEED;
int gol[XRES][YRES];
extern sign signs[MAXSIGNS];
extern stamp stamps[STAMP_MAX];
diff --git a/includes/powder.h b/includes/powder.h
index 10758a0..75fa728 100644
--- a/includes/powder.h
+++ b/includes/powder.h
@@ -285,7 +285,7 @@ static const part_type ptypes[PT_NUM] =
{"HSWC", PIXPACK(0x3B1010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", TYPE_SOLID},
{"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID},
{"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART},
- {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Game Of Life!", TYPE_SOLID},
+ {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 9000.0f, 0, "Game Of Life!", TYPE_SOLID},
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description
};
diff --git a/src/main.c b/src/main.c
index 8926716..36efa88 100644
--- a/src/main.c
+++ b/src/main.c
@@ -104,6 +104,7 @@ int FPSB = 0;
int MSIGN =-1;
int NGOL = 0;
int CGOL = 0;
+int GSPEED = 1;
sign signs[MAXSIGNS];
diff --git a/src/powder.c b/src/powder.c
index 911dbf9..b4aeebb 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -824,7 +824,7 @@ void update_particles_i(pixel *vid, int start, int inc)
int starti = (start*-1);
if(sys_pause&&!framerender)
return;
- if(CGOL>=8)
+ if(CGOL>=GSPEED)
{
CGOL = 0;
create_part(-1,0,0,PT_GOL);
@@ -862,7 +862,7 @@ void update_particles_i(pixel *vid, int start, int inc)
for(nx=0;nx<XRES;nx++)
for(ny=0;ny<YRES;ny++){
r = pmap[ny][nx];
- if(gol[nx][ny]>=5){
+ if(gol[nx][ny]>=5&&(parts[r>>8].type==PT_NONE||parts[r>>8].type==PT_GOL)){
parts[r>>8].type=PT_NONE;
}
else if(gol[nx][ny]==3){
@@ -871,7 +871,7 @@ void update_particles_i(pixel *vid, int start, int inc)
else if(gol[nx][ny]==2&&parts[r>>8].type==PT_GOL){
parts[r>>8].type=PT_NONE;
}
- else if(gol[nx][ny]==1){
+ else if(gol[nx][ny]==1&&(parts[r>>8].type==PT_NONE||parts[r>>8].type==PT_GOL)){
parts[r>>8].type=PT_NONE;
}
gol[nx][ny]=0;
@@ -1843,6 +1843,11 @@ void update_particles_i(pixel *vid, int start, int inc)
else if(t==PT_MORT) {
create_part(-1, x, y-1, PT_SMKE);
}
+ else if(t==PT_GOL)
+ {
+ if(parts[i].temp>0)
+ parts[i].temp -= 50.0f;
+ }
else if(t==PT_LCRY)
{
for(nx=-1; nx<2; nx++)