From 4c5fd9d9e2a6c67c2c3ad9eea6e560e648ff44d4 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 25 Mar 2013 04:31:31 +0000 Subject: [PATCH] Hackily implement spriteext.alpha into Classic by internally attaching 33% and 66% to the cstat bits. git-svn-id: https://svn.eduke32.com/eduke32@3607 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 40e341908..9ddb5a39e 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -5545,6 +5545,32 @@ static void drawsprite_classic(int32_t snum) DO_TILE_ANIM(tspr->picnum, spritenum+32768); +#ifdef USE_OPENGL + { + // hack pending proper alpha implentation + // TODO: a real implementation + float alpha = spriteext[tspr->owner].alpha; + + if (alpha >= 0.33f) // if alpha is 0 (which is the default) this structure should only necessitate one comparison + { + if ((cstat&2) && alpha >= 0.5f) // this covers the multiplicative aspect used in the Polymodes + cstat |= 512; + + cstat |= 2; + + if (alpha >= 0.66f) + { + cstat |= 512; + + if (alpha >= 1.0f) + return; + } + + tspr->cstat = cstat; + } + } +#endif + tilenum = tspr->picnum; if ((cstat&48)==48)