From 09f0f53ff46cd400faeace7a55e77410a827174a Mon Sep 17 00:00:00 2001 From: Daveo Date: Tue, 1 May 2001 22:40:25 +0000 Subject: [PATCH] --- source/fmv/fmv.cpp | 2 +- source/gfx/font.cpp | 1 + source/gfx/otpos.h | 8 ++++---- source/gfx/prim.cpp | 24 ++++++++++++++---------- source/gfx/prim.h | 18 +++++++++++++----- source/gui/gui.cpp | 1 + source/system/main.cpp | 2 +- 7 files changed, 35 insertions(+), 21 deletions(-) diff --git a/source/fmv/fmv.cpp b/source/fmv/fmv.cpp index f7df10f1a..a759b7c5e 100644 --- a/source/fmv/fmv.cpp +++ b/source/fmv/fmv.cpp @@ -183,7 +183,7 @@ static int HasInit=0; // Cos it uses prim pool, best check its big enough CdReadyCallback(0); // clear it in case XA is being naughty ASSERT(PRIMPOOL_SIZE>FMVWidth*(FMVHeight+1)); - InitOTagR(OtPtr,MAX_OT); // Ensure no prims need the Prim Pool + InitOTagR(BaseOtPtr,MAX_OT_ALL); // Ensure no prims need the Prim Pool SYSTEM_DBGMSG("[FMV] Playing fmv %d ( fid:%d )",fmvNumber,s_fmvData[fmvNumber].m_filename); startSector=CFileIO::GetFilePos(s_fmvData[fmvNumber].m_filename); diff --git a/source/gfx/font.cpp b/source/gfx/font.cpp index e8ae0377a..0cafbc1dc 100644 --- a/source/gfx/font.cpp +++ b/source/gfx/font.cpp @@ -221,6 +221,7 @@ void FontBank::setJustification( Justification _justification ) void FontBank::setOt( u16 _ot ) { m_ot = _ot; + m_ot=0; // Sorry!! } diff --git a/source/gfx/otpos.h b/source/gfx/otpos.h index e7b6818b6..d5440fbff 100644 --- a/source/gfx/otpos.h +++ b/source/gfx/otpos.h @@ -27,10 +27,10 @@ enum { - OTPOS__ACTOR_POS=10, - OTPOS__PICKUP_POS=10, - OTPOS__INGAME_UI=3, - OTPOS__DEBUG_INFO=1, + OTPOS__DEBUG_INFO=0, + OTPOS__INGAME_UI=0, + OTPOS__ACTOR_POS=6, + OTPOS__PICKUP_POS=OTPOS__ACTOR_POS, }; diff --git a/source/gfx/prim.cpp b/source/gfx/prim.cpp index 6a1602a08..da60e0cfc 100644 --- a/source/gfx/prim.cpp +++ b/source/gfx/prim.cpp @@ -9,7 +9,7 @@ #include "system\vid.h" /*****************************************************************************/ -sOT *OtList[2],*OtPtr; +sOT *OtList[2],*BaseOtPtr,*GUIOtPtr,*OtPtr; u32 DmaStart[2]; u8 *PrimBuffer[2],*PrimListStart,*PrimListEnd; u8 *CurrPrim,*EndPrim; @@ -19,21 +19,23 @@ int PrimFlipFlag; void PrimInit() { // Alloc Lists - OtList[0]=(sOT*)MemAlloc(MAX_OT*2*sizeof(sOT), "-Ot-"); - OtList[1]=OtList[0]+MAX_OT; + OtList[0]=(sOT*)MemAlloc(OTLIST_SIZE*2, "-Ot-"); + OtList[1]=OtList[0]+MAX_OT_ALL; PrimBuffer[0]=(u8*)MemAlloc(PRIMPOOL_SIZE*2, "Prim"); PrimBuffer[1]=PrimBuffer[0]+(PRIMPOOL_SIZE); PrimFlipFlag=0; - OtPtr=(sOT*)OtList[PrimFlipFlag]; + BaseOtPtr=(sOT*)OtList[PrimFlipFlag]; + GUIOtPtr=BaseOtPtr; + OtPtr=GUIOtPtr+MAX_OT_GUI; CurrPrim=(u8*)PrimBuffer[PrimFlipFlag]; EndPrim=CurrPrim+(PRIMPOOL_SIZE); PrimListStart=PrimBuffer[0]; PrimListEnd=PrimListStart+(PRIMPOOL_SIZE*2); - InitOTagR(OtList[0],MAX_OT); - InitOTagR(OtList[1],MAX_OT); + InitOTagR(OtList[0],MAX_OT_ALL); + InitOTagR(OtList[1],MAX_OT_ALL); } @@ -42,19 +44,21 @@ void PrimInit() void PrimDisplay() { CAnimTex::AnimateTex(); - UnlinkOTagR(OtPtr, MAX_OT, &DmaStart[PrimFlipFlag]); + UnlinkOTagR(BaseOtPtr, MAX_OT_ALL, &DmaStart[PrimFlipFlag]); #ifdef USE_NTAGS DrawOTag((u32*)&DmaStart[PrimFlipFlag]); #else - DrawOTag(OtPtr+(MAX_OT-1)); + DrawOTag(BaseOtPtr+(MAX_OT_ALL-1)); #endif PrimFlipFlag^=1; - OtPtr=(sOT*)OtList[PrimFlipFlag]; + BaseOtPtr=(sOT*)OtList[PrimFlipFlag]; + GUIOtPtr=BaseOtPtr; + OtPtr=GUIOtPtr+MAX_OT_GUI; CurrPrim=(u8*)PrimBuffer[PrimFlipFlag]; EndPrim=CurrPrim+(PRIMPOOL_SIZE); - ResetOTagR(OtPtr,MAX_OT); + ResetOTagR(BaseOtPtr,MAX_OT_ALL); } /*** Clipping ****************************************************************/ diff --git a/source/gfx/prim.h b/source/gfx/prim.h index b58cc209c..2df3078c5 100644 --- a/source/gfx/prim.h +++ b/source/gfx/prim.h @@ -15,7 +15,9 @@ #include "gfx\primplus.h" #endif +#define MAX_OT_GUI (0) #define MAX_OT (16) +#define MAX_OT_ALL (MAX_OT+MAX_OT_GUI) #define MAX_PRIMS ((1024*2)+256) //#define USE_NTAGS 1 @@ -175,8 +177,8 @@ typedef u32 sOT; #define InitOTagR(Ot, Count) ClearOTagR(Ot,Count); #define ResetOTag(Ot, Count) InitOTag(Ot,Count); #define ResetOTagR(Ot, Count) InitOTagR(Ot,Count); -#define UnlinkOTag(OtPtr, MAX_OT, Dma) ; -#define UnlinkOTagR(OtPtr, MAX_OT, Dma) ; +#define UnlinkOTag(OtPtr, MAX_OT_ALL, Dma) ; +#define UnlinkOTagR(OtPtr, MAX_OT_ALL, Dma) ; #endif @@ -302,10 +304,10 @@ typedef u32 sOT; /********************************************************************************************************/ #define MAX_PRIM_SIZE (sizeof(POLY_FT4)) #define PRIMPOOL_SIZE (MAX_PRIMS*MAX_PRIM_SIZE) -#define OTLIST_SIZE (MAX_OT*sizeof(sOT)) +#define OTLIST_SIZE (MAX_OT_ALL*sizeof(sOT)) /********************************************************************************************************/ -extern sOT *OtPtr; +extern sOT *BaseOtPtr,*GUIOtPtr,*OtPtr; extern u8 *CurrPrim,*EndPrim; extern u8 *PrimListStart,*PrimListEnd; //extern int PrimFlipFlag; @@ -326,12 +328,18 @@ LINE_G2 *DrawGLine(int _x0,int _y0,int _x1,int _y1,int _r1,int _g1,int _b1,int /********************************************************************************************************/ /*** Inlines ********************************************************************************************/ /********************************************************************************************************/ +inline void AddGUIPrimToList(void *Prim,u32 Depth) +{ + ASSERT(DepthU;*V=Fr->V;} inline void GetFrameUVWH(sFrameHdr *Fr,u8 *U,u8 *V,u8 *W,u8 *H) {*U=Fr->U; *V=Fr->V; *W=Fr->W; *H=Fr->H; } diff --git a/source/gui/gui.cpp b/source/gui/gui.cpp index eda5d945c..9836ee5fa 100644 --- a/source/gui/gui.cpp +++ b/source/gui/gui.cpp @@ -434,6 +434,7 @@ void initGUIStuff() ---------------------------------------------------------------------- */ void drawBambooBorder(int _x,int _y,int _w,int _h,int _ot) { + _ot=0; // Sorry again sFrameHdr *vbam,*hbam,*corner; int totalSize,numSprites,step; int x1,y1,x2,y2; diff --git a/source/system/main.cpp b/source/system/main.cpp index d9461a1bd..622d90861 100644 --- a/source/system/main.cpp +++ b/source/system/main.cpp @@ -166,9 +166,9 @@ void MainLoop() while(DrawSync(1)); // Render States + CFader::render(); GameState::render(); CBubicleFactory::render(); - CFader::render(); #ifdef __USER_paul__ s_paulScene.render();