Fix a static-init issue on windows

This commit is contained in:
rdb 2009-04-02 18:39:25 +00:00
parent e72e24a73d
commit b3816055dc
2 changed files with 9 additions and 2 deletions

View File

@ -59,6 +59,7 @@ DAEToEggConverter() {
_document = NULL; _document = NULL;
_table = NULL; _table = NULL;
_frame_rate = -1; _frame_rate = -1;
_error_handler = NULL;
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -79,6 +80,9 @@ DAEToEggConverter(const DAEToEggConverter &copy) :
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
DAEToEggConverter:: DAEToEggConverter::
~DAEToEggConverter() { ~DAEToEggConverter() {
if (_error_handler != NULL) {
delete _error_handler;
}
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -129,6 +133,9 @@ convert_file(const Filename &filename) {
_vertex_pools.clear(); _vertex_pools.clear();
_skeletons.clear(); _skeletons.clear();
_frame_rate = -1; _frame_rate = -1;
if (_error_handler == NULL) {
_error_handler = new FUErrorSimpleHandler;
}
// The default coordinate system is Y-up // The default coordinate system is Y-up
if (_egg_data->get_coordinate_system() == CS_default) { if (_egg_data->get_coordinate_system() == CS_default) {
@ -139,7 +146,7 @@ convert_file(const Filename &filename) {
FCollada::Initialize(); FCollada::Initialize();
_document = FCollada::LoadDocument(filename.to_os_specific().c_str()); _document = FCollada::LoadDocument(filename.to_os_specific().c_str());
if (_document == NULL) { if (_document == NULL) {
daeegg_cat.error() << "Failed to load document: " << _error_handler.GetErrorString() << endl; daeegg_cat.error() << "Failed to load document: " << _error_handler->GetErrorString() << endl;
FCollada::Release(); FCollada::Release();
return false; return false;
} }

View File

@ -59,7 +59,7 @@ private:
PT(EggTable) _table; PT(EggTable) _table;
FCDocument* _document; FCDocument* _document;
FUErrorSimpleHandler _error_handler; FUErrorSimpleHandler* _error_handler;
pmap<const string, PT(EggGroup)> _joints; pmap<const string, PT(EggGroup)> _joints;
pmap<const string, PT(EggVertexPool)> _vertex_pools; pmap<const string, PT(EggVertexPool)> _vertex_pools;
pvector<string> _skeletons; pvector<string> _skeletons;