This commit is contained in:
Daveo 2001-04-17 20:09:03 +00:00
parent df67653abb
commit b8ab5fb31e
4 changed files with 52 additions and 17 deletions

View File

@ -61,16 +61,17 @@ int XPos=MapPos.vx>>MapXYShift;
int YPos=MapPos.vy>>MapXYShift; int YPos=MapPos.vy>>MapXYShift;
MapXY.vx=XPos>>4; MapXY.vx=XPos>>4;
MapXY.vy=YPos>>4; MapXY.vy=YPos/12;
#if 0
if (LayerHdr->SubType==1) // BODGE AND A HALF if (LayerHdr->SubType==1) // BODGE AND A HALF
{ {
/**/ MapXY.vx+=TileMapOfs.vx; /**/ MapXY.vx+=TileMapOfs.vx;
/**/ MapXY.vy+=TileMapOfs.vy; /**/ MapXY.vy+=TileMapOfs.vy;
} }
#endif
ShiftX=XPos & 15; ShiftX=XPos & 15;
ShiftY=YPos & 15; // ShiftY=YPos & 15;
ShiftY=YPos%12;
if (MapXY.vx+SCREEN_TILE_WIDTH<=MapWidth) if (MapXY.vx+SCREEN_TILE_WIDTH<=MapWidth)
RenderW=SCREEN_TILE_WIDTH; RenderW=SCREEN_TILE_WIDTH;
@ -87,6 +88,49 @@ int YPos=MapPos.vy>>MapXYShift;
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/ /*****************************************************************************/
#if 1
void CLayerTile::render()
{
sTileMapElem *MapPtr=GetMapPos();
u8 *PrimPtr=GetPrimPtr();
s16 TileX,TileY;
sOT *ThisOT=OtPtr+LayerOT;
// Setup shift bits of pos
TileY=-ShiftY;
// Render it!!
for (int Y=0; Y<RenderH; Y++)
{
sTileMapElem *MapRow=MapPtr;
TileX=-ShiftX;
for (int X=0; X<RenderW; X++)
{
int ThisTile=*MapRow++;
if (ThisTile)
{
sTile *Tile=&TileBank[ThisTile];
POLY_FT4 *Ft4=(POLY_FT4*)PrimPtr;
setPolyFT4(Ft4);
setShadeTex(Ft4,1);
setXYWH(Ft4,TileX,TileY,16,12);
setUVWH(Ft4,Tile->u0,Tile->v0,15,15);
Ft4->tpage=Tile->TPage;
Ft4->clut=Tile->Clut;
addPrimNoCheck(ThisOT,Ft4);
PrimPtr+=sizeof(POLY_FT4);
}
TileX+=TILE_WIDTH;
}
MapPtr+=MapWidth;
TileY+=TILE_HEIGHT;
}
SetPrimPtr(PrimPtr);
}
#else
void CLayerTile::render() void CLayerTile::render()
{ {
sTileMapElem *MapPtr=GetMapPos(); sTileMapElem *MapPtr=GetMapPos();
@ -129,3 +173,5 @@ sOT *ThisOT=OtPtr+LayerOT;
} }
#endif

View File

@ -28,9 +28,9 @@ public:
enum enum
{ {
TILE_WIDTH=16, TILE_WIDTH=16,
TILE_HEIGHT=16, TILE_HEIGHT=12,
SCREEN_TILE_WIDTH=34, SCREEN_TILE_WIDTH=34,
SCREEN_TILE_HEIGHT=18, SCREEN_TILE_HEIGHT=24,
SCREEN_TILE_SIZE=SCREEN_TILE_WIDTH*SCREEN_TILE_HEIGHT SCREEN_TILE_SIZE=SCREEN_TILE_WIDTH*SCREEN_TILE_HEIGHT
}; };

View File

@ -64,8 +64,6 @@ void CLayerTile3d::shutdown()
{ {
} }
int GHV=256;
/*****************************************************************************/ /*****************************************************************************/
void CLayerTile3d::think(DVECTOR &MapPos) void CLayerTile3d::think(DVECTOR &MapPos)
@ -103,9 +101,6 @@ int YPos=MapPos.vy>>MapXYShift;
RenderH=SCREEN_TILE_HEIGHT3D; RenderH=SCREEN_TILE_HEIGHT3D;
else else
RenderH=MapHeight-MapXY.vy; RenderH=MapHeight-MapXY.vy;
SetGeomScreen(GHV);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -686,12 +686,6 @@ void CLevel::shutdown(bool CleanUp)
/*****************************************************************************/ /*****************************************************************************/
void CLevel::render() void CLevel::render()
{ {
// Setup Constant Rot Matrix
MATRIX *Mtx=CGameScene::GetCamMtx();
SetRotMatrix(Mtx);
SetTransMatrix(Mtx);
// Setup dummy prim to ensure OtPos 0 is initialised (for fast add) // Setup dummy prim to ensure OtPos 0 is initialised (for fast add)
for (int i=0;i<8; i++) for (int i=0;i<8; i++)
{ {