Fix filename resolution within VRML2 Inline{}

This commit is contained in:
Cirilo Bernardo
2016-04-03 10:55:22 +10:00
parent 978268250e
commit 2dfd8064d4
3 changed files with 11 additions and 2 deletions
+8
View File
@@ -133,6 +133,13 @@ SGNODE* WRL2BASE::GetInlineData( const std::string& aName )
wxFileName fn;
fn.Assign( tname );
if( fn.IsRelative() && !m_dir.empty() )
{
wxString fname = wxString::FromUTF8Unchecked( m_dir.c_str() );
fname.append( tname );
fn.Assign( fname );
}
if( !fn.Normalize() )
{
m_inlineModels.insert( std::pair< std::string, SGNODE* >( aName, NULL ) );
@@ -200,6 +207,7 @@ bool WRL2BASE::Read( WRLPROC& proc )
}
WRL2NODE* node = NULL;
m_dir = proc.GetParentDir();
while( ReadNode( proc, this, &node ) && !proc.eof() );