Working scale*2
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 30
This commit is contained in:
parent
1e30507db7
commit
ebf190f5a9
1 changed files with 16 additions and 10 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
// Emacs style mode select -*- C++ -*-
|
// Emacs style mode select -*- C++ -*-
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Id: i_video.c 29 2005-07-25 20:50:55Z fraggle $
|
// $Id: i_video.c 30 2005-08-03 21:58:02Z fraggle $
|
||||||
//
|
//
|
||||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||||
// Copyright(C) 2005 Simon Howard
|
// Copyright(C) 2005 Simon Howard
|
||||||
|
|
@ -22,6 +22,9 @@
|
||||||
// 02111-1307, USA.
|
// 02111-1307, USA.
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.8 2005/08/03 21:58:02 fraggle
|
||||||
|
// Working scale*2
|
||||||
|
//
|
||||||
// Revision 1.7 2005/07/25 20:50:55 fraggle
|
// Revision 1.7 2005/07/25 20:50:55 fraggle
|
||||||
// mouse
|
// mouse
|
||||||
//
|
//
|
||||||
|
|
@ -53,7 +56,7 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
static const char
|
static const char
|
||||||
rcsid[] = "$Id: i_video.c 29 2005-07-25 20:50:55Z fraggle $";
|
rcsid[] = "$Id: i_video.c 30 2005-08-03 21:58:02Z fraggle $";
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
@ -79,7 +82,7 @@ boolean grabMouse;
|
||||||
// replace each 320x200 pixel with multiply*multiply pixels.
|
// replace each 320x200 pixel with multiply*multiply pixels.
|
||||||
// According to Dave Taylor, it still is a bonehead thing
|
// According to Dave Taylor, it still is a bonehead thing
|
||||||
// to use ....
|
// to use ....
|
||||||
static int multiply=1;
|
static int multiply=2;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Translates the SDL key
|
// Translates the SDL key
|
||||||
|
|
@ -378,7 +381,6 @@ void I_FinishUpdate (void)
|
||||||
screens[0][ (SCREENHEIGHT-1)*SCREENWIDTH + i] = 0x0;
|
screens[0][ (SCREENHEIGHT-1)*SCREENWIDTH + i] = 0x0;
|
||||||
|
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
// scales the screen size before blitting it
|
// scales the screen size before blitting it
|
||||||
if (multiply == 2)
|
if (multiply == 2)
|
||||||
{
|
{
|
||||||
|
|
@ -388,10 +390,14 @@ void I_FinishUpdate (void)
|
||||||
unsigned int twoopixels;
|
unsigned int twoopixels;
|
||||||
unsigned int twomoreopixels;
|
unsigned int twomoreopixels;
|
||||||
unsigned int fouripixels;
|
unsigned int fouripixels;
|
||||||
|
unsigned int X_width = screen->pitch;
|
||||||
|
Uint8 *screen_pixels = (Uint8 *) screen->pixels;
|
||||||
|
|
||||||
|
SDL_LockSurface(screen);
|
||||||
|
|
||||||
ilineptr = (unsigned int *) (screens[0]);
|
ilineptr = (unsigned int *) (screens[0]);
|
||||||
for (i=0 ; i<2 ; i++)
|
for (i=0 ; i<2 ; i++)
|
||||||
olineptrs[i] = (unsigned int *) &image->data[i*X_width];
|
olineptrs[i] = (unsigned int *) &screen_pixels[i*X_width];
|
||||||
|
|
||||||
y = SCREENHEIGHT;
|
y = SCREENHEIGHT;
|
||||||
while (y--)
|
while (y--)
|
||||||
|
|
@ -422,7 +428,9 @@ void I_FinishUpdate (void)
|
||||||
olineptrs[1] += X_width/4;
|
olineptrs[1] += X_width/4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_UnlockSurface(screen);
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
else if (multiply == 3)
|
else if (multiply == 3)
|
||||||
{
|
{
|
||||||
unsigned int *olineptrs[3];
|
unsigned int *olineptrs[3];
|
||||||
|
|
@ -528,9 +536,9 @@ void I_InitGraphics(void)
|
||||||
|
|
||||||
SDL_Init(SDL_INIT_VIDEO);
|
SDL_Init(SDL_INIT_VIDEO);
|
||||||
|
|
||||||
// flags |= SDL_FULLSCREEN;
|
flags |= SDL_FULLSCREEN;
|
||||||
|
|
||||||
screen = SDL_SetVideoMode(SCREENWIDTH, SCREENHEIGHT, 8, flags);
|
screen = SDL_SetVideoMode(SCREENWIDTH*multiply, SCREENHEIGHT*multiply, 8, flags);
|
||||||
|
|
||||||
if (screen == NULL)
|
if (screen == NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -558,7 +566,7 @@ void InitExpand (void)
|
||||||
exptable[i] = i | (i<<8) | (i<<16) | (i<<24);
|
exptable[i] = i | (i<<8) | (i<<16) | (i<<24);
|
||||||
}
|
}
|
||||||
|
|
||||||
double exptable2[256*256];
|
double exptable2[256*256];
|
||||||
|
|
||||||
void InitExpand2 (void)
|
void InitExpand2 (void)
|
||||||
{
|
{
|
||||||
|
|
@ -572,7 +580,6 @@ void InitExpand2 (void)
|
||||||
unsigned u[2];
|
unsigned u[2];
|
||||||
} pixel;
|
} pixel;
|
||||||
|
|
||||||
printf ("building exptable2...\n");
|
|
||||||
exp = exptable2;
|
exp = exptable2;
|
||||||
for (i=0 ; i<256 ; i++)
|
for (i=0 ; i<256 ; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -583,7 +590,6 @@ void InitExpand2 (void)
|
||||||
*exp++ = pixel.d;
|
*exp++ = pixel.d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf ("done.\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int inited;
|
int inited;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue