diff options
author | Willem Jan Palenstijn | 2009-02-23 22:36:39 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2009-02-23 22:36:39 +0000 |
commit | 4dca30cfe9896378540d955ba09946d12fa0abd1 (patch) | |
tree | 19158828b51c6974bbc2bd345a598c23e08a8a0d /engines/sci/gfx | |
parent | 25738df2d34be0f7933000d6b622f439f558a6d4 (diff) | |
download | scummvm-rg350-4dca30cfe9896378540d955ba09946d12fa0abd1.tar.gz scummvm-rg350-4dca30cfe9896378540d955ba09946d12fa0abd1.tar.bz2 scummvm-rg350-4dca30cfe9896378540d955ba09946d12fa0abd1.zip |
reinstate line drawing for xfact/yfact > 1
svn-id: r38821
Diffstat (limited to 'engines/sci/gfx')
-rw-r--r-- | engines/sci/gfx/gfx_driver.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp index 84f7e04c95..593b646f3e 100644 --- a/engines/sci/gfx/gfx_driver.cpp +++ b/engines/sci/gfx/gfx_driver.cpp @@ -111,28 +111,36 @@ static void scummvm_exit(gfx_driver_t *drv) { // Drawing operations static void drawProc(int x, int y, int c, void *data) { - uint8 *p = (uint8 *)data; - p[y * 320 + x] = c; + gfx_driver_t *drv = (gfx_driver_t *)data; + uint8 *p = S->visual[1]; + p[y * 320*drv->mode->xfact + x] = c; } static int scummvm_draw_line(gfx_driver_t *drv, Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) { uint32 scolor = color.visual.global_index; + int xfact = (line_mode == GFX_LINE_MODE_FINE)? 1: drv->mode->xfact; + int yfact = (line_mode == GFX_LINE_MODE_FINE)? 1: drv->mode->yfact; int xsize = S->xsize; int ysize = S->ysize; if (color.mask & GFX_MASK_VISUAL) { Common::Point nstart, nend; - nstart.x = CLIP<int16>(start.x, 0, xsize); - nstart.y = CLIP<int16>(start.y, 0, ysize); - nend.x = CLIP<int16>(end.x, 0, xsize - 1); - nend.y = CLIP<int16>(end.y, 0, ysize - 1); + for (int xc = 0; xc < xfact; xc++) { + for (int yc = 0; yc < yfact; yc++) { - Graphics::drawLine(nstart.x, nstart.y, nend.x, nend.y, scolor, drawProc, S->visual[1]); + nstart.x = CLIP<int16>(start.x + xc, 0, xsize); + nstart.y = CLIP<int16>(start.y + yc, 0, ysize); + nend.x = CLIP<int16>(end.x + xc, 0, xsize - 1); + nend.y = CLIP<int16>(end.y + yc, 0, ysize - 1); - if (color.mask & GFX_MASK_PRIORITY) { - gfx_draw_line_pixmap_i(S->priority[0], nstart, nend, color.priority); + Graphics::drawLine(nstart.x, nstart.y, nend.x, nend.y, scolor, drawProc, drv); + + if (color.mask & GFX_MASK_PRIORITY) { + gfx_draw_line_pixmap_i(S->priority[0], nstart, nend, color.priority); + } + } } } |