diff --git a/source/frontend/maintitl.cpp b/source/frontend/maintitl.cpp index 78b30766e..11d41505b 100644 --- a/source/frontend/maintitl.cpp +++ b/source/frontend/maintitl.cpp @@ -70,6 +70,10 @@ #include "utils\utils.h" #endif +#ifndef __GAME_GAMESLOT_H__ +#include "game\gameslot.h" +#endif + /* Std Lib ------- */ @@ -183,9 +187,7 @@ void CFrontEndMainTitles::select() m_demoTimeout=0; - // Currently the selection of title screens is random.. eventually it will be tied - // into how much of the game has been completed (pkg) - s_image=CFileIO::loadFile(s_imageFiles[getRndRange(4)]); + s_image=CFileIO::loadFile(s_imageFiles[CGameSlotManager::getNumberOfFrontendScreenToUse()]); ASSERT(s_image); SetScreenImage(s_image); diff --git a/source/game/gameslot.cpp b/source/game/gameslot.cpp index f6aa96202..c61d062cb 100644 --- a/source/game/gameslot.cpp +++ b/source/game/gameslot.cpp @@ -29,6 +29,34 @@ /* Data ---- */ +// Level data include files: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + /*---------------------------------------------------------------------- Tyepdefs && Defines ------------------- */ @@ -205,5 +233,87 @@ CGameSlotManager::GameSlot CGameSlotManager::getSlotData(int _slot) } +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: 0..3 + ---------------------------------------------------------------------- */ +int CGameSlotManager::getNumberOfFrontendScreenToUse() +{ + int bestSoFar; + GameSlot *slot; + int i; + + bestSoFar=0; + slot=s_gameSlots; + for(i=0;im_isInUse) + { + // All normal levels completed? ( screen 1 ) + if(slot->hasQustItemBeenCollected(5-1,4-1)) + { + bestForThisSlot=1; + + // ..and bought all party items? ( screen 2 ) + int j; + for(j=CShopScene::NUM_SHOP_ITEM_IDS;j>0&&slot->isPartyItemHeld(j);j--); + if(j==0) + { + bestForThisSlot=2; + + // ..and collected all spats? ( screen 3 ) + int count,c,l; + count=0; + for(c=0;c<5;c++) + { + for(l=0;l<4;l++) + { + count+=slot->getSpatulaCollectedCount(c,l); + } + } + if(count==CHAPTER01_LEVEL01_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER01_LEVEL02_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER01_LEVEL03_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER01_LEVEL04_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER02_LEVEL01_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER02_LEVEL02_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER02_LEVEL03_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER02_LEVEL04_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER03_LEVEL01_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER03_LEVEL02_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER03_LEVEL03_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER03_LEVEL04_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER04_LEVEL01_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER04_LEVEL02_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER04_LEVEL03_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER04_LEVEL04_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER05_LEVEL01_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER05_LEVEL02_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER05_LEVEL03_INF_TOTAL_ITEM_GOLDEN_SPATULA+ + CHAPTER05_LEVEL04_INF_TOTAL_ITEM_GOLDEN_SPATULA) + { + bestForThisSlot=3; + } + } + } + + // Is this slot better than the others? + if(bestForThisSlot>bestSoFar) + { + bestSoFar=bestForThisSlot; + } + } + + slot++; + } + + return bestSoFar; +} + + /*=========================================================================== end */ diff --git a/source/game/gameslot.h b/source/game/gameslot.h index bcad9c383..75b5badeb 100644 --- a/source/game/gameslot.h +++ b/source/game/gameslot.h @@ -216,6 +216,8 @@ public: static void eraseGameSlot(unsigned int _slot); static void copyGameSlot(unsigned int _src,unsigned int _dest); + static int getNumberOfFrontendScreenToUse(); + private: static GameSlot s_gameSlots[NUM_GAME_SLOTS];