ref: d0340ee6ba7d1402a2e8786139fa3f59cd68c010
parent: 050589ae8afe1b26f684d2aa7bc41fc58e9c655d
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Dec 28 18:10:01 EST 2023
treat alpha 0 ("default") as alpha 0xff when drawing
--- a/d_alpha.c
+++ b/d_alpha.c
@@ -5,6 +5,8 @@
{
int a, b, c;
+ alpha = (ca >> 24)*alpha >> 8;
+
if(currententity != nil && currententity->effects & EF_ADDITIVE){
ca = R_BlendFog(ca, izi);
a = (alpha*((ca>> 0)&0xff) + 255*((cb>> 0)&0xff))>> 8;
--- a/protocol.h
+++ b/protocol.h
@@ -17,7 +17,7 @@
ZERO_ALPHA,
};
-#define defalpha(a) ((a) == DEFAULT_ALPHA)
+#define defalpha(a) ((a) == DEFAULT_ALPHA || (a) == 0xff)
#define zeroalpha(a) (!defalpha(a) && (a) <= ZERO_ALPHA)
#define f2alpha(f) ((f) == 0.0 ? DEFAULT_ALPHA : clamp((f)*254+1, 1, 255))
#define alpha2f(a) (zeroalpha(a) ? 0.0 : (float)(a)/255.0)
--- a/r_main.c
+++ b/r_main.c
@@ -472,6 +472,8 @@
return 1;
if((entdrawflags(e) ^ r_drawflags) != 0)
return 0;
+ if(e->alpha == DEFAULT_ALPHA)
+ e->alpha = 0xff;
currententity = e;
VectorCopy(modelorg, oldorigin);