diff src/redraw_man.c @ 1114:7451af5d63ec

Make tank and calculator works for console backend
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 08 Dec 2010 22:39:12 +0800
parents d09f603438d8
children 36cbe73813a8
line wrap: on
line diff
--- a/src/redraw_man.c	Wed Dec 08 19:47:25 2010 +0800
+++ b/src/redraw_man.c	Wed Dec 08 22:39:12 2010 +0800
@@ -2474,10 +2474,14 @@
 	 * rules.
 	 */
 	draw_shapes_in_dirty_areas(rdman);
-	n_areas = _coord_get_dirty_areas(rdman->root_coord)->num;
-	areas = _coord_get_dirty_areas(rdman->root_coord)->ds;
-	copy_cr_2_backend(rdman, n_areas, areas);
-	reset_clip(rdman->backend);
+	if(rdman->backend) {
+	    n_areas = _coord_get_dirty_areas(rdman->root_coord)->num;
+	    areas = _coord_get_dirty_areas(rdman->root_coord)->ds;
+	    copy_cr_2_backend(rdman, n_areas, areas);
+	    reset_clip(rdman->backend);
+	} else {
+	    mbe_flush(rdman->cr);
+	}
 	for(i = 0; i < rdman->zeroing_coords.num; i++) {
 	    coord = rdman->zeroing_coords.ds[i];
 	    DARRAY_CLEAN(_coord_get_dirty_areas(coord));
@@ -2515,8 +2519,8 @@
     area.x = area.y = 0;
 #ifndef UNITTEST
     surface = mbe_get_target(rdman->cr);
-    area.w = mbe_image_surface_get_width(surface);
-    area.h = mbe_image_surface_get_height(surface);
+    area.w = rdman->w;
+    area.h = rdman->h;
 #else
     area.w = 1024;
     area.h = 1024;