forked from Miroirs/x49gp
Compare commits
2 commits
3e37407a61
...
c9191b6c00
Author | SHA1 | Date | |
---|---|---|---|
|
c9191b6c00 | ||
|
b179f88451 |
3 changed files with 27 additions and 32 deletions
|
@ -284,8 +284,8 @@ static int x49gp_get_pixel_color( s3c2410_lcd_t* lcd, int x, int y )
|
|||
void x49gp_draw_rectangle( GdkPixmap* target, int x, int y, int w, int h, GdkColor* color )
|
||||
{
|
||||
cairo_t* cr = gdk_cairo_create( target );
|
||||
cairo_set_source_rgb( cr, color->red, color->green, color->blue );
|
||||
|
||||
cairo_set_source_rgb( cr, color->red / 65535.0, color->green / 65535.0, color->blue / 65535.0 );
|
||||
cairo_rectangle( cr, x, y, w, h );
|
||||
cairo_fill( cr );
|
||||
|
||||
|
@ -308,6 +308,11 @@ void x49gp_lcd_update( x49gp_t* x49gp )
|
|||
gdk_gc_set_rgb_fg_color( ui->ann_left_gc, &( ui->colors[ UI_COLOR_GRAYSCALE_0 + color ] ) );
|
||||
gdk_draw_rectangle( ui->lcd_pixmap, ui->ann_left_gc, true, 11, 0, 15, 12 );
|
||||
|
||||
/* cr = gdk_cairo_create( ui->ann_left ); */
|
||||
/* gdk_cairo_set_source_pixbuf( cr, ui->lcd_pixmap, 11, 0 ); */
|
||||
/* cairo_paint( cr ); */
|
||||
/* cairo_destroy( cr ); */
|
||||
|
||||
color = x49gp_get_pixel_color( lcd, 131, 2 );
|
||||
gdk_gc_set_rgb_fg_color( ui->ann_right_gc, &( ui->colors[ UI_COLOR_GRAYSCALE_0 + color ] ) );
|
||||
gdk_draw_rectangle( ui->lcd_pixmap, ui->ann_right_gc, true, 56, 0, 15, 12 );
|
||||
|
@ -328,21 +333,11 @@ void x49gp_lcd_update( x49gp_t* x49gp )
|
|||
gdk_gc_set_rgb_fg_color( ui->ann_io_gc, &( ui->colors[ UI_COLOR_GRAYSCALE_0 + color ] ) );
|
||||
gdk_draw_rectangle( ui->lcd_pixmap, ui->ann_io_gc, true, 236, 0, 15, 12 );
|
||||
|
||||
GdkGC* gc = gdk_gc_new( gtk_widget_get_window( ui->lcd_canvas ) );
|
||||
|
||||
for ( int y = 0; y < ( ui->lcd_height - ui->lcd_annunciators_height ) / LCD_PIXEL_SCALE; y++ ) {
|
||||
for ( int x = 0; x < ui->lcd_width / LCD_PIXEL_SCALE; x++ ) {
|
||||
color = x49gp_get_pixel_color( lcd, x, y );
|
||||
/* gdk_gc_set_rgb_fg_color( gc, &( ui->colors[ UI_COLOR_GRAYSCALE_0 + color ] ) ); */
|
||||
|
||||
/* gdk_draw_rectangle( ui->lcd_pixmap, gc, true, LCD_PIXEL_SCALE * x, LCD_PIXEL_SCALE * y + ui->lcd_annunciators_height, */
|
||||
/* LCD_PIXEL_SCALE, LCD_PIXEL_SCALE ); */
|
||||
|
||||
x49gp_draw_rectangle( ui->lcd_pixmap, LCD_PIXEL_SCALE * x, LCD_PIXEL_SCALE * y + ui->lcd_annunciators_height, LCD_PIXEL_SCALE, LCD_PIXEL_SCALE, &(ui->colors[ UI_COLOR_GRAYSCALE_0 + color ]) );
|
||||
}
|
||||
}
|
||||
|
||||
g_object_unref( gc );
|
||||
for ( int y = 0; y < ( ( ui->lcd_height - ui->lcd_annunciators_height ) / LCD_PIXEL_SCALE ); y++ )
|
||||
for ( int x = 0; x < ( ui->lcd_width / LCD_PIXEL_SCALE ); x++ )
|
||||
x49gp_draw_rectangle( ui->lcd_pixmap, LCD_PIXEL_SCALE * x, LCD_PIXEL_SCALE * y + ui->lcd_annunciators_height,
|
||||
LCD_PIXEL_SCALE, LCD_PIXEL_SCALE,
|
||||
&(ui->colors[ UI_COLOR_GRAYSCALE_0 + x49gp_get_pixel_color( lcd, x, y ) ]) );
|
||||
}
|
||||
|
||||
GdkRectangle rect;
|
||||
|
|
Loading…
Reference in a new issue