OpenGEX: fix coverity findings.
parent
d6ecc8b621
commit
210182b17a
|
@ -133,7 +133,7 @@ namespace Grammar {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int isValidMetricType( const char *token ) {
|
static int isValidMetricType( const char *token ) {
|
||||||
if( NULL == token ) {
|
if( nullptr == token ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,8 +165,7 @@ namespace Grammar {
|
||||||
return CameraNodeToken;
|
return CameraNodeToken;
|
||||||
} else if ( LightNodeType == tokenType ) {
|
} else if ( LightNodeType == tokenType ) {
|
||||||
return LightNodeToken;
|
return LightNodeToken;
|
||||||
}
|
} else if ( GeometryObjectType == tokenType ) {
|
||||||
else if ( GeometryObjectType == tokenType ) {
|
|
||||||
return GeometryObjectToken;
|
return GeometryObjectToken;
|
||||||
} else if ( CameraObjectType == tokenType ) {
|
} else if ( CameraObjectType == tokenType ) {
|
||||||
return CameraObjectToken;
|
return CameraObjectToken;
|
||||||
|
@ -205,11 +204,11 @@ USE_ODDLPARSER_NS
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
static void propId2StdString( Property *prop, std::string &name, std::string &key ) {
|
static void propId2StdString( Property *prop, std::string &name, std::string &key ) {
|
||||||
name = key = "";
|
name = key = "";
|
||||||
if ( NULL == prop ) {
|
if ( nullptr == prop ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( NULL != prop->m_key ) {
|
if ( nullptr != prop->m_key ) {
|
||||||
name = prop->m_key->m_buffer;
|
name = prop->m_key->m_buffer;
|
||||||
if ( Value::ddl_string == prop->m_value->m_type ) {
|
if ( Value::ddl_string == prop->m_value->m_type ) {
|
||||||
key = prop->m_value->getString();
|
key = prop->m_value->getString();
|
||||||
|
@ -220,9 +219,9 @@ static void propId2StdString( Property *prop, std::string &name, std::string &ke
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
OpenGEXImporter::VertexContainer::VertexContainer()
|
OpenGEXImporter::VertexContainer::VertexContainer()
|
||||||
: m_numVerts( 0 )
|
: m_numVerts( 0 )
|
||||||
, m_vertices(NULL)
|
, m_vertices( nullptr )
|
||||||
, m_numNormals( 0 )
|
, m_numNormals( 0 )
|
||||||
, m_normals(NULL)
|
, m_normals( nullptr )
|
||||||
, m_numUVComps()
|
, m_numUVComps()
|
||||||
, m_textureCoords()
|
, m_textureCoords()
|
||||||
{
|
{
|
||||||
|
@ -254,17 +253,17 @@ OpenGEXImporter::RefInfo::~RefInfo() {
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
OpenGEXImporter::OpenGEXImporter()
|
OpenGEXImporter::OpenGEXImporter()
|
||||||
: m_root( NULL )
|
: m_root( nullptr )
|
||||||
, m_nodeChildMap()
|
, m_nodeChildMap()
|
||||||
, m_meshCache()
|
, m_meshCache()
|
||||||
, m_mesh2refMap()
|
, m_mesh2refMap()
|
||||||
, m_ctx( NULL )
|
, m_ctx( nullptr )
|
||||||
, m_metrics()
|
, m_metrics()
|
||||||
, m_currentNode( NULL )
|
, m_currentNode( nullptr )
|
||||||
, m_currentVertices()
|
, m_currentVertices()
|
||||||
, m_currentMesh( NULL )
|
, m_currentMesh( nullptr )
|
||||||
, m_currentMaterial( NULL )
|
, m_currentMaterial( nullptr )
|
||||||
, m_currentLight( NULL )
|
, m_currentLight( nullptr )
|
||||||
, m_currentCamera( nullptr )
|
, m_currentCamera( nullptr )
|
||||||
, m_tokenType( Grammar::NoneType )
|
, m_tokenType( Grammar::NoneType )
|
||||||
, m_materialCache()
|
, m_materialCache()
|
||||||
|
@ -328,14 +327,14 @@ const aiImporterDesc *OpenGEXImporter::GetInfo() const {
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void OpenGEXImporter::SetupProperties( const Importer *pImp ) {
|
void OpenGEXImporter::SetupProperties( const Importer *pImp ) {
|
||||||
if( NULL == pImp ) {
|
if( nullptr == pImp ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void OpenGEXImporter::handleNodes( DDLNode *node, aiScene *pScene ) {
|
void OpenGEXImporter::handleNodes( DDLNode *node, aiScene *pScene ) {
|
||||||
if( NULL == node ) {
|
if( nullptr == node ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,7 +425,7 @@ void OpenGEXImporter::handleNodes( DDLNode *node, aiScene *pScene ) {
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void OpenGEXImporter::handleMetricNode( DDLNode *node, aiScene *pScene ) {
|
void OpenGEXImporter::handleMetricNode( DDLNode *node, aiScene *pScene ) {
|
||||||
if( NULL == node || NULL == m_ctx ) {
|
if( nullptr == node || nullptr == m_ctx ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,14 +434,14 @@ void OpenGEXImporter::handleMetricNode( DDLNode *node, aiScene *pScene ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Property *prop( node->getProperties() );
|
Property *prop( node->getProperties() );
|
||||||
while( NULL != prop ) {
|
while( nullptr != prop ) {
|
||||||
if( NULL != prop->m_key ) {
|
if( nullptr != prop->m_key ) {
|
||||||
if( Value::ddl_string == prop->m_value->m_type ) {
|
if( Value::ddl_string == prop->m_value->m_type ) {
|
||||||
std::string valName( ( char* ) prop->m_value->m_data );
|
std::string valName( ( char* ) prop->m_value->m_data );
|
||||||
int type( Grammar::isValidMetricType( valName.c_str() ) );
|
int type( Grammar::isValidMetricType( valName.c_str() ) );
|
||||||
if( Grammar::NoneType != type ) {
|
if( Grammar::NoneType != type ) {
|
||||||
Value *val( node->getValue() );
|
Value *val( node->getValue() );
|
||||||
if( NULL != val ) {
|
if( nullptr != val ) {
|
||||||
if( Value::ddl_float == val->m_type ) {
|
if( Value::ddl_float == val->m_type ) {
|
||||||
m_metrics[ type ].m_floatValue = val->getFloat();
|
m_metrics[ type ].m_floatValue = val->getFloat();
|
||||||
} else if( Value::ddl_int32 == val->m_type ) {
|
} else if( Value::ddl_int32 == val->m_type ) {
|
||||||
|
@ -489,10 +488,10 @@ static void getRefNames( DDLNode *node, std::vector<std::string> &names ) {
|
||||||
ai_assert( NULL != node );
|
ai_assert( NULL != node );
|
||||||
|
|
||||||
Reference *ref = node->getReferences();
|
Reference *ref = node->getReferences();
|
||||||
if( NULL != ref ) {
|
if( nullptr != ref ) {
|
||||||
for( size_t i = 0; i < ref->m_numRefs; i++ ) {
|
for( size_t i = 0; i < ref->m_numRefs; i++ ) {
|
||||||
Name *currentName( ref->m_referencedName[ i ] );
|
Name *currentName( ref->m_referencedName[ i ] );
|
||||||
if( NULL != currentName && NULL != currentName->m_id ) {
|
if( nullptr != currentName && nullptr != currentName->m_id ) {
|
||||||
const std::string name( currentName->m_id->m_buffer );
|
const std::string name( currentName->m_id->m_buffer );
|
||||||
if( !name.empty() ) {
|
if( !name.empty() ) {
|
||||||
names.push_back( name );
|
names.push_back( name );
|
||||||
|
@ -504,7 +503,7 @@ static void getRefNames( DDLNode *node, std::vector<std::string> &names ) {
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void OpenGEXImporter::handleObjectRefNode( DDLNode *node, aiScene *pScene ) {
|
void OpenGEXImporter::handleObjectRefNode( DDLNode *node, aiScene *pScene ) {
|
||||||
if( NULL == m_currentNode ) {
|
if( nullptr == m_currentNode ) {
|
||||||
throw DeadlyImportError( "No parent node for name." );
|
throw DeadlyImportError( "No parent node for name." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -524,7 +523,7 @@ void OpenGEXImporter::handleObjectRefNode( DDLNode *node, aiScene *pScene ) {
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void OpenGEXImporter::handleMaterialRefNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
void OpenGEXImporter::handleMaterialRefNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
||||||
if( NULL == m_currentNode ) {
|
if( nullptr == m_currentNode ) {
|
||||||
throw DeadlyImportError( "No parent node for name." );
|
throw DeadlyImportError( "No parent node for name." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -603,7 +602,7 @@ void OpenGEXImporter::handleLightObject( ODDLParser::DDLNode *node, aiScene *pSc
|
||||||
|
|
||||||
Property *prop( node->findPropertyByName( "type" ) );
|
Property *prop( node->findPropertyByName( "type" ) );
|
||||||
if ( nullptr != prop ) {
|
if ( nullptr != prop ) {
|
||||||
if ( NULL != prop->m_value ) {
|
if ( nullptr != prop->m_value ) {
|
||||||
std::string typeStr( prop->m_value->getString() );
|
std::string typeStr( prop->m_value->getString() );
|
||||||
if ( "point" == typeStr ) {
|
if ( "point" == typeStr ) {
|
||||||
m_currentLight->mType = aiLightSource_POINT;
|
m_currentLight->mType = aiLightSource_POINT;
|
||||||
|
@ -621,14 +620,14 @@ void OpenGEXImporter::handleLightObject( ODDLParser::DDLNode *node, aiScene *pSc
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
static void setMatrix( aiNode *node, DataArrayList *transformData ) {
|
static void setMatrix( aiNode *node, DataArrayList *transformData ) {
|
||||||
ai_assert( NULL != node );
|
ai_assert( nullptr != node );
|
||||||
ai_assert( NULL != transformData );
|
ai_assert( nullptr != transformData );
|
||||||
|
|
||||||
float m[ 16 ];
|
float m[ 16 ];
|
||||||
size_t i( 1 );
|
size_t i( 1 );
|
||||||
Value *next( transformData->m_dataList->m_next );
|
Value *next( transformData->m_dataList->m_next );
|
||||||
m[ 0 ] = transformData->m_dataList->getFloat();
|
m[ 0 ] = transformData->m_dataList->getFloat();
|
||||||
while( next != NULL ) {
|
while( next != nullptr ) {
|
||||||
m[ i ] = next->getFloat();
|
m[ i ] = next->getFloat();
|
||||||
next = next->m_next;
|
next = next->m_next;
|
||||||
i++;
|
i++;
|
||||||
|
@ -657,13 +656,13 @@ static void setMatrix( aiNode *node, DataArrayList *transformData ) {
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void OpenGEXImporter::handleTransformNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
void OpenGEXImporter::handleTransformNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
||||||
if( NULL == m_currentNode ) {
|
if( nullptr == m_currentNode ) {
|
||||||
throw DeadlyImportError( "No parent node for name." );
|
throw DeadlyImportError( "No parent node for name." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataArrayList *transformData( node->getDataArrayList() );
|
DataArrayList *transformData( node->getDataArrayList() );
|
||||||
if( NULL != transformData ) {
|
if( nullptr != transformData ) {
|
||||||
if( transformData->m_numItems != 16 ) {
|
if( transformData->m_numItems != 16 ) {
|
||||||
throw DeadlyImportError( "Invalid number of data for transform matrix." );
|
throw DeadlyImportError( "Invalid number of data for transform matrix." );
|
||||||
return;
|
return;
|
||||||
|
@ -679,7 +678,7 @@ void OpenGEXImporter::handleMeshNode( ODDLParser::DDLNode *node, aiScene *pScene
|
||||||
m_meshCache.push_back( m_currentMesh );
|
m_meshCache.push_back( m_currentMesh );
|
||||||
|
|
||||||
Property *prop = node->getProperties();
|
Property *prop = node->getProperties();
|
||||||
if( NULL != prop ) {
|
if( nullptr != prop ) {
|
||||||
std::string propName, propKey;
|
std::string propName, propKey;
|
||||||
propId2StdString( prop, propName, propKey );
|
propId2StdString( prop, propName, propKey );
|
||||||
if( "primitive" == propName ) {
|
if( "primitive" == propName ) {
|
||||||
|
@ -700,7 +699,7 @@ void OpenGEXImporter::handleMeshNode( ODDLParser::DDLNode *node, aiScene *pScene
|
||||||
handleNodes( node, pScene );
|
handleNodes( node, pScene );
|
||||||
|
|
||||||
DDLNode *parent( node->getParent() );
|
DDLNode *parent( node->getParent() );
|
||||||
if( NULL != parent ) {
|
if( nullptr != parent ) {
|
||||||
const std::string &name = parent->getName();
|
const std::string &name = parent->getName();
|
||||||
m_mesh2refMap[ name ] = meshidx;
|
m_mesh2refMap[ name ] = meshidx;
|
||||||
}
|
}
|
||||||
|
@ -716,7 +715,7 @@ enum MeshAttribute {
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
static MeshAttribute getAttributeByName( const char *attribName ) {
|
static MeshAttribute getAttributeByName( const char *attribName ) {
|
||||||
ai_assert( NULL != attribName );
|
ai_assert( nullptr != attribName );
|
||||||
|
|
||||||
if( 0 == strncmp( "position", attribName, strlen( "position" ) ) ) {
|
if( 0 == strncmp( "position", attribName, strlen( "position" ) ) ) {
|
||||||
return Position;
|
return Position;
|
||||||
|
@ -731,8 +730,8 @@ static MeshAttribute getAttributeByName( const char *attribName ) {
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
static void fillVector3( aiVector3D *vec3, Value *vals ) {
|
static void fillVector3( aiVector3D *vec3, Value *vals ) {
|
||||||
ai_assert( NULL != vec3 );
|
ai_assert( nullptr != vec3 );
|
||||||
ai_assert( NULL != vals );
|
ai_assert( nullptr != vals );
|
||||||
|
|
||||||
float x( 0.0f ), y( 0.0f ), z( 0.0f );
|
float x( 0.0f ), y( 0.0f ), z( 0.0f );
|
||||||
Value *next( vals );
|
Value *next( vals );
|
||||||
|
@ -740,7 +739,7 @@ static void fillVector3( aiVector3D *vec3, Value *vals ) {
|
||||||
next = next->m_next;
|
next = next->m_next;
|
||||||
y = next->getFloat();
|
y = next->getFloat();
|
||||||
next = next->m_next;
|
next = next->m_next;
|
||||||
if( NULL != next ) {
|
if( nullptr != next ) {
|
||||||
z = next->getFloat();
|
z = next->getFloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -750,13 +749,13 @@ static void fillVector3( aiVector3D *vec3, Value *vals ) {
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
static size_t countDataArrayListItems( DataArrayList *vaList ) {
|
static size_t countDataArrayListItems( DataArrayList *vaList ) {
|
||||||
size_t numItems( 0 );
|
size_t numItems( 0 );
|
||||||
if( NULL == vaList ) {
|
if( nullptr == vaList ) {
|
||||||
return numItems;
|
return numItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataArrayList *next( vaList );
|
DataArrayList *next( vaList );
|
||||||
while( NULL != next ) {
|
while( nullptr != next ) {
|
||||||
if( NULL != vaList->m_dataList ) {
|
if( nullptr != vaList->m_dataList ) {
|
||||||
numItems++;
|
numItems++;
|
||||||
}
|
}
|
||||||
next = next->m_next;
|
next = next->m_next;
|
||||||
|
@ -776,13 +775,13 @@ static void copyVectorArray( size_t numItems, DataArrayList *vaList, aiVector3D
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void OpenGEXImporter::handleVertexArrayNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
void OpenGEXImporter::handleVertexArrayNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
||||||
if( NULL == node ) {
|
if( nullptr == node ) {
|
||||||
throw DeadlyImportError( "No parent node for name." );
|
throw DeadlyImportError( "No parent node for name." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Property *prop( node->getProperties() );
|
Property *prop( node->getProperties() );
|
||||||
if( NULL != prop ) {
|
if( nullptr != prop ) {
|
||||||
std::string propName, propKey;
|
std::string propName, propKey;
|
||||||
propId2StdString( prop, propName, propKey );
|
propId2StdString( prop, propName, propKey );
|
||||||
MeshAttribute attribType( getAttributeByName( propKey.c_str() ) );
|
MeshAttribute attribType( getAttributeByName( propKey.c_str() ) );
|
||||||
|
@ -791,7 +790,7 @@ void OpenGEXImporter::handleVertexArrayNode( ODDLParser::DDLNode *node, aiScene
|
||||||
}
|
}
|
||||||
|
|
||||||
DataArrayList *vaList = node->getDataArrayList();
|
DataArrayList *vaList = node->getDataArrayList();
|
||||||
if( NULL == vaList ) {
|
if( nullptr == vaList ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -815,18 +814,18 @@ void OpenGEXImporter::handleVertexArrayNode( ODDLParser::DDLNode *node, aiScene
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void OpenGEXImporter::handleIndexArrayNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
void OpenGEXImporter::handleIndexArrayNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
||||||
if( NULL == node ) {
|
if( nullptr == node ) {
|
||||||
throw DeadlyImportError( "No parent node for name." );
|
throw DeadlyImportError( "No parent node for name." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( NULL == m_currentMesh ) {
|
if( nullptr == m_currentMesh ) {
|
||||||
throw DeadlyImportError( "No current mesh for index data found." );
|
throw DeadlyImportError( "No current mesh for index data found." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataArrayList *vaList = node->getDataArrayList();
|
DataArrayList *vaList = node->getDataArrayList();
|
||||||
if( NULL == vaList ) {
|
if( nullptr == vaList ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -877,7 +876,7 @@ void OpenGEXImporter::handleIndexArrayNode( ODDLParser::DDLNode *node, aiScene *
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
static void getColorRGB( aiColor3D *pColor, DataArrayList *colList ) {
|
static void getColorRGB( aiColor3D *pColor, DataArrayList *colList ) {
|
||||||
if( NULL == pColor || NULL == colList ) {
|
if( nullptr == pColor || nullptr == colList ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -901,7 +900,7 @@ enum ColorType {
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
static ColorType getColorType( Text *id ) {
|
static ColorType getColorType( Text *id ) {
|
||||||
if ( NULL == id ) {
|
if ( nullptr == id ) {
|
||||||
return NoneColor;
|
return NoneColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -928,15 +927,15 @@ void OpenGEXImporter::handleMaterialNode( ODDLParser::DDLNode *node, aiScene *pS
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void OpenGEXImporter::handleColorNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
void OpenGEXImporter::handleColorNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
||||||
if( NULL == node ) {
|
if( nullptr == node ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Property *prop = node->findPropertyByName( "attrib" );
|
Property *prop = node->findPropertyByName( "attrib" );
|
||||||
if( NULL != prop ) {
|
if( nullptr != prop ) {
|
||||||
if( NULL != prop->m_value ) {
|
if( nullptr != prop->m_value ) {
|
||||||
DataArrayList *colList( node->getDataArrayList() );
|
DataArrayList *colList( node->getDataArrayList() );
|
||||||
if( NULL == colList ) {
|
if( nullptr == colList ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
aiColor3D col;
|
aiColor3D col;
|
||||||
|
@ -957,15 +956,15 @@ void OpenGEXImporter::handleColorNode( ODDLParser::DDLNode *node, aiScene *pScen
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void OpenGEXImporter::handleTextureNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
void OpenGEXImporter::handleTextureNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
||||||
if( NULL == node ) {
|
if( nullptr == node ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Property *prop = node->findPropertyByName( "attrib" );
|
Property *prop = node->findPropertyByName( "attrib" );
|
||||||
if( NULL != prop ) {
|
if( nullptr != prop ) {
|
||||||
if( NULL != prop->m_value ) {
|
if( nullptr != prop->m_value ) {
|
||||||
Value *val( node->getValue() );
|
Value *val( node->getValue() );
|
||||||
if( NULL != val ) {
|
if( nullptr != val ) {
|
||||||
aiString tex;
|
aiString tex;
|
||||||
tex.Set( val->getString() );
|
tex.Set( val->getString() );
|
||||||
if( prop->m_value->getString() == Grammar::DiffuseTextureToken ) {
|
if( prop->m_value->getString() == Grammar::DiffuseTextureToken ) {
|
||||||
|
@ -992,24 +991,28 @@ void OpenGEXImporter::handleTextureNode( ODDLParser::DDLNode *node, aiScene *pSc
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void OpenGEXImporter::handleParamNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
void OpenGEXImporter::handleParamNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
|
||||||
if ( NULL == node ) {
|
if ( nullptr == node ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Property *prop = node->findPropertyByName( "attrib" );
|
Property *prop = node->findPropertyByName( "attrib" );
|
||||||
|
if ( nullptr == prop ) {
|
||||||
if ( nullptr != prop ) {
|
return;
|
||||||
if ( NULL != prop->m_value ) {
|
}
|
||||||
Value *val( node->getValue() );
|
|
||||||
const float floatVal( val->getFloat() );
|
if ( nullptr != prop->m_value ) {
|
||||||
if ( NULL != val && prop->m_value != NULL ) {
|
Value *val( node->getValue() );
|
||||||
if ( "fov" == prop->m_value->getString() ) {
|
if ( nullptr == val ) {
|
||||||
m_currentCamera->mHorizontalFOV = floatVal;
|
return;
|
||||||
} else if ( "near" == prop->m_value->getString() ) {
|
}
|
||||||
m_currentCamera->mClipPlaneNear = floatVal;
|
const float floatVal( val->getFloat() );
|
||||||
} else if ( "far" == prop->m_value->getString() ) {
|
if ( prop->m_value != nullptr ) {
|
||||||
m_currentCamera->mClipPlaneFar = floatVal;
|
if ( "fov" == prop->m_value->getString() ) {
|
||||||
}
|
m_currentCamera->mHorizontalFOV = floatVal;
|
||||||
|
} else if ( "near" == prop->m_value->getString() ) {
|
||||||
|
m_currentCamera->mClipPlaneNear = floatVal;
|
||||||
|
} else if ( "far" == prop->m_value->getString() ) {
|
||||||
|
m_currentCamera->mClipPlaneFar = floatVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue