[Scummvm-cvs-logs] SF.net SVN: scummvm:[38821] scummvm/trunk/engines/sci/gfx/gfx_driver.cpp

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Mon Feb 23 23:36:39 CET 2009


Revision: 38821
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38821&view=rev
Author:   wjpalenstijn
Date:     2009-02-23 22:36:39 +0000 (Mon, 23 Feb 2009)

Log Message:
-----------
reinstate line drawing for xfact/yfact > 1

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gfx/gfx_driver.cpp

Modified: scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-02-23 22:36:19 UTC (rev 38820)
+++ scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-02-23 22:36:39 UTC (rev 38821)
@@ -111,28 +111,36 @@
 // 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);
+				}
+			}
 		}
 	}
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list