comparison 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
comparison
equal deleted inserted replaced
1113:572277fcec0d 1114:7451af5d63ec
2472 if(rdman->n_dirty_areas > 0) { 2472 if(rdman->n_dirty_areas > 0) {
2473 /*! \brief Draw shapes in preorder of coord tree and support opacity 2473 /*! \brief Draw shapes in preorder of coord tree and support opacity
2474 * rules. 2474 * rules.
2475 */ 2475 */
2476 draw_shapes_in_dirty_areas(rdman); 2476 draw_shapes_in_dirty_areas(rdman);
2477 n_areas = _coord_get_dirty_areas(rdman->root_coord)->num; 2477 if(rdman->backend) {
2478 areas = _coord_get_dirty_areas(rdman->root_coord)->ds; 2478 n_areas = _coord_get_dirty_areas(rdman->root_coord)->num;
2479 copy_cr_2_backend(rdman, n_areas, areas); 2479 areas = _coord_get_dirty_areas(rdman->root_coord)->ds;
2480 reset_clip(rdman->backend); 2480 copy_cr_2_backend(rdman, n_areas, areas);
2481 reset_clip(rdman->backend);
2482 } else {
2483 mbe_flush(rdman->cr);
2484 }
2481 for(i = 0; i < rdman->zeroing_coords.num; i++) { 2485 for(i = 0; i < rdman->zeroing_coords.num; i++) {
2482 coord = rdman->zeroing_coords.ds[i]; 2486 coord = rdman->zeroing_coords.ds[i];
2483 DARRAY_CLEAN(_coord_get_dirty_areas(coord)); 2487 DARRAY_CLEAN(_coord_get_dirty_areas(coord));
2484 } 2488 }
2485 DARRAY_CLEAN(_coord_get_dirty_areas(rdman->root_coord)); 2489 DARRAY_CLEAN(_coord_get_dirty_areas(rdman->root_coord));
2513 int r; 2517 int r;
2514 2518
2515 area.x = area.y = 0; 2519 area.x = area.y = 0;
2516 #ifndef UNITTEST 2520 #ifndef UNITTEST
2517 surface = mbe_get_target(rdman->cr); 2521 surface = mbe_get_target(rdman->cr);
2518 area.w = mbe_image_surface_get_width(surface); 2522 area.w = rdman->w;
2519 area.h = mbe_image_surface_get_height(surface); 2523 area.h = rdman->h;
2520 #else 2524 #else
2521 area.w = 1024; 2525 area.w = 1024;
2522 area.h = 1024; 2526 area.h = 1024;
2523 #endif 2527 #endif
2524 add_dirty_area(rdman, rdman->root_coord, &area); 2528 add_dirty_area(rdman, rdman->root_coord, &area);