The game didn't allocate memory if data was in a subdir of "data". Fixed
git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@125 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
@@ -17,6 +17,7 @@ using namespace std;
|
||||
CExeFile::CExeFile(int episode, const std::string& datadirectory) {
|
||||
m_episode = episode;
|
||||
m_datadirectory = datadirectory;
|
||||
if(m_datadirectory != "") m_datadirectory += "/";
|
||||
m_data = NULL;
|
||||
}
|
||||
|
||||
@@ -29,6 +30,7 @@ bool CExeFile::readData()
|
||||
std::string filename = "data/" + m_datadirectory + "keen" + itoa(m_episode) + ".exe";
|
||||
|
||||
std::ifstream File(filename.c_str(),ios::binary);
|
||||
// TODO: If Exe-file wasn't detected, make the program quit somehow, or it crashes
|
||||
|
||||
if(!File) return false;
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ CPatcher::CPatcher(int episode, int version,unsigned char *data, const std::stri
|
||||
m_version = version;
|
||||
m_data = data;
|
||||
m_datadirectory = datadir;
|
||||
if(m_datadirectory != "") m_datadirectory += "/";
|
||||
}
|
||||
|
||||
CPatcher::~CPatcher() {
|
||||
|
||||
@@ -96,7 +96,6 @@ bool CTileLoader::load()
|
||||
|
||||
if(!setProperOffset()) return false;
|
||||
|
||||
//TileProperty = (int**) malloc(1000*sizeof(int*));
|
||||
TileProperty = new int*[1000];
|
||||
|
||||
for(i = 0 ; i < 1000 ; i++)
|
||||
|
||||
@@ -149,7 +149,6 @@ int i,x,c;
|
||||
animtiles[AnimTileInUse[(((x<<4)+mapxstripepos)&511)>>4][y>>4]].slotinuse = 0;
|
||||
AnimTileInUse[(((x<<4)+mapxstripepos)&511)>>4][y>>4] = 0;
|
||||
}
|
||||
//if (tiles[c].isAnimated)
|
||||
if ( TileProperty[c][ANIMATION] > 1 )
|
||||
{ // we just drew an animated tile which we will now register
|
||||
|
||||
|
||||
@@ -163,9 +163,7 @@ bool loadStartMenu(stCloneKeenPlus *pCKP)
|
||||
|
||||
// Show me the games you detected!
|
||||
for( int i=0 ; i < pCKP->numGames ; i++ )
|
||||
{
|
||||
GamesMenu->addOptionText(pCKP->GameData[i].Name);
|
||||
}
|
||||
|
||||
GamesMenu->animateDialogBox(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user