oglrender: support wireframe

This commit is contained in:
zeromus 2009-07-25 19:59:40 +00:00
parent b5dfdc501c
commit 1ba3351f6e
3 changed files with 6 additions and 4 deletions

View File

@ -829,6 +829,7 @@ static void OGLRender()
VERT *vert0 = &gfx3d.vertlist->list[poly->vertIndexes[0]];
u8 alpha = material_5bit_to_8bit[poly->getAlpha()];
if(wireframe) alpha = 255;
u8 color0[4] = {
material_5bit_to_8bit[vert0->color[0]],
material_5bit_to_8bit[vert0->color[1]],
@ -836,6 +837,9 @@ static void OGLRender()
alpha
};
//this draws things as a fan to prepare for the day when the clipping is done in gfx3d
//and funny shaped polys find their way into here.
//of course it could really be drawn as a fan, i suppose.. i dont remember why we did it this way
for(int j = 1; j < (type-1); j++)
{
VERT *vert1 = &gfx3d.vertlist->list[poly->vertIndexes[j]];

View File

@ -546,9 +546,6 @@ static void gfx3d_glPolygonAttrib_cache()
// back face culling
cullingMask = (polyAttr>>6)&3;
// Alpha value, actually not well handled, 0 should be wireframe
colorRGB[3] = colorAlpha = ((polyAttr>>16)&0x1F);
}
static void gfx3d_glTexImage_cache()

View File

@ -84,7 +84,8 @@ struct POLY {
bool isTranslucent()
{
//alpha != 31 -> translucent
if((polyAttr&0x001F0000) != 0x001F0000)
//except for alpha 0 which is wireframe (unless it has a translucent tex)
if((polyAttr&0x001F0000) != 0x001F0000 && (polyAttr&0x001F0000) != 0)
return true;
int texFormat = (texParam>>26)&7;