From 88e0bfd7d3472f61647b54cc4d5c31be089fae74 Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 11 Feb 2015 05:21:38 +0000 Subject: [PATCH] More twalltype git-svn-id: https://svn.eduke32.com/eduke32@4981 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 2 +- polymer/eduke32/source/actors.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index b157d4f72..9b1f1964e 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -12601,7 +12601,7 @@ restart_grand: #endif for (cnt=sec->wallnum,wal=&wall[sec->wallptr]; cnt>0; cnt--,wal++) { - const walltype *const wal2 = &wall[wal->point2]; + const twalltype *const wal2 = (twalltype *)&wall[wal->point2]; const int32_t x31 = wal->x-x1, x34 = wal->x-wal2->x; const int32_t y31 = wal->y-y1, y34 = wal->y-wal2->y; diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 4f8285676..cc8cb538f 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -108,7 +108,7 @@ void G_ClearCameraView(DukePlayer_t *ps) } // Manhattan distance between wall-point and sprite. -static int32_t G_WallSpriteDist(const walltype *wal, const spritetype *spr) +static inline int32_t G_WallSpriteDist(const twalltype *wal, const spritetype *spr) { return klabs(wal->x - spr->x) + klabs(wal->y - spr->y); } @@ -139,7 +139,7 @@ void A_RadiusDamage(int32_t i, int32_t r, int32_t hp1, int32_t hp2, int32_t hp3, do { - const walltype *wal; + const twalltype *wal; const int32_t dasect = sectorlist[sectcnt++]; const int32_t startwall = sector[dasect].wallptr; const int32_t endwall = startwall+sector[dasect].wallnum; @@ -149,8 +149,8 @@ void A_RadiusDamage(int32_t i, int32_t r, int32_t hp1, int32_t hp2, int32_t hp3, // Check if "hit" 1st or 3rd wall-point. This mainly makes sense // for rectangular "ceiling light"-style sectors. - if (G_WallSpriteDist(&wall[startwall], s) < r || - G_WallSpriteDist(&wall[wall[w2].point2], s) < r) + if (G_WallSpriteDist((twalltype *)&wall[startwall], s) < r || + G_WallSpriteDist((twalltype *)&wall[wall[w2].point2], s) < r) { if (((sector[dasect].ceilingz-s->z)>>8) < r) Sect_DamageCeilingOrFloor(0, dasect); @@ -158,7 +158,7 @@ void A_RadiusDamage(int32_t i, int32_t r, int32_t hp1, int32_t hp2, int32_t hp3, Sect_DamageCeilingOrFloor(1, dasect); } - for (w=startwall,wal=&wall[startwall]; w