Remove old triangle version

This commit is contained in:
Magnus Norddahl 2016-11-07 04:27:55 +01:00
parent 8e7e1b48e9
commit 92be8f401c
3 changed files with 3 additions and 91 deletions

View file

@ -393,19 +393,6 @@ void R_DrawSingleSkyCol4_rgba(uint32_t solid_top, uint32_t solid_bottom);
void R_DrawDoubleSkyCol1_rgba(uint32_t solid_top, uint32_t solid_bottom); void R_DrawDoubleSkyCol1_rgba(uint32_t solid_top, uint32_t solid_bottom);
void R_DrawDoubleSkyCol4_rgba(uint32_t solid_top, uint32_t solid_bottom); void R_DrawDoubleSkyCol4_rgba(uint32_t solid_top, uint32_t solid_bottom);
struct TriVertex
{
TriVertex() { }
TriVertex(float x, float y, float z, float w, float u, float v, float light) : x(x), y(y), z(z), w(w) { varying[0] = u; varying[1] = v; varying[2] = light; }
enum { NumVarying = 3 };
float x, y, z, w;
float varying[NumVarying];
};
class VSMatrix;
void R_DrawTriangles(const VSMatrix &objectToWorld, const TriVertex *vertices, int count, int clipleft, int clipright, const short *cliptop, const short *clipbottom, FTexture *texture);
extern bool r_swtruecolor; extern bool r_swtruecolor;
EXTERN_CVAR(Bool, r_multithreaded); EXTERN_CVAR(Bool, r_multithreaded);

View file

@ -1260,6 +1260,7 @@ void ApplySpecialColormapRGBACommand::Execute(DrawerThread *thread)
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#if 0
class DrawTrianglesCommand : public DrawerCommand class DrawTrianglesCommand : public DrawerCommand
{ {
public: public:
@ -1705,6 +1706,7 @@ void R_DrawTriangles(const VSMatrix &transform, const TriVertex *vertices, int c
DrawerCommandQueue::QueueCommand<DrawTrianglesCommand>(transform, vertices, count, clipleft, clipright, clipdata, texture->GetPixelsBgra(), texture->GetWidth(), texture->GetHeight()); DrawerCommandQueue::QueueCommand<DrawTrianglesCommand>(transform, vertices, count, clipleft, clipright, clipdata, texture->GetPixelsBgra(), texture->GetWidth(), texture->GetHeight());
} }
#endif
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

View file

@ -66,7 +66,6 @@
#endif #endif
EXTERN_CVAR(Int, r_skymode) EXTERN_CVAR(Int, r_skymode)
CVAR(Bool, r_cubesky, false, 0)
//EXTERN_CVAR (Int, tx) //EXTERN_CVAR (Int, tx)
//EXTERN_CVAR (Int, ty) //EXTERN_CVAR (Int, ty)
@ -1016,77 +1015,6 @@ static const BYTE *R_GetTwoSkyColumns (FTexture *fronttex, int x)
} }
} }
static void R_DrawCubeSky(visplane_t *pl)
{
int x1 = pl->left;
int x2 = pl->right;
short *uwal = (short *)pl->top;
short *dwal = (short *)pl->bottom;
static TriVertex cube[6 * 6] =
{
// Top
{ -1.0f, 1.0f, 0.6f, 1.0f, 1.0f, 0.0f, 1.0f },
{ 1.0f, 1.0f, 0.6f, 1.0f, 0.0f, 0.0f, 1.0f },
{ 1.0f, -1.0f, 0.6f, 1.0f, 0.0f, 0.1f, 1.0f },
{ 1.0f, -1.0f, 0.6f, 1.0f, 0.0f, 0.1f, 1.0f },
{ -1.0f, -1.0f, 0.6f, 1.0f, 1.0f, 0.1f, 1.0f },
{ -1.0f, 1.0f, 0.6f, 1.0f, 1.0f, 0.0f, 1.0f },
// Bottom
{ 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 0.9f, 1.0f },
{ 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f },
{ -1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f },
{ -1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f },
{ -1.0f, -1.0f, -1.0f, 1.0f, 0.0f, 0.9f, 1.0f },
{ 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 0.9f, 1.0f },
// Front
{ 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 2.0f, 1.0f },
{ 1.0f, 1.0f, 0.6f, 1.0f, 1.0f, 0.0f, 1.0f },
{ -1.0f, 1.0f, 0.6f, 1.0f, 0.0f, 0.0f, 1.0f },
{ -1.0f, 1.0f, 0.6f, 1.0f, 0.0f, 0.0f, 1.0f },
{ -1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 2.0f, 1.0f },
{ 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 2.0f, 1.0f },
// Back
{ -1.0f, -1.0f, 0.6f, 1.0f, 1.0f, 0.0f, 1.0f },
{ 1.0f, -1.0f, 0.6f, 1.0f, 0.0f, 0.0f, 1.0f },
{ 1.0f, -1.0f, -1.0f, 1.0f, 0.0f, 2.0f, 1.0f },
{ 1.0f, -1.0f, -1.0f, 1.0f, 0.0f, 2.0f, 1.0f },
{ -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 2.0f, 1.0f },
{ -1.0f, -1.0f, 0.6f, 1.0f, 1.0f, 0.0f, 1.0f },
// Right
{ 1.0f, -1.0f, 0.6f, 1.0f, 1.0f, 0.0f, 1.0f },
{ 1.0f, 1.0f, 0.6f, 1.0f, 0.0f, 0.0f, 1.0f },
{ 1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 2.0f, 1.0f },
{ 1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 2.0f, 1.0f },
{ 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 2.0f, 1.0f },
{ 1.0f, -1.0f, 0.6f, 1.0f, 1.0f, 0.0f, 1.0f },
// Left
{ -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 2.0f, 1.0f },
{ -1.0f, 1.0f, 0.6f, 1.0f, 1.0f, 0.0f, 1.0f },
{ -1.0f, -1.0f, 0.6f, 1.0f, 0.0f, 0.0f, 1.0f },
{ -1.0f, -1.0f, 0.6f, 1.0f, 0.0f, 0.0f, 1.0f },
{ -1.0f, -1.0f, -1.0f, 1.0f, 0.0f, 2.0f, 1.0f },
{ -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 2.0f, 1.0f }
};
VSMatrix transform(0);
transform.translate((float)ViewPos.X, (float)ViewPos.Y, (float)ViewPos.Z);
transform.scale(1000.0f, 1000.0f, 1000.0f);
R_DrawTriangles(transform, cube, 6 * 6, x1, x2 - 1, uwal, dwal, frontskytex);
}
static void R_DrawSkyColumnStripe(int start_x, int y1, int y2, int columns, double scale, double texturemid, double yrepeat) static void R_DrawSkyColumnStripe(int start_x, int y1, int y2, int columns, double scale, double texturemid, double yrepeat)
{ {
uint32_t height = frontskytex->GetHeight(); uint32_t height = frontskytex->GetHeight();
@ -1279,12 +1207,7 @@ static void R_DrawCapSky(visplane_t *pl)
static void R_DrawSky (visplane_t *pl) static void R_DrawSky (visplane_t *pl)
{ {
if (r_swtruecolor && r_cubesky) if (r_skymode == 2)
{
R_DrawCubeSky(pl);
return;
}
else if (r_skymode == 2)
{ {
R_DrawCapSky(pl); R_DrawCapSky(pl);
return; return;