- Changed true color texture creation to use a newly defined Bitmap class

instead of having the copy functions in the frame buffer class.
- Fixed: The WolfSS didn't have its obituary defined.


SVN r915 (trunk)
This commit is contained in:
Christoph Oelckers 2008-04-15 18:05:39 +00:00
commit ce5d4dba02
17 changed files with 648 additions and 505 deletions

View file

@ -40,6 +40,7 @@
#include "templates.h"
#include "i_system.h"
#include "r_translate.h"
#include "bitmap.h"
typedef bool (*CheckFunc)(FileReader & file);
typedef FTexture * (*CreateFunc)(FileReader & file, int lumpnum);
@ -456,8 +457,11 @@ void FTexture::FillBuffer(BYTE *buff, int pitch, int height, FTextureFormat fmt)
break;
case TEX_RGB:
CopyTrueColorPixels(buff, pitch, height, 0, 0);
{
FBitmap bmp(buff, pitch, pitch, height);
CopyTrueColorPixels(&bmp, 0, 0);
break;
}
default:
I_Error("FTexture::FillBuffer: Unsupported format %d", fmt);
@ -476,25 +480,21 @@ void FTexture::FillBuffer(BYTE *buff, int pitch, int height, FTextureFormat fmt)
//
//===========================================================================
int FTexture::CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf_height, int x, int y, int rotate)
int FTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate)
{
PalEntry *palette = screen->GetPalette();
palette[0].a=255; // temporarily modify the first color's alpha
screen->CopyPixelData(buffer, buf_pitch, buf_height, x, y,
GetPixels(), Width, Height, Height, 1,
rotate, palette);
bmp->CopyPixelData(x, y, GetPixels(), Width, Height, Height, 1, rotate, palette);
palette[0].a=0;
return 0;
}
int FTexture::CopyTrueColorTranslated(BYTE *buffer, int buf_pitch, int buf_height, int x, int y, FRemapTable *remap)
int FTexture::CopyTrueColorTranslated(FBitmap *bmp, int x, int y, FRemapTable *remap)
{
PalEntry *palette = remap->Palette;
palette[0].a=255; // temporarily modify the first color's alpha
screen->CopyPixelData(buffer, buf_pitch, buf_height, x, y,
GetPixels(), Width, Height, Height, 1,
0, palette);
bmp->CopyPixelData(x, y, GetPixels(), Width, Height, Height, 1, 0, palette);
palette[0].a=0;
return 0;