X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fgraphics.c;h=abcab4a4a07e58344d54754c28d17ed5b6ef1078;hb=c6e78c57fc1b323ec055bfe48c7430515be27d1c;hp=21fcd09067937b6820d33069877f6d798758033b;hpb=bdca86598f7604d7c20f91ac810d825513c72090;p=rodin%2Fchimara.git diff --git a/libchimara/graphics.c b/libchimara/graphics.c index 21fcd09..abcab4a 100644 --- a/libchimara/graphics.c +++ b/libchimara/graphics.c @@ -139,7 +139,6 @@ image_cache_find(struct image_info* to_find) /* Empty cache */ if(link == NULL) { gdk_threads_leave(); - printf("Cache miss for image %d\n", to_find->resource_number); return NULL; } @@ -154,7 +153,6 @@ image_cache_find(struct image_info* to_find) if(info->width == to_find->width && info->height == to_find->height) { /* Prescaled image found */ gdk_threads_leave(); - printf("Exact cache hit for image %d\n", to_find->resource_number); return info; } else if(info->width >= to_find->width && info->height >= to_find->height) { @@ -165,7 +163,6 @@ image_cache_find(struct image_info* to_find) } else { if(!info->scaled) { gdk_threads_leave(); - printf("Exact cache hit for image %d\n", to_find->resource_number); return info; /* Found a match */ } } @@ -174,11 +171,6 @@ image_cache_find(struct image_info* to_find) gdk_threads_leave(); - if(match == NULL) - printf("Cache miss for image %d\n", to_find->resource_number); - else - printf("Approx cache hit for image %d\n", to_find->resource_number); - return match; } @@ -423,7 +415,7 @@ draw_image_common(winid_t win, GdkPixbuf *pixbuf, glsi32 val1, glsi32 val2) * * This function may only be used with graphics windows. To set background * colors in a text window, use text styles with color hints; see Styles. + * linkend="chimara-Styles">Styles. * */ void @@ -454,14 +446,15 @@ glk_window_fill_rect(winid_t win, glui32 color, glsi32 left, glsi32 top, glui32 VALID_WINDOW(win, return); g_return_if_fail(win->type == wintype_Graphics); - gdk_threads_enter(); GdkPixmap *map; gtk_image_get_pixmap( GTK_IMAGE(win->widget), &map, NULL ); GdkGC *gc = gdk_gc_new(map); - gdk_gc_set_foreground( gc, glkcolor_to_gdkcolor(color) ); + GdkColor gdkcolor; + glkcolor_to_gdkcolor(color, &gdkcolor); + gdk_gc_set_rgb_fg_color(gc, &gdkcolor); gdk_draw_rectangle( GDK_DRAWABLE(map), gc, TRUE, left, top, width, height); gtk_widget_queue_draw(win->widget); g_object_unref(gc);