1 /* GemRB - Infinity Engine Emulator
2 * Copyright (C) 2003 The GemRB Project
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #include "RGBAColor.h"
30 class GEM_EXPORT Trapezoid
{
33 int left_edge
, right_edge
;
36 class GEM_EXPORT Gem_Polygon
{
38 Gem_Polygon(Point
* points
, unsigned int count
, Region
*bbox
= NULL
);
43 std::list
<Trapezoid
> trapezoids
;
44 bool PointIn(const Point
&p
) const;
45 bool PointIn(int x
, int y
) const;
47 void ComputeTrapezoids();
50 // wall polygons are used to render area wallgroups
51 // wall polygons never create a surface
52 //ALWAYSCOVER wallpolygon blocks everything that it covers
53 //BASELINE means there is a baseline, the loader makes the distinction
54 //between first edge is base line/separate baseline
55 //DITHER means the polygon only dithers what it covers
57 #define WF_ALWAYSCOVER 0
60 //this is used only externally, but converted to baseline on load time
63 #define WF_COVERANIMS 8
64 // door polygons are not always drawn
65 #define WF_DISABLED 0x80
67 class GEM_EXPORT Wall_Polygon
: public Gem_Polygon
{
69 Wall_Polygon(Point
*points
,int count
,Region
*bbox
) : Gem_Polygon(points
,count
,bbox
) {}
70 //is the point above the baseline
71 bool PointCovered(const Point
&p
) const;
72 bool PointCovered(int x
, int y
) const;
73 ieDword
GetPolygonFlag() const { return wall_flag
; }
74 void SetPolygonFlag(ieDword flg
) { wall_flag
=flg
; }
75 void SetBaseline(const Point
&a
, const Point
&b
);