On Tuesday 19 August 2003 14:09, Falk Hueffner wrote:
> Will Newton <[EMAIL PROTECTED]> writes:
> > A package I maintain (aqsis) no longer builds with gcc 3.3 as the default
> > compiler. The error given is:
> >
> > shaderstack.h: In function `void Aqsis::OpCAST(A&, B&,
> > Aqsis::IqShaderData*, Aqsis::IqShaderData*, Aqsis::CqBitVector&) [with A
> > = TqFloat, B = Aqsis::CqColor]':
> > shadervm1.cpp:277:   instantiated from here
> > shaderstack.h:543: error: invalid static_cast from type `float' to type `
> >    Aqsis::CqColor'
>
> What type is Aqsis::CqColor?

A class representing a color, coded as you might expect, as a vector of three 
float values. It doesn't have a (float) constructor but this code does 
compile with gcc 3.2. I'm not sure how it could, but my C++ is a bit rusty.

The constructors are:

                /// Default constructor.
                CqColor() : m_fRed( 0.0f ), m_fGreen( 0.0f ), m_fBlue( 0.0f )
                {}
                /** Component constructor
                 * \param fRed red component 0.0-1.0
                 * \param fGreen green component 0.0-1.0
                 * \param fBlue blue component 0.0-1.0
                 */
                CqColor( TqFloat fRed, TqFloat fGreen, TqFloat fBlue ) :
                                m_fRed( fRed ),
                                m_fGreen( fGreen ),
                                m_fBlue( fBlue )
                {}
                /** 3D vector constructor.
                 * \param From the vector to copy the component values from.
                 */
                CqColor( const CqVector3D& From )
                {
                        *this = From;
                }
                /** Array component constructor.
                 * \param From array of floats to use as the components.
                 */
                CqColor( const TqFloat From[ 3 ] ) :
                                m_fRed( From[ 0 ] ),
                                m_fGreen( From[ 1 ] ),
                                m_fBlue( From[ 2 ] )


Reply via email to