Fixed start menu bug for unreachable entries. Fixed string problems with CLogFile under hq_sound.cpp
git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@122 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
@@ -26,7 +26,9 @@ short HQSndDrv_Load(SDL_AudioSpec *AudioSpec, stHQSound *psound, const std::stri
|
||||
#ifdef BUILD_WITH_OGG
|
||||
if(openOGGSound(fp, &AudioFileSpec, AudioSpec->format, psound) != 0)
|
||||
{
|
||||
g_pLogFile->ftextOut(PURPLE,"OGG file could not be opened: \"%s\". The file was detected, but appears to be damaged. Trying to load the classical sound<br>", soundfile.c_str());
|
||||
std::string buf2;
|
||||
buf2 = "OGG file \"" + buf +"\"could not be opened. The file was detected, but appears to be damaged. Trying to load the classical sound<br>";
|
||||
g_pLogFile->ftextOut(PURPLE,buf2.c_str());
|
||||
return 1;
|
||||
}
|
||||
psound->enabled = true;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
char controlsmenu(stCloneKeenPlus *pCKP);
|
||||
int mainmenu(stCloneKeenPlus *pCKP,int defaultopt);
|
||||
char configmenu(stCloneKeenPlus *pCKP);
|
||||
short loadStartMenu(stCloneKeenPlus *pCKP);
|
||||
bool loadStartMenu(stCloneKeenPlus *pCKP);
|
||||
void keensleft(stCloneKeenPlus *pCKP);
|
||||
void showmapatpos(int level, int xoff, int yoff, int wm, stCloneKeenPlus *pCKP);
|
||||
short loadResourcesforStartMenu(stCloneKeenPlus *pCKP, CGame *Game);
|
||||
|
||||
@@ -167,10 +167,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
if(!CKP.Control.skipstarting)
|
||||
{
|
||||
if(loadStartMenu(&CKP) == 1)
|
||||
while(!loadStartMenu(&CKP))
|
||||
{
|
||||
cleanupResources(&CKP);
|
||||
return 0;
|
||||
g_pLogFile->textOut(PURPLE,"Error! You have chosen a Game that doesn't exist. Please correct the \"games.cfg\" File under \"data\" and choose another game.<br>");
|
||||
//cleanupResources(&CKP);
|
||||
//return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
15
src/menu.cpp
15
src/menu.cpp
@@ -144,10 +144,11 @@ short loadResourcesforStartMenu(stCloneKeenPlus *pCKP, CGame *Game)
|
||||
#define MAINMENU_GOTO_DEMO_TIME 4000
|
||||
|
||||
extern char fade_black;
|
||||
short loadStartMenu(stCloneKeenPlus *pCKP)
|
||||
bool loadStartMenu(stCloneKeenPlus *pCKP)
|
||||
{
|
||||
CDialog *GamesMenu;
|
||||
int i;
|
||||
bool ret;
|
||||
|
||||
fade.mode = FADE_GO;
|
||||
fade.rate = FADE_NORM;
|
||||
@@ -194,8 +195,14 @@ short loadStartMenu(stCloneKeenPlus *pCKP)
|
||||
fade.fadetimer = 0;
|
||||
fade.rate = FADE_NORM;
|
||||
fade.mode = FADE_GO;
|
||||
pCKP->Resources.GameSelected = GamesMenu->getSelection()+1;
|
||||
pCKP->Control.levelcontrol.episode = pCKP->GameData[pCKP->Resources.GameSelected-1].Episode;
|
||||
|
||||
if( GamesMenu->getSelection()+1 < pCKP->numGames )
|
||||
{
|
||||
ret = true;
|
||||
pCKP->Resources.GameSelected = GamesMenu->getSelection()+1;
|
||||
pCKP->Control.levelcontrol.episode = pCKP->GameData[pCKP->Resources.GameSelected-1].Episode;
|
||||
}
|
||||
else ret = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -208,7 +215,7 @@ short loadStartMenu(stCloneKeenPlus *pCKP)
|
||||
|
||||
delete GamesMenu;
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mainmenu(stCloneKeenPlus *pCKP,int defaultopt)
|
||||
|
||||
Reference in New Issue
Block a user