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:
Robert Osfield
2010-03-05 12:55:08 +00:00
parent 273420bb1c
commit 86f491e649
16 changed files with 84 additions and 107 deletions

View File

@@ -79,14 +79,16 @@ class OSG_EXPORT CullSettings
READ_BUFFER = (0x1 << 18),
NO_VARIABLES = 0x00000000,
ALL_VARIABLES = 0xFFFFFFFF
ALL_VARIABLES = 0x7FFFFFFF
};
typedef int InheritanceMask;
/** Set the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object.*/
void setInheritanceMask(unsigned int mask) { _inheritanceMask = mask; }
void setInheritanceMask(InheritanceMask mask) { _inheritanceMask = mask; }
/** Get the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object.*/
unsigned int getInheritanceMask() const { return _inheritanceMask; }
InheritanceMask getInheritanceMask() const { return _inheritanceMask; }
/** Set the local cull settings values from specified CullSettings object.*/
void setCullSettings(const CullSettings& settings);
@@ -190,7 +192,7 @@ class OSG_EXPORT CullSettings
CLUSTER_CULLING
};
typedef unsigned int CullingMode;
typedef int CullingMode;
/** Set the culling mode for the CullVisitor to use.*/
void setCullingMode(CullingMode mode) { _cullingMode = mode; applyMaskAction(CULLING_MODE); }
@@ -244,7 +246,7 @@ class OSG_EXPORT CullSettings
protected:
unsigned int _inheritanceMask;
InheritanceMask _inheritanceMask;
InheritanceMaskActionOnAttributeSetting _inheritanceMaskActionOnAttributeSetting;
ComputeNearFarMode _computeNearFar;

View File

@@ -120,7 +120,7 @@ class OSG_EXPORT CullingSet : public Referenced
typedef std::vector<ShadowVolumeOccluder> OccluderList;
typedef unsigned int Mask;
typedef int Mask;
enum MaskValues
{
@@ -140,7 +140,7 @@ class OSG_EXPORT CullingSet : public Referenced
SMALL_FEATURE_CULLING|
SHADOW_OCCLUSION_CULLING
};
void setCullingMask(Mask mask) { _mask = mask; }
Mask getCullingMask() const { return _mask; }