- more detailed error handling for bad textures and/or models and sounds

This commit is contained in:
Mark Vejvoda
2012-11-11 04:52:26 +00:00
parent 8ba5524f35
commit 1966710628
6 changed files with 166 additions and 304 deletions

View File

@@ -20,7 +20,6 @@ using std::runtime_error;
namespace Shared{ namespace Graphics{
/**Copied from pixmap.cpp*/
// =====================================================
// Structs used for BMP-reading
// =====================================================
@@ -91,7 +90,7 @@ Pixmap2D* BMPReader::read(ifstream& in, const string& path, Pixmap2D* ret) const
}
if(fileHeader.type1!='B' || fileHeader.type2!='M'){
throw megaglest_runtime_error(path +" is not a bitmap");
throw megaglest_runtime_error(path +" is not a bitmap",true);
}
//read info header
@@ -112,7 +111,7 @@ Pixmap2D* BMPReader::read(ifstream& in, const string& path, Pixmap2D* ret) const
}
if(infoHeader.bitCount!=24){
throw megaglest_runtime_error(path+" is not a 24 bit bitmap");
throw megaglest_runtime_error(path+" is not a 24 bit bitmap",true);
}
int h= infoHeader.height;