Ejemplo n.º 1
0
void NumberControl::processRender(const GsRect<float> &RectDispCoordFloat)
{
    // Transform to the display coordinates
    GsRect<float> displayRect = mRect;
    displayRect.transform(RectDispCoordFloat);
    SDL_Rect lRect = displayRect.SDLRect();

    GsWeakSurface blitsfc(gVideoDriver.getBlitSurface());

    if(!mEnabled)
    {
        mTextDisabledSfc.blitTo(blitsfc, lRect);
    }
    else
    {
        if(mHovered)
        {
            if(mDecSel)
                mTextLightSfcL.blitTo(blitsfc, lRect);
            else if(mIncSel)
                mTextLightSfcR.blitTo(blitsfc, lRect);
            else
                mTextLightSfc.blitTo(blitsfc, lRect);
        }
        else // Button is not hovered
        {
            mTextDarkSfc.blitTo(blitsfc, lRect);
        }
    }

    drawBlinker(lRect);
}
Ejemplo n.º 2
0
void GalaxyButton::processRender(const GsRect<float> &RectDispCoordFloat)
{
    // Transform to the display coordinates
    GsRect<float> displayRect = mRect;
    displayRect.transform(RectDispCoordFloat);
    SDL_Rect lRect = displayRect.SDLRect();

    GsWeakSurface blitsfc( gVideoDriver.getBlitSurface() );

    if(!mEnabled)
    {
        mTextDisabledSfc.blitTo(blitsfc, lRect);
    }
    else
    {
        drawEnabledButton(blitsfc, lRect, mHovered);
    }

    drawBlinker(lRect);
}
Ejemplo n.º 3
0
void CGUIButton::drawGalaxyStyle(SDL_Rect& lRect)
{
	SDL_Surface *blitsfc = g_pVideoDriver->getBlitSurface();

	if(!mEnabled)
	{
		SDL_BlitSurface(mpTextDisabledSfc.get(), NULL, blitsfc, &lRect);
	}
	else
	{
		if(mHovered)
		{
			SDL_BlitSurface(mpTextLightSfc.get(), NULL, blitsfc, &lRect);
		}
		else // Button is not hovered
		{
			SDL_BlitSurface(mpTextDarkSfc.get(), NULL, blitsfc, &lRect);
		}
	}

	drawBlinker(lRect);
}
Ejemplo n.º 4
0
int main(void)
{
    // Setup

    // init I/Os
    DDRB |= (1 << PB1) | (1 << PB2) | (1 << PB3) | (1 << PB4) | (1 << PB0);
    PORTB |= (1 << PB1) | (1 << PB2) | (1 << PB3) | (1 << PB4) | (1 << PB0);
  
    // clear framebuffer
    for (uint8_t i = 0; i < 64; i++) {
        framebuffer[i] = 0x00;
    }
    
    drawDigit(0,0);
    drawDigit(0,1);
    drawDigit(0,2);
    drawDigit(0,3);

    drawBlinker(1);

    // Loop

    while (1)
    {
        // scan all rows
        uint8_t rowAddr = 1;
        //uint8_t bufferPos = 0;

        uint8_t* p = &framebuffer[0];

        // On
        
        for (char row = 0; row < 8; row++)
        {
            for (char bank = 3; bank >= 0; bank--)
            {
                // set a pixel bank
                MODE_B;
                clock_byte_lsb_first(bank);
                
                // load 16 pixels per board
                MODE_A;
                STROBE_HIGH;
            
                clock_byte_lsb_first(p[1]);
                clock_byte_lsb_first(p[0]);
     
                _delay_us(25);
           
                p += 2;
            }
            
            // select row
            MODE_B;
            clock_byte_lsb_first(rowAddr);
            STROBE_LOW;
            MODE_A;
            
            rowAddr = rowAddr << 1;
        }
    }
    
    return 0;
}