diff --git a/source/fma/fma.cpp b/source/fma/fma.cpp index 47fd12f42..bdf82874c 100644 --- a/source/fma/fma.cpp +++ b/source/fma/fma.cpp @@ -86,6 +86,10 @@ FX #include "save\save.h" #endif +#ifndef __VID_HEADER_ +#include "system\vid.h" +#endif + /* Std Lib @@ -1260,6 +1264,7 @@ void CFmaScene::init() m_stillProcessingCommand=false; m_doOtherProcessing=false; + StopLoad(); } diff --git a/source/frontend/frontend.cpp b/source/frontend/frontend.cpp index 986d84f12..c53d524d4 100644 --- a/source/frontend/frontend.cpp +++ b/source/frontend/frontend.cpp @@ -78,6 +78,9 @@ #include "fma\fma.h" #endif +#ifndef __VID_HEADER_ +#include "system\vid.h" +#endif /* Std Lib ------- */ @@ -150,6 +153,8 @@ CFrontEndScene::FrontEndMode CFrontEndScene::s_startMode=MODE__NICK_LOGO; ---------------------------------------------------------------------- */ void CFrontEndScene::init() { + CLevel::DisplayLoadingScreen(); + for(int i=0;iinit(); @@ -166,6 +171,7 @@ void CFrontEndScene::init() m_font=new ("frontendfont") FontBank(); m_font->initialise(&standardFont); m_font->setJustification(FontBank::JUST_CENTRE); + StopLoad(); } diff --git a/source/level/level.cpp b/source/level/level.cpp index f6850febe..8df78fab5 100644 --- a/source/level/level.cpp +++ b/source/level/level.cpp @@ -204,7 +204,6 @@ void CLevel::init(int LevelNo) // Load it sLvlTab *lvlTab=&LvlTable[LevelNo]; -// DisplayLoadingScreen(lvlTab); CSoundMediator::setSong((CSoundMediator::SONGID)lvlTab->songId); @@ -319,6 +318,7 @@ int i; MemFree(s_image); VSync(20); font.dump(); + StartLoad(); } /*****************************************************************************/ diff --git a/source/map/map.cpp b/source/map/map.cpp index fe5c4064e..4675ef92e 100644 --- a/source/map/map.cpp +++ b/source/map/map.cpp @@ -275,6 +275,7 @@ void CMapScene::init() CSoundMediator::setSong(CSoundMediator::SONG_MAPSCREEN); m_musicStarted=false; + StopLoad(); } diff --git a/source/system/vid.cpp b/source/system/vid.cpp index 414c4fad3..cbff419e8 100644 --- a/source/system/vid.cpp +++ b/source/system/vid.cpp @@ -33,14 +33,14 @@ static const CVECTOR s_defClearCol = {0, 0, 0}; /*****************************************************************************/ POLY_FT4 LoadPoly; static int LoadX=430; -static int LoadY=161; +static int LoadY=192; +static int LoadBackY; static int LoadHalfWidth; static int LoadIconSide; static int DrawLoadIcon=0; static RECT LoadBackRect; -static int LoadBackY; static int LoadTime=0; - +static const int LoadBackInc=8; /*****************************************************************************/ // Altered to keep aspect ratio @@ -50,6 +50,7 @@ s8 LoadTab[]= 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,17,18,18,19,19,19,20,20,20,20,20,21 }; const int LoadTabSize=sizeof(LoadTab)/sizeof(s8); + /*****************************************************************************/ void LoadingIcon() { @@ -65,14 +66,12 @@ POLY_FT4 *PolyPtr=&LoadPoly; rgb=128-(LoadTab[(LoadTime+LoadTabSize/2)%LoadTabSize]*3); setRGB0(PolyPtr,rgb,rgb,rgb); - MoveImage(&LoadBackRect,LoadX,LoadY+LoadBackY); - + MoveImage(&LoadBackRect,LoadX-LoadBackInc,LoadBackY); PutDrawEnv(&Screen[FrameFlipFlag^1].Draw); DrawPrim(PolyPtr); LoadTime++; if (LoadTime>=LoadTabSize) LoadTime=0; -// if(LoadTime==LoadTabSize/2) LoadIconSide^=1; } /*****************************************************************************/ @@ -86,21 +85,26 @@ sFrameHdr *fh=(sFrameHdr*)_fh; LoadPoly.clut=fh->Clut; LoadHalfWidth=fh->W/2; - setRECT(&LoadBackRect,LoadX,LoadY+(LoadBackY^256),fh->W+4,fh->H+4); + LoadBackRect.w=fh->W+(LoadBackInc*2); + LoadBackRect.h=fh->H; } /*****************************************************************************/ void StartLoad(int _loadX,int _loadY) { - LoadX=_loadX; - LoadY=_loadY; + SYSTEM_DBGMSG("Start Load"); + + if (_loadX!=-1) LoadX=_loadX; + if (_loadY!=-1) LoadY=_loadY; Screen[0].Draw.isbg=Screen[1].Draw.isbg=0; PutDrawEnv(&Screen[FrameFlipFlag^1].Draw); PutDispEnv(&Screen[FrameFlipFlag].Disp); - LoadBackY=Screen[FrameFlipFlag^1].Disp.disp.y; + LoadBackRect.x=LoadX-LoadBackInc; + LoadBackRect.y=LoadY+((FrameFlipFlag)*256);; + LoadBackY=LoadY+((FrameFlipFlag^1)*256); LoadTime=0; DrawLoadIcon=1; @@ -110,7 +114,6 @@ void StartLoad(int _loadX,int _loadY) /*****************************************************************************/ void StopLoad() { - while(LoadTime) { VSync(0); @@ -119,6 +122,8 @@ void StopLoad() Screen[0].Draw.isbg=Screen[1].Draw.isbg=1; DrawLoadIcon=0; + SYSTEM_DBGMSG("Stop Load"); + } /*****************************************************************************/ diff --git a/source/system/vid.h b/source/system/vid.h index 001c14228..7ada2726e 100644 --- a/source/system/vid.h +++ b/source/system/vid.h @@ -59,7 +59,7 @@ void VidRemoveVSyncFunc(VbFuncType v); void VRamViewer(); void SetUpLoadIcon(void *fh); -void StartLoad(int _loadX=430,int _loadY=202); +void StartLoad(int _loadX=-1,int _loadY=-1); void StopLoad(); void SetScreenImage(u8 *Ptr);