Replaced use of unsigned int/enum mask combinations with int/enum mask combinations to avoid the need for casting enums to unsigned ints,
and to avoid associated warnings. Update wrappers to reflect these changes.
This commit is contained in:
@@ -874,7 +874,7 @@ bool SphereSegment::Spoke_computeBound(osg::BoundingBox& bbox, BoundaryAngle azA
|
||||
return true;
|
||||
}
|
||||
|
||||
void SphereSegment::setDrawMask(DrawMask dm)
|
||||
void SphereSegment::setDrawMask(int dm)
|
||||
{
|
||||
_drawMask=dm;
|
||||
dirtyAllDrawableDisplayLists();
|
||||
|
||||
@@ -84,20 +84,20 @@ protected:
|
||||
|
||||
}
|
||||
|
||||
void ShaderGenCache::setStateSet(unsigned int stateMask, osg::StateSet *stateSet)
|
||||
void ShaderGenCache::setStateSet(int stateMask, osg::StateSet *stateSet)
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||
_stateSetMap[stateMask] = stateSet;
|
||||
}
|
||||
|
||||
osg::StateSet *ShaderGenCache::getStateSet(unsigned int stateMask) const
|
||||
osg::StateSet *ShaderGenCache::getStateSet(int stateMask) const
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||
StateSetMap::const_iterator it = _stateSetMap.find(stateMask);
|
||||
return (it != _stateSetMap.end()) ? it->second.get() : 0;
|
||||
}
|
||||
|
||||
osg::StateSet *ShaderGenCache::getOrCreateStateSet(unsigned int stateMask)
|
||||
osg::StateSet *ShaderGenCache::getOrCreateStateSet(int stateMask)
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||
StateSetMap::iterator it = _stateSetMap.find(stateMask);
|
||||
@@ -110,7 +110,7 @@ osg::StateSet *ShaderGenCache::getOrCreateStateSet(unsigned int stateMask)
|
||||
return it->second.get();
|
||||
}
|
||||
|
||||
osg::StateSet *ShaderGenCache::createStateSet(unsigned int stateMask) const
|
||||
osg::StateSet *ShaderGenCache::createStateSet(int stateMask) const
|
||||
{
|
||||
osg::StateSet *stateSet = new osg::StateSet;
|
||||
osg::Program *program = new osg::Program;
|
||||
@@ -363,7 +363,7 @@ void ShaderGenVisitor::update(osg::Drawable *drawable)
|
||||
if (state->getAttribute(osg::StateAttribute::PROGRAM))
|
||||
return;
|
||||
|
||||
unsigned int stateMask = 0;
|
||||
int stateMask = 0;
|
||||
//if (state->getMode(GL_BLEND) & osg::StateAttribute::ON)
|
||||
// stateMask |= ShaderGen::BLEND;
|
||||
if (state->getMode(GL_LIGHTING) & osg::StateAttribute::ON)
|
||||
|
||||
@@ -76,7 +76,9 @@ BEGIN_ENUM_REFLECTOR(osg::CullSettings::CullingModeValues)
|
||||
I_EnumLabel(osg::CullSettings::ENABLE_ALL_CULLING);
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(unsigned int, osg::CullSettings::CullingMode)
|
||||
TYPE_NAME_ALIAS(int, osg::CullSettings::InheritanceMask)
|
||||
|
||||
TYPE_NAME_ALIAS(int, osg::CullSettings::CullingMode)
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osg::CullSettings)
|
||||
I_DeclaringFile("osg/CullSettings");
|
||||
@@ -98,14 +100,14 @@ BEGIN_VALUE_REFLECTOR(osg::CullSettings)
|
||||
__void__setDefaults,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setInheritanceMask, IN, unsigned int, mask,
|
||||
I_Method1(void, setInheritanceMask, IN, osg::CullSettings::InheritanceMask, mask,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setInheritanceMask__unsigned_int,
|
||||
__void__setInheritanceMask__InheritanceMask,
|
||||
"Set the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object. ",
|
||||
"");
|
||||
I_Method0(unsigned int, getInheritanceMask,
|
||||
I_Method0(osg::CullSettings::InheritanceMask, getInheritanceMask,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getInheritanceMask,
|
||||
__InheritanceMask__getInheritanceMask,
|
||||
"Get the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object. ",
|
||||
"");
|
||||
I_Method1(void, setCullSettings, IN, const osg::CullSettings &, settings,
|
||||
@@ -318,9 +320,9 @@ BEGIN_VALUE_REFLECTOR(osg::CullSettings)
|
||||
I_SimpleProperty(bool, ImpostorsActive,
|
||||
__bool__getImpostorsActive,
|
||||
__void__setImpostorsActive__bool);
|
||||
I_SimpleProperty(unsigned int, InheritanceMask,
|
||||
__unsigned_int__getInheritanceMask,
|
||||
__void__setInheritanceMask__unsigned_int);
|
||||
I_SimpleProperty(osg::CullSettings::InheritanceMask, InheritanceMask,
|
||||
__InheritanceMask__getInheritanceMask,
|
||||
__void__setInheritanceMask__InheritanceMask);
|
||||
I_SimpleProperty(osg::CullSettings::InheritanceMaskActionOnAttributeSetting, InheritanceMaskActionOnAttributeSetting,
|
||||
__InheritanceMaskActionOnAttributeSetting__getInheritanceMaskActionOnAttributeSetting,
|
||||
__void__setInheritanceMaskActionOnAttributeSetting__InheritanceMaskActionOnAttributeSetting);
|
||||
|
||||
@@ -49,7 +49,7 @@ TYPE_NAME_ALIAS(std::vector< osg::CullingSet::StateFrustumPair >, osg::CullingSe
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< osg::ShadowVolumeOccluder >, osg::CullingSet::OccluderList)
|
||||
|
||||
TYPE_NAME_ALIAS(unsigned int, osg::CullingSet::Mask)
|
||||
TYPE_NAME_ALIAS(int, osg::CullingSet::Mask)
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::CullingSet)
|
||||
I_DeclaringFile("osg/CullingSet");
|
||||
|
||||
@@ -417,24 +417,24 @@ BEGIN_OBJECT_REFLECTOR(osgGA::GUIEventAdapter)
|
||||
__MouseYOrientation__getMouseYOrientation,
|
||||
"get mouse-Y orientation (mouse-Y increases upwards or downwards). ",
|
||||
"");
|
||||
I_Method1(void, setButtonMask, IN, unsigned int, mask,
|
||||
I_Method1(void, setButtonMask, IN, int, mask,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setButtonMask__unsigned_int,
|
||||
__void__setButtonMask__int,
|
||||
"set current mouse button state. ",
|
||||
"");
|
||||
I_Method0(unsigned int, getButtonMask,
|
||||
I_Method0(int, getButtonMask,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getButtonMask,
|
||||
__int__getButtonMask,
|
||||
"get current mouse button state. ",
|
||||
"");
|
||||
I_Method1(void, setModKeyMask, IN, unsigned int, mask,
|
||||
I_Method1(void, setModKeyMask, IN, int, mask,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setModKeyMask__unsigned_int,
|
||||
__void__setModKeyMask__int,
|
||||
"set modifier key mask. ",
|
||||
"");
|
||||
I_Method0(unsigned int, getModKeyMask,
|
||||
I_Method0(int, getModKeyMask,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getModKeyMask,
|
||||
__int__getModKeyMask,
|
||||
"get modifier key mask. ",
|
||||
"");
|
||||
I_Method1(void, setScrollingMotion, IN, osgGA::GUIEventAdapter::ScrollingMotion, motion,
|
||||
@@ -524,9 +524,9 @@ BEGIN_OBJECT_REFLECTOR(osgGA::GUIEventAdapter)
|
||||
I_SimpleProperty(int, Button,
|
||||
__int__getButton,
|
||||
__void__setButton__int);
|
||||
I_SimpleProperty(unsigned int, ButtonMask,
|
||||
__unsigned_int__getButtonMask,
|
||||
__void__setButtonMask__unsigned_int);
|
||||
I_SimpleProperty(int, ButtonMask,
|
||||
__int__getButtonMask,
|
||||
__void__setButtonMask__int);
|
||||
I_SimpleProperty(osgGA::GUIEventAdapter::EventType, EventType,
|
||||
__EventType__getEventType,
|
||||
__void__setEventType__EventType);
|
||||
@@ -539,9 +539,9 @@ BEGIN_OBJECT_REFLECTOR(osgGA::GUIEventAdapter)
|
||||
I_SimpleProperty(int, Key,
|
||||
__int__getKey,
|
||||
__void__setKey__int);
|
||||
I_SimpleProperty(unsigned int, ModKeyMask,
|
||||
__unsigned_int__getModKeyMask,
|
||||
__void__setModKeyMask__unsigned_int);
|
||||
I_SimpleProperty(int, ModKeyMask,
|
||||
__int__getModKeyMask,
|
||||
__void__setModKeyMask__int);
|
||||
I_SimpleProperty(osgGA::GUIEventAdapter::MouseYOrientation, MouseYOrientation,
|
||||
__MouseYOrientation__getMouseYOrientation,
|
||||
__void__setMouseYOrientation__MouseYOrientation);
|
||||
|
||||
@@ -320,13 +320,6 @@ BEGIN_ENUM_REFLECTOR(osgPresentation::SlideEventHandler::WhichPosition)
|
||||
I_EnumLabel(osgPresentation::SlideEventHandler::LAST_POSITION);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_ENUM_REFLECTOR(osgPresentation::SlideEventHandler::ObjectMask)
|
||||
I_DeclaringFile("osgPresentation/SlideEventHandler");
|
||||
I_EnumLabel(osgPresentation::SlideEventHandler::MOVIE);
|
||||
I_EnumLabel(osgPresentation::SlideEventHandler::OBJECTS);
|
||||
I_EnumLabel(osgPresentation::SlideEventHandler::ALL_OBJECTS);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgPresentation::SlideEventHandler)
|
||||
I_DeclaringFile("osgPresentation/SlideEventHandler");
|
||||
I_BaseType(osgGA::GUIEventHandler);
|
||||
|
||||
@@ -22,16 +22,6 @@
|
||||
#undef OUT
|
||||
#endif
|
||||
|
||||
BEGIN_ENUM_REFLECTOR(osgSim::ObjectRecordData::Flags)
|
||||
I_DeclaringFile("osgSim/ObjectRecordData");
|
||||
I_EnumLabel(osgSim::ObjectRecordData::DONT_DISPLAY_IN_DAYLIGHT);
|
||||
I_EnumLabel(osgSim::ObjectRecordData::DONT_DISPLAY_AT_DUSK);
|
||||
I_EnumLabel(osgSim::ObjectRecordData::DONT_DISPLAY_AT_NIGHT);
|
||||
I_EnumLabel(osgSim::ObjectRecordData::DONT_ILLUMINATE);
|
||||
I_EnumLabel(osgSim::ObjectRecordData::FLAT_SHADED);
|
||||
I_EnumLabel(osgSim::ObjectRecordData::GROUPS_SHADOW_OBJECT);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgSim::ObjectRecordData)
|
||||
I_DeclaringFile("osgSim/ObjectRecordData");
|
||||
I_BaseType(osg::Object);
|
||||
|
||||
@@ -108,14 +108,14 @@ BEGIN_OBJECT_REFLECTOR(osgSim::SphereSegment)
|
||||
__int__getDensity,
|
||||
"Get the density of the sphere segment. ",
|
||||
"");
|
||||
I_Method1(void, setDrawMask, IN, osgSim::SphereSegment::DrawMask, dm,
|
||||
I_Method1(void, setDrawMask, IN, int, dm,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setDrawMask__DrawMask,
|
||||
__void__setDrawMask__int,
|
||||
"Specify the DrawMask. ",
|
||||
" param dm Bitmask specifying which parts of the sphere segment should be drawn. see DrawMask ");
|
||||
I_Method0(osgSim::SphereSegment::DrawMask, getDrawMask,
|
||||
I_Method0(int, getDrawMask,
|
||||
Properties::NON_VIRTUAL,
|
||||
__DrawMask__getDrawMask,
|
||||
__int__getDrawMask,
|
||||
"Get the DrawMask. ",
|
||||
"");
|
||||
I_Method1(void, setSurfaceColor, IN, const osg::Vec4 &, c,
|
||||
@@ -222,9 +222,9 @@ BEGIN_OBJECT_REFLECTOR(osgSim::SphereSegment)
|
||||
I_SimpleProperty(int, Density,
|
||||
__int__getDensity,
|
||||
__void__setDensity__int);
|
||||
I_SimpleProperty(osgSim::SphereSegment::DrawMask, DrawMask,
|
||||
__DrawMask__getDrawMask,
|
||||
__void__setDrawMask__DrawMask);
|
||||
I_SimpleProperty(int, DrawMask,
|
||||
__int__getDrawMask,
|
||||
__void__setDrawMask__int);
|
||||
I_SimpleProperty(osg::Vec4, EdgeLineColor,
|
||||
__osg_Vec4__getEdgeLineColor,
|
||||
__void__setEdgeLineColor__C5_osg_Vec4_R1);
|
||||
|
||||
@@ -32,7 +32,7 @@ BEGIN_ENUM_REFLECTOR(osgUtil::ShaderGenCache::StateMask)
|
||||
I_EnumLabel(osgUtil::ShaderGenCache::NORMAL_MAP);
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(std::map< unsigned int COMMA osg::ref_ptr< osg::StateSet > >, osgUtil::ShaderGenCache::StateSetMap)
|
||||
TYPE_NAME_ALIAS(std::map< int COMMA osg::ref_ptr< osg::StateSet > >, osgUtil::ShaderGenCache::StateSetMap)
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgUtil::ShaderGenCache)
|
||||
I_DeclaringFile("osgUtil/ShaderGen");
|
||||
@@ -40,30 +40,30 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::ShaderGenCache)
|
||||
I_Constructor0(____ShaderGenCache,
|
||||
"",
|
||||
"");
|
||||
I_Method2(void, setStateSet, IN, unsigned int, stateMask, IN, osg::StateSet *, program,
|
||||
I_Method2(void, setStateSet, IN, int, stateMask, IN, osg::StateSet *, program,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setStateSet__unsigned_int__osg_StateSet_P1,
|
||||
__void__setStateSet__int__osg_StateSet_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(osg::StateSet *, getStateSet, IN, unsigned int, stateMask,
|
||||
I_Method1(osg::StateSet *, getStateSet, IN, int, stateMask,
|
||||
Properties::NON_VIRTUAL,
|
||||
__osg_StateSet_P1__getStateSet__unsigned_int,
|
||||
__osg_StateSet_P1__getStateSet__int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(osg::StateSet *, getOrCreateStateSet, IN, unsigned int, stateMask,
|
||||
I_Method1(osg::StateSet *, getOrCreateStateSet, IN, int, stateMask,
|
||||
Properties::NON_VIRTUAL,
|
||||
__osg_StateSet_P1__getOrCreateStateSet__unsigned_int,
|
||||
__osg_StateSet_P1__getOrCreateStateSet__int,
|
||||
"",
|
||||
"");
|
||||
I_ProtectedMethod1(osg::StateSet *, createStateSet, IN, unsigned int, stateMask,
|
||||
I_ProtectedMethod1(osg::StateSet *, createStateSet, IN, int, stateMask,
|
||||
Properties::NON_VIRTUAL,
|
||||
Properties::CONST,
|
||||
__osg_StateSet_P1__createStateSet__unsigned_int,
|
||||
__osg_StateSet_P1__createStateSet__int,
|
||||
"",
|
||||
"");
|
||||
I_IndexedProperty(osg::StateSet *, StateSet,
|
||||
__osg_StateSet_P1__getStateSet__unsigned_int,
|
||||
__void__setStateSet__unsigned_int__osg_StateSet_P1,
|
||||
__osg_StateSet_P1__getStateSet__int,
|
||||
__void__setStateSet__int__osg_StateSet_P1,
|
||||
0);
|
||||
END_REFLECTOR
|
||||
|
||||
@@ -127,5 +127,5 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::ShaderGenVisitor)
|
||||
__void__setStateCache__ShaderGenCache_P1);
|
||||
END_REFLECTOR
|
||||
|
||||
STD_MAP_REFLECTOR(std::map< unsigned int COMMA osg::ref_ptr< osg::StateSet > >)
|
||||
STD_MAP_REFLECTOR(std::map< int COMMA osg::ref_ptr< osg::StateSet > >)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user