summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacob1 <jfu614@gmail.com>2012-05-22 22:11:41 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-05-24 18:57:29 (GMT)
commit4da9a26502fa79f54330866671992498a6a6d289 (patch)
tree965048e346f252dd69b0388037191642433877db /src
parent8196d2a645d386b5c97134c446e959e5e50a345b (diff)
downloadpowder-4da9a26502fa79f54330866671992498a6a6d289.zip
powder-4da9a26502fa79f54330866671992498a6a6d289.tar.gz
remove lastx/lasty variables when OGLR is disabled
Conflicts: src/graphics.c
Diffstat (limited to 'src')
-rw-r--r--src/elements/neut.c2
-rw-r--r--src/graphics.c3
-rw-r--r--src/powder.c10
-rw-r--r--src/save.c4
4 files changed, 19 insertions, 0 deletions
diff --git a/src/elements/neut.c b/src/elements/neut.c
index afb0523..e3593f5 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 0c4c965..c7611ff 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 700a6d5..3861248 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 b5f3b39..8f5b060 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;