summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacksonmj <jacksonmj@jacksonmj.none>2011-01-28 21:38:36 (GMT)
committer jacksonmj <jacksonmj@jacksonmj.none>2011-01-28 21:46:40 (GMT)
commita5ff51f5a508b35980502ebce46c4a3822ecb4b4 (patch)
treebb7ce78fd6763688375c31397cf46e243711124e
parent079d35f1a03088aca57be633f75c6e60d62a9fb3 (diff)
downloadpowder-a5ff51f5a508b35980502ebce46c4a3822ecb4b4.zip
powder-a5ff51f5a508b35980502ebce46c4a3822ecb4b4.tar.gz
Restore cracker64 changes overwritten by merge
-rw-r--r--includes/powder.h21
-rw-r--r--src/main.c43
-rw-r--r--src/powder.c10
3 files changed, 40 insertions, 34 deletions
diff --git a/includes/powder.h b/includes/powder.h
index cc177e7..e033e02 100644
--- a/includes/powder.h
+++ b/includes/powder.h
@@ -501,7 +501,7 @@ static const part_type ptypes[PT_NUM] =
{"BOMB", PIXPACK(0xFFF288), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 20, 1, 30, SC_EXPLOSIVE, R_TEMP-2.0f +273.15f, 29, "Bomb.", ST_NONE, TYPE_PART, &update_BOMB},
{"C-5", PIXPACK(0x2050E0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Cold explosive", ST_SOLID, TYPE_SOLID | PROP_NEUTPENETRATE, &update_C5},
{"SING", PIXPACK(0x242424), 0.7f, 0.36f * CFDS, 0.96f, 0.80f, 0.1f, 0.12f, 0.00f, -0.001f * CFDS, 1, 0, 0, 0, 0, 1, 86, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Singularity", ST_SOLID, TYPE_PART, &update_SING},
- {"QRTZ", PIXPACK(0xAADDDD), 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_SOLIDS, R_TEMP+0.0f +273.15f, 3, "Quartz, breakable mineral. Conducts but becomes brittle at lower temperatures.", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_HOT_GLOW, &update_QRTZ},
+ {"QRTZ", PIXPACK(0xAADDDD), 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_SOLIDS, R_TEMP+0.0f +273.15f, 3, "Quartz, breakable mineral. Conducts but becomes brittle at lower temperatures.", ST_SOLID, TYPE_SOLID|PROP_HOT_GLOW, &update_QRTZ},
{"PQRT", PIXPACK(0x88BBBB), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.27f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 3, "Broken quartz.", ST_SOLID, TYPE_PART| PROP_HOT_GLOW, NULL},
{"SEED", PIXPACK(0xFBEC7D), 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, "B2/S", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"MAZE", PIXPACK(0xA8E4A0), 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, "B3/S12345", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
@@ -510,13 +510,12 @@ static const part_type ptypes[PT_NUM] =
{"GNAR", PIXPACK(0xE5B73B), 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, "B1/S1", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"REPL", PIXPACK(0x259588), 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, "B1357/S1357", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"MYST", PIXPACK(0x0C3C00), 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, "B3458/S05678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
-
{"BOYL", PIXPACK(0x0A3200), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.18f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Boyle, variable pressure gas. Expands when heated.", ST_GAS, TYPE_GAS, &update_BOYL},
- {"LOTE", 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_LIFE2, 9000.0f, 40, "Behaves kinda like Living on the Edge S3458/B37/4", TYPE_SOLID|PROP_LIFE, NULL},
- {"FRG2", PIXPACK(0x00FF00), 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_LIFE2, 9000.0f, 40, "Like Frogs rule S124/B3/3", TYPE_SOLID|PROP_LIFE, NULL},
- {"STAR", 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_LIFE2, 9000.0f, 40, "Like Star Wars rule S3456/B278/6", TYPE_SOLID|PROP_LIFE, NULL},
- {"FROG", PIXPACK(0x00AA00), 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_LIFE2, 9000.0f, 40, "Frogs S12/B34/3", TYPE_SOLID|PROP_LIFE, NULL},
- {"BRAN", PIXPACK(0xCCCC00), 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_LIFE2, 9000.0f, 40, "Brian 6 S6/B246/3", TYPE_SOLID|PROP_LIFE, NULL},
+ {"LOTE", 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_LIFE2, 9000.0f, 40, "Behaves kinda like Living on the Edge S3458/B37/4", ST_SOLID, TYPE_SOLID|PROP_LIFE, NULL},
+ {"FRG2", PIXPACK(0x00FF00), 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_LIFE2, 9000.0f, 40, "Like Frogs rule S124/B3/3", ST_SOLID, TYPE_SOLID|PROP_LIFE, NULL},
+ {"STAR", 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_LIFE2, 9000.0f, 40, "Like Star Wars rule S3456/B278/6", ST_SOLID, TYPE_SOLID|PROP_LIFE, NULL},
+ {"FROG", PIXPACK(0x00AA00), 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_LIFE2, 9000.0f, 40, "Frogs S12/B34/3", ST_SOLID, TYPE_SOLID|PROP_LIFE, NULL},
+ {"BRAN", PIXPACK(0xCCCC00), 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_LIFE2, 9000.0f, 40, "Brian 6 S6/B246/3", ST_SOLID, TYPE_SOLID|PROP_LIFE, NULL},
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins Description
};
@@ -675,10 +674,10 @@ static part_transition ptransitions[PT_NUM] =
/* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* BOYL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
- /* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
- /* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
- /* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
- /* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
+ /* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
+ /* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
+ /* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
+ /* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
};
#undef IPL
#undef IPH
diff --git a/src/main.c b/src/main.c
index 68c1140..46267c2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -492,6 +492,10 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
memset(vx, 0, sizeof(vx));
memset(vy, 0, sizeof(vy));
memset(pv, 0, sizeof(pv));
+ memset(photons, 0, sizeof(photons));
+ memset(wireless, 0, sizeof(wireless));
+ memset(gol2, 0, sizeof(gol2));
+ memset(portal, 0, sizeof(portal));
death = death2 = ISSPAWN1 = ISSPAWN2 = 0;
}
@@ -714,10 +718,10 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
ttv |= (d[p++]);
parts[i-1].tmp = ttv;
if(ptypes[parts[i-1].type].properties&PROP_LIFE && !parts[i-1].tmp)
- for(q = 1; q<NGOL ; q++){
- if(parts[i-1].type==goltype[q-1] && grule[q][9]==2)
- parts[i-1].tmp = grule[q][9]-1;
- }
+ for(q = 1; q<NGOL ; q++) {
+ if(parts[i-1].type==goltype[q-1] && grule[q][9]==2)
+ parts[i-1].tmp = grule[q][9]-1;
+ }
} else {
p+=2;
}
@@ -1495,13 +1499,25 @@ int main(int argc, char *argv[])
if (sdl_key=='=')
{
int nx, ny;
- for (nx = 0; nx<XRES/CELL; nx++)
- for (ny = 0; ny<YRES/CELL; ny++)
- {
- pv[ny][nx] = 0;
- vx[ny][nx] = 0;
- vy[ny][nx] = 0;
- }
+ if(sdl_mod & (KMOD_CTRL))
+ {
+ for(i=0; i<NPART; i++)
+ if(parts[i].type==PT_SPRK)
+ {
+ parts[i].type = parts[i].ctype;
+ parts[i].life = 0;
+ }
+ }
+ else
+ {
+ for (nx = 0; nx<XRES/CELL; nx++)
+ for (ny = 0; ny<YRES/CELL; ny++)
+ {
+ pv[ny][nx] = 0;
+ vx[ny][nx] = 0;
+ vy[ny][nx] = 0;
+ }
+ }
}
if (sdl_key=='w' && (!isplayer2 || (sdl_mod & (KMOD_SHIFT)))) //Gravity, by Moach
@@ -2036,7 +2052,6 @@ int main(int argc, char *argv[])
memset(bmap, 0, sizeof(bmap));
memset(emap, 0, sizeof(emap));
memset(parts, 0, sizeof(particle)*NPART);
-
memset(photons, 0, sizeof(photons));
memset(wireless, 0, sizeof(wireless));
memset(gol2, 0, sizeof(gol2));
@@ -2098,10 +2113,6 @@ int main(int argc, char *argv[])
if (x>=19 && x<=35 && svf_last && svf_open && !bq) {
//int tpval = sys_pause;
parse_save(svf_last, svf_lsize, 1, 0, 0);
- for (j= 0; j<99; j++) { //reset wifi on reload
- wireless[j][0] = 0;
- wireless[j][1] = 0;
- }
//sys_pause = tpval;
}
if (x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq)
diff --git a/src/powder.c b/src/powder.c
index 385ac5d..add5f48 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -577,8 +577,7 @@ inline int create_part(int p, int x, int y, int t)
if (t==PT_SPRK)
{
- if (!((pmap[y][x]&0xFF)==PT_INST||(ptypes[pmap[y][x]&0xFF].properties&PROP_CONDUCTS))
- || (pmap[y][x]&0xFF)==PT_QRTZ)
+ if (!((pmap[y][x]&0xFF)==PT_INST||(ptypes[pmap[y][x]&0xFF].properties&PROP_CONDUCTS)))
return -1;
if (parts[pmap[y][x]>>8].life!=0)
return -1;
@@ -604,8 +603,6 @@ inline int create_part(int p, int x, int y, int t)
}
}
}
- if (photons[y][x] && t==PT_PHOT)
- return -1;
if (pfree == -1)
return -1;
i = pfree;
@@ -967,7 +964,6 @@ inline void delete_part(int x, int y)
}
else
return;
-
}
#if defined(WIN32) && !defined(__GNUC__)
@@ -1124,7 +1120,7 @@ int nearest_part(int ci, int t)
void update_particles_i(pixel *vid, int start, int inc)
{
- int i, j, x, y, t, nx, ny, r, surround_space, s, lt, rt, nt, nnx, nny, q, golnum, goldelete, z;
+ int i, j, x, y, t, nx, ny, r, surround_space, s, lt, rt, nt, nnx, nny, q, golnum, goldelete, z, neighbors;
float mv, dx, dy, ix, iy, lx, ly, nrx, nry, dp;
int fin_x, fin_y, clear_x, clear_y;
float fin_xf, fin_yf, clear_xf, clear_yf;
@@ -1316,7 +1312,7 @@ void update_particles_i(pixel *vid, int start, int inc)
for (nx=CELL; nx<XRES-CELL; nx++)
for (ny=CELL; ny<YRES-CELL; ny++)
{
- int neighbors = gol2[nx][ny][0];
+ neighbors = gol2[nx][ny][0];
if (neighbors==0)
continue;
for ( golnum = 1; golnum<NGOL; golnum++)