featuresmask |= palette_featureflags[skindata[i]];
skinframe->hasalpha = false;
+ // fence textures
+ if (name[0] == '{')
+ skinframe->hasalpha = true;
skinframe->qhascolormapping = loadpantsandshirt && (featuresmask & (PALETTEFEATURE_PANTS | PALETTEFEATURE_SHIRT));
skinframe->qgeneratenmap = r_shadow_bumpscale_basetexture.value > 0;
skinframe->qgeneratemerged = true;
if (skinframe->qgenerateglow)
{
skinframe->qgenerateglow = false;
- skinframe->glow = R_LoadTexture2D(r_main_texturepool, va(vabuf, sizeof(vabuf), "%s_glow", skinframe->basename), width, height, skindata, vid.sRGB3D ? TEXTYPE_SRGB_PALETTE : TEXTYPE_PALETTE, skinframe->textureflags, -1, palette_bgra_onlyfullbrights); // glow
+ if (skinframe->hasalpha) // fence textures
+ skinframe->glow = R_LoadTexture2D(r_main_texturepool, va(vabuf, sizeof(vabuf), "%s_glow", skinframe->basename), width, height, skindata, vid.sRGB3D ? TEXTYPE_SRGB_PALETTE : TEXTYPE_PALETTE, skinframe->textureflags | TEXF_ALPHA, -1, palette_bgra_onlyfullbrights_transparent); // glow
+ else
+ skinframe->glow = R_LoadTexture2D(r_main_texturepool, va(vabuf, sizeof(vabuf), "%s_glow", skinframe->basename), width, height, skindata, vid.sRGB3D ? TEXTYPE_SRGB_PALETTE : TEXTYPE_PALETTE, skinframe->textureflags, -1, palette_bgra_onlyfullbrights); // glow
}
if (colormapped)
else
{
skinframe->qgeneratemerged = false;
- skinframe->merged = R_LoadTexture2D(r_main_texturepool, skinframe->basename, width, height, skindata, vid.sRGB3D ? TEXTYPE_SRGB_PALETTE : TEXTYPE_PALETTE, skinframe->textureflags, -1, skinframe->glow ? palette_bgra_nofullbrights : palette_bgra_complete);
+ if (skinframe->hasalpha) // fence textures
+ skinframe->merged = R_LoadTexture2D(r_main_texturepool, skinframe->basename, width, height, skindata, vid.sRGB3D ? TEXTYPE_SRGB_PALETTE : TEXTYPE_PALETTE, skinframe->textureflags | TEXF_ALPHA, -1, skinframe->glow ? palette_bgra_nofullbrights_transparent : palette_bgra_transparent);
+ else
+ skinframe->merged = R_LoadTexture2D(r_main_texturepool, skinframe->basename, width, height, skindata, vid.sRGB3D ? TEXTYPE_SRGB_PALETTE : TEXTYPE_PALETTE, skinframe->textureflags, -1, skinframe->glow ? palette_bgra_nofullbrights : palette_bgra_complete);
}
if (!skinframe->qgeneratemerged && !skinframe->qgeneratebase)
unsigned int palette_bgra_nocolormap[256];
unsigned int palette_bgra_nocolormapnofullbrights[256];
unsigned int palette_bgra_nofullbrights[256];
+unsigned int palette_bgra_nofullbrights_transparent[256];
unsigned int palette_bgra_onlyfullbrights[256];
+unsigned int palette_bgra_onlyfullbrights_transparent[256];
unsigned int palette_bgra_pantsaswhite[256];
unsigned int palette_bgra_shirtaswhite[256];
unsigned int palette_bgra_transparent[256];
palette_bgra_nofullbrights[i] = palette_bgra_complete[i];
for (i = fullbright_start;i < fullbright_end;i++)
palette_bgra_nofullbrights[i] = palette_bgra_complete[0];
+ for (i = 0;i < 256;i++)
+ palette_bgra_nofullbrights_transparent[i] = palette_bgra_nofullbrights[i];
+ palette_bgra_nofullbrights_transparent[transparentcolor] = 0;
for (i = 0;i < 256;i++)
palette_bgra_onlyfullbrights[i] = 0;
for (i = fullbright_start;i < fullbright_end;i++)
palette_bgra_onlyfullbrights[i] = palette_bgra_complete[i];
+ for (i = 0;i < 256;i++)
+ palette_bgra_onlyfullbrights_transparent[i] = palette_bgra_onlyfullbrights[i];
+ palette_bgra_onlyfullbrights_transparent[transparentcolor] = 0;
for (i = 0;i < 256;i++)
palette_bgra_nocolormapnofullbrights[i] = palette_bgra_complete[i];
extern unsigned int palette_bgra_nocolormap[256];
extern unsigned int palette_bgra_nocolormapnofullbrights[256];
extern unsigned int palette_bgra_nofullbrights[256];
+extern unsigned int palette_bgra_nofullbrights_transparent[256];
extern unsigned int palette_bgra_onlyfullbrights[256];
+extern unsigned int palette_bgra_onlyfullbrights_transparent[256];
extern unsigned int palette_bgra_pantsaswhite[256];
extern unsigned int palette_bgra_shirtaswhite[256];
extern unsigned int palette_bgra_transparent[256];