ScummVM API documentation
dungeon_surface.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 ULTIMA_SHARED_GFX_DUNGEON_H
23 #define ULTIMA_SHARED_GFX_DUNGEON_H
24 
25 #include "ultima/shared/gfx/visual_surface.h"
26 
27 namespace Ultima {
28 namespace Shared {
29 
30 typedef void(*DrawWidgetFn)(Graphics::ManagedSurface &s, uint widgetId, uint distance, byte color);
31 
32 class Game;
33 
38 private:
39  Point _penPos;
40  byte _edgeColor;
41  byte _highlightColor;
42  byte _widgetColor;
43  DrawWidgetFn _widgetFn;
44 public:
48  DungeonSurface(const Graphics::ManagedSurface &src, const Rect &bounds, Game *game, DrawWidgetFn widgetFn);
49 
53  void drawLine(int x0, int y0, int x1, int y1, uint32 color) {
54  Gfx::VisualSurface::drawLine(x0 - 8, y0 - 8, x1 - 8, y1 - 8, color);
55  _penPos = Point(x1, y1);
56  }
57 
61  void drawLineTo(int x, int y, uint32 color) {
62  Gfx::VisualSurface::drawLine(_penPos.x - 8, _penPos.y - 8, x - 8, y - 8, color);
63  _penPos = Point(x, y);
64  }
65 
69  void hLine(int x, int y, int x2, uint32 color) {
70  Gfx::VisualSurface::hLine(x - 8, y - 8, x2 - 8, color);
71  _penPos = Point(x2, y);
72  }
73 
77  void vLine(int x, int y, int y2, uint32 color) {
78  Gfx::VisualSurface::vLine(x - 8, y - 8, y2 - 8, color);
79  _penPos = Point(x, y2);
80  }
81 
85  void frameRect(const Common::Rect &r, uint32 color) {
86  Gfx::VisualSurface::frameRect(Rect(r.left - 8, r.top - 8, r.right - 8, r.bottom - 8), color);
87  }
88 
89 
93  void drawWall(uint distance);
94 
98  void drawDoorway(uint distance);
99 
103  void drawLeftEdge(uint distance);
104 
108  void drawRightEdge(uint distance);
109 
113  void drawWidget(uint widgetId, uint distance, byte color);
114 
118  void drawLadderDownFaceOn(uint distance);
119 
123  void drawLadderDownSideOn(uint distance);
124 
128  void drawLadderUpFaceOn(uint distance);
129 
133  void drawLadderUpSideOn(uint distance);
134 
138  void drawBeams(uint distance);
139 
143  void drawLeftDoor(uint distance);
144 
148  void drawLeftWall(uint distance);
149 
153  void drawLeftBlank(uint distance);
154 
158  void drawRightDoor(uint distance);
159 
163  void drawRightWall(uint distance);
164 
168  void drawRightBlank(uint distance);
169 };
170 
171 } // End of namespace Shared
172 } // End of namespace Ultima
173 
174 #endif
Definition: managed_surface.h:51
void drawDoorway(uint distance)
Definition: game.h:42
void hLine(int x, int y, int x2, uint32 color)
Definition: dungeon_surface.h:69
void drawLadderUpSideOn(uint distance)
Definition: visual_surface.h:39
int16 right
Definition: rect.h:146
void drawRightBlank(uint distance)
void drawLine(int x0, int y0, int x1, int y1, uint32 color)
Definition: managed_surface.h:722
DungeonSurface(const Graphics::ManagedSurface &src, const Rect &bounds, Game *game, DrawWidgetFn widgetFn)
Definition: rect.h:144
Definition: dungeon_surface.h:37
void vLine(int x, int y, int y2, uint32 color)
Definition: managed_surface.h:746
void drawLadderUpFaceOn(uint distance)
Definition: detection.h:27
void drawBeams(uint distance)
void drawLeftEdge(uint distance)
void drawLadderDownFaceOn(uint distance)
void drawLine(int x0, int y0, int x1, int y1, uint32 color)
Definition: dungeon_surface.h:53
Definition: rect.h:45
int16 left
Definition: rect.h:145
void drawLeftBlank(uint distance)
void drawLeftDoor(uint distance)
void drawRightWall(uint distance)
int16 x
Definition: rect.h:46
void frameRect(const Common::Rect &r, uint32 color)
Definition: managed_surface.h:762
int16 y
Definition: rect.h:47
void drawLeftWall(uint distance)
void drawRightDoor(uint distance)
void frameRect(const Common::Rect &r, uint32 color)
Definition: dungeon_surface.h:85
void vLine(int x, int y, int y2, uint32 color)
Definition: dungeon_surface.h:77
void hLine(int x, int y, int x2, uint32 color)
Definition: managed_surface.h:738
void drawWidget(uint widgetId, uint distance, byte color)
void drawLadderDownSideOn(uint distance)
void drawLineTo(int x, int y, uint32 color)
Definition: dungeon_surface.h:61
void drawRightEdge(uint distance)
void drawWall(uint distance)