1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #if !defined(SCUMM_HE_FLOODFILL_HE_H) && defined(ENABLE_HE)
24 #define SCUMM_HE_FLOODFILL_HE_H
25 
26 #include "common/rect.h"
27 
28 namespace Scumm {
29 
30 struct FloodFillParameters {
31 	Common::Rect box;
32 	int32 x;
33 	int32 y;
34 	int32 flags;
35 
resetFloodFillParameters36 	void reset() {
37 		box.top = box.left = box.bottom = box.right = 0;
38 		x = 0;
39 		y = 0;
40 		flags = 0;
41 	}
42 };
43 
44 struct FloodFillLine {
45 	int y;
46 	int x1;
47 	int x2;
48 	int inc;
49 };
50 
51 struct FloodFillState {
52 	FloodFillLine *fillLineTable;
53 	FloodFillLine *fillLineTableEnd;
54 	FloodFillLine *fillLineTableCur;
55 	Common::Rect dstBox;
56 	Common::Rect srcBox;
57 	uint8 *dst;
58 	int dst_w;
59 	int dst_h;
60 	int color1;
61 	int color2;
62 	int fillLineTableCount;
63 };
64 
65 class ScummEngine_v90he;
66 
67 typedef bool (*FloodFillPixelCheckCallback)(int x, int y, const FloodFillState *ffs);
68 
69 void floodFill(FloodFillParameters *ffp, ScummEngine_v90he *vm);
70 
71 } // End of namespace Scumm
72 
73 #endif
74