mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-24 07:46:20 +00:00
Fixed: build_interface currently only works with 32 bits bitmaps
This commit is contained in:
parent
8f7a050a9e
commit
f63f7acfbd
1 changed files with 11 additions and 3 deletions
|
@ -258,16 +258,24 @@ int main(int nNbArg, char **ppArgs)
|
||||||
AllMaps.resize( mapSize );
|
AllMaps.resize( mapSize );
|
||||||
for(sint i = 0; i < mapSize; ++i )
|
for(sint i = 0; i < mapSize; ++i )
|
||||||
{
|
{
|
||||||
|
NLMISC::CBitmap *pBtmp = NULL;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
NLMISC::CBitmap *pBtmp = new NLMISC::CBitmap;
|
pBtmp = new NLMISC::CBitmap;
|
||||||
NLMISC::CIFile inFile;
|
NLMISC::CIFile inFile;
|
||||||
inFile.open( AllMapNames[i] );
|
if (!inFile.open( AllMapNames[i] )) throw NLMISC::Exception("Unable to open " + AllMapNames[i]);
|
||||||
pBtmp->load(inFile);
|
|
||||||
|
uint8 colors = pBtmp->load(inFile);
|
||||||
|
|
||||||
|
if (colors != 32) throw NLMISC::Exception(AllMapNames[i] + " is using " + toString(colors) + " bits colors, only 32 bit supported!");
|
||||||
|
|
||||||
AllMaps[i] = pBtmp;
|
AllMaps[i] = pBtmp;
|
||||||
}
|
}
|
||||||
catch (const NLMISC::Exception &e)
|
catch (const NLMISC::Exception &e)
|
||||||
{
|
{
|
||||||
|
if (pBtmp) delete pBtmp;
|
||||||
|
|
||||||
outString (string("ERROR :") + e.what());
|
outString (string("ERROR :") + e.what());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue