diff --git a/includes/powder.h b/includes/powder.h index dcf5d0322..29aac3b48 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -283,7 +283,9 @@ struct particle int type; int life, ctype; float x, y, vx, vy; +#ifdef OGLR float lastX, lastY; +#endif float temp; float pavg[2]; int flags; diff --git a/src/elements/neut.c b/src/elements/neut.c index afb052301..e3593f57a 100644 --- a/src/elements/neut.c +++ b/src/elements/neut.c @@ -40,8 +40,10 @@ int create_n_parts(int n, int x, int y, float vx, float vy, float temp, int t)// parts[i].x = (float)x; parts[i].y = (float)y; +#ifdef OGLR parts[i].lastX = (float)x; parts[i].lastY = (float)y; +#endif parts[i].type = t; parts[i].life = rand()%480+480; parts[i].vx = r*cosf(a); diff --git a/src/graphics.c b/src/graphics.c index 0c4c9653f..c7611ff6f 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1802,8 +1802,11 @@ void render_parts(pixel *vid) ny = (int)(parts[i].y+0.5f); fnx = parts[i].x; fny = parts[i].y; +#ifdef OGLR flx = parts[i].lastX; fly = parts[i].lastY; +#endif + if(photons[ny][nx]&0xFF && !(ptypes[t].properties & TYPE_ENERGY) && t!=PT_STKM && t!=PT_STKM2 && t!=PT_FIGH) continue; diff --git a/src/powder.c b/src/powder.c index 700a6d5e0..3861248bb 100644 --- a/src/powder.c +++ b/src/powder.c @@ -892,8 +892,10 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a { parts[i].x = (float)x; parts[i].y = (float)y; +#ifdef OGLR parts[i].lastX = (float)x; parts[i].lastY = (float)y; +#endif parts[i].type = t; parts[i].vx = 0; parts[i].vy = 0; @@ -1037,8 +1039,10 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a { parts[i].x = (float)x; parts[i].y = (float)y; +#ifdef OGLR parts[i].lastX = (float)x; parts[i].lastY = (float)y; +#endif parts[i].type = PT_STKM; parts[i].vx = 0; parts[i].vy = 0; @@ -1061,8 +1065,10 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a { parts[i].x = (float)x; parts[i].y = (float)y; +#ifdef OGLR parts[i].lastX = (float)x; parts[i].lastY = (float)y; +#endif parts[i].type = PT_STKM2; parts[i].vx = 0; parts[i].vy = 0; @@ -1087,8 +1093,10 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a { parts[i].x = (float)x; parts[i].y = (float)y; +#ifdef OGLR parts[i].lastX = (float)x; parts[i].lastY = (float)y; +#endif parts[i].type = PT_FIGH; parts[i].vx = 0; parts[i].vy = 0; @@ -1733,8 +1741,10 @@ void update_particles_i(pixel *vid, int start, int inc) if (parts[i].type) { t = parts[i].type; +#ifdef OGLR parts[i].lastX = parts[i].x; parts[i].lastY = parts[i].y; +#endif if (t<0 || t>=PT_NUM) { kill_part(i); diff --git a/src/save.c b/src/save.c index b5f3b3913..8f5b06007 100644 --- a/src/save.c +++ b/src/save.c @@ -1347,8 +1347,10 @@ int parse_save_OPS(void *save, int size, int replace, int x0, int y0, unsigned c partsptr[newIndex].tmp2 = partsData[i++]; } +#ifdef OGLR partsptr[newIndex].lastX = partsptr[newIndex].x - partsptr[newIndex].vx; partsptr[newIndex].lastY = partsptr[newIndex].y - partsptr[newIndex].vy; +#endif if ((player.spwn == 1 && partsptr[newIndex].type==PT_STKM) || (player2.spwn == 1 && partsptr[newIndex].type==PT_STKM2)) { @@ -2027,8 +2029,10 @@ int parse_save_PSv(void *save, int size, int replace, int x0, int y0, unsigned c { parts[i].vx = (d[p++]-127.0f)/16.0f; parts[i].vy = (d[p++]-127.0f)/16.0f; +#ifdef OGLR parts[i].lastX = parts[i].x - parts[i].vx; parts[i].lastY = parts[i].y - parts[i].vy; +#endif } else p += 2;