summaryrefslogtreecommitdiff
path: root/src/i_video.c
diff options
context:
space:
mode:
authorSimon Howard2006-05-08 21:54:32 +0000
committerSimon Howard2006-05-08 21:54:32 +0000
commit7d37b373ee43b8d509d9eae882a18bf6744db15c (patch)
treee4a47d7c8f2729aca2549de3f4c3c28bd0b42861 /src/i_video.c
parent4c28d8a8a37edea1893896f3d601771c1615c1c5 (diff)
downloadchocolate-doom-7d37b373ee43b8d509d9eae882a18bf6744db15c.tar.gz
chocolate-doom-7d37b373ee43b8d509d9eae882a18bf6744db15c.tar.bz2
chocolate-doom-7d37b373ee43b8d509d9eae882a18bf6744db15c.zip
Allow -3 scale.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 478
Diffstat (limited to 'src/i_video.c')
-rw-r--r--src/i_video.c59
1 files changed, 55 insertions, 4 deletions
diff --git a/src/i_video.c b/src/i_video.c
index 23fbd159..50d0515c 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_video.c 477 2006-05-06 19:22:31Z fraggle $
+// $Id: i_video.c 478 2006-05-08 21:54:32Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -175,7 +175,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_video.c 477 2006-05-06 19:22:31Z fraggle $";
+rcsid[] = "$Id: i_video.c 478 2006-05-08 21:54:32Z fraggle $";
#include <SDL.h>
#include <ctype.h>
@@ -707,6 +707,53 @@ static void BlitArea(int x1, int y1, int x2, int y2)
SDL_UnlockSurface(screen);
}
}
+
+ if (screenmultiply == 3)
+ {
+ byte *bufp, *screenp, *screenp2, *screenp3;
+ int x, y;
+ int pitch;
+
+ if (SDL_LockSurface(screen) >= 0)
+ {
+ pitch = screen->pitch * 3;
+ bufp = screens[0] + y1 * SCREENWIDTH + x1;
+ screenp = (byte *) screen->pixels
+ + (y1 + y_offset) * pitch
+ + x1 * 3;
+ screenp2 = screenp + screen->pitch;
+ screenp3 = screenp + screen->pitch * 2;
+
+ for (y=y1; y<y2; ++y)
+ {
+ byte *sp, *sp2, *sp3, *bp;
+ sp = screenp;
+ sp2 = screenp2;
+ sp3 = screenp3;
+ bp = bufp;
+
+ for (x=x1; x<x2; ++x)
+ {
+ *sp++ = *bp;
+ *sp++ = *bp;
+ *sp++ = *bp;
+ *sp2++ = *bp;
+ *sp2++ = *bp;
+ *sp2++ = *bp;
+ *sp3++ = *bp;
+ *sp3++ = *bp;
+ *sp3++ = *bp;
+ ++bp;
+ }
+ screenp += pitch;
+ screenp2 += pitch;
+ screenp3 += pitch;
+ bufp += SCREENWIDTH;
+ }
+
+ SDL_UnlockSurface(screen);
+ }
+ }
}
static void UpdateRect(int x1, int y1, int x2, int y2)
@@ -982,11 +1029,15 @@ void I_InitGraphics(void)
{
screenmultiply = 2;
}
+ else if (M_CheckParm("-3"))
+ {
+ screenmultiply = 3;
+ }
if (screenmultiply < 1)
screenmultiply = 1;
- if (screenmultiply > 2)
- screenmultiply = 2;
+ if (screenmultiply > 3)
+ screenmultiply = 3;
if (fullscreen)
{