From 8d9c1ba2c656e56526c656e151c0ecc74320b0fb Mon Sep 17 00:00:00 2001 From: coderJeff Date: Fri, 3 Jun 2022 11:03:43 -0400 Subject: [PATCH] gfxlib2: gfx_dos drivers initialize the internal dirty array based on scanline size --- changelog.txt | 1 + src/gfxlib2/dos/gfx_dos.c | 4 ++-- src/gfxlib2/unix/gfx_driver_opengl_x11.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 2066a050a..780f785e3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -32,6 +32,7 @@ Version 1.10.0 - fbc: only up-cast initializers when needed. New behaviour is to try matching initializers without up-casting before matching with up-casting. - fbc: don't join operators separated by white space. Previously, '<' + '=', '<' + '>', '=' + '>', and '-' + '>' were joined together even if separated by whitespace. - fbc: don't skip whitespace between decimal point and digit. Previously, '.' + '0..9' floating point literals were allowed to be separated by whitespace. +- gfxlib2: gfx_dos drivers initialize the internal dirty array based on scanline size [added] - gas/gas64: '.cif_sections' and '.cif_' directives for stack unwinding (adeyblue) diff --git a/src/gfxlib2/dos/gfx_dos.c b/src/gfxlib2/dos/gfx_dos.c index e0aa7a21b..7492f0ad3 100644 --- a/src/gfxlib2/dos/gfx_dos.c +++ b/src/gfxlib2/dos/gfx_dos.c @@ -359,7 +359,7 @@ static int fb_dos_timer_handler(unsigned irq) } fb_dos.update(); - fb_hMemSet(__fb_gfx->dirty, FALSE, fb_dos.h); + fb_hMemSet(__fb_gfx->dirty, FALSE, __fb_gfx->h * __fb_gfx->scanline_size); if ( fb_dos.mouse_ok && fb_dos.mouse_cursor ) { 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 if (!fb_dos_timer_init(TIMER_HZ)) return -1; - fb_hMemSet(__fb_gfx->dirty, TRUE, __fb_gfx->h); + fb_hMemSet(__fb_gfx->dirty, TRUE, __fb_gfx->h * __fb_gfx->scanline_size); fb_dos.locked = 0; diff --git a/src/gfxlib2/unix/gfx_driver_opengl_x11.c b/src/gfxlib2/unix/gfx_driver_opengl_x11.c index 8552b7e3f..03eed0a62 100644 --- a/src/gfxlib2/unix/gfx_driver_opengl_x11.c +++ b/src/gfxlib2/unix/gfx_driver_opengl_x11.c @@ -225,7 +225,7 @@ static int driver_init(char *title, int w, int h, int depth, int refresh_rate, i if (__fb_gl_params.init_scale>1){ __fb_gl_params.scale = __fb_gl_params.init_scale; free(__fb_gfx->dirty); - __fb_gfx->dirty = (char *)calloc(1, __fb_gfx->h * __fb_gfx->scanline_size* __fb_gl_params.scale); + __fb_gfx->dirty = (char *)calloc(1, __fb_gfx->h * __fb_gfx->scanline_size * __fb_gl_params.scale); } result = fb_hX11Init(title, w * __fb_gl_params.scale, h * __fb_gl_params.scale, info->depth, refresh_rate, flags);