Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Alpha test is no longer used. Removing it.

  • Loading branch information...
commit dbbc0b675816230efcb4fb8f00673b966004c9b5 1 parent 1ae5031
@perim perim authored
View
12 lib/ivis_opengl/pieblitfunc.cpp
@@ -147,7 +147,6 @@ void GFX::draw()
}
else if (mType == GFX_COLOUR)
{
- pie_SetAlphaTest(false);
pie_SetTexturePage(TEXPAGE_NONE);
glEnableClientState(GL_COLOR_ARRAY);
glBindBuffer(GL_ARRAY_BUFFER, mBuffers[VBO_TEXCOORD]); glColorPointer(4, GL_UNSIGNED_BYTE, 0, NULL);
@@ -179,7 +178,6 @@ GFX::~GFX()
void iV_Line(int x0, int y0, int x1, int y1, PIELIGHT colour)
{
pie_SetTexturePage(TEXPAGE_NONE);
- pie_SetAlphaTest(false);
glColor4ubv(colour.vector);
glBegin(GL_LINES);
@@ -193,8 +191,6 @@ void iV_Line(int x0, int y0, int x1, int y1, PIELIGHT colour)
*/
static void pie_DrawRect(float x0, float y0, float x1, float y1, PIELIGHT colour)
{
- pie_SetAlphaTest(false);
-
glColor4ubv(colour.vector);
glBegin(GL_TRIANGLE_STRIP);
glVertex2f(x0, y0);
@@ -217,7 +213,6 @@ void iV_ShadowBox(int x0, int y0, int x1, int y1, int pad, PIELIGHT first, PIELI
void iV_Box2(int x0,int y0, int x1, int y1, PIELIGHT first, PIELIGHT second)
{
pie_SetTexturePage(TEXPAGE_NONE);
- pie_SetAlphaTest(false);
glColor4ubv(first.vector);
glBegin(GL_LINES);
@@ -328,6 +323,7 @@ void iV_DrawImage2(const QString &filename, float x, float y, float width, float
y += image->YOffset;
pie_SetTexturePage(image->textureId);
glColor4ubv(WZCOL_WHITE.vector);
+ pie_SetRendMode(REND_ALPHA);
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(tu * image->invTextureSize, tv * invTextureSize);
glVertex2f(x, y);
@@ -341,8 +337,6 @@ void iV_DrawImage2(const QString &filename, float x, float y, float width, float
glTexCoord2f((tu + image->Width) * invTextureSize, (tv + image->Height) * invTextureSize);
glVertex2f(x + w, y + h);
glEnd();
- pie_SetRendMode(REND_ALPHA);
- pie_SetAlphaTest(true);
}
void iV_DrawImage(IMAGEFILE *ImageFile, UWORD ID, int x, int y)
@@ -356,7 +350,6 @@ void iV_DrawImage(IMAGEFILE *ImageFile, UWORD ID, int x, int y)
Vector2i pieImage = makePieImage(ImageFile, ID, &dest, x, y);
pie_SetRendMode(REND_ALPHA);
- pie_SetAlphaTest(true);
pie_DrawImage(ImageFile, ID, pieImage, &dest);
}
@@ -373,7 +366,6 @@ void iV_DrawImageTc(Image image, Image imageTc, int x, int y, PIELIGHT colour)
Vector2i pieImageTc = makePieImage(imageTc.images, imageTc.id);
pie_SetRendMode(REND_ALPHA);
- pie_SetAlphaTest(true);
pie_DrawImage(image.images, image.id, pieImage, &dest);
pie_DrawImage(imageTc.images, imageTc.id, pieImageTc, &dest, colour);
@@ -388,7 +380,6 @@ void iV_DrawImageRepeatX(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Width
const ImageDef *Image = &ImageFile->imageDefs[ID];
pie_SetRendMode(REND_OPAQUE);
- pie_SetAlphaTest(true);
PIERECT dest;
Vector2i pieImage = makePieImage(ImageFile, ID, &dest, x, y);
@@ -418,7 +409,6 @@ void iV_DrawImageRepeatY(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Heigh
const ImageDef *Image = &ImageFile->imageDefs[ID];
pie_SetRendMode(REND_OPAQUE);
- pie_SetAlphaTest(true);
PIERECT dest;
Vector2i pieImage = makePieImage(ImageFile, ID, &dest, x, y);
View
3  lib/ivis_opengl/piedraw.cpp
@@ -146,7 +146,6 @@ static void pie_Draw3DButton(iIMDShape *shape)
{
const PIELIGHT colour = WZCOL_WHITE;
const PIELIGHT teamcolour = pal_GetTeamColour(NetPlay.players[selectedPlayer].colour);
- pie_SetAlphaTest(true);
pie_SetFogStatus(false);
pie_SetDepthBufferStatus(DEPTH_CMP_LEQ_WRT_ON);
pie_ActivateShader(SHADER_BUTTON, shape, teamcolour, colour);
@@ -174,7 +173,6 @@ static void pie_Draw3DShape2(iIMDShape *shape, int frame, PIELIGHT colour, PIELI
bool light = true;
glLoadMatrixf(&matrix[0][0]);
- pie_SetAlphaTest((pieFlag & pie_PREMULTIPLIED) == 0);
/* Set fog status */
if (!(pieFlag & pie_FORCE_FOG) && (pieFlag & pie_ADDITIVE || pieFlag & pie_TRANSLUCENT || pieFlag & pie_PREMULTIPLIED))
@@ -486,7 +484,6 @@ static void pie_DrawShadows(void)
glPushMatrix();
- pie_SetAlphaTest(false);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthFunc(GL_LESS);
glDepthMask(GL_FALSE);
View
3  lib/ivis_opengl/piefunc.cpp
@@ -150,9 +150,6 @@ void pie_DrawSkybox(float scale)
// enable alpha
pie_SetRendMode(REND_ALPHA);
- // for the nice blend of the sky with the fog
- glDisable(GL_ALPHA_TEST);
-
// Apply scale matrix
glScalef(scale, scale/2.0f, scale);
View
20 lib/ivis_opengl/piestate.cpp
@@ -76,10 +76,6 @@ void pie_SetDefaultStates(void)//Sets all states
rendStates.rendMode = REND_ALPHA; // to force reset to REND_OPAQUE
pie_SetRendMode(REND_OPAQUE);
-
- //chroma keying on black
- rendStates.keyingOn = false;//to force reset to true
- pie_SetAlphaTest(true);
}
//***************************************************************************
@@ -561,22 +557,6 @@ void pie_SetTexturePage(SDWORD num)
}
}
-void pie_SetAlphaTest(bool keyingOn)
-{
- if (keyingOn != rendStates.keyingOn)
- {
- rendStates.keyingOn = keyingOn;
- pieStateCount++;
-
- if (keyingOn == true) {
- glEnable(GL_ALPHA_TEST);
- glAlphaFunc(GL_GREATER, 0.1f);
- } else {
- glDisable(GL_ALPHA_TEST);
- }
- }
-}
-
void pie_SetRendMode(REND_MODE rendMode)
{
if (rendMode != rendStates.rendMode)
View
2  lib/ivis_opengl/piestate.h
@@ -49,7 +49,6 @@ struct RENDER_STATE
PIELIGHT fogColour;
SDWORD texPage;
REND_MODE rendMode;
- bool keyingOn;
};
void rendStatesRendModeHack(); // Sets rendStates.rendMode = REND_ALPHA; (Added during merge, since the renderStates is now static.)
@@ -81,7 +80,6 @@ extern PIELIGHT pie_GetFogColour(void) WZ_DECL_PURE;
extern void pie_UpdateFogDistance(float begin, float end);
//render states
extern void pie_SetTexturePage(SDWORD num);
-extern void pie_SetAlphaTest(bool keyingOn);
extern void pie_SetRendMode(REND_MODE rendMode);
bool pie_LoadShaders();
View
3  src/display3d.cpp
@@ -1023,7 +1023,6 @@ static void drawTiles(iView *player)
// now we are about to draw the terrain
GL_DEBUG("Draw 3D scene - terrain");
- pie_SetAlphaTest(false);
pie_SetFogStatus(true);
pie_MatBegin();
@@ -1042,7 +1041,6 @@ static void drawTiles(iView *player)
// and prepare for rendering the models
GL_DEBUG("Draw 3D scene - models");
pie_SetRendMode(REND_OPAQUE);
- pie_SetAlphaTest(true);
/* ---------------------------------------------------------------- */
/* Now display all the static objects */
@@ -1063,7 +1061,6 @@ static void drawTiles(iView *player)
atmosDrawParticles();
// prepare for the water and the lightmap
- pie_SetAlphaTest(false);
pie_SetFogStatus(true);
pie_MatBegin();

0 comments on commit dbbc0b6

Please sign in to comment.
Something went wrong with that request. Please try again.