diff options
author | Eugene Sandulenko | 2016-06-02 23:44:43 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-06-03 00:45:56 +0200 |
commit | 531b190d5974f2bb396a19cd4869020ce2669c3a (patch) | |
tree | 64aceb68b7e143a7dc1d7e276cac512c923a5d9a /graphics/surface.h | |
parent | 2c7976e4e94d52bbd27a07eba8ae15379977189b (diff) | |
download | scummvm-rg350-531b190d5974f2bb396a19cd4869020ce2669c3a.tar.gz scummvm-rg350-531b190d5974f2bb396a19cd4869020ce2669c3a.tar.bz2 scummvm-rg350-531b190d5974f2bb396a19cd4869020ce2669c3a.zip |
GRAPHICS: Added FloodFill class to Surface.
Moved from WAGE engine and is using stack-based classic floodfill
implementation.
Diffstat (limited to 'graphics/surface.h')
-rw-r--r-- | graphics/surface.h | 16 |
1 files changed, 16 insertions, 0 deletions
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<Common::Point *> _queue; + Surface *_surface; + uint32 _oldColor, _fillColor; + byte *_visited; + int _w, _h; +}; } // End of namespace Graphics |