예제 #1
0
void sim_backlight(int value)
{
#if LCD_DEPTH <= 8
    if (value > 0) {
        sdl_set_gradient(lcd_surface, &lcd_bl_color_dark,
                         &lcd_bl_color_bright, 0, NUM_SHADES);
#ifdef HAVE_LCD_SPLIT
        sdl_set_gradient(lcd_surface, &lcd_bl_color2_dark,
                         &lcd_bl_color2_bright, NUM_SHADES, NUM_SHADES);
#endif
    } else {
        sdl_set_gradient(lcd_surface, &lcd_color_dark,
                         &lcd_color_bright, 0, NUM_SHADES);
#ifdef HAVE_LCD_SPLIT
        sdl_set_gradient(lcd_surface, &lcd_color2_dark,
                         &lcd_color2_bright, NUM_SHADES, NUM_SHADES);
#endif
    }
#else /* LCD_DEPTH > 8 */
    SDL_SetAlpha(lcd_surface, SDL_SRCALPHA, (value * 255) / 100);
#endif /* LCD_DEPTH */

    sdl_gui_update(lcd_surface, 0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
                   SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
                   background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0);
}
예제 #2
0
void sim_backlight(int value)
{
#if LCD_DEPTH <= 8
    if (value > 0) {
        sdl_set_gradient(lcd_surface, &lcd_bl_color_dark,
                         &lcd_bl_color_bright, 0, NUM_SHADES);
#ifdef HAVE_LCD_SPLIT
        sdl_set_gradient(lcd_surface, &lcd_bl_color2_dark,
                         &lcd_bl_color2_bright, NUM_SHADES, NUM_SHADES);
#endif
    } else {
        sdl_set_gradient(lcd_surface, &lcd_color_dark,
                         &lcd_color_bright, 0, NUM_SHADES);
#ifdef HAVE_LCD_SPLIT
        sdl_set_gradient(lcd_surface, &lcd_color2_dark,
                         &lcd_color2_bright, NUM_SHADES, NUM_SHADES);
#endif
    }
#else /* LCD_DEPTH > 8 */
#if defined(HAVE_TRANSFLECTIVE_LCD) && defined(HAVE_LCD_SLEEP)
    if (!lcd_active())
        SDL_SetAlpha(lcd_surface, SDL_SRCALPHA, 0);
    else
        SDL_SetAlpha(lcd_surface, SDL_SRCALPHA,
                        MAX(BACKLIGHT_OFF_ALPHA, (value * 255) / 100));
#else
    SDL_SetAlpha(lcd_surface, SDL_SRCALPHA, (value * 255) / 100);
#endif
#endif /* LCD_DEPTH */

    sdl_gui_update(lcd_surface, 0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
                   SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
                   background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0);
}
예제 #3
0
void sim_lcd_update_rect(int x_start, int y_start, int width, int height)
{
    sdl_update_rect(lcd_surface, x_start, y_start, width, height,
                    SIM_LCD_WIDTH, SIM_LCD_HEIGHT, get_lcd_pixel);
    sdl_gui_update(lcd_surface, x_start, y_start, width, height,
                   SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
                   background ? UI_LCD_POSX : 0, background ? UI_LCD_POSY : 0);
}
예제 #4
0
void sim_lcd_ex_update_rect(int x_start, int y_start, int width, int height)
{
    if (lcd_ex_getpixel) {
        sdl_update_rect(lcd_surface, x_start, y_start, width, height,
                        LCD_WIDTH, LCD_HEIGHT, lcd_ex_getpixel);
        sdl_gui_update(lcd_surface, x_start, y_start, width, 
                       height + LCD_SPLIT_LINES, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
                       background ? UI_LCD_POSX : 0,
                       background ? UI_LCD_POSY : 0);
    }
}
예제 #5
0
void lcd_remote_update_rect(int x_start, int y_start, int width, int height)
{
    if (remote_surface)
    {
        sdl_update_rect(remote_surface, x_start, y_start, width, height,
            LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, get_lcd_remote_pixel);
        sdl_gui_update(remote_surface, x_start, y_start, width, height,
            LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, background ? UI_REMOTE_POSX : 0,
            background ? UI_REMOTE_POSY : LCD_HEIGHT);
    }
}
예제 #6
0
void lcd_update_rect(int x_start, int y_start, int width, int height)
{
#if (CONFIG_PLATFORM & PLATFORM_MAEMO)
    /* Don't update display if not shown */
    if (!maemo_display_on)
        return;

    /* Don't update if we don't have the input focus */
    if (!sdl_app_has_input_focus)
        return;
#endif

    sdl_update_rect(lcd_surface, x_start, y_start, width, height,
                    LCD_WIDTH, LCD_HEIGHT, get_lcd_pixel);
    sdl_gui_update(lcd_surface, x_start, y_start, width,
                   height + LCD_SPLIT_LINES, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
                   background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0);
}
예제 #7
0
void sim_remote_backlight(int value)
{
    if (remote_surface)
    {
        if (value > 0) 
        {
            sdl_set_gradient(remote_surface, &remote_bl_color_dark,
                             &remote_bl_color_bright, 0, NUM_SHADES);
        } 
        else
        {
            sdl_set_gradient(remote_surface, &remote_color_dark,
                             &remote_color_bright, 0, NUM_SHADES);
        }
        sdl_gui_update(remote_surface, 0, 0, LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT,
                       LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT,
                       background ? UI_REMOTE_POSX : 0,
                       background? UI_REMOTE_POSY : LCD_HEIGHT);
    }
}