comparison Render.cpp @ 2078:66cbc97b31fa

fix transparent fonts
author Gloval
date Wed, 04 Dec 2013 23:35:44 +0400
parents 121316212c1c
children a869b0376b48
comparison
equal deleted inserted replaced
2077:d8b40e0fa21d 2078:66cbc97b31fa
1213 goto LABEL_6; 1213 goto LABEL_6;
1214 if ( !Dst->dwSize ) 1214 if ( !Dst->dwSize )
1215 { 1215 {
1216 v2 = 1; 1216 v2 = 1;
1217 LABEL_6: 1217 LABEL_6:
1218 memcpy(Dst, Src, 0x20u); 1218 memcpy(Dst, Src, sizeof(DDPIXELFORMAT));
1219 return v2; 1219 return v2;
1220 } 1220 }
1221 } 1221 }
1222 return 1; 1222 return 1;
1223 } 1223 }
6743 unsigned __int32 c = color16; 6743 unsigned __int32 c = color16;
6744 unsigned int b = (c & 31) * 8; 6744 unsigned int b = (c & 31) * 8;
6745 unsigned int g = ((c >> 5) & 63) * 4; 6745 unsigned int g = ((c >> 5) & 63) * 4;
6746 unsigned int r = ((c >> 11) & 31) * 8; 6746 unsigned int r = ((c >> 11) & 31) * 8;
6747 6747
6748 return 0xFF000000 | (r << 16) | (g << 8) | b; 6748 return (r << 16) | (g << 8) | b;//
6749 } 6749 }
6750 6750
6751 //----- (0040DEF3) -------------------------------------------------------- 6751 //----- (0040DEF3) --------------------------------------------------------
6752 unsigned __int16 Color16(unsigned __int32 r, unsigned __int32 g, unsigned __int32 b) 6752 unsigned __int16 Color16(unsigned __int32 r, unsigned __int32 g, unsigned __int32 b)
6753 { 6753 {
7103 for (uint y = 0; y < uHeight; ++y) 7103 for (uint y = 0; y < uHeight; ++y)
7104 { 7104 {
7105 void *pDst = (char *)pTargetSurface + (FORCE_16_BITS ? 2 : 4) * (uX + (y + uY) * uTargetSurfacePitch); 7105 void *pDst = (char *)pTargetSurface + (FORCE_16_BITS ? 2 : 4) * (uX + (y + uY) * uTargetSurfacePitch);
7106 7106
7107 memset32(pDst, 7107 memset32(pDst,
7108 FORCE_16_BITS ? twoColors : Color32(uColor16), // two colors per int (16bit) or 1 (32bit) 7108 FORCE_16_BITS ? twoColors : 0xFF000000 |Color32(uColor16), // two colors per int (16bit) or 1 (32bit)
7109 uWidth / (FORCE_16_BITS ? 2 : 1)); // two pixels per int (16bit) or 1 (32bit) 7109 uWidth / (FORCE_16_BITS ? 2 : 1)); // two pixels per int (16bit) or 1 (32bit)
7110 7110
7111 if (FORCE_16_BITS && uWidth & 1) // we may miss one pixel for 16bit 7111 if (FORCE_16_BITS && uWidth & 1) // we may miss one pixel for 16bit
7112 ((unsigned __int16 *)pTargetSurface)[uX + uWidth - 1 + (y + uY) * uTargetSurfacePitch] = uColor16; 7112 ((unsigned __int16 *)pTargetSurface)[uX + uWidth - 1 + (y + uY) * uTargetSurfacePitch] = uColor16;
7113 } 7113 }