From 75922ae31df9df98f258cf2a5995524b3e4fc63b Mon Sep 17 00:00:00 2001 From: Philip Date: Sat, 6 Nov 2010 19:03:35 -0400 Subject: [PATCH] added Day&Night life particles --- includes/defines.h | 2 +- includes/powder.h | 4 +++- src/main.c | 2 ++ src/powder.c | 35 ++++++++++++++++++++++++++++++++++- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 7763f75e8..675728d36 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -18,7 +18,7 @@ #define THUMB_CACHE_SIZE 256 -#define NGOL 5 +#define NGOL 6 #define IMGCONNS 3 #define TIMEOUT 100 diff --git a/includes/powder.h b/includes/powder.h index 8729b869d..94e748dc8 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -120,7 +120,8 @@ #define PT_HLIF 79 #define PT_ASIM 80 #define PT_2x2 81 -#define PT_NUM 82 +#define PT_DANI 82 +#define PT_NUM 83 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -292,6 +293,7 @@ static const part_type ptypes[PT_NUM] = {"HLIF", PIXPACK(0xFF0000), 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_LIFE, 9000.0f, 40, "High Life! (like GOL)", TYPE_SOLID}, {"ASIM", PIXPACK(0x0000FF), 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_LIFE, 9000.0f, 40, "Assimilation! (like GOL)", TYPE_SOLID}, {"2x2", PIXPACK(0xFFFF00), 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_LIFE, 9000.0f, 40, "2x2! (like GOL)", TYPE_SOLID}, + {"DANI", PIXPACK(0x00FFFF), 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_LIFE, 9000.0f, 40, "Day and Night! (like GOL)", 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 bb57fc622..fe5cfd8ba 100644 --- a/src/main.c +++ b/src/main.c @@ -528,6 +528,8 @@ int parse_save(void *save, int size, int replace, int x0, int y0) gol[x][y] = 3; if(j == PT_2x2) gol[x][y] = 4; + if(j == PT_DANI) + gol[x][y] = 5; if(j == PT_PHOT) parts[k].ctype = 0x3fffffff; parts[k].x = (float)x; diff --git a/src/powder.c b/src/powder.c index daaef9146..948629904 100644 --- a/src/powder.c +++ b/src/powder.c @@ -850,7 +850,11 @@ void update_particles_i(pixel *vid, int start, int inc) else if(parts[r>>8].type==PT_2x2) { gol[nx][ny] = 4; - } + } + else if(parts[r>>8].type==PT_DANI) + { + gol[nx][ny] = 5; + } } for(nx=4;nx=2) { create_part(-1,nx,ny,PT_2x2); + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][5]>=2) + { + create_part(-1,nx,ny,PT_DANI); } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][1]==1) { create_part(-1,nx,ny,PT_GOL); @@ -913,6 +922,10 @@ void update_particles_i(pixel *vid, int start, int inc) { create_part(-1,nx,ny,PT_HLIF); } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][4]==1) + { + create_part(-1,nx,ny,PT_2x2); + } else if(v==4&&gol[nx][ny]==0&&gol2[nx][ny][3]>=2) { @@ -931,6 +944,20 @@ void update_particles_i(pixel *vid, int start, int inc) { create_part(-1,nx,ny,PT_2x2); } + else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][5]>=3) + { + create_part(-1,nx,ny,PT_DANI); + } + + else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][5]>=4) + { + create_part(-1,nx,ny,PT_DANI); + } + + else if(v==8&&gol[nx][ny]==0&&gol2[nx][ny][5]>=4) + { + create_part(-1,nx,ny,PT_DANI); + } else if(v>=5&&gol[nx][ny]==1) parts[r>>8].type = PT_NONE; @@ -957,10 +984,16 @@ void update_particles_i(pixel *vid, int start, int inc) else if(v<=1&&gol[nx][ny]==4) parts[r>>8].type = PT_NONE; + else if(v==6&&gol[nx][ny]==5) + parts[r>>8].type = PT_NONE; + else if(v<=3&&gol[nx][ny]==5) + parts[r>>8].type = PT_NONE; + gol2[nx][ny][1]=0; gol2[nx][ny][2]=0; gol2[nx][ny][3]=0; gol2[nx][ny][4]=0; + gol2[nx][ny][5]=0; } CGOL++; for(i=start; i<(NPART-starti); i+=inc)