diff options
author | Simon Howard | 2005-08-04 22:23:07 +0000 |
---|---|---|
committer | Simon Howard | 2005-08-04 22:23:07 +0000 |
commit | 479d7ded6db85c364940e5e77966746224318f20 (patch) | |
tree | b9b571dcf30d48db81066e2e51ac0e951776625a /src | |
parent | 9fa822847de1c2d64b8e2186e9ec74277f28cc16 (diff) | |
download | chocolate-doom-479d7ded6db85c364940e5e77966746224318f20.tar.gz chocolate-doom-479d7ded6db85c364940e5e77966746224318f20.tar.bz2 chocolate-doom-479d7ded6db85c364940e5e77966746224318f20.zip |
Use zone memory function. Add command line options
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 40
Diffstat (limited to 'src')
-rw-r--r-- | src/i_video.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/i_video.c b/src/i_video.c index 971a541e..0239b964 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: i_video.c 38 2005-08-04 19:54:56Z fraggle $ +// $Id: i_video.c 40 2005-08-04 22:23:07Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -22,6 +22,9 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.13 2005/08/04 22:23:07 fraggle +// Use zone memory function. Add command line options +// // Revision 1.12 2005/08/04 19:54:56 fraggle // Use keysym value rather than unicode value (fixes problems with shift // key) @@ -69,7 +72,7 @@ //----------------------------------------------------------------------------- static const char -rcsid[] = "$Id: i_video.c 38 2005-08-04 19:54:56Z fraggle $"; +rcsid[] = "$Id: i_video.c 40 2005-08-04 22:23:07Z fraggle $"; #include <ctype.h> #include <SDL.h> @@ -168,7 +171,6 @@ static void LoadDiskImage(void) V_DrawPatch(0, 0, 0, disk); disk_image_w = SHORT(disk->width); disk_image_h = SHORT(disk->height); - printf("%i, %i\n", disk_image_w, disk_image_h); disk_image = Z_Malloc(disk_image_w * disk_image_h, PU_STATIC, NULL); saved_background = Z_Malloc(disk_image_w * disk_image_h, PU_STATIC, NULL); @@ -631,7 +633,21 @@ void I_InitGraphics(void) SDL_Init(SDL_INIT_VIDEO); flags |= SDL_SWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF; - flags |= SDL_FULLSCREEN; + + // default to fullscreen mode, allow override with command line + // nofullscreen because we love prboom + + if (!M_CheckParm("-window") && !M_CheckParm("-nofullscreen")) + { + flags |= SDL_FULLSCREEN; + } + + // scale-by-2 mode + + if (M_CheckParm("-2")) + { + multiply = 2; + } screen = SDL_SetVideoMode(SCREENWIDTH*multiply, SCREENHEIGHT*multiply, 8, flags); @@ -643,7 +659,7 @@ void I_InitGraphics(void) if (multiply == 1) screens[0] = (unsigned char *) (screen->pixels); else - screens[0] = (unsigned char *) malloc (SCREENWIDTH * SCREENHEIGHT); + screens[0] = (unsigned char *) Z_Malloc (SCREENWIDTH * SCREENHEIGHT, PU_STATIC, NULL); SDL_ShowCursor(0); SDL_WM_GrabInput(SDL_GRAB_ON); |