diff --git a/includes/defines.h b/includes/defines.h index df1fa0aef..1827ecad6 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -104,6 +104,9 @@ struct stamp typedef struct stamp stamp; int MSIGN; +int NGOL; +int CGOL; +int gol[XRES][YRES]; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/includes/powder.h b/includes/powder.h index fbf79fc05..10758a076 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -116,7 +116,8 @@ #define PT_HSWC 75 #define PT_IRON 76 #define PT_MORT 77 -#define PT_NUM 78 +#define PT_GOL 78 +#define PT_NUM 79 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -284,6 +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}, //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/graphics.c b/src/graphics.c index b403fe36f..e108e99e2 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1244,6 +1244,7 @@ void draw_parts(pixel *vid) int cr, cg, cb; float fr, fg, fb; float pt = R_TEMP; + int gol[XRES][YRES]; for(i = 0; i>8)>0 && (pmap[signs[i].y][signs[i].x]>>8)=8) + { + CGOL = 0; + create_part(-1,0,0,PT_GOL); + for(nx=0;nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==PT_GOL) + for(int nnx=1; nnx>-2; nnx--) + for(int nny=1; nny>-2; nny--) + if(nx+nnx>=0 && ny+nny>0 && nx+nnx=4){ + gol[nx+nnx][ny+nny] =5; + } + else if(gol[nx+nnx][ny+nny]==3){ + gol[nx+nnx][ny+nny] =4; + } + else if(gol[nx+nnx][ny+nny]==2){ + gol[nx+nnx][ny+nny] =3; + } + else if(gol[nx+nnx][ny+nny]==1){ + gol[nx+nnx][ny+nny] =2; + } + else if(gol[nx+nnx][ny+nny]==0){ + gol[nx+nnx][ny+nny] =1; + } + } + } + } + for(nx=0;nx=5){ + parts[r>>8].type=PT_NONE; + } + else if(gol[nx][ny]==3){ + create_part(-1,nx,ny,PT_GOL); + } + else if(gol[nx][ny]==2&&parts[r>>8].type==PT_GOL){ + parts[r>>8].type=PT_NONE; + } + else if(gol[nx][ny]==1){ + parts[r>>8].type=PT_NONE; + } + gol[nx][ny]=0; + + } + } + CGOL++; for(i=start; i<(NPART-starti); i+=inc) if(parts[i].type) { @@ -831,10 +888,7 @@ void update_particles_i(pixel *vid, int start, int inc) ly = parts[i].y; t = parts[i].type; - if(sys_pause&&!framerender) - return; - - if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL) + if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--;