mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-02-21 10:51:25 +00:00
- Fixed: When FMultiPatchTexture::MakeTexture() needed to work in RGB
colorspace, it didn't zero out the temporary buffer. SVN r1547 (trunk)
This commit is contained in:
parent
c2ff8c78dd
commit
659be956de
3 changed files with 15 additions and 10 deletions
|
@ -1,4 +1,6 @@
|
||||||
April 15, 2009
|
April 15, 2009
|
||||||
|
- Fixed: When FMultiPatchTexture::MakeTexture() needed to work in RGB
|
||||||
|
colorspace, it didn't zero out the temporary buffer.
|
||||||
- Fixed memory leak from leftover code for 7z loading and added the
|
- Fixed memory leak from leftover code for 7z loading and added the
|
||||||
LUMPF_ZIPFILE flag to their contents so they have the same semantics
|
LUMPF_ZIPFILE flag to their contents so they have the same semantics
|
||||||
as zips.
|
as zips.
|
||||||
|
|
|
@ -339,8 +339,8 @@ static const CopyFunc copyfuncs[][9]={
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
bool ClipCopyPixelRect(int texwidth, int texheight, int &originx, int &originy,
|
bool ClipCopyPixelRect(int texwidth, int texheight, int &originx, int &originy,
|
||||||
const BYTE *&patch, int &srcwidth, int &srcheight,
|
const BYTE *&patch, int &srcwidth, int &srcheight,
|
||||||
int &pstep_x, int &pstep_y, int rotate)
|
int &pstep_x, int &pstep_y, int rotate)
|
||||||
{
|
{
|
||||||
int pixxoffset;
|
int pixxoffset;
|
||||||
int pixyoffset;
|
int pixyoffset;
|
||||||
|
|
|
@ -488,8 +488,6 @@ void FMultiPatchTexture::MakeTexture ()
|
||||||
// Add a little extra space at the end if the texture's height is not
|
// Add a little extra space at the end if the texture's height is not
|
||||||
// a power of 2, in case somebody accidentally makes it repeat vertically.
|
// a power of 2, in case somebody accidentally makes it repeat vertically.
|
||||||
int numpix = Width * Height + (1 << HeightBits) - Height;
|
int numpix = Width * Height + (1 << HeightBits) - Height;
|
||||||
BYTE blendwork[256];
|
|
||||||
static BYTE NullMap[256] = {0};
|
|
||||||
bool hasTranslucent = false;
|
bool hasTranslucent = false;
|
||||||
|
|
||||||
Pixels = new BYTE[numpix];
|
Pixels = new BYTE[numpix];
|
||||||
|
@ -503,18 +501,20 @@ void FMultiPatchTexture::MakeTexture ()
|
||||||
// and merge these pixels in.
|
// and merge these pixels in.
|
||||||
for (int i = 0; i < NumParts; ++i)
|
for (int i = 0; i < NumParts; ++i)
|
||||||
{
|
{
|
||||||
BYTE *trans = Parts[i].Translation? Parts[i].Translation->Remap : NULL;
|
BYTE *trans = Parts[i].Translation ? Parts[i].Translation->Remap : NULL;
|
||||||
if (Parts[i].op != OP_COPY)
|
if (Parts[i].op != OP_COPY)
|
||||||
{
|
{
|
||||||
trans = NullMap;
|
|
||||||
hasTranslucent = true;
|
hasTranslucent = true;
|
||||||
}
|
}
|
||||||
else if (Parts[i].Blend != 0)
|
else
|
||||||
{
|
{
|
||||||
trans = GetBlendMap(Parts[i].Blend, blendwork);
|
if (Parts[i].Blend != 0)
|
||||||
|
{
|
||||||
|
trans = GetBlendMap(Parts[i].Blend, blendwork);
|
||||||
|
}
|
||||||
|
Parts[i].Texture->CopyToBlock (Pixels, Width, Height,
|
||||||
|
Parts[i].OriginX, Parts[i].OriginY, Parts[i].Rotate, trans);
|
||||||
}
|
}
|
||||||
Parts[i].Texture->CopyToBlock (Pixels, Width, Height,
|
|
||||||
Parts[i].OriginX, Parts[i].OriginY, Parts[i].Rotate, trans);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasTranslucent)
|
if (hasTranslucent)
|
||||||
|
@ -522,6 +522,9 @@ void FMultiPatchTexture::MakeTexture ()
|
||||||
// In case there are translucent patches let's do the composition in
|
// In case there are translucent patches let's do the composition in
|
||||||
// True color to keep as much precision as possible before downconverting to the palette.
|
// True color to keep as much precision as possible before downconverting to the palette.
|
||||||
BYTE *buffer = new BYTE[Width * Height * 4];
|
BYTE *buffer = new BYTE[Width * Height * 4];
|
||||||
|
BYTE blendwork[256];
|
||||||
|
|
||||||
|
memset(buffer, 0, Width * Height * 4);
|
||||||
FillBuffer(buffer, Width * 4, Height, TEX_RGB);
|
FillBuffer(buffer, Width * 4, Height, TEX_RGB);
|
||||||
for(int y = 0; y < Height; y++)
|
for(int y = 0; y < Height; y++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue