remove lastx/lasty variables when OGLR is disabled

Conflicts:

	src/graphics.c
This commit is contained in:
Jacob1
2012-05-22 18:11:41 -04:00
committed by Simon Robertshaw
parent 8196d2a645
commit 4da9a26502
5 changed files with 21 additions and 0 deletions

View File

@@ -283,7 +283,9 @@ struct particle
int type; int type;
int life, ctype; int life, ctype;
float x, y, vx, vy; float x, y, vx, vy;
#ifdef OGLR
float lastX, lastY; float lastX, lastY;
#endif
float temp; float temp;
float pavg[2]; float pavg[2];
int flags; int flags;

View File

@@ -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].x = (float)x;
parts[i].y = (float)y; parts[i].y = (float)y;
#ifdef OGLR
parts[i].lastX = (float)x; parts[i].lastX = (float)x;
parts[i].lastY = (float)y; parts[i].lastY = (float)y;
#endif
parts[i].type = t; parts[i].type = t;
parts[i].life = rand()%480+480; parts[i].life = rand()%480+480;
parts[i].vx = r*cosf(a); parts[i].vx = r*cosf(a);

View File

@@ -1802,8 +1802,11 @@ void render_parts(pixel *vid)
ny = (int)(parts[i].y+0.5f); ny = (int)(parts[i].y+0.5f);
fnx = parts[i].x; fnx = parts[i].x;
fny = parts[i].y; fny = parts[i].y;
#ifdef OGLR
flx = parts[i].lastX; flx = parts[i].lastX;
fly = parts[i].lastY; fly = parts[i].lastY;
#endif
if(photons[ny][nx]&0xFF && !(ptypes[t].properties & TYPE_ENERGY) && t!=PT_STKM && t!=PT_STKM2 && t!=PT_FIGH) if(photons[ny][nx]&0xFF && !(ptypes[t].properties & TYPE_ENERGY) && t!=PT_STKM && t!=PT_STKM2 && t!=PT_FIGH)
continue; continue;

View File

@@ -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].x = (float)x;
parts[i].y = (float)y; parts[i].y = (float)y;
#ifdef OGLR
parts[i].lastX = (float)x; parts[i].lastX = (float)x;
parts[i].lastY = (float)y; parts[i].lastY = (float)y;
#endif
parts[i].type = t; parts[i].type = t;
parts[i].vx = 0; parts[i].vx = 0;
parts[i].vy = 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].x = (float)x;
parts[i].y = (float)y; parts[i].y = (float)y;
#ifdef OGLR
parts[i].lastX = (float)x; parts[i].lastX = (float)x;
parts[i].lastY = (float)y; parts[i].lastY = (float)y;
#endif
parts[i].type = PT_STKM; parts[i].type = PT_STKM;
parts[i].vx = 0; parts[i].vx = 0;
parts[i].vy = 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].x = (float)x;
parts[i].y = (float)y; parts[i].y = (float)y;
#ifdef OGLR
parts[i].lastX = (float)x; parts[i].lastX = (float)x;
parts[i].lastY = (float)y; parts[i].lastY = (float)y;
#endif
parts[i].type = PT_STKM2; parts[i].type = PT_STKM2;
parts[i].vx = 0; parts[i].vx = 0;
parts[i].vy = 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].x = (float)x;
parts[i].y = (float)y; parts[i].y = (float)y;
#ifdef OGLR
parts[i].lastX = (float)x; parts[i].lastX = (float)x;
parts[i].lastY = (float)y; parts[i].lastY = (float)y;
#endif
parts[i].type = PT_FIGH; parts[i].type = PT_FIGH;
parts[i].vx = 0; parts[i].vx = 0;
parts[i].vy = 0; parts[i].vy = 0;
@@ -1733,8 +1741,10 @@ void update_particles_i(pixel *vid, int start, int inc)
if (parts[i].type) if (parts[i].type)
{ {
t = parts[i].type; t = parts[i].type;
#ifdef OGLR
parts[i].lastX = parts[i].x; parts[i].lastX = parts[i].x;
parts[i].lastY = parts[i].y; parts[i].lastY = parts[i].y;
#endif
if (t<0 || t>=PT_NUM) if (t<0 || t>=PT_NUM)
{ {
kill_part(i); kill_part(i);

View File

@@ -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++]; partsptr[newIndex].tmp2 = partsData[i++];
} }
#ifdef OGLR
partsptr[newIndex].lastX = partsptr[newIndex].x - partsptr[newIndex].vx; partsptr[newIndex].lastX = partsptr[newIndex].x - partsptr[newIndex].vx;
partsptr[newIndex].lastY = partsptr[newIndex].y - partsptr[newIndex].vy; 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)) 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].vx = (d[p++]-127.0f)/16.0f;
parts[i].vy = (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].lastX = parts[i].x - parts[i].vx;
parts[i].lastY = parts[i].y - parts[i].vy; parts[i].lastY = parts[i].y - parts[i].vy;
#endif
} }
else else
p += 2; p += 2;