Removed some unused code.

Added some of the level drawing hacks (water, rain).
This commit is contained in:
Steven Fuller 2001-08-21 22:37:05 +00:00 committed by Patryk Obara
parent fe15141c2f
commit abd1c68579
5 changed files with 2693 additions and 374 deletions

View file

@ -4,6 +4,7 @@ CXX = gcc
#CXX = gcc-3.0
NASM = nasm
#CFLAGS = -g -Wall -pipe -Dengine=1 -I. -Iinclude -Iwin95 -Iavp -Iavp/win95 -Iavp/support -Iavp/win95/frontend -Iavp/win95/gadgets
CFLAGS = -g -Wall -pipe -O2 -Dengine=1 -I. -Iinclude -Iwin95 -Iavp -Iavp/win95 -Iavp/support -Iavp/win95/frontend -Iavp/win95/gadgets
#CFLAGS = -Wall -pipe -O6 -ffast-math -fomit-frame-pointer -march=pentiumpro -mcpu=pentiumpro -Dengine=1 -I. -Iinclude -Iwin95 -Iavp -Iavp/win95 -Iavp/support -Iavp/win95/frontend -Iavp/win95/gadgets
CXXFLAGS = $(CFLAGS)

View file

@ -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)
{

View file

@ -624,10 +624,12 @@ int main(int argc, char *argv[])
#else
// AvP.PlayerType = I_Alien;
// SetLevelToLoad(AVP_ENVIRONMENT_TEMPLE); /* starting alien level */
// SetLevelToLoad(AVP_ENVIRONMENT_INVASION_A);
AvP.PlayerType = I_Marine;
SetLevelToLoad(AVP_ENVIRONMENT_DERELICT); /* starting marine level */
// SetLevelToLoad(AVP_ENVIRONMENT_DERELICT); /* starting marine level */
SetLevelToLoad(AVP_ENVIRONMENT_COLONY);
// AvP.PlayerType = I_Predator;
// SetLevelToLoad(AVP_ENVIRONMENT_WATERFALL); /* starting predator level */

File diff suppressed because it is too large Load diff

View file

@ -271,11 +271,6 @@ void InitForceField()
fprintf(stderr, "InitForceField()\n");
}
void PostLandscapeRendering()
{
fprintf(stderr, "PostLandscapeRendering()\n");
}
void SetFogDistance(int fogDistance)
{
fprintf(stderr, "SetFontDistance(%d)\n", fogDistance);
@ -339,26 +334,11 @@ BOOL EndD3DScene()
return FALSE;
}
void D3D_DrawWaterTest(MODULE *testModulePtr)
{
fprintf(stderr, "D3D_DrawWaterTest(%p)\n", testModulePtr);
}
void D3D_DrawParticle_Rain(PARTICLE *particlePtr,VECTORCH *prevPositionPtr)
{
fprintf(stderr, "D3D_DrawParticle_Rain(%p, %p)\n", particlePtr, prevPositionPtr);
}
void D3D_DrawCable(VECTORCH *centrePtr, MATRIXCH *orientationPtr)
{
fprintf(stderr, "D3D_DrawCable(%p, %p)\n", centrePtr, orientationPtr);
}
void D3D_BackdropPolygon_Output(POLYHEADER *inputPolyPtr,RENDERVERTEX *renderVerticesPtr)
{
fprintf(stderr, "D3D_BackdropPolygon_Output(%p, %p)\n", inputPolyPtr, renderVerticesPtr);
}
/* dd_func.cpp */
long BackBufferPitch;