- Changed the way gamma works for D3DFB: In windowed mode, the display is
drawn to a texture, then that texture is copied to the real back buffer using a gamma-correcting pixel shader. In fullscreen mode, SetGammaRamp is used. - Fixed flashing of vid_fps display when fps > 1000. - Fixed loading of RGB textures for native 2D mode. - Changed the first rotozoomer's data because it just became too obvious when the backdrop is drawn with a full 256 distinct colors available. - Set the player backdrop to update no more frequently than 35 FPS, so opening the player setup menu before starting a game won't produce a very fast moving backdrop. - Changed the player backdrop into a texture so that it can be drawn like anything else. SVN r648 (trunk)
This commit is contained in:
parent
d1655ca2b9
commit
834e4bef32
21 changed files with 676 additions and 246 deletions
|
|
@ -737,7 +737,7 @@ void FDDSTexture::DecompressDXT5 (FWadLump &lump, bool premultiplied, BYTE *tcbu
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
int FDDSTexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_height, int x, int y)
|
||||
int FDDSTexture::CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf_height, int x, int y)
|
||||
{
|
||||
FWadLump lump = Wads.OpenLumpNum (SourceLump);
|
||||
|
||||
|
|
@ -763,7 +763,7 @@ int FDDSTexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_heigh
|
|||
}
|
||||
|
||||
// All formats decompress to RGBA.
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, TexBuffer, Width, Height, 4, Width*4, CF_RGBA);
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, TexBuffer, Width, Height, 4, Width*4, CF_RGBA);
|
||||
delete [] TexBuffer;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ void FJPEGTexture::MakeTexture ()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
int FJPEGTexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_height, int x, int y)
|
||||
int FJPEGTexture::CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf_height, int x, int y)
|
||||
{
|
||||
PalEntry pe[256];
|
||||
|
||||
|
|
@ -375,18 +375,18 @@ int FJPEGTexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_heig
|
|||
switch (cinfo.out_color_space)
|
||||
{
|
||||
case JCS_RGB:
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, buff, cinfo.output_width, cinfo.output_height,
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, buff, cinfo.output_width, cinfo.output_height,
|
||||
3, cinfo.output_width * cinfo.output_components, CF_RGB);
|
||||
break;
|
||||
|
||||
case JCS_GRAYSCALE:
|
||||
for(int i=0;i<256;i++) pe[i]=PalEntry(0,i,i,i); // default to a gray map
|
||||
screen->CopyPixelData(buffer, buf_width, buf_height, x, y, buff, cinfo.output_width, cinfo.output_height,
|
||||
screen->CopyPixelData(buffer, buf_pitch, buf_height, x, y, buff, cinfo.output_width, cinfo.output_height,
|
||||
1, cinfo.output_width, pe);
|
||||
break;
|
||||
|
||||
case JCS_CMYK:
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, buff, cinfo.output_width, cinfo.output_height,
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, buff, cinfo.output_width, cinfo.output_height,
|
||||
4, cinfo.output_width * cinfo.output_components, CF_CMYK);
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -379,13 +379,13 @@ void FMultiPatchTexture::CheckForHacks ()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
int FMultiPatchTexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_height, int x, int y)
|
||||
int FMultiPatchTexture::CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf_height, int x, int y)
|
||||
{
|
||||
int retv = -1;
|
||||
|
||||
for(int i=0;i<NumParts;i++)
|
||||
{
|
||||
int ret = Parts[i].Texture->CopyTrueColorPixels(buffer, buf_width, buf_height,
|
||||
int ret = Parts[i].Texture->CopyTrueColorPixels(buffer, buf_pitch, buf_height,
|
||||
x+Parts[i].OriginX, y+Parts[i].OriginY);
|
||||
|
||||
if (ret > retv) retv = ret;
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ void FPCXTexture::MakeTexture()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
int FPCXTexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_height, int x, int y)
|
||||
int FPCXTexture::CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf_height, int x, int y)
|
||||
{
|
||||
PalEntry pe[256];
|
||||
PCXHeader header;
|
||||
|
|
@ -472,14 +472,14 @@ int FPCXTexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_heigh
|
|||
lump.Seek(sizeof(header), SEEK_SET);
|
||||
ReadPCX8bits (Pixels, lump, &header);
|
||||
}
|
||||
screen->CopyPixelData(buffer, buf_width, buf_height, x, y, Pixels, Width, Height, 1, Width, pe);
|
||||
screen->CopyPixelData(buffer, buf_pitch, buf_height, x, y, Pixels, Width, Height, 1, Width, pe);
|
||||
}
|
||||
else
|
||||
{
|
||||
Pixels = new BYTE[Width*Height * 3];
|
||||
BYTE * row = buffer;
|
||||
ReadPCX24bits (Pixels, lump, &header, 3);
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, Pixels, Width, Height, 3, Width*3, CF_RGB);
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, Pixels, Width, Height, 3, Width*3, CF_RGB);
|
||||
}
|
||||
delete [] Pixels;
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ void FPNGTexture::MakeTexture ()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
int FPNGTexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_height, int x, int y)
|
||||
int FPNGTexture::CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf_height, int x, int y)
|
||||
{
|
||||
// Parse pre-IDAT chunks. I skip the CRCs. Is that bad?
|
||||
PalEntry pe[256];
|
||||
|
|
@ -469,7 +469,9 @@ int FPNGTexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_heigh
|
|||
|
||||
case MAKE_ID('P','L','T','E'):
|
||||
for(int i=0;i<PaletteSize;i++)
|
||||
{
|
||||
lump >> pe[i].r >> pe[i].g >> pe[i].b;
|
||||
}
|
||||
break;
|
||||
|
||||
case MAKE_ID('t','R','N','S'):
|
||||
|
|
@ -496,20 +498,20 @@ int FPNGTexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_heigh
|
|||
{
|
||||
case 0:
|
||||
case 3:
|
||||
screen->CopyPixelData(buffer, buf_width, buf_height, x, y, Pixels, Width, Height, 1, Width, pe);
|
||||
screen->CopyPixelData(buffer, buf_pitch, buf_height, x, y, Pixels, Width, Height, 1, Width, pe);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, Pixels, Width, Height, 3, pixwidth, CF_RGB);
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, Pixels, Width, Height, 3, pixwidth, CF_RGB);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, Pixels, Width, Height, 2, pixwidth, CF_IA);
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, Pixels, Width, Height, 2, pixwidth, CF_IA);
|
||||
transpal = -1;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, Pixels, Width, Height, 4, pixwidth, CF_RGBA);
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, Pixels, Width, Height, 4, pixwidth, CF_RGBA);
|
||||
transpal = -1;
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -481,11 +481,11 @@ void FTexture::FillBuffer(BYTE *buff, int pitch, int height, FTextureFormat fmt)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
int FTexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_height, int x, int y)
|
||||
int FTexture::CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf_height, int x, int y)
|
||||
{
|
||||
PalEntry * palette = screen->GetPalette();
|
||||
palette[0].a=255; // temporarily modify the first color's alpha
|
||||
screen->CopyPixelData(buffer, buf_width, buf_height, x, y,
|
||||
screen->CopyPixelData(buffer, buf_pitch, buf_height, x, y,
|
||||
GetPixels(), Width, Height, Height, 1,
|
||||
palette);
|
||||
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ void FTGATexture::MakeTexture ()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
int FTGATexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_height, int x, int y)
|
||||
int FTGATexture::CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf_height, int x, int y)
|
||||
{
|
||||
PalEntry pe[256];
|
||||
FWadLump lump = Wads.OpenLumpNum (SourceLump);
|
||||
|
|
@ -469,7 +469,7 @@ int FTGATexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_heigh
|
|||
switch (hdr.img_type & 7)
|
||||
{
|
||||
case 1: // paletted
|
||||
screen->CopyPixelData(buffer, buf_width, buf_height, x, y, ptr, Width, Height, step_x, Pitch, pe);
|
||||
screen->CopyPixelData(buffer, buf_pitch, buf_height, x, y, ptr, Width, Height, step_x, Pitch, pe);
|
||||
break;
|
||||
|
||||
case 2: // RGB
|
||||
|
|
@ -477,21 +477,21 @@ int FTGATexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_heigh
|
|||
{
|
||||
case 15:
|
||||
case 16:
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, ptr, Width, Height, step_x, Pitch, CF_RGB555);
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, ptr, Width, Height, step_x, Pitch, CF_RGB555);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, ptr, Width, Height, step_x, Pitch, CF_BGR);
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, ptr, Width, Height, step_x, Pitch, CF_BGR);
|
||||
break;
|
||||
|
||||
case 32:
|
||||
if ((hdr.img_desc&15)!=8) // 32 bits without a valid alpha channel
|
||||
{
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, ptr, Width, Height, step_x, Pitch, CF_BGR);
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, ptr, Width, Height, step_x, Pitch, CF_BGR);
|
||||
}
|
||||
else
|
||||
{
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, ptr, Width, Height, step_x, Pitch, CF_BGRA);
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, ptr, Width, Height, step_x, Pitch, CF_BGRA);
|
||||
transval = -1;
|
||||
}
|
||||
break;
|
||||
|
|
@ -506,11 +506,11 @@ int FTGATexture::CopyTrueColorPixels(BYTE * buffer, int buf_width, int buf_heigh
|
|||
{
|
||||
case 8:
|
||||
for(int i=0;i<256;i++) pe[i]=PalEntry(0,i,i,i); // gray map
|
||||
screen->CopyPixelData(buffer, buf_width, buf_height, x, y, ptr, Width, Height, step_x, Pitch, pe);
|
||||
screen->CopyPixelData(buffer, buf_pitch, buf_height, x, y, ptr, Width, Height, step_x, Pitch, pe);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
screen->CopyPixelDataRGB(buffer, buf_width, buf_height, x, y, ptr, Width, Height, step_x, Pitch, CF_I16);
|
||||
screen->CopyPixelDataRGB(buffer, buf_pitch, buf_height, x, y, ptr, Width, Height, step_x, Pitch, CF_I16);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue