Use the "unused" bit in SDL palettes for alpha.
This commit is contained in:
@@ -972,7 +972,7 @@ unsigned RageDisplay_D3D::CreateTexture(
|
|||||||
pal.p[i].peGreen = c.g;
|
pal.p[i].peGreen = c.g;
|
||||||
pal.p[i].peBlue = c.b;
|
pal.p[i].peBlue = c.b;
|
||||||
bool bIsColorKey = img->flags & SDL_SRCCOLORKEY && (unsigned)i == img->format->colorkey;
|
bool bIsColorKey = img->flags & SDL_SRCCOLORKEY && (unsigned)i == img->format->colorkey;
|
||||||
pal.p[i].peFlags = bIsColorKey ? 0x00 : 0xFF;
|
pal.p[i].peFlags = bIsColorKey ? BYTE(0x00) : c.unused;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT( g_TexResourceToTexturePalette.find(uTexHandle) == g_TexResourceToTexturePalette.end() );
|
ASSERT( g_TexResourceToTexturePalette.find(uTexHandle) == g_TexResourceToTexturePalette.end() );
|
||||||
|
|||||||
@@ -1127,7 +1127,7 @@ unsigned RageDisplay_OGL::CreateTexture(
|
|||||||
if(img->flags & SDL_SRCCOLORKEY && i == int(img->format->colorkey))
|
if(img->flags & SDL_SRCCOLORKEY && i == int(img->format->colorkey))
|
||||||
palette[p++] = 0;
|
palette[p++] = 0;
|
||||||
else
|
else
|
||||||
palette[p++] = 0xFF; /* opaque */
|
palette[p++] = img->format->palette->colors[i].unused;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the palette. */
|
/* Set the palette. */
|
||||||
|
|||||||
Reference in New Issue
Block a user