SBSPSS/source/level/layerback.cpp

77 lines
1.9 KiB
C++
Raw Normal View History

2001-01-13 18:04:56 +01:00
/******************************/
/*** Solid Tile Layer Class ***/
/******************************/
#include "system\global.h"
#include <DStructs.h>
#include "utils\utils.h"
#include "gfx\prim.h"
#include "LayerTile.h"
2001-01-15 16:22:33 +01:00
#include "LayerBack.h"
2001-01-13 18:04:56 +01:00
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
2001-01-15 16:22:33 +01:00
CLayerBack::CLayerBack(sLayerHdr *Hdr,sTile *TileList,sTri *TriList,sQuad *QuadList,sVtx *VtxList) : CLayerTile(Hdr,TileList,TriList,QuadList,VtxList)
2001-01-13 18:04:56 +01:00
{
}
/*****************************************************************************/
2001-01-15 16:22:33 +01:00
CLayerBack::~CLayerBack()
2001-01-13 18:04:56 +01:00
{
}
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
2001-01-15 16:22:33 +01:00
void CLayerBack::init(DVECTOR &MapPos,int Shift,int Width,int Height)
2001-01-13 18:04:56 +01:00
{
}
/*****************************************************************************/
2001-01-15 16:22:33 +01:00
void CLayerBack::shutdown()
2001-01-13 18:04:56 +01:00
{
}
/*****************************************************************************/
2001-01-15 16:22:33 +01:00
int YY;
void CLayerBack::think(DVECTOR &MapPos)
2001-01-13 18:04:56 +01:00
{ // Overide default strip scroll update
int XPos=MapPos.vx>>MapXYShift;
int YPos=MapPos.vy>>MapXYShift;
ShiftX=XPos&15;
ShiftY=YPos&15;
MapX=XPos>>4;
MapY=YPos>>4;
2001-01-15 16:22:33 +01:00
YY=MapPos.vy>>2;
2001-01-13 18:04:56 +01:00
}
/*****************************************************************************/
2001-01-15 16:22:33 +01:00
void CLayerBack::render()
2001-01-13 18:04:56 +01:00
{
2001-01-15 16:22:33 +01:00
POLY_G4 *G4;
sOT *ThisOT=OtPtr+LayerOT;
int Col;
Col=YY;
if (Col>127) Col=127;
G4=GetPrimG4();
setXYWH(G4,0,0,512,256);
setRGB0(G4,0,255-Col,255-Col);
setRGB1(G4,0,255-Col,255-Col);
setRGB2(G4,0,0,128-Col);
setRGB3(G4,0,0,128-Col);
addPrimNoCheck(ThisOT,G4);
2001-01-13 18:04:56 +01:00
}