Re: [AD] GGI patch for 3.9.21 |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Shawn Hargreaves <shawn@xxxxxxxxxx> writes:
> Michael Bukin <M.A.Bukin@xxxxxxxxxx> writes:
> > There is an idea for GFX_SAFE mode which is explained with pseudo-code:
>
> That's an interesting proposal, but not very portable because at least on
> DOS, when I tried to do an automatic screen update with conversion using a
> timer handler, it was very unstable and kept locking the machine. I don't
> think that is quite safe enough to fit the name of the driver :-)
I like your other ideas about GFX_SAFE, but just for completeness, I
did not mean to make autoconversion in the timer. It can be done with
wrappers for graphics primitives and bank switching.
void
_rectfill_wrapperXX (BITMAP *dst, int x1, int y1, int x2, int y2, int color)
{
/* Clip x1, y1, x2, y2. */
...
/* Turn off update magic for bank switching. */
magic = FALSE;
/* Call real rectfill (for writing to double-buffer). */
_linear_rectfillXX (dst, x1, y1, x2, y2, color);
/* Update region of screen. */
_update_screen (real_screen, screen, x1, y1, x2 - x1 + 1, y2 - y1 + 1);
magic = TRUE;
}
unsigned long
gfx_safe_write_line (BITMAP *bmp, int line)
{
if (magic && (current_line != line)) {
_update_screen (real_screen, screen, current_line, 0, SCREEN_W, 1);
}
current_line = line;
return bmp->line[line];
}
--
Michael Bukin