This commit is contained in:
parent
90742214eb
commit
6abd565b82
5 changed files with 42 additions and 21 deletions
|
@ -38,7 +38,7 @@ TEMP_FILE := $(TEMP_BUILD_DIR)/build.tmp
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
#--- Levels -----------------------------------------------------------------
|
#--- Levels -----------------------------------------------------------------
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
LEVELS_OPTS := -t:8,2,1 -s:16
|
LEVELS_OPTS := -t:8,2,1 -s:256
|
||||||
LEVELS_IN_DIR := $(GRAF_DIR)/levels
|
LEVELS_IN_DIR := $(GRAF_DIR)/levels
|
||||||
LEVELS_OUT_DIR := $(DATA_OUT)/levels
|
LEVELS_OUT_DIR := $(DATA_OUT)/levels
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,23 @@
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
sOT *OtList[2],*OtPtr;
|
sOT *OtList[2],*OtPtr;
|
||||||
|
u32 *PrimDrawList;
|
||||||
u32 DmaStart[2];
|
u32 DmaStart[2];
|
||||||
u8 *PrimBuffer[2],*PrimListStart,*PrimListEnd;
|
u8 *PrimBuffer[2],*PrimListStart,*PrimListEnd;
|
||||||
u8 *CurrPrim,*EndPrim;
|
u8 *CurrPrim,*EndPrim;
|
||||||
int PrimFlipFlag;
|
int PrimFlipFlag;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void PrimDrawCallBack()
|
||||||
|
{
|
||||||
|
if (PrimDrawList)
|
||||||
|
{
|
||||||
|
DrawOTag(PrimDrawList);
|
||||||
|
}
|
||||||
|
|
||||||
|
PrimDrawList=0;
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void PrimInit()
|
void PrimInit()
|
||||||
{
|
{
|
||||||
|
@ -34,31 +46,31 @@ void PrimInit()
|
||||||
|
|
||||||
InitOTagR(OtList[0],MAX_OT);
|
InitOTagR(OtList[0],MAX_OT);
|
||||||
InitOTagR(OtList[1],MAX_OT);
|
InitOTagR(OtList[1],MAX_OT);
|
||||||
|
|
||||||
|
PrimDrawList=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void PrimDisplay()
|
void PrimDisplay()
|
||||||
{
|
{
|
||||||
CAnimTex::AnimateTex();
|
// CAnimTex::AnimateTex();
|
||||||
UnlinkOTagR(OtPtr, MAX_OT, &DmaStart[PrimFlipFlag]);
|
UnlinkOTagR(OtPtr, MAX_OT, &DmaStart[PrimFlipFlag]);
|
||||||
|
|
||||||
#ifdef USE_NTAGS
|
#ifdef USE_NTAGS
|
||||||
DrawOTag((u32*)&DmaStart[PrimFlipFlag]);
|
// DrawOTag((u32*)&DmaStart[PrimFlipFlag]);
|
||||||
|
PrimDrawList=&DmaStart[PrimFlipFlag];
|
||||||
#else
|
#else
|
||||||
DrawOTag(OtPtr+(MAX_OT-1));
|
// DrawOTag(OtPtr+(MAX_OT-1));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PrimFlipFlag^=1;
|
PrimFlipFlag^=1;
|
||||||
OtPtr=(sOT*)OtList[PrimFlipFlag];
|
OtPtr=(sOT*)OtList[PrimFlipFlag];
|
||||||
CurrPrim=(u8*)PrimBuffer[PrimFlipFlag];
|
CurrPrim=(u8*)PrimBuffer[PrimFlipFlag];
|
||||||
EndPrim=CurrPrim+(PRIMPOOL_SIZE);
|
EndPrim=CurrPrim+(PRIMPOOL_SIZE);
|
||||||
|
|
||||||
ResetOTagR(OtPtr,MAX_OT);
|
ResetOTagR(OtPtr,MAX_OT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*** Clipping ****************************************************************/
|
/*** Clipping ****************************************************************/
|
||||||
void PrimClip(RECT *R, u32 Depth)
|
void PrimClip(RECT *R, u32 Depth)
|
||||||
{
|
{
|
||||||
|
|
|
@ -306,6 +306,8 @@ extern u8 *PrimListStart,*PrimListEnd;
|
||||||
void PrimInit();
|
void PrimInit();
|
||||||
|
|
||||||
void PrimDisplay();
|
void PrimDisplay();
|
||||||
|
void PrimDrawCallBack();
|
||||||
|
|
||||||
void PrimClip(RECT *r, u32 Depth);
|
void PrimClip(RECT *r, u32 Depth);
|
||||||
void PrimFullScreen(int Depth);
|
void PrimFullScreen(int Depth);
|
||||||
inline u8 *GetPrimPtr() {return(CurrPrim);}
|
inline u8 *GetPrimPtr() {return(CurrPrim);}
|
||||||
|
|
|
@ -134,30 +134,34 @@ void MainLoop()
|
||||||
|
|
||||||
frames=GameState::getFramesSinceLast();
|
frames=GameState::getFramesSinceLast();
|
||||||
|
|
||||||
|
// System Think
|
||||||
FontBank::think(frames);
|
FontBank::think(frames);
|
||||||
|
|
||||||
GameState::think();
|
|
||||||
GameState::render();
|
|
||||||
|
|
||||||
CBubicleFactory::think(frames);
|
|
||||||
CBubicleFactory::render();
|
|
||||||
|
|
||||||
CFader::think(frames);
|
|
||||||
CFader::render();
|
|
||||||
|
|
||||||
CSoundMediator::think(frames);
|
CSoundMediator::think(frames);
|
||||||
|
|
||||||
|
// Think States
|
||||||
|
GameState::think();
|
||||||
|
CBubicleFactory::think(frames);
|
||||||
|
CFader::think(frames);
|
||||||
|
|
||||||
#ifdef __USER_paul__
|
#ifdef __USER_paul__
|
||||||
s_paulScene.think(frames);
|
s_paulScene.think(frames);
|
||||||
s_paulScene.render();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while(DrawSync(1));
|
while(DrawSync(1));
|
||||||
|
|
||||||
|
// Render States
|
||||||
|
GameState::render();
|
||||||
|
CBubicleFactory::render();
|
||||||
|
CFader::render();
|
||||||
|
|
||||||
|
#ifdef __USER_paul__
|
||||||
|
s_paulScene.render();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
PrimDisplay();
|
||||||
|
VidSwapDraw();
|
||||||
VSync(0);
|
VSync(0);
|
||||||
|
|
||||||
VidSwapDraw();
|
|
||||||
PrimDisplay();
|
|
||||||
PadUpdate();
|
PadUpdate();
|
||||||
|
|
||||||
DbgPollHost();
|
DbgPollHost();
|
||||||
|
|
|
@ -143,6 +143,9 @@ static void VidVSyncCallback()
|
||||||
FrameCounter++;
|
FrameCounter++;
|
||||||
TickCount++;
|
TickCount++;
|
||||||
if (DrawLoadIcon) LoadingIcon();
|
if (DrawLoadIcon) LoadingIcon();
|
||||||
|
|
||||||
|
PrimDrawCallBack();
|
||||||
|
|
||||||
if (VbFunc)
|
if (VbFunc)
|
||||||
{
|
{
|
||||||
VbFunc();
|
VbFunc();
|
||||||
|
|
Loading…
Add table
Reference in a new issue