Removed some unused code.
Added some of the level drawing hacks (water, rain).
This commit is contained in:
parent
fe15141c2f
commit
abd1c68579
5 changed files with 2693 additions and 374 deletions
228
src/kshape.c
228
src/kshape.c
|
@ -5705,133 +5705,7 @@ void OutputTranslucentPolyList(void)
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
int CuboidPolyVertexList[][4] =
|
||||
{
|
||||
{0,1,2,3}, //+ve x
|
||||
{0,3,7,4}, //+ve y
|
||||
{6,7,3,2}, //+ve z
|
||||
|
||||
{6,7,4,5}, //-ve x
|
||||
{6,5,1,2}, //-ve y
|
||||
{0,1,5,4}, //-ve z
|
||||
};
|
||||
EULER CubeOrient = {0,0,0};
|
||||
void CubeOMatic(void)
|
||||
{
|
||||
#define CUBESCALE 128
|
||||
VECTORCH vertices[8]=
|
||||
{
|
||||
{+CUBESCALE,+CUBESCALE,-CUBESCALE},
|
||||
{+CUBESCALE,-CUBESCALE,-CUBESCALE},
|
||||
{+CUBESCALE,-CUBESCALE,+CUBESCALE},
|
||||
{+CUBESCALE,+CUBESCALE,+CUBESCALE},
|
||||
{-CUBESCALE,+CUBESCALE,-CUBESCALE},
|
||||
{-CUBESCALE,-CUBESCALE,-CUBESCALE},
|
||||
{-CUBESCALE,-CUBESCALE,+CUBESCALE},
|
||||
{-CUBESCALE,+CUBESCALE,+CUBESCALE},
|
||||
};
|
||||
VECTORCH translatedPts[8];
|
||||
|
||||
POLYHEADER fakeHeader;
|
||||
int polyNumber;
|
||||
MATRIXCH matrix;
|
||||
CreateEulerMatrix(&CubeOrient,&matrix);
|
||||
TransposeMatrixCH(&matrix);
|
||||
|
||||
CubeOrient.EulerX += MUL_FIXED(NormalFrameTime,128*4);
|
||||
CubeOrient.EulerX &=4095;
|
||||
CubeOrient.EulerY += MUL_FIXED(NormalFrameTime,256*4);
|
||||
CubeOrient.EulerY &=4095;
|
||||
CubeOrient.EulerZ += MUL_FIXED(NormalFrameTime,128*4);
|
||||
CubeOrient.EulerZ &=4095;
|
||||
|
||||
fakeHeader.PolyFlags = iflag_transparent;
|
||||
|
||||
{
|
||||
|
||||
int i = 7;
|
||||
do
|
||||
{
|
||||
translatedPts[i] = vertices[i];
|
||||
RotateVector(&translatedPts[i],&matrix);
|
||||
translatedPts[i].vy = MUL_FIXED(translatedPts[i].vy,87381);
|
||||
}
|
||||
while(i--);
|
||||
}
|
||||
|
||||
|
||||
for(polyNumber=0; polyNumber<6; polyNumber++)
|
||||
{
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<4; i++)
|
||||
{
|
||||
int v = CuboidPolyVertexList[polyNumber][i];
|
||||
VerticesBuffer[i].A = 128;
|
||||
VerticesBuffer[i].X = translatedPts[v].vx-400;
|
||||
VerticesBuffer[i].Y = translatedPts[v].vy+300;
|
||||
VerticesBuffer[i].Z = translatedPts[v].vz+900;
|
||||
VerticesBuffer[i].Y = MUL_FIXED(VerticesBuffer[i].Y,87381);
|
||||
|
||||
{
|
||||
int brightness = -(translatedPts[v].vz*2);
|
||||
|
||||
if (brightness<0) brightness=0;
|
||||
if (brightness>255) brightness=255;
|
||||
VerticesBuffer[i].R = brightness;
|
||||
}
|
||||
VerticesBuffer[i].G = 0;
|
||||
VerticesBuffer[i].B = 0;
|
||||
}
|
||||
RenderPolygon.NumberOfVertices=4;
|
||||
}
|
||||
{
|
||||
int outcode = QuadWithinFrustrum();
|
||||
|
||||
if (outcode)
|
||||
{
|
||||
if (outcode!=2)
|
||||
{
|
||||
GouraudPolygon_ClipWithZ();
|
||||
if(RenderPolygon.NumberOfVertices<3) continue;
|
||||
GouraudPolygon_ClipWithNegativeX();
|
||||
if(RenderPolygon.NumberOfVertices<3) continue;
|
||||
GouraudPolygon_ClipWithPositiveY();
|
||||
if(RenderPolygon.NumberOfVertices<3) continue;
|
||||
GouraudPolygon_ClipWithNegativeY();
|
||||
if(RenderPolygon.NumberOfVertices<3) continue;
|
||||
GouraudPolygon_ClipWithPositiveX();
|
||||
if(RenderPolygon.NumberOfVertices<3) continue;
|
||||
D3D_ZBufferedGouraudPolygon_Output(&fakeHeader,RenderPolygon.Vertices);
|
||||
}
|
||||
else D3D_ZBufferedGouraudPolygon_Output(&fakeHeader,VerticesBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
int CuboidPolyVertexList[][4] =
|
||||
{
|
||||
{0,3,7,4}, //+ve y
|
||||
#if 0
|
||||
{0,1,2,3}, //+ve x
|
||||
{0,1,5,4}, //-ve z
|
||||
|
||||
{6,7,4,5}, //-ve x
|
||||
{6,7,3,2}, //+ve z
|
||||
#else
|
||||
{6,7,3,2}, //+ve z
|
||||
{6,7,4,5}, //-ve x
|
||||
|
||||
{0,1,5,4}, //-ve z
|
||||
{0,1,2,3}, //+ve x
|
||||
#endif
|
||||
};
|
||||
EULER CubeOrient = {0,0,0};
|
||||
int CuboidPolyVertexU[][4] =
|
||||
static const int CuboidPolyVertexU[][4] =
|
||||
{
|
||||
{1,1,1,1},
|
||||
|
||||
|
@ -5841,7 +5715,7 @@ int CuboidPolyVertexU[][4] =
|
|||
{127,127,0,0},
|
||||
{128,128,255,255},
|
||||
};
|
||||
int CuboidPolyVertexV[][4] =
|
||||
static const int CuboidPolyVertexV[][4] =
|
||||
{
|
||||
{1,1,1,1},
|
||||
|
||||
|
@ -5851,104 +5725,6 @@ int CuboidPolyVertexV[][4] =
|
|||
{128,255,255,128},
|
||||
};
|
||||
|
||||
#include "chnktexi.h"
|
||||
|
||||
void CubeSky(void)
|
||||
{
|
||||
#define CUBESCALE 1024
|
||||
VECTORCH vertices[8]=
|
||||
{
|
||||
#if 0
|
||||
{+CUBESCALE,-CUBESCALE,-CUBESCALE},
|
||||
{+CUBESCALE,CUBESCALE,-CUBESCALE},
|
||||
{+CUBESCALE,CUBESCALE,+CUBESCALE},
|
||||
{+CUBESCALE,-CUBESCALE,+CUBESCALE},
|
||||
{-CUBESCALE,-CUBESCALE,-CUBESCALE},
|
||||
{-CUBESCALE,CUBESCALE,-CUBESCALE},
|
||||
{-CUBESCALE,CUBESCALE,+CUBESCALE},
|
||||
{-CUBESCALE,-CUBESCALE,+CUBESCALE},
|
||||
#else
|
||||
{+CUBESCALE,-CUBESCALE*2,-CUBESCALE},
|
||||
{+CUBESCALE,0,-CUBESCALE},
|
||||
{+CUBESCALE,0,+CUBESCALE},
|
||||
{+CUBESCALE,-CUBESCALE*2,+CUBESCALE},
|
||||
{-CUBESCALE,-CUBESCALE*2,-CUBESCALE},
|
||||
{-CUBESCALE,0,-CUBESCALE},
|
||||
{-CUBESCALE,0,+CUBESCALE},
|
||||
{-CUBESCALE,-CUBESCALE*2,+CUBESCALE},
|
||||
#endif
|
||||
};
|
||||
VECTORCH translatedPts[8];
|
||||
|
||||
POLYHEADER fakeHeader;
|
||||
int polyNumber;
|
||||
|
||||
#if 1
|
||||
{
|
||||
extern int BackdropImage;
|
||||
fakeHeader.PolyFlags = 0;
|
||||
fakeHeader.PolyColour =BackdropImage;
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
int i = 7;
|
||||
do
|
||||
{
|
||||
translatedPts[i] = vertices[i];
|
||||
RotateVector(&translatedPts[i],&(Global_VDB_Ptr->VDB_Mat));
|
||||
translatedPts[i].vy = MUL_FIXED(translatedPts[i].vy,87381);
|
||||
}
|
||||
while(i--);
|
||||
}
|
||||
#endif
|
||||
|
||||
for(polyNumber=0; polyNumber<5; polyNumber++)
|
||||
{
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<4; i++)
|
||||
{
|
||||
int v = CuboidPolyVertexList[polyNumber][i];
|
||||
VerticesBuffer[i].A = 0;
|
||||
VerticesBuffer[i].X = translatedPts[v].vx;
|
||||
VerticesBuffer[i].Y = translatedPts[v].vy;
|
||||
VerticesBuffer[i].Z = translatedPts[v].vz;
|
||||
VerticesBuffer[i].U = CuboidPolyVertexU[polyNumber][i]<<16;
|
||||
VerticesBuffer[i].V = CuboidPolyVertexV[polyNumber][i]<<16;
|
||||
|
||||
|
||||
VerticesBuffer[i].R = 127;
|
||||
VerticesBuffer[i].G = 127;
|
||||
VerticesBuffer[i].B = 127;
|
||||
}
|
||||
RenderPolygon.NumberOfVertices=4;
|
||||
}
|
||||
{
|
||||
int outcode = QuadWithinFrustrum();
|
||||
|
||||
if (outcode)
|
||||
{
|
||||
if (outcode!=2)
|
||||
{
|
||||
GouraudTexturedPolygon_ClipWithZ();
|
||||
if(RenderPolygon.NumberOfVertices<3) continue;
|
||||
GouraudTexturedPolygon_ClipWithNegativeX();
|
||||
if(RenderPolygon.NumberOfVertices<3) continue;
|
||||
GouraudTexturedPolygon_ClipWithPositiveY();
|
||||
if(RenderPolygon.NumberOfVertices<3) continue;
|
||||
GouraudTexturedPolygon_ClipWithNegativeY();
|
||||
if(RenderPolygon.NumberOfVertices<3) continue;
|
||||
GouraudTexturedPolygon_ClipWithPositiveX();
|
||||
if(RenderPolygon.NumberOfVertices<3) continue;
|
||||
D3D_BackdropPolygon_Output(&fakeHeader,RenderPolygon.Vertices);
|
||||
}
|
||||
else D3D_BackdropPolygon_Output(&fakeHeader,VerticesBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RenderMirrorSurface(void)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue