- Added the "extended" keyword for episode definitions to define episodes

that are only available in the extended version of Heretic.
Update to ZDoom r1199:

- Added hexendemo.wad and hexdemo.wad as aliases for the demo Hexen IWAD.
- Added IWAD checks for freedoom1.wad and freedm.wad.
- The garbage collector now has an opportunity to step each time individual
  thinkers tick, not just once every game tick. This more closely follows
  the original Lua behavior. This change was made because, in cases of
  extremely large and frequent memory allocations, the collector may not run
  fast enough if it only has a chance to execute once per tick.
- Fixed: The "same level" dmflag did not work.
- Changed the nextlevel global var to an FString.
- Implemented some more controllers for the OPL player:
  * RPN select (controllers 100 and 101)
  *  RPN 0 (pitch bend sensitivity)
  * NPRN select (controllers 98 and 99)
  * Data entry (controllers 6 and 38)
  * All notes off (controller 123)
  * All sounds off (controller 120)
  * Reset controllers (controller 121)
- Added pixel doubling and quadrupling for fullscreen DirectDraw modes.
  The command line options -2 and -4 can be used to force them.


git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@170 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2008-09-06 08:22:12 +00:00
parent 75efa47eb1
commit bc90a2210b
10 changed files with 242 additions and 27 deletions

View file

@ -52,6 +52,9 @@ static void Palette32Generic (const PalEntry *pal);
static void Palette32RGB (const PalEntry *pal);
static void Palette32BGR (const PalEntry *pal);
static void Scale8 (BYTE *src, int srcpitch,
void *destin, int destpitch, int destwidth, int destheight,
fixed_t xstep, fixed_t ystep, fixed_t xfrac, fixed_t yfrac);
static void Convert8 (BYTE *src, int srcpitch,
void *destin, int destpitch, int destwidth, int destheight,
fixed_t xstep, fixed_t ystep, fixed_t xfrac, fixed_t yfrac);
@ -69,6 +72,11 @@ void PfxState::SetFormat (int bits, uint32 redMask, uint32 greenMask, uint32 blu
{
switch (bits)
{
case -8:
Convert = Scale8;
SetPalette = NULL;
break;
case 8:
Convert = Convert8;
SetPalette = NULL;
@ -132,7 +140,7 @@ void PfxState::SetFormat (int bits, uint32 redMask, uint32 greenMask, uint32 blu
default:
I_FatalError ("Can't draw to %d-bit displays", bits);
}
if (bits != 8)
if (bits != 8 && bits != -8)
{
RedLeft = AnalyzeMask (redMask, &RedShift);
GreenLeft = AnalyzeMask (greenMask, &GreenShift);
@ -260,7 +268,7 @@ static void Palette32BGR (const PalEntry *pal)
// Bitmap converters -------------------------------------------------------
static void Convert8 (BYTE *src, int srcpitch,
static void Scale8 (BYTE *src, int srcpitch,
void *destin, int destpitch, int destwidth, int destheight,
fixed_t xstep, fixed_t ystep, fixed_t xfrac, fixed_t yfrac)
{
@ -273,8 +281,129 @@ static void Convert8 (BYTE *src, int srcpitch,
BYTE *dest = (BYTE *)destin;
if (xstep == FRACUNIT && ystep == FRACUNIT)
{
for (y = destheight; y != 0; y--)
{
memcpy(dest, src, destwidth);
dest += destpitch;
src += srcpitch;
}
}
else if (xstep == FRACUNIT/2 && ystep == FRACUNIT/2)
{
BYTE *dest2 = dest + destpitch;
destpitch = destpitch * 2 - destwidth;
srcpitch -= destwidth / 2;
for (y = destheight / 2; y != 0; --y)
{
for (x = destwidth / 2; x != 0; --x)
{
BYTE foo = src[0];
dest[0] = foo;
dest[1] = foo;
dest2[0] = foo;
dest2[1] = foo;
dest += 2;
dest2 += 2;
src += 1;
}
dest += destpitch;
dest2 += destpitch;
src += srcpitch;
}
}
else if (xstep == FRACUNIT/4 && ystep == FRACUNIT/4)
{
int gap = destpitch * 4 - destwidth;
srcpitch -= destwidth / 4;
for (y = destheight / 4; y != 0; --y)
{
for (BYTE *end = dest + destpitch; dest != end; dest += 4)
{
BYTE foo = src[0];
dest[0] = foo;
dest[1] = foo;
dest[2] = foo;
dest[3] = foo;
dest[0 + destpitch] = foo;
dest[1 + destpitch] = foo;
dest[2 + destpitch] = foo;
dest[3 + destpitch] = foo;
dest[0 + destpitch*2] = foo;
dest[1 + destpitch*2] = foo;
dest[2 + destpitch*2] = foo;
dest[3 + destpitch*2] = foo;
dest[0 + destpitch*3] = foo;
dest[1 + destpitch*3] = foo;
dest[2 + destpitch*3] = foo;
dest[3 + destpitch*3] = foo;
src += 1;
}
dest += gap;
src += srcpitch;
}
}
else
{
destpitch -= destwidth;
for (y = destheight; y != 0; y--)
{
fixed_t xf = xfrac;
x = destwidth;
while (((size_t)dest & 3) && x != 0)
{
*dest++ = src[xf >> FRACBITS];
xf += xstep;
x--;
}
for (savedx = x, x >>= 2; x != 0; x--)
{
DWORD work;
#ifdef WORDS_BIGENDIAN
work = src[xf >> FRACBITS] << 24; xf += xstep;
work |= src[xf >> FRACBITS] << 16; xf += xstep;
work |= src[xf >> FRACBITS] << 8; xf += xstep;
work |= src[xf >> FRACBITS]; xf += xstep;
#else
work = src[xf >> FRACBITS]; xf += xstep;
work |= src[xf >> FRACBITS] << 8; xf += xstep;
work |= src[xf >> FRACBITS] << 16; xf += xstep;
work |= src[xf >> FRACBITS] << 24; xf += xstep;
#endif
*(DWORD *)dest = work;
dest += 4;
}
for (savedx &= 3; savedx != 0; savedx--, xf += xstep)
{
*dest++ = src[xf >> FRACBITS];
}
yfrac += ystep;
while (yfrac >= FRACUNIT)
{
yfrac -= FRACUNIT;
src += srcpitch;
}
dest += destpitch;
}
}
}
static void Convert8 (BYTE *src, int srcpitch,
void *destin, int destpitch, int destwidth, int destheight,
fixed_t xstep, fixed_t ystep, fixed_t xfrac, fixed_t yfrac)
{
if ((destwidth | destheight) == 0)
{
return;
}
int x, y, savedx;
BYTE *dest = (BYTE *)destin;
destpitch -= destwidth;
if (xstep == FRACUNIT && ystep == FRACUNIT)
{
srcpitch -= destwidth;
for (y = destheight; y != 0; y--)
{
@ -311,7 +440,6 @@ static void Convert8 (BYTE *src, int srcpitch,
}
else
{
destpitch -= destwidth;
for (y = destheight; y != 0; y--)
{
fixed_t xf = xfrac;
@ -367,9 +495,9 @@ static void Convert16 (BYTE *src, int srcpitch,
int x, y, savedx;
WORD *dest = (WORD *)destin;
destpitch = (destpitch >> 1) - destwidth;
if (xstep == FRACUNIT && ystep == FRACUNIT)
{
destpitch = (destpitch >> 1) - destwidth;
srcpitch -= destwidth;
for (y = destheight; y != 0; y--)
{
@ -402,7 +530,6 @@ static void Convert16 (BYTE *src, int srcpitch,
}
else
{
destpitch = (destpitch >> 1) - destwidth;
for (y = destheight; y != 0; y--)
{
fixed_t xf = xfrac;
@ -454,9 +581,9 @@ static void Convert24 (BYTE *src, int srcpitch,
int x, y;
BYTE *dest = (BYTE *)destin;
destpitch = destpitch - destwidth*3;
if (xstep == FRACUNIT && ystep == FRACUNIT)
{
destpitch = destpitch - destwidth*3;
srcpitch -= destwidth;
for (y = destheight; y != 0; y--)
{
@ -475,7 +602,6 @@ static void Convert24 (BYTE *src, int srcpitch,
}
else
{
destpitch = destpitch - destwidth*3;
for (y = destheight; y != 0; y--)
{
fixed_t xf = xfrac;
@ -511,9 +637,9 @@ static void Convert32 (BYTE *src, int srcpitch,
int x, y, savedx;
DWORD *dest = (DWORD *)destin;
destpitch = (destpitch >> 2) - destwidth;
if (xstep == FRACUNIT && ystep == FRACUNIT)
{
destpitch = (destpitch >> 2) - destwidth;
srcpitch -= destwidth;
for (y = destheight; y != 0; y--)
{
@ -540,7 +666,6 @@ static void Convert32 (BYTE *src, int srcpitch,
}
else
{
destpitch -= destwidth;
for (y = destheight; y != 0; y--)
{
fixed_t xf = xfrac;