diff options
| author | Cracker64 <cracker642@gmail.com> | 2011-01-29 01:13:29 (GMT) |
|---|---|---|
| committer | Cracker64 <cracker642@gmail.com> | 2011-01-29 01:13:29 (GMT) |
| commit | 964ecf2ecfe2246fcecde20bf417c001d58a0c8b (patch) | |
| tree | a6f6c53156cd0bc1c200bb77e4d3e9a5d614331d /src | |
| parent | 880ed33fc7b5258626afd186e71b02808555ce15 (diff) | |
| download | powder-964ecf2ecfe2246fcecde20bf417c001d58a0c8b.zip powder-964ecf2ecfe2246fcecde20bf417c001d58a0c8b.tar.gz | |
Other things overwritten, and changes from jacksonmj
Diffstat (limited to 'src')
| -rw-r--r-- | src/elements/sprk.c | 2 | ||||
| -rw-r--r-- | src/main.c | 31 | ||||
| -rw-r--r-- | src/powder.c | 14 |
3 files changed, 25 insertions, 22 deletions
diff --git a/src/elements/sprk.c b/src/elements/sprk.c index 0f3c6c7..58692ee 100644 --- a/src/elements/sprk.c +++ b/src/elements/sprk.c @@ -5,7 +5,7 @@ int update_SPRK(UPDATE_FUNC_ARGS) { int r, rx, ry, rt, conduct_sprk, nearp, pavg, ct = parts[i].ctype; if (parts[i].life<=0) { - if (ct==PT_WATR||ct==PT_SLTW||ct==PT_PSCN||ct==PT_NSCN||ct==PT_ETRD) + if (ct==PT_WATR||ct==PT_SLTW||ct==PT_PSCN||ct==PT_NSCN||ct==PT_ETRD||ct==PT_INWR) parts[i].temp = R_TEMP + 273.15f; if (!ct) ct = PT_METL; @@ -1495,13 +1495,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 +2048,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 +2109,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 632aab8..873913c 100644 --- a/src/powder.c +++ b/src/powder.c @@ -450,7 +450,7 @@ void kill_part(int i) } #if defined(WIN32) && !defined(__GNUC__) -_inline void part_change_type(int n, int x, int y, int t) +_inline void part_change_type(int i, int x, int y, int t) #else inline void part_change_type(int i, int x, int y, int t) #endif @@ -465,7 +465,7 @@ inline void part_change_type(int i, int x, int y, int t) } #if defined(WIN32) && !defined(__GNUC__) -_inline int create_n_parts(int n, int x, int y, int t) +_inline int create_n_parts(int n, int x, int y, float vx, float vy, int t) #else inline int create_n_parts(int n, int x, int y, float vx, float vy, int t) #endif @@ -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; @@ -973,7 +970,6 @@ inline void delete_part(int x, int y) } else return; - } #if defined(WIN32) && !defined(__GNUC__) @@ -1134,7 +1130,7 @@ void update_particles_i(pixel *vid, int start, int inc) 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; - float nn, ct1, ct2; + float nn, ct1, ct2, swappage; float pt = R_TEMP; float c_heat = 0.0f; int h_count = 0; @@ -1489,7 +1485,6 @@ void update_particles_i(pixel *vid, int start, int inc) if (!legacy_enable) { if (y-2 >= 0 && y-2 < YRES && (ptypes[t].properties&TYPE_LIQUID)) { - float swappage; r = pmap[y-2][x]; if (!((r>>8)>=NPART || !r || parts[i].type != (r&0xFF))) { if (parts[i].temp>parts[r>>8].temp) { @@ -1561,6 +1556,7 @@ void update_particles_i(pixel *vid, int start, int inc) if (parts[i].ctype&&parts[i].ctype!=PT_LAVA) { if (ptransitions[parts[i].ctype].tht==PT_LAVA&&pt>=ptransitions[parts[i].ctype].thv) s = 0; else if (parts[i].ctype==PT_THRM&&pt>=ptransitions[PT_BMTL].thv) s = 0; + else if (pt>=973.0f) s = 0; // freezing point for lava with any other (not listed in ptransitions as turning into lava) ctype else { t = parts[i].ctype; parts[i].ctype = PT_NONE; |
