- Use additive blending instead of alpha blending for construction/deconstruction lines (regression from 2.3).

- Use Vector3f instead of superfluous CLIP_VERTEX in pie_TransColouredTriangle().

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10358 4a71c877-e1ca-e34f-864e-861f7616d084
master
i-nod 2010-03-19 02:04:57 +00:00 committed by Git SVN Gateway
parent 968b77770e
commit 0b39df6e6f
3 changed files with 15 additions and 29 deletions

View File

@ -34,7 +34,7 @@
#include "lib/ivis_common/pieclip.h"
extern UBYTE pie_ByteScale(UBYTE a, UBYTE b) WZ_DECL_CONST;
extern void pie_TransColouredTriangle(CLIP_VERTEX *vrt, PIELIGHT c);
extern void pie_TransColouredTriangle(Vector3f *vrt, PIELIGHT c);
extern void pie_DrawSkybox(float scale, int u, int v, int w, int h);
extern void pie_DrawFogBox(float left, float right, float front, float back, float height, float wider);
extern void pie_DrawViewingWindow( Vector3i *v, UDWORD x1, UDWORD y1, UDWORD x2, UDWORD y2, PIELIGHT colour);

View File

@ -98,7 +98,7 @@ void pie_DrawViewingWindow(Vector3i *v, UDWORD x1, UDWORD y1, UDWORD x2, UDWORD
glEnd();
}
void pie_TransColouredTriangle(CLIP_VERTEX *vrt, PIELIGHT c)
void pie_TransColouredTriangle(Vector3f *vrt, PIELIGHT c)
{
UDWORD i;
@ -110,7 +110,7 @@ void pie_TransColouredTriangle(CLIP_VERTEX *vrt, PIELIGHT c)
glBegin(GL_TRIANGLE_FAN);
for (i = 0; i < 3; ++i)
{
glVertex3f(vrt[i].pos.x, vrt[i].pos.y, vrt[i].pos.z);
glVertex3f(vrt[i].x, vrt[i].y, vrt[i].z);
}
glEnd();
}

View File

@ -4168,10 +4168,9 @@ static void drawDroidSensorLock(DROID *psDroid)
/// Draw the construction lines for all construction droids
static void doConstructionLines( void )
{
DROID *psDroid;
UDWORD i;
DROID *psDroid;
UDWORD i;
pie_SetTranslucencyMode(TRANS_ALPHA);
for(i=0; i<MAX_PLAYERS; i++)
{
for(psDroid= apsDroidLists[i]; psDroid; psDroid = psDroid->psNext)
@ -4217,9 +4216,8 @@ UDWORD i;
/// Draw the construction or demolish lines for one droid
static void addConstructionLine(DROID *psDroid, STRUCTURE *psStructure)
{
CLIP_VERTEX pts[3];
Vector3i each;
Vector3f *point;
Vector3f *point, pts[3];
UDWORD pointIndex;
SDWORD realY;
Vector3i null, vec;
@ -4237,9 +4235,9 @@ static void addConstructionLine(DROID *psDroid, STRUCTURE *psStructure)
rx = player.p.x & (TILE_UNITS-1);
rz = player.p.z & (TILE_UNITS-1);
pts[0].pos.x = vec.x + rx;
pts[0].pos.y = vec.y;
pts[0].pos.z = vec.z - rz;
pts[0].x = vec.x + rx;
pts[0].y = vec.y;
pts[0].z = vec.z - rz;
pointIndex = rand()%(psStructure->sDisplay.imd->npoints-1);
point = &(psStructure->sDisplay.imd->points[pointIndex]);
@ -4261,9 +4259,9 @@ static void addConstructionLine(DROID *psDroid, STRUCTURE *psStructure)
rx = player.p.x & (TILE_UNITS-1);
rz = player.p.z & (TILE_UNITS-1);
pts[1].pos.x = vec.x + rx;
pts[1].pos.y = vec.y;
pts[1].pos.z = vec.z - rz;
pts[1].x = vec.x + rx;
pts[1].y = vec.y;
pts[1].z = vec.z - rz;
pointIndex = rand()%(psStructure->sDisplay.imd->npoints-1);
point = &(psStructure->sDisplay.imd->points[pointIndex]);
@ -4279,9 +4277,9 @@ static void addConstructionLine(DROID *psDroid, STRUCTURE *psStructure)
rx = player.p.x & (TILE_UNITS-1);
rz = player.p.z & (TILE_UNITS-1);
pts[2].pos.x = vec.x + rx;
pts[2].pos.y = vec.y;
pts[2].pos.z = vec.z - rz;
pts[2].x = vec.x + rx;
pts[2].y = vec.y;
pts[2].z = vec.z - rz;
// set the colour
colour = pal_SetBrightness(UBYTE_MAX);
@ -4294,18 +4292,6 @@ static void addConstructionLine(DROID *psDroid, STRUCTURE *psStructure)
colour.byte.r = 0;
colour.byte.g = 0;
}
pts[0].light.rgba = 0xff000000;
pts[1].light.rgba = 0xff000000;
pts[2].light.rgba = 0xff000000;
pts[0].u = 0;
pts[0].v = 0;
pts[1].u = 0;
pts[1].v = 0;
pts[2].u = 0;
pts[2].v = 0;
pie_TransColouredTriangle(pts, colour);
}