1.1 --- a/examples/vga/main.c Sun Nov 11 18:15:24 2018 +0100
1.2 +++ b/examples/vga/main.c Sun Nov 11 22:23:40 2018 +0100
1.3 @@ -107,57 +107,7 @@
1.4
1.5 static void plot_screen_edge(int xorigin, int yorigin, int xstep, int ystep)
1.6 {
1.7 - /* The display regions are either the left or right edge... */
1.8 -
1.9 - int xedge = xstep < 0 ? 0 : display_config.line_length - xstep;
1.10 - int xdisplay = xedge;
1.11 -
1.12 - /* and either the top or bottom edge... */
1.13 -
1.14 - int yedge = ystep < 0 ? 0 : display_config.line_count * scr.yscale - ystep;
1.15 - int ydisplay = yedge / scr.yscale;
1.16 -
1.17 - /* Determine the origin position within the image. */
1.18 -
1.19 - int xpos = wrap_value(xorigin, scr.image->width);
1.20 - int ypos = wrap_value(yorigin, scr.image->height);
1.21 - int xsource, ysource;
1.22 -
1.23 - /* Horizontal scrolling requires columns spanning the height of the screen
1.24 - at the appropriate edge (left or right). */
1.25 -
1.26 - /* The column width is the absolute increment. */
1.27 -
1.28 - if (xstep)
1.29 - {
1.30 - /* Find the source position for the appropriate edge. */
1.31 -
1.32 - xsource = wrap_value(xpos + xedge, scr.image->width);
1.33 - ysource = ypos;
1.34 -
1.35 - /* Request tiling in the source coordinates. */
1.36 -
1.37 - image_tile_sprite(&scr, xsource, ysource,
1.38 - abs(xstep), display_config.line_count * scr.yscale,
1.39 - xdisplay, 0);
1.40 - }
1.41 -
1.42 - /* Vertical scrolling requires columns across the width of the screen at the
1.43 - appropriate edge (top or bottom). */
1.44 -
1.45 - if (ystep)
1.46 - {
1.47 - /* Find the source position for the appropriate edge. */
1.48 -
1.49 - xsource = xpos;
1.50 - ysource = wrap_value(ypos + yedge, scr.image->height);
1.51 -
1.52 - /* Request tiling in the source coordinates. */
1.53 -
1.54 - image_tile_sprite(&scr, xsource, ysource,
1.55 - display_config.line_length, abs(ystep),
1.56 - 0, ydisplay);
1.57 - }
1.58 + image_update_scrolled_tiled_image(&scr, xorigin, yorigin, xstep, ystep);
1.59 }
1.60
1.61