Added support for enum's in the Lua script integration

This commit is contained in:
Robert Osfield
2014-02-08 10:39:20 +00:00
parent 8eae4b0381
commit 1319c2d281
3 changed files with 28 additions and 2 deletions

View File

@@ -145,6 +145,8 @@ public:
virtual bool write( OutputStream&, const osg::Object& ) = 0;
virtual const std::string& getName() const = 0;
virtual IntLookup* getIntLookup() { return 0; }
protected:
int _firstVersion; // Library version when the serializer is first introduced
int _lastVersion; // Library version when the serializer is last required.
@@ -654,6 +656,8 @@ public:
EnumSerializer( const char* name, P def, Getter gf, Setter sf )
: ParentType(name, def), _getter(gf), _setter(sf) {}
virtual IntLookup* getIntLookup() { return &_lookup; }
void add( const char* str, P value )
{ _lookup.add(str, static_cast<IntLookup::Value>(value)); }