fix today's no-alpha bug.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5314 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
46d99e8186
commit
fa523c3e53
1 changed files with 8 additions and 3 deletions
|
@ -482,7 +482,7 @@ qbyte *W_GetTexture(const char *name, int *width, int *height, uploadfmt_t *form
|
||||||
|
|
||||||
*width = 128;
|
*width = 128;
|
||||||
*height = 128;
|
*height = 128;
|
||||||
*format = PTI_RGBX8;
|
*format = PTI_RGBA8;
|
||||||
|
|
||||||
data = BZ_Malloc(128 * 128 * 4);
|
data = BZ_Malloc(128 * 128 * 4);
|
||||||
for (i = 0; i < 128 * 128; i++)
|
for (i = 0; i < 128 * 128; i++)
|
||||||
|
@ -498,15 +498,20 @@ qbyte *W_GetTexture(const char *name, int *width, int *height, uploadfmt_t *form
|
||||||
}
|
}
|
||||||
else if (lumptype == TYP_QPIC && lumpsize == 8+p->width*p->height)
|
else if (lumptype == TYP_QPIC && lumpsize == 8+p->width*p->height)
|
||||||
{
|
{
|
||||||
|
qboolean alpha = false;
|
||||||
|
qbyte pal;
|
||||||
*width = p->width;
|
*width = p->width;
|
||||||
*height = p->height;
|
*height = p->height;
|
||||||
*format = PTI_RGBX8;
|
|
||||||
|
|
||||||
data = BZ_Malloc(p->width * p->height * 4);
|
data = BZ_Malloc(p->width * p->height * 4);
|
||||||
for (i = 0; i < p->width * p->height; i++)
|
for (i = 0; i < p->width * p->height; i++)
|
||||||
{
|
{
|
||||||
((unsigned int*)data)[i] = d_8to24rgbtable[p->data[i]];
|
pal = p->data[i];
|
||||||
|
((unsigned int*)data)[i] = d_8to24rgbtable[pal];
|
||||||
|
if (pal == 0xff)
|
||||||
|
alpha = true;
|
||||||
}
|
}
|
||||||
|
*format = alpha?PTI_RGBA8:PTI_RGBX8;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
else if (lumptype == TYP_QPIC && lumpsize == 8+p->width*p->height+4+768)
|
else if (lumptype == TYP_QPIC && lumpsize == 8+p->width*p->height+4+768)
|
||||||
|
|
Loading…
Reference in a new issue