remove lastx/lasty variables when OGLR is disabled
Conflicts: src/graphics.c
This commit is contained in:
parent
8196d2a645
commit
4da9a26502
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
10
src/powder.c
10
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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user