- fbx: extend list of supported property data types.

pull/14/head
Alexander Gessler 2012-08-11 01:59:10 +02:00
parent 391a69e68b
commit 1bdf39448a
1 changed files with 6 additions and 2 deletions

View File

@ -82,7 +82,7 @@ Property* ReadTypedProperty(const Element& element)
if (!strcmp(cs,"KString")) { if (!strcmp(cs,"KString")) {
return new TypedProperty<std::string>(ParseTokenAsString(*tok[4])); return new TypedProperty<std::string>(ParseTokenAsString(*tok[4]));
} }
else if (!strcmp(cs,"bool")) { else if (!strcmp(cs,"bool") || !strcmp(cs,"Bool")) {
return new TypedProperty<bool>(ParseTokenAsInt(*tok[4]) != 0); return new TypedProperty<bool>(ParseTokenAsInt(*tok[4]) != 0);
} }
else if (!strcmp(cs,"int") || !strcmp(cs,"enum")) { else if (!strcmp(cs,"int") || !strcmp(cs,"enum")) {
@ -105,12 +105,13 @@ Property* ReadTypedProperty(const Element& element)
ParseTokenAsFloat(*tok[6])) ParseTokenAsFloat(*tok[6]))
); );
} }
else if (!strcmp(cs,"double") || !strcmp(cs,"Number") || !strcmp(cs,"KTime")) { else if (!strcmp(cs,"double") || !strcmp(cs,"Number") || !strcmp(cs,"KTime") || !strcmp(cs,"Float")) {
return new TypedProperty<float>(ParseTokenAsFloat(*tok[4])); return new TypedProperty<float>(ParseTokenAsFloat(*tok[4]));
} }
return NULL; return NULL;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// peek into an element and check if it contains a FBX property, if so return its name. // peek into an element and check if it contains a FBX property, if so return its name.
std::string PeekPropertyName(const Element& element) std::string PeekPropertyName(const Element& element)
@ -134,6 +135,7 @@ PropertyTable::PropertyTable()
{ {
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
PropertyTable::PropertyTable(const Element& element, boost::shared_ptr<const PropertyTable> templateProps) PropertyTable::PropertyTable(const Element& element, boost::shared_ptr<const PropertyTable> templateProps)
: templateProps(templateProps) : templateProps(templateProps)
@ -162,6 +164,7 @@ PropertyTable::PropertyTable(const Element& element, boost::shared_ptr<const Pro
} }
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
PropertyTable::~PropertyTable() PropertyTable::~PropertyTable()
{ {
@ -170,6 +173,7 @@ PropertyTable::~PropertyTable()
} }
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
const Property* PropertyTable::Get(const std::string& name) const const Property* PropertyTable::Get(const std::string& name) const
{ {