mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 16:03:05 +00:00
GRAPHICS: Create FloodFill mask with the matching pixel format of the main surface
This commit is contained in:
parent
97fecbec16
commit
e8e137a46c
@ -543,7 +543,7 @@ FloodFill::FloodFill(Graphics::Surface *surface, uint32 oldColor, uint32 fillCol
|
||||
|
||||
if (_maskMode) {
|
||||
_mask = new Graphics::Surface();
|
||||
_mask->create(_w, _h, Graphics::PixelFormat::createFormatCLUT8()); // Uses calloc()
|
||||
_mask->create(_w, _h, surface->format); // Uses calloc()
|
||||
}
|
||||
|
||||
_visited = (byte *)calloc(_w * _h, 1);
|
||||
@ -588,7 +588,7 @@ void FloodFill::addSeed(int x, int y) {
|
||||
if (!_maskMode)
|
||||
WRITE_UINT16(src, _fillColor);
|
||||
else
|
||||
*((byte *)dst) = 255;
|
||||
*((uint16 *)dst) = 0xffff;
|
||||
|
||||
changed = true;
|
||||
}
|
||||
@ -597,7 +597,7 @@ void FloodFill::addSeed(int x, int y) {
|
||||
if (!_maskMode)
|
||||
WRITE_UINT32(src, _fillColor);
|
||||
else
|
||||
*((byte *)dst) = 255;
|
||||
*((uint32 *)dst) = 0xffffffff;
|
||||
|
||||
changed = true;
|
||||
}
|
||||
@ -632,7 +632,7 @@ void FloodFill::fillMask() {
|
||||
|
||||
if (!_mask) {
|
||||
_mask = new Graphics::Surface();
|
||||
_mask->create(_w, _h, Graphics::PixelFormat::createFormatCLUT8()); // Uses calloc()
|
||||
_mask->create(_w, _h, _surface->format); // Uses calloc()
|
||||
}
|
||||
|
||||
fill();
|
||||
|
Loading…
x
Reference in New Issue
Block a user