From Louis Hamilton, fix to LightPoint's under 64 bit build, changing longs to ints in

colour conversion code.
This commit is contained in:
Robert Osfield 2005-12-06 10:16:21 +00:00
parent 6971588592
commit 22d5390784
5 changed files with 28 additions and 28 deletions

View File

@ -108,20 +108,20 @@ class Vec4d
inline value_type a() const { return _v[3]; }
inline unsigned long asABGR() const
inline unsigned int asABGR() const
{
return (unsigned long)clampTo((_v[0]*255.0),0.0,255.0)<<24 |
(unsigned long)clampTo((_v[1]*255.0),0.0,255.0)<<16 |
(unsigned long)clampTo((_v[2]*255.0),0.0,255.0)<<8 |
(unsigned long)clampTo((_v[3]*255.0),0.0,255.0);
return (unsigned int)clampTo((_v[0]*255.0),0.0,255.0)<<24 |
(unsigned int)clampTo((_v[1]*255.0),0.0,255.0)<<16 |
(unsigned int)clampTo((_v[2]*255.0),0.0,255.0)<<8 |
(unsigned int)clampTo((_v[3]*255.0),0.0,255.0);
}
inline unsigned long asRGBA() const
inline unsigned int asRGBA() const
{
return (unsigned long)clampTo((_v[3]*255.0),0.0,255.0)<<24 |
(unsigned long)clampTo((_v[2]*255.0),0.0,255.0)<<16 |
(unsigned long)clampTo((_v[1]*255.0),0.0,255.0)<<8 |
(unsigned long)clampTo((_v[0]*255.0),0.0,255.0);
return (unsigned int)clampTo((_v[3]*255.0),0.0,255.0)<<24 |
(unsigned int)clampTo((_v[2]*255.0),0.0,255.0)<<16 |
(unsigned int)clampTo((_v[1]*255.0),0.0,255.0)<<8 |
(unsigned int)clampTo((_v[0]*255.0),0.0,255.0);
}
inline bool valid() const { return !isNaN(); }

View File

@ -103,20 +103,20 @@ class Vec4f
inline value_type b() const { return _v[2]; }
inline value_type a() const { return _v[3]; }
inline unsigned long asABGR() const
inline unsigned int asABGR() const
{
return (unsigned long)clampTo((_v[0]*255.0f),0.0f,255.0f)<<24 |
(unsigned long)clampTo((_v[1]*255.0f),0.0f,255.0f)<<16 |
(unsigned long)clampTo((_v[2]*255.0f),0.0f,255.0f)<<8 |
(unsigned long)clampTo((_v[3]*255.0f),0.0f,255.0f);
return (unsigned int)clampTo((_v[0]*255.0f),0.0f,255.0f)<<24 |
(unsigned int)clampTo((_v[1]*255.0f),0.0f,255.0f)<<16 |
(unsigned int)clampTo((_v[2]*255.0f),0.0f,255.0f)<<8 |
(unsigned int)clampTo((_v[3]*255.0f),0.0f,255.0f);
}
inline unsigned long asRGBA() const
inline unsigned int asRGBA() const
{
return (unsigned long)clampTo((_v[3]*255.0f),0.0f,255.0f)<<24 |
(unsigned long)clampTo((_v[2]*255.0f),0.0f,255.0f)<<16 |
(unsigned long)clampTo((_v[1]*255.0f),0.0f,255.0f)<<8 |
(unsigned long)clampTo((_v[0]*255.0f),0.0f,255.0f);
return (unsigned int)clampTo((_v[3]*255.0f),0.0f,255.0f)<<24 |
(unsigned int)clampTo((_v[2]*255.0f),0.0f,255.0f)<<16 |
(unsigned int)clampTo((_v[1]*255.0f),0.0f,255.0f)<<8 |
(unsigned int)clampTo((_v[0]*255.0f),0.0f,255.0f);
}
inline bool valid() const { return !isNaN(); }

View File

@ -40,18 +40,18 @@ class OSGSIM_EXPORT LightPointDrawable : public osg::Drawable
virtual const char* className() const { return "LightPointDrawable"; }
//typedef std::pair<unsigned long,osg::Vec3> ColorPosition;
//typedef std::pair<unsigned int,osg::Vec3> ColorPosition;
struct ColorPosition
{
unsigned long first;
unsigned int first;
osg::Vec3 second;
ColorPosition() {}
ColorPosition(unsigned long f,const osg::Vec3& s):first(f),second(s) {}
ColorPosition(unsigned int f,const osg::Vec3& s):first(f),second(s) {}
};
void reset();
inline unsigned long asRGBA(const osg::Vec4& color) const
inline unsigned int asRGBA(const osg::Vec4& color) const
{
return _endian==osg::BigEndian?color.asABGR():color.asRGBA();
}

View File

@ -51,8 +51,8 @@ BEGIN_VALUE_REFLECTOR(osg::Vec4d)
I_Method0(osg::Vec4d::value_type, g);
I_Method0(osg::Vec4d::value_type, b);
I_Method0(osg::Vec4d::value_type, a);
I_Method0(unsigned long, asABGR);
I_Method0(unsigned long, asRGBA);
I_Method0(unsigned int, asABGR);
I_Method0(unsigned int, asRGBA);
I_Method0(bool, valid);
I_Method0(bool, isNaN);
I_Method0(osg::Vec4d::value_type, length);

View File

@ -49,8 +49,8 @@ BEGIN_VALUE_REFLECTOR(osg::Vec4f)
I_Method0(osg::Vec4f::value_type, g);
I_Method0(osg::Vec4f::value_type, b);
I_Method0(osg::Vec4f::value_type, a);
I_Method0(unsigned long, asABGR);
I_Method0(unsigned long, asRGBA);
I_Method0(unsigned int, asABGR);
I_Method0(unsigned int, asRGBA);
I_Method0(bool, valid);
I_Method0(bool, isNaN);
I_Method0(osg::Vec4f::value_type, length);