From d9092fcd2b102d5d30125895b2170d900012a76d Mon Sep 17 00:00:00 2001 From: plagman Date: Tue, 3 Aug 2010 15:19:01 +0000 Subject: [PATCH] Implement 'away1' and 'away2' maphacks in Polymer. git-svn-id: https://svn.eduke32.com/eduke32@1681 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 09c4bba22..e05771209 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -1315,6 +1315,21 @@ void polymer_drawsprite(int32_t snum) cs = tspr->cstat; + // I think messing with the tspr is safe at this point? + // If not, change that to modify a temp position in updatesprite itself. + // I don't think this flags are meant to change on the fly so it'd possibly + // be safe to cache a plane that has them applied. + if (spriteext[tspr->owner].flags & SPREXT_AWAY1) + { + tspr->x += sintable[(tspr->ang + 512) & 2047] >> 13; + tspr->y += sintable[tspr->ang & 2047] >> 13; + } + else if (spriteext[tspr->owner].flags & SPREXT_AWAY2) + { + tspr->x -= sintable[(tspr->ang + 512) & 2047] >> 13; + tspr->y -= sintable[tspr->ang & 2047] >> 13; + } + polymer_updatesprite(snum); if (prsprites[tspr->owner] == NULL)