Improve decode_bin output slightly.

This commit is contained in:
James Turner 2012-09-30 16:44:22 +01:00
parent 7bcf02a0b4
commit f7a87789ab
2 changed files with 7 additions and 2 deletions

View File

@ -13,6 +13,7 @@
#include <cstdio>
#include "sg_binobj.hxx"
#include <simgear/debug/logstream.hxx>
using std::cout;
using std::endl;
@ -25,6 +26,9 @@ int main( int argc, char **argv ) {
if ( argc != 2 ) {
cout << "Usage: " << argv[0] << " binary_obj_file" << endl;
}
sglog().setLogLevels( SG_ALL, SG_ALERT );
SGBinObject obj;
bool result = obj.read_bin( argv[1] );

View File

@ -423,10 +423,11 @@ bool SGBinObject::read_bin( const string& file ) {
} else {
// close the file before we return
gzclose(fp);
SG_LOG( SG_EVENT, SG_ALERT,
"ERROR: " << file << "has bad header");
return false;
}
// read creation time
unsigned int foo_calendar_time;
sgReadUInt( fp, &foo_calendar_time );