diff options
| -rw-r--r-- | .gitignore | 5 | ||||
| -rw-r--r-- | README | 1 | ||||
| -rw-r--r-- | build/.empty | 0 | ||||
| -rw-r--r-- | includes/powder.h | 21 | ||||
| -rw-r--r-- | src/main.c | 16 | ||||
| -rw-r--r-- | src/powder.c | 6 |
6 files changed, 27 insertions, 22 deletions
@@ -1,6 +1,7 @@ *.*.swp -powder-64-sse3 +.directory powder.def -powder-debug gmon.out *.*.orig +build/powder* +build/stamps/* @@ -0,0 +1 @@ +Hello diff --git a/build/.empty b/build/.empty new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/build/.empty diff --git a/includes/powder.h b/includes/powder.h index 251605b..91d8f1f 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -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", ST_NONE,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_NONE, 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_NONE, 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_NONE, 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_NONE, 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_NONE, 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_NONE, 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_NONE, 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_NONE, 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_NONE, 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 @@ -690,7 +689,7 @@ static part_transition ptransitions[PT_NUM] = static int grule[NGOL][10] = { -// 0,1,2,3,4,5,6,7,8,STATES live=1 spawn=2 spawn&live=3 States are kind of how long until it dies, normal ones use two states(living,dead) for others the intermediate states live but do nothing +// 0,1,2,3,4,5,6,7,8,STATES live=1 spawn=2 spawn&live=3 States are kind of how long until it dies, normal ones use two states(living,dead) for others the intermediate states live but do nothing {0,0,0,0,0,0,0,0,0,2},//blank {0,0,1,3,0,0,0,0,0,2},//GOL {0,0,1,3,0,0,2,0,0,2},//HLIF @@ -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; } @@ -1503,7 +1507,7 @@ int main(int argc, char *argv[]) parts[i].type = parts[i].ctype; parts[i].life = 0; } - } + } else { for (nx = 0; nx<XRES/CELL; nx++) @@ -1737,7 +1741,7 @@ int main(int argc, char *argv[]) int tctype = parts[cr>>8].ctype; if (tctype>=PT_NUM) tctype = 0; - sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d, Tmp: %d", ptypes[cr&0xFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life ,parts[cr>>8].tmp); + sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); //sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[parts[cr>>8].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); } else { sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f); diff --git a/src/powder.c b/src/powder.c index 873913c..b2932d1 100644 --- a/src/powder.c +++ b/src/powder.c @@ -664,9 +664,9 @@ inline int create_part(int p, int x, int y, int t) parts[i].life = 50; parts[i].tmp = 50; } - if(ptypes[t].properties&PROP_LIFE) { + if (ptypes[t].properties&PROP_LIFE) { int r; - for(r = 0;r<NGOL;r++) + for(r = 0; r<NGOL; r++) if(t==goltype[r]) parts[i].tmp = grule[r+1][9] - 1; } @@ -1317,7 +1317,7 @@ void update_particles_i(pixel *vid, int start, int inc) } else { parts[r>>8].tmp --; if(parts[r>>8].tmp<=0) - parts[r>>8].type = PT_NONE;//using kill_part makes it not work + parts[r>>8].type = PT_NONE;//using kill_part makes it not work } } } |
