From 531b190d5974f2bb396a19cd4869020ce2669c3a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 2 Jun 2016 23:44:43 +0200 Subject: GRAPHICS: Added FloodFill class to Surface. Moved from WAGE engine and is using stack-based classic floodfill implementation. --- graphics/surface.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'graphics/surface.h') diff --git a/graphics/surface.h b/graphics/surface.h index aaa386b168..e5685bf997 100644 --- a/graphics/surface.h +++ b/graphics/surface.h @@ -24,9 +24,11 @@ #define GRAPHICS_SURFACE_H #include "common/scummsys.h" +#include "common/list.h" namespace Common { struct Rect; +struct Point; } #include "graphics/pixelformat.h" @@ -341,6 +343,20 @@ struct SharedPtrSurfaceDeleter { } }; +class FloodFill { +public: + FloodFill(Surface *surface, uint32 oldColor, uint32 fillColor); + ~FloodFill(); + void addSeed(int x, int y); + void fill(); + +private: + Common::List _queue; + Surface *_surface; + uint32 _oldColor, _fillColor; + byte *_visited; + int _w, _h; +}; } // End of namespace Graphics -- cgit v1.2.3