Skip to content

Commit 8d9c1ba

Browse files
committed
gfxlib2: gfx_dos drivers initialize the internal dirty array based on scanline size
1 parent 8f4ff82 commit 8d9c1ba

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Version 1.10.0
3232
- fbc: only up-cast initializers when needed. New behaviour is to try matching initializers without up-casting before matching with up-casting.
3333
- fbc: don't join operators separated by white space. Previously, '<' + '=', '<' + '>', '=' + '>', and '-' + '>' were joined together even if separated by whitespace.
3434
- fbc: don't skip whitespace between decimal point and digit. Previously, '.' + '0..9' floating point literals were allowed to be separated by whitespace.
35+
- gfxlib2: gfx_dos drivers initialize the internal dirty array based on scanline size
3536

3637
[added]
3738
- gas/gas64: '.cif_sections' and '.cif_' directives for stack unwinding (adeyblue)

src/gfxlib2/dos/gfx_dos.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static int fb_dos_timer_handler(unsigned irq)
359359
}
360360

361361
fb_dos.update();
362-
fb_hMemSet(__fb_gfx->dirty, FALSE, fb_dos.h);
362+
fb_hMemSet(__fb_gfx->dirty, FALSE, __fb_gfx->h * __fb_gfx->scanline_size);
363363

364364
if ( fb_dos.mouse_ok && fb_dos.mouse_cursor ) {
365365
fb_hSoftCursorUnput(mouse_x, mouse_y);
@@ -569,7 +569,7 @@ int fb_dos_init(char *title, int w, int h, int depth, int refresh_rate, int flag
569569
if (!fb_dos_timer_init(TIMER_HZ))
570570
return -1;
571571

572-
fb_hMemSet(__fb_gfx->dirty, TRUE, __fb_gfx->h);
572+
fb_hMemSet(__fb_gfx->dirty, TRUE, __fb_gfx->h * __fb_gfx->scanline_size);
573573

574574
fb_dos.locked = 0;
575575

src/gfxlib2/unix/gfx_driver_opengl_x11.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static int driver_init(char *title, int w, int h, int depth, int refresh_rate, i
225225
if (__fb_gl_params.init_scale>1){
226226
__fb_gl_params.scale = __fb_gl_params.init_scale;
227227
free(__fb_gfx->dirty);
228-
__fb_gfx->dirty = (char *)calloc(1, __fb_gfx->h * __fb_gfx->scanline_size* __fb_gl_params.scale);
228+
__fb_gfx->dirty = (char *)calloc(1, __fb_gfx->h * __fb_gfx->scanline_size * __fb_gl_params.scale);
229229
}
230230

231231
result = fb_hX11Init(title, w * __fb_gl_params.scale, h * __fb_gl_params.scale, info->depth, refresh_rate, flags);

0 commit comments

Comments
 (0)