From 99e8ce054246dbeaa4ccd01ae9ce5fff0a8c6bf2 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 30 Dec 2010 11:48:32 +0000 Subject: [PATCH] Testing Some DEUT --- src/powder.c | 55 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/src/powder.c b/src/powder.c index 9d2c9c12b..c21ed5155 100644 --- a/src/powder.c +++ b/src/powder.c @@ -426,6 +426,40 @@ void kill_part(int i) pfree = i; } +#if defined(WIN32) && !defined(__GNUC__) +_inline int create_n_parts(int n, int x, int y, int t) +#else +inline int create_n_parts(int n, int x, int y, float vx, float vy, int t) +#endif +{ + int i, c; + + if(x<0 || y<0 || x>=XRES || y>=YRES) + return -1; + + for (c; c>8].ctype = t; - } + if(((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||(pmap[y][x]&0xFF)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN)) + { + parts[pmap[y][x]>>8].ctype = t; + } return -1; - } + } if(pfree == -1) return -1; i = pfree; @@ -2462,10 +2496,12 @@ void update_particles_i(pixel *vid, int start, int inc) } if((r&0xFF)==PT_DEUT && (rt+1)>(rand()%1000)) { - +#ifdef SDEUT + create_n_parts(parts[r>>8].life, x+nx, y+ny, parts[i].vx, parts[i].vy, PT_NEUT); +#elif create_part(r>>8, x+nx, y+ny, PT_NEUT); - parts[r>>8].vx = 0.25f*parts[r>>8].vx + parts[i].vx; - parts[r>>8].vy = 0.25f*parts[r>>8].vy + parts[i].vy; + parts[r>>8].vx = 0.25f*parts[r>>8].vx + parts[i].vx; + parts[r>>8].vy = 0.25f*parts[r>>8].vy + parts[i].vy; if(parts[r>>8].life>0) { parts[r>>8].life --; @@ -2474,7 +2510,8 @@ void update_particles_i(pixel *vid, int start, int inc) } else - parts[r>>8].type = PT_NONE; + parts[r>>8].type = PT_NONE; +#endif } if((r&0xFF)==PT_GUNP && 15>(rand()%1000)) parts[r>>8].type = PT_DUST;