Clean up the definitions of the rendering modes.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9620 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
6120368424
commit
6f5a49387f
|
@ -116,18 +116,15 @@ void pie_SetRendMode(REND_MODE rendMode)
|
|||
rendStates.rendMode = rendMode;
|
||||
switch (rendMode)
|
||||
{
|
||||
case REND_FLAT:
|
||||
case REND_GOURAUD_TEX:
|
||||
case REND_OPAQUE:
|
||||
pie_SetTranslucencyMode(TRANS_DECAL);
|
||||
break;
|
||||
|
||||
case REND_ALPHA_TEX:
|
||||
case REND_ALPHA_FLAT:
|
||||
case REND_ALPHA:
|
||||
pie_SetTranslucencyMode(TRANS_ALPHA);
|
||||
break;
|
||||
|
||||
case REND_ADDITIVE_TEX:
|
||||
case REND_ALPHA_ITERATED:
|
||||
case REND_ADDITIVE:
|
||||
pie_SetTranslucencyMode(TRANS_ADDITIVE);
|
||||
break;
|
||||
|
||||
|
|
|
@ -45,12 +45,9 @@
|
|||
|
||||
typedef enum REND_MODE
|
||||
{
|
||||
REND_GOURAUD_TEX,
|
||||
REND_ALPHA_TEX,
|
||||
REND_ADDITIVE_TEX,
|
||||
REND_FLAT,
|
||||
REND_ALPHA_FLAT,
|
||||
REND_ALPHA_ITERATED
|
||||
REND_ALPHA,
|
||||
REND_ADDITIVE,
|
||||
REND_OPAQUE,
|
||||
}
|
||||
REND_MODE;
|
||||
|
||||
|
@ -66,22 +63,12 @@ typedef enum DEPTH_MODE
|
|||
typedef enum TRANSLUCENCY_MODE
|
||||
{
|
||||
TRANS_DECAL,
|
||||
TRANS_DECAL_FOG,
|
||||
TRANS_FILTER,
|
||||
TRANS_ALPHA,
|
||||
TRANS_ADDITIVE
|
||||
}
|
||||
TRANSLUCENCY_MODE;
|
||||
|
||||
typedef enum COLOUR_MODE
|
||||
{
|
||||
COLOUR_FLAT_CONSTANT,
|
||||
COLOUR_FLAT_ITERATED,
|
||||
COLOUR_TEX_ITERATED,
|
||||
COLOUR_TEX_CONSTANT
|
||||
}
|
||||
COLOUR_MODE;
|
||||
|
||||
typedef struct RENDER_STATE
|
||||
{
|
||||
BOOL fogEnabled;
|
||||
|
|
|
@ -128,7 +128,7 @@ void pie_Box(int x0,int y0, int x1, int y1, PIELIGHT colour)
|
|||
|
||||
void pie_BoxFill(int x0,int y0, int x1, int y1, PIELIGHT colour)
|
||||
{
|
||||
pie_SetRendMode(REND_FLAT);
|
||||
pie_SetRendMode(REND_OPAQUE);
|
||||
pie_SetTexturePage(TEXPAGE_NONE);
|
||||
pie_DrawRect(x0, y0, x1, y1, colour);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ void pie_TransBoxFill(float x0, float y0, float x1, float y1)
|
|||
void pie_UniTransBoxFill(float x0, float y0, float x1, float y1, PIELIGHT light)
|
||||
{
|
||||
pie_SetTexturePage(TEXPAGE_NONE);
|
||||
pie_SetRendMode(REND_ALPHA_FLAT);
|
||||
pie_SetRendMode(REND_ALPHA);
|
||||
pie_DrawRect(x0, y0, x1, y1, light);
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ void pie_ImageFileID(IMAGEFILE *ImageFile, UWORD ID, int x, int y)
|
|||
Image = &ImageFile->ImageDefs[ID];
|
||||
|
||||
ASSERT_OR_RETURN(, Image->TPageID < MAX_NUM_TPAGEIDS, "Out of range 2: %d", (int)Image->TPageID);
|
||||
pie_SetRendMode(REND_ALPHA_TEX);
|
||||
pie_SetRendMode(REND_ALPHA);
|
||||
pie_SetAlphaTest(true);
|
||||
|
||||
pieImage.texPage = ImageFile->TPageIDs[Image->TPageID];
|
||||
|
@ -193,7 +193,7 @@ void pie_ImageFileIDTile(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Width
|
|||
Image = &ImageFile->ImageDefs[ID];
|
||||
|
||||
ASSERT_OR_RETURN(, Image->TPageID < MAX_NUM_TPAGEIDS, "Out of range 2: %d", (int)Image->TPageID);
|
||||
pie_SetRendMode(REND_GOURAUD_TEX);
|
||||
pie_SetRendMode(REND_OPAQUE);
|
||||
pie_SetAlphaTest(true);
|
||||
|
||||
pieImage.texPage = ImageFile->TPageIDs[Image->TPageID];
|
||||
|
@ -308,7 +308,7 @@ void pie_DownLoadRadar(UDWORD *buffer, int width, int height)
|
|||
void pie_RenderRadar(int x, int y, int width, int height)
|
||||
{
|
||||
pie_SetTexturePage(radarTexture);
|
||||
pie_SetRendMode(REND_GOURAUD_TEX);
|
||||
pie_SetRendMode(REND_OPAQUE);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glColor4ubv(WZCOL_WHITE.vector);
|
||||
|
|
|
@ -137,14 +137,14 @@ static void pie_Draw3DShape2(iIMDShape *shape, int frame, PIELIGHT colour, WZ_DE
|
|||
if (pieFlag & pie_ADDITIVE)
|
||||
{ //Assume also translucent
|
||||
pie_SetFogStatus(false);
|
||||
pie_SetRendMode(REND_ADDITIVE_TEX);
|
||||
pie_SetRendMode(REND_ADDITIVE);
|
||||
colour.byte.a = (UBYTE)pieFlagData;
|
||||
light = false;
|
||||
}
|
||||
else if (pieFlag & pie_TRANSLUCENT)
|
||||
{
|
||||
pie_SetFogStatus(false);
|
||||
pie_SetRendMode(REND_ALPHA_TEX);
|
||||
pie_SetRendMode(REND_ALPHA);
|
||||
colour.byte.a = (UBYTE)pieFlagData;
|
||||
light = false;
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ static void pie_Draw3DShape2(iIMDShape *shape, int frame, PIELIGHT colour, WZ_DE
|
|||
{
|
||||
pie_SetFogStatus(true);
|
||||
}
|
||||
pie_SetRendMode(REND_GOURAUD_TEX);
|
||||
pie_SetRendMode(REND_OPAQUE);
|
||||
}
|
||||
|
||||
if (light)
|
||||
|
|
|
@ -55,7 +55,7 @@ void pie_DrawViewingWindow(Vector3i *v, UDWORD x1, UDWORD y1, UDWORD x2, UDWORD
|
|||
SDWORD i;
|
||||
|
||||
pie_SetTexturePage(TEXPAGE_NONE);
|
||||
pie_SetRendMode(REND_ALPHA_FLAT);
|
||||
pie_SetRendMode(REND_ALPHA);
|
||||
|
||||
pieVrts[0].pos.x = v[1].x;
|
||||
pieVrts[0].pos.y = v[1].y;
|
||||
|
@ -103,7 +103,7 @@ void pie_TransColouredTriangle(CLIP_VERTEX *vrt, PIELIGHT c)
|
|||
UDWORD i;
|
||||
|
||||
pie_SetTexturePage(TEXPAGE_NONE);
|
||||
pie_SetRendMode(REND_ALPHA_ITERATED);
|
||||
pie_SetRendMode(REND_ADDITIVE);
|
||||
|
||||
glColor4ub(c.byte.r, c.byte.g, c.byte.b, 128);
|
||||
|
||||
|
@ -171,7 +171,7 @@ void pie_DrawFogBox(float left, float right, float front, float back, float heig
|
|||
|
||||
glColor4ub(fog_colour.byte.r,fog_colour.byte.g,fog_colour.byte.b,0xFF);
|
||||
|
||||
pie_SetRendMode(REND_FLAT);
|
||||
pie_SetRendMode(REND_OPAQUE);
|
||||
|
||||
glPushAttrib(GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT | GL_FOG_BIT);
|
||||
// no use in updating the depth buffer
|
||||
|
|
|
@ -874,7 +874,7 @@ static void drawTiles(iView *player)
|
|||
}
|
||||
|
||||
// and prepare for rendering the models
|
||||
pie_SetRendMode(REND_GOURAUD_TEX);
|
||||
pie_SetRendMode(REND_OPAQUE);
|
||||
pie_SetAlphaTest(true);
|
||||
|
||||
targetOpenList((BASE_OBJECT*)driveGetDriven());
|
||||
|
|
Loading…
Reference in New Issue