ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
surface_area.h
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 modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TITANIC_SURFACE_OBJ_H
23 #define TITANIC_SURFACE_OBJ_H
24 
25 #include "titanic/support/rect.h"
26 #include "titanic/support/video_surface.h"
27 #include "titanic/star_control/fpoint.h"
28 #include "titanic/star_control/frect.h"
29 
30 namespace Titanic {
31 
32 enum SurfaceAreaMode {
33  SA_SOLID = 0, SA_MODE1 = 1, SA_MODE2 = 2, SA_XOR = 3, SA_MODE4 = 4
34 };
35 
36 class CSurfaceArea {
37 private:
41  void initialize();
42 
46  void setColor(uint rgb);
47 
48  void pixelToRGB(uint pixel, uint *rgb);
49 
50  Graphics::PixelFormat getPixelFormat() const;
51 public:
52  int _field0;
53  int _width;
54  int _height;
55  int _pitch;
56  int _bpp;
57  byte *_pixelsPtr;
58  FPoint _centroid;
59  uint _pixel;
60  byte _field24;
61  byte _field25;
62  byte _field26;
63  byte _field27;
64  uint _rgb;
65  int _field2C;
66  uint _colorMask;
67  uint _color;
68  SurfaceAreaMode _mode;
69  Rect _bounds;
70  Graphics::Surface *_surface;
71 public:
72  CSurfaceArea(CVideoSurface *surface);
73 
77  SurfaceAreaMode setMode(SurfaceAreaMode mode);
78 
82  void setColorFromPixel();
83 
87  double drawLine(const FPoint &pt1, const FPoint &pt2);
88 
93  double drawLine(const FRect &rect) {
94  return drawLine(FPoint(rect.left, rect.top), FPoint(rect.right, rect.bottom));
95  }
96 };
97 
98 } // End of namespace Titanic
99 
100 #endif /* TITANIC_STAR_CONTROL_SUB16_H */
Definition: surface_area.h:36
Definition: surface.h:67
Definition: frect.h:30
Definition: pixelformat.h:138
double drawLine(const FRect &rect)
Definition: surface_area.h:93
Definition: rect.h:35
Definition: arm.h:30
SurfaceAreaMode setMode(SurfaceAreaMode mode)
double drawLine(const FPoint &pt1, const FPoint &pt2)
Definition: video_surface.h:43
Definition: fpoint.h:32