From 6c1633b80a30c639bc096cc4b98a1da998af38c2 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 21 Jul 2017 21:10:12 +0200 Subject: changed video mode management, moved to video driver, the VGA driver registers his specific mode data with the video driver kernel function now use virtual functions of the video driver --- src/gui/desktop.c | 4 ++-- src/gui/window.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gui') diff --git a/src/gui/desktop.c b/src/gui/desktop.c index 9851b78..e0cb69b 100644 --- a/src/gui/desktop.c +++ b/src/gui/desktop.c @@ -49,13 +49,13 @@ void desktop_draw( void *obj, graphics_context_t *context ) if( desktop->mouse_x > i ) { vga_set_pixel( context, desktop->mouse_x - i, desktop->mouse_y, VGA_COLOR_WHITE ); } - if( desktop->mouse_x < context->mode.x - i ) { + if( desktop->mouse_x < context->mode->base.x - i ) { vga_set_pixel( context, desktop->mouse_x + i, desktop->mouse_y, VGA_COLOR_WHITE ); } if( desktop->mouse_y > i ) { vga_set_pixel( context, desktop->mouse_x, desktop->mouse_y - i, VGA_COLOR_WHITE ); } - if( desktop->mouse_y < context->mode.y - i ) { + if( desktop->mouse_y < context->mode->base.y - i ) { vga_set_pixel( context, desktop->mouse_x, desktop->mouse_y + i, VGA_COLOR_WHITE ); } } diff --git a/src/gui/window.c b/src/gui/window.c index fd53920..681c3b7 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -39,14 +39,14 @@ void window_draw( void *obj, graphics_context_t *context ) if( ((widget_t *)widget)->x < 0 ) { ((widget_t *)widget)->x = 0; } - if( ((widget_t *)widget)->x > context->mode.x - ((widget_t *)widget)->w ) { - ((widget_t *)widget)->x = context->mode.x - ((widget_t *)widget)->w; + if( ((widget_t *)widget)->x > context->mode->base.x - ((widget_t *)widget)->w ) { + ((widget_t *)widget)->x = context->mode->base.x - ((widget_t *)widget)->w; } if( ((widget_t *)widget)->y < 0 ) { ((widget_t *)widget)->y = 0; } - if( ((widget_t *)widget)->y > context->mode.y - ((widget_t *)widget)->h ) { - ((widget_t *)widget)->y = context->mode.y - ((widget_t *)widget)->h; + if( ((widget_t *)widget)->y > context->mode->base.y - ((widget_t *)widget)->h ) { + ((widget_t *)widget)->y = context->mode->base.y - ((widget_t *)widget)->h; } composite_widget_draw( obj, context ); -- cgit v1.2.3-54-g00ecf