more fixes
git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@110 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
@@ -70,14 +70,14 @@ typedef struct stControl
|
||||
stLevelControl levelcontrol;
|
||||
} stControl;
|
||||
|
||||
typedef struct stGameData
|
||||
struct stGameData
|
||||
{
|
||||
std::string DataDirectory;
|
||||
short Episode;
|
||||
std::string Name;
|
||||
std::string FileList[MAX_NUMBER_OF_FILES];
|
||||
stGameData() : Episode(0) {}
|
||||
} stGameData;
|
||||
};
|
||||
|
||||
|
||||
typedef struct stResources
|
||||
|
||||
14
src/menu.cpp
14
src/menu.cpp
@@ -72,12 +72,10 @@ short loadResourcesforStartMenu(stCloneKeenPlus *pCKP, CGame *Game)
|
||||
{
|
||||
getline (gamescfg,line);
|
||||
|
||||
if(strncmp(line.data(),"[",strlen("[")) == 0)
|
||||
if(line != "" && line[0] == '[')
|
||||
{
|
||||
stGameData *NewGameData;
|
||||
|
||||
pCKP->numGames++;
|
||||
NewGameData = new stGameData[pCKP->numGames];
|
||||
stGameData* NewGameData = new stGameData[pCKP->numGames];
|
||||
for(int i = 0; i < pCKP->numGames-1; ++i)
|
||||
NewGameData[i] = pCKP->GameData[i];
|
||||
|
||||
@@ -85,15 +83,15 @@ short loadResourcesforStartMenu(stCloneKeenPlus *pCKP, CGame *Game)
|
||||
|
||||
pCKP->GameData = NewGameData;
|
||||
}
|
||||
if(strncmp(line.data(),"Name=",strlen("Name=")) == 0)
|
||||
if(strncmp(line.c_str(),"Name=",strlen("Name=")) == 0)
|
||||
{
|
||||
pCKP->GameData[pCKP->numGames-1].Name = line.substr(strlen("Name="));
|
||||
}
|
||||
if(strncmp(line.data(),"Episode=",strlen("Episode=")) == 0)
|
||||
if(strncmp(line.c_str(),"Episode=",strlen("Episode=")) == 0)
|
||||
{
|
||||
sscanf(line.data(),"Episode=%hd", &(pCKP->GameData[pCKP->numGames-1].Episode));
|
||||
sscanf(line.c_str(),"Episode=%hd", &(pCKP->GameData[pCKP->numGames-1].Episode));
|
||||
}
|
||||
if(strncmp(line.data(),"Path=",strlen("Path=")) == 0)
|
||||
if(strncmp(line.c_str(),"Path=",strlen("Path=")) == 0)
|
||||
{
|
||||
unsigned short l = strlen("Path=");
|
||||
pCKP->GameData[pCKP->numGames-1].DataDirectory = line.substr(l);
|
||||
|
||||
Reference in New Issue
Block a user