Пример #1
0
long GuiRenderer::colourToOGL(const CEGUI::colour& col) const
{
    CEGUI::ulong cval;
    cval =  (static_cast<CEGUI::ulong>(255 * col.getAlpha())) << 24;
    cval |= (static_cast<CEGUI::ulong>(255 * col.getBlue())) << 16;
    cval |= (static_cast<CEGUI::ulong>(255 * col.getGreen())) << 8;
    cval |= (static_cast<CEGUI::ulong>(255 * col.getRed()));

    return cval;
}
Пример #2
0
bool CGUIListItem_Impl::GetColor ( unsigned char & ucRed, unsigned char & ucGreen, unsigned char & ucBlue, unsigned char & ucAlpha )
{
    if ( ItemType == TextItem )
    {
        CEGUI::colour color = reinterpret_cast < CEGUI::ListboxTextItem* > ( m_pListItem )->getTextColours ().d_top_left;
        ucRed = static_cast < unsigned char > ( color.getRed () * 255 );
        ucGreen = static_cast < unsigned char > ( color.getGreen () * 255 );
        ucBlue = static_cast < unsigned char > ( color.getBlue () * 255 );
        ucAlpha = static_cast < unsigned char > ( color.getAlpha () * 255 );
        return true;
    }
    else if ( ItemType == NumberItem )
    {
        CEGUI::colour color = reinterpret_cast < CEGUI::ListboxNumberItem* > ( m_pListItem )->getTextColours ().d_top_left;
        ucRed = static_cast < unsigned char > ( color.getRed () * 255 );
        ucGreen = static_cast < unsigned char > ( color.getGreen () * 255 );
        ucBlue = static_cast < unsigned char > ( color.getBlue () * 255 );
        ucAlpha = static_cast < unsigned char > ( color.getAlpha () * 255 );
        return true;
    }
    return false;
}