diff --git a/docs/rh-log.txt b/docs/rh-log.txt index ac304a52d..a5bee140a 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,9 @@ +September 24, 2009 +- Fixed: FMultiPatchTexture::CopyTrueColorPixels() should clear the buffer + first before drawing into it if the copy op passed to it is OP_OVERWRITE. + FTexture::FillBuffer() sets this to erase whatever texture might have been + in the space it is going into. + September 22, 2009 - Added a technique to try and minimize input lag with vsync enabled: Two surfaces are alternately locked for read-only access each frame, forcing diff --git a/src/textures/bitmap.cpp b/src/textures/bitmap.cpp index 913aa507e..f1d78c478 100644 --- a/src/textures/bitmap.cpp +++ b/src/textures/bitmap.cpp @@ -477,3 +477,17 @@ void FBitmap::CopyPixelData(int originx, int originy, const BYTE * patch, int sr } } +//=========================================================================== +// +// Clear buffer +// +//=========================================================================== +void FBitmap::Zero() +{ + BYTE *buffer = data; + for (int y = 0; y < Height; ++y) + { + memset(buffer, 0, Width*4); + buffer += Pitch; + } +} diff --git a/src/textures/bitmap.h b/src/textures/bitmap.h index 04bd580cd..35bdf62a2 100644 --- a/src/textures/bitmap.h +++ b/src/textures/bitmap.h @@ -116,6 +116,7 @@ public: return data; } + void Zero(); virtual void CopyPixelDataRGB(int originx, int originy, const BYTE *patch, int srcwidth, int srcheight, int step_x, int step_y, int rotate, int ct, FCopyInfo *inf = NULL); diff --git a/src/textures/multipatchtexture.cpp b/src/textures/multipatchtexture.cpp index 4b9bd5e1b..66c5276a3 100644 --- a/src/textures/multipatchtexture.cpp +++ b/src/textures/multipatchtexture.cpp @@ -550,7 +550,12 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int w, i if (w < 0 || w > Width) w = Width; if (h < 0 || h > Height) h = Height; - for(int i=0;iop == OP_OVERWRITE) + { + bmp->Zero(); + } + + for(int i = 0; i < NumParts; i++) { int ret = -1;