summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip <philip@philip-linuxlaptop.(none)>2010-11-06 23:03:35 (GMT)
committer Philip <philip@philip-linuxlaptop.(none)>2010-11-06 23:03:35 (GMT)
commit75922ae31df9df98f258cf2a5995524b3e4fc63b (patch)
treee54c1cedbc069991fe1ba6e2be68ae721e2c1caa
parenta2c8443c369daaa693e7a820500465acd8334df9 (diff)
downloadpowder-75922ae31df9df98f258cf2a5995524b3e4fc63b.zip
powder-75922ae31df9df98f258cf2a5995524b3e4fc63b.tar.gz
added Day&Night life particles
-rw-r--r--includes/defines.h2
-rw-r--r--includes/powder.h4
-rw-r--r--src/main.c2
-rw-r--r--src/powder.c35
4 files changed, 40 insertions, 3 deletions
diff --git a/includes/defines.h b/includes/defines.h
index 7763f75..675728d 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 8729b86..94e748d 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 bb57fc6..fe5cfd8 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 daaef91..9486299 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<XRES-4;nx++)
for(ny=4;ny<YRES-4;ny++)
@@ -904,7 +908,12 @@ void update_particles_i(pixel *vid, int start, int inc)
else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][4]>=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)