This commit is contained in:
parent
d895b2c12f
commit
4d10183fb8
4 changed files with 33 additions and 21 deletions
|
@ -97,6 +97,11 @@ struct sOT
|
|||
(OT)->LastPrim = (u32*)(Prim); \
|
||||
(OT)->FirstPrim = (u32*)(Prim); \
|
||||
}
|
||||
#define addPrimNoCheck(OT,Prim) \
|
||||
{ \
|
||||
setaddr(((u32*)Prim), (OT)->FirstPrim); \
|
||||
(OT)->FirstPrim = (u32*)(Prim); \
|
||||
}
|
||||
|
||||
#define NTAG_addPrims(_nt,_ps,_pe) \
|
||||
{ \
|
||||
|
@ -217,20 +222,20 @@ typedef u32 sOT;
|
|||
#define GetPrimLG4() GetPrim(LINE_G4);\
|
||||
setLineG4(CurrPrim-sizeof(LINE_G4))
|
||||
|
||||
#define GetPrimSPRT8() GetPrim(SPRT8);\
|
||||
setSprt8(CurrPrim-sizeof(SPRT8))
|
||||
#define GetPrimSPRT8() GetPrim(SPRT_8);\
|
||||
setSprt8(CurrPrim-sizeof(SPRT_8))
|
||||
|
||||
#define GetPrimSPRT16() GetPrim(SPRT16);\
|
||||
setSprt16(CurrPrim-sizeof(SPRT16))
|
||||
#define GetPrimSPRT16() GetPrim(SPRT_16);\
|
||||
setSprt16(CurrPrim-sizeof(SPRT_16))
|
||||
|
||||
#define GetPrimSPRT() GetPrim(SPRT);\
|
||||
setSprt(CurrPrim-sizeof(SPRT))
|
||||
|
||||
#define GetPrimTILE8() GetPrim(TILE8);\
|
||||
setTile(CurrPrim-sizeof(TILE8))
|
||||
#define GetPrimTILE8() GetPrim(TILE_8);\
|
||||
setTile(CurrPrim-sizeof(TILE_8))
|
||||
|
||||
#define GetPrimTILE16() GetPrim(TILE16);\
|
||||
setTile(CurrPrim-sizeof(TILE16))
|
||||
#define GetPrimTILE16() GetPrim(TILE_16);\
|
||||
setTile(CurrPrim-sizeof(TILE_16))
|
||||
|
||||
#define GetPrimTILE() GetPrim(TILE);\
|
||||
setTile(CurrPrim-sizeof(TILE))
|
||||
|
|
|
@ -220,7 +220,7 @@ s16 TileX,TileY;
|
|||
{
|
||||
/**/ Prim->x0=TileX;
|
||||
/**/ Prim->y0=TileY;
|
||||
/**/ AddPrim(OtPtr,Prim);
|
||||
addPrimNoCheck(OtPtr,Prim);
|
||||
}
|
||||
Grid=Grid->Right;
|
||||
TileX+=TILE_WIDTH;
|
||||
|
|
|
@ -147,7 +147,6 @@ sTileMapElem3d *MapPtr=GetMapPos3d(X,Y);
|
|||
#define BLOCK_MULT 16
|
||||
void CLayerTile3d::render()
|
||||
{
|
||||
|
||||
sPrimGridElem3d *Grid=GetGridPos3d(MapX,MapY);
|
||||
s16 TileX,TileY;
|
||||
VECTOR BlkPos;
|
||||
|
@ -172,7 +171,7 @@ s32 BlkXStore;
|
|||
{ // Has 2d Data
|
||||
/**/ Prim->x0=TileX;
|
||||
/**/ Prim->y0=TileY;
|
||||
/**/ AddPrim(OtPtr,Prim);
|
||||
addPrimNoCheck(OtPtr,Prim);
|
||||
}
|
||||
if (Grid->Flags)
|
||||
{ // Has 3d Data
|
||||
|
@ -231,7 +230,7 @@ sTri *TList=TriList+Tile->TriStart;
|
|||
*(u16*)&TPrimPtr->u2=T2; // Set UV2
|
||||
|
||||
TList++;
|
||||
addPrim(OtPtr,TPrimPtr);
|
||||
addPrimNoCheck(OtPtr,TPrimPtr);
|
||||
gte_stsxy3_ft3(TPrimPtr);
|
||||
TPrimPtr++;
|
||||
}
|
||||
|
|
|
@ -46,14 +46,6 @@ void CLevel::init()
|
|||
TPLoadTex(LEVEL04_LEVEL04_TEX);
|
||||
|
||||
initLayers();
|
||||
|
||||
// Setup Constand Rot Matrix
|
||||
MATRIX Mtx;
|
||||
|
||||
SetIdent(&Mtx);
|
||||
Mtx.t[2]=ZPos;
|
||||
SetRotMatrix(&Mtx);
|
||||
SetTransMatrix(&Mtx);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -114,6 +106,22 @@ void CLevel::shutdown()
|
|||
/*****************************************************************************/
|
||||
void CLevel::render()
|
||||
{
|
||||
// Setup Constant Rot Matrix
|
||||
MATRIX Mtx;
|
||||
|
||||
SetIdent(&Mtx);
|
||||
Mtx.t[2]=ZPos;
|
||||
SetRotMatrix(&Mtx);
|
||||
SetTransMatrix(&Mtx);
|
||||
|
||||
// Setup dummy prim to ensure OtPos 0 is initialised (for fast add)
|
||||
TILE_16 *Prim=GetPrimTILE16();
|
||||
|
||||
Prim->x0=1024;
|
||||
Prim->y0=1024;
|
||||
AddPrim(OtPtr,Prim);
|
||||
ASSERT(OtPtr->FirstPrim);
|
||||
|
||||
for (int i=0; i<CLayerTile::LAYER_TILE_TYPE_MAX; i++)
|
||||
{
|
||||
if (TileLayers[i]) TileLayers[i]->render();
|
||||
|
@ -123,7 +131,7 @@ void CLevel::render()
|
|||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
int MapSpd=8;
|
||||
int MapSpd=4;
|
||||
void CLevel::think(int _frames)
|
||||
{
|
||||
int padh = PadGetHeld( 0 );
|
||||
|
|
Loading…
Add table
Reference in a new issue