Changeset 3581
- Timestamp:
- 07/26/09 21:17:20 (4 years ago)
- Location:
- libcaca/trunk/caca
- Files:
-
- 2 edited
-
driver/x11.c (modified) (5 diffs)
-
string.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/driver/x11.c
r3569 r3581 64 64 uint32_t max_char; 65 65 int cursor_flags; 66 int dirty_cursor_x, dirty_cursor_y; 66 67 }; 67 68 … … 250 251 251 252 dp->drv.p->cursor_flags = 0; 253 dp->drv.p->dirty_cursor_x = -1; 254 dp->drv.p->dirty_cursor_y = -1; 252 255 253 256 return 0; … … 297 300 int x, y, i, len; 298 301 299 for(i = 0; i < caca_get_dirty_rect_count(dp->cv); i++) 302 /* XXX: the magic value -1 is used to handle the cursor area */ 303 for(i = -1; i < caca_get_dirty_rect_count(dp->cv); i++) 300 304 { 301 305 int dx, dy, dw, dh; 302 306 303 caca_get_dirty_rect(dp->cv, i, &dx, &dy, &dw, &dh); 307 /* Get the dirty rectangle coordinates, either from the previous 308 * cursor position, or from the canvas's list. */ 309 if(i == -1) 310 { 311 if(dp->drv.p->dirty_cursor_x < 0 || dp->drv.p->dirty_cursor_y < 0 312 || dp->drv.p->dirty_cursor_x >= width 313 || dp->drv.p->dirty_cursor_y >= height) 314 continue; 315 316 dx = dp->drv.p->dirty_cursor_x; 317 dy = dp->drv.p->dirty_cursor_y; 318 dw = dh = 1; 319 320 dp->drv.p->dirty_cursor_x = -1; 321 dp->drv.p->dirty_cursor_y = -1; 322 } 323 else 324 { 325 caca_get_dirty_rect(dp->cv, i, &dx, &dy, &dw, &dh); 326 } 304 327 305 328 /* First draw the background colours. Splitting the process in two … … 349 372 } 350 373 351 /* Print the cursor if necessary. FIXME: handle dirty rectangles!*/374 /* Print the cursor if necessary. */ 352 375 if(dp->drv.p->cursor_flags) 353 376 { … … 359 382 x * dp->drv.p->font_width, y * dp->drv.p->font_height, 360 383 dp->drv.p->font_width, dp->drv.p->font_height); 384 385 /* Mark the area as dirty */ 386 dp->drv.p->dirty_cursor_x = x; 387 dp->drv.p->dirty_cursor_y = y; 361 388 } 362 389 -
libcaca/trunk/caca/string.c
r3559 r3581 54 54 int caca_gotoxy(caca_canvas_t *cv, int x, int y) 55 55 { 56 /* FIXME Not needed if cursor is invisible */57 caca_add_dirty_rect(cv, cv->frames[cv->frame].x, cv->frames[cv->frame].y, 1, 1);58 caca_add_dirty_rect(cv, x, y, 1, 1);59 60 56 cv->frames[cv->frame].x = x; 61 57 cv->frames[cv->frame].y = y;
Note: See TracChangeset
for help on using the changeset viewer.
