shithub: qk1

Download patch

ref: 61a668a6c7d98d157c6e6fcf8149aba332a80587
parent: d0340ee6ba7d1402a2e8786139fa3f59cd68c010
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Thu Dec 28 18:11:05 EST 2023

sprite32: always blend as the alpha is not necessarily 0xff/0x00 for all pixels

--- a/d_sprite.c
+++ b/d_sprite.c
@@ -135,15 +135,12 @@
 			do
 			{
 				btemp = *(pbase + (s >> 16) + (t >> 16) * cachewidth);
-				if (opaque(btemp))
-				{
-					if (*pz <= izi){
-						if(r_drawflags & DRAW_BLEND){
-							*pdest = blendalpha(btemp, *pdest, alpha, izi);
-						}else{
-							*pz = izi;
-							*pdest = btemp;
-						}
+				if(opaque(btemp) && *pz <= izi){
+					if(r_drawflags & DRAW_BLEND){
+						*pdest = blendalpha(btemp, *pdest, alpha, izi);
+					}else{
+						*pz = izi;
+						*pdest = btemp;
 					}
 				}
 
--- a/model_sprite.c
+++ b/model_sprite.c
@@ -35,7 +35,8 @@
 		in += size;
 	}else if(mod->ver == SPRITE32_VERSION){
 		for(i = 0; i < size; i++, in += sizeof(pixel_t))
-			pspriteframe->pixels[i] = in[0]<<24 | in[3]<<16 | in[1]<<8 | in[2];
+			pspriteframe->pixels[i] = in[3]<<24 | in[0]<<16 | in[1]<<8 | in[2];
+		mod->blend = true;
 	}
 
 	return in;