Exemplo n.º 1
0
//-----------------------------------------------------------------------------
CMouseEventResult CScrollbar::onMouseExited (CPoint& where, const CButtonState& buttons)
{
	if (overlayStyle)
	{
		Animation::ITimingFunction* timingFunction = 0;
		if (getAlphaValue () == 1.f)
		{
			Animation::InterpolationTimingFunction* interpolTimingFunction = new Animation::InterpolationTimingFunction (400);
			interpolTimingFunction->addPoint (300.f/400.f, 1.f);
			timingFunction = interpolTimingFunction;
		}
		else
			timingFunction = new Animation::LinearTimingFunction (100);
		addAnimation ("AlphaValueAnimation", new Animation::AlphaValueAnimation (0.001f), timingFunction);
	}
	mouseIsInside = false;
	return kMouseEventNotHandled;
}
Exemplo n.º 2
0
bool BlendChunk::operator == (const StateChunk &other) const
{
    BlendChunk const *tother = dynamic_cast<BlendChunk const*>(&other);

    if(!tother)
        return false;

    if(tother == this)
        return true;

    if(getSrcFactor()  != tother->getSrcFactor()  ||
       getDestFactor() != tother->getDestFactor() ||
       getEquation()   != tother->getEquation()   ||
       getColor()      != tother->getColor()      ||
       getAlphaFunc()  != tother->getAlphaFunc()  ||
       getAlphaValue() != tother->getAlphaValue()   )
        return false;

    return true;
}
Exemplo n.º 3
0
//-------------------------------------------------------------
// CGLTexMgr::texColor() return color mapped into an int value
//-------------------------------------------------------------
int CGLTexMgr::texColor(double v,int options){
    double s=intensity*v;
    int h,indx;
    long value=0;
    int r=0,b=0,g=0,a=255;
    double cval,aval;

    if((options & XPARANCY) > 0){
        aval=getAlphaValue(s);
        a=(int)(255*aval)&0xff;
    }  
    cval=getColorValue(s);
    h = (int)((ncolors - 1) * cval);
    indx = (h % ncolors) * 4;
    r=(int)(255.0*colormap[indx])&0xff;
    g=(int)(255.0*colormap[indx+1])&0xff;
    b=(int)(255.0*colormap[indx+2])&0xff;
    value=(a<<24)|(b<<16)|(g<<8)|(r);
    return (int)value;
}