[Scummvm-cvs-logs] scummvm master -> 934e1860637186c98d4dd8434a260923748b8936

sev- sev at scummvm.org
Tue Jun 14 20:45:31 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
934e186063 GRAPHICS: Initialize mask in FllodFill when required


Commit: 934e1860637186c98d4dd8434a260923748b8936
    https://github.com/scummvm/scummvm/commit/934e1860637186c98d4dd8434a260923748b8936
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-06-14T20:45:09+02:00

Commit Message:
GRAPHICS: Initialize mask in FllodFill when required

Changed paths:
    graphics/surface.cpp



diff --git a/graphics/surface.cpp b/graphics/surface.cpp
index 5f87965..699e1cc 100644
--- a/graphics/surface.cpp
+++ b/graphics/surface.cpp
@@ -508,6 +508,11 @@ FloodFill::FloodFill(Graphics::Surface *surface, uint32 oldColor, uint32 fillCol
 	_mask = nullptr;
 	_maskMode = maskMode;
 
+	if (_maskMode) {
+		_mask = new Graphics::Surface();
+		_mask->create(_w, _h, Graphics::PixelFormat::createFormatCLUT8()); // Uses calloc()
+	}
+
 	_visited = (byte *)calloc(_w * _h, 1);
 }
 
@@ -588,10 +593,13 @@ void FloodFill::fill() {
 }
 
 void FloodFill::fillMask() {
-	_mask = new Graphics::Surface();
-	_mask->create(_w, _h, Graphics::PixelFormat::createFormatCLUT8()); // Uses calloc()
 	_maskMode = true;
 
+	if (!_mask) {
+		_mask = new Graphics::Surface();
+		_mask->create(_w, _h, Graphics::PixelFormat::createFormatCLUT8()); // Uses calloc()
+	}
+
 	fill();
 }
 






More information about the Scummvm-git-logs mailing list