ScummVM API documentation
dungeonview.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 ULTIMA4_VIEWS_DUNGEONVIEW_H
23 #define ULTIMA4_VIEWS_DUNGEONVIEW_H
24 
25 #include "ultima/ultima4/game/context.h"
26 #include "ultima/ultima4/map/dungeon.h"
27 #include "ultima/ultima4/filesys/savegame.h"
28 #include "ultima/ultima4/map/tileset.h"
29 #include "ultima/ultima4/map/direction.h"
30 #include "ultima/ultima4/views/tileview.h"
31 #include "ultima/ultima4/core/types.h"
32 #include "ultima/ultima4/map/location.h"
33 
34 namespace Ultima {
35 namespace Ultima4 {
36 
37 typedef enum {
38  DNGGRAPHIC_NONE,
39  DNGGRAPHIC_WALL,
40  DNGGRAPHIC_LADDERUP,
41  DNGGRAPHIC_LADDERDOWN,
42  DNGGRAPHIC_LADDERUPDOWN,
43  DNGGRAPHIC_DOOR,
44  DNGGRAPHIC_DNGTILE,
45  DNGGRAPHIC_BASETILE
46 } DungeonGraphicType;
47 
48 Std::vector<MapTile> dungeonViewGetTiles(int fwd, int side);
49 DungeonGraphicType dungeonViewTilesToGraphic(const Std::vector<MapTile> &tiles);
50 
51 #define DungeonViewer (*DungeonView::getInstance())
52 
59 class DungeonView : public TileView {
60  struct MapTiles {
61  MapTile _corridor;
62  MapTile _upLadder;
63  MapTile _downLadder;
64  MapTile _upDownLadder;
65  bool _loaded;
66 
67  MapTiles() : _loaded(false) {
68  }
69  };
70 private:
71  bool _screen3dDungeonViewEnabled;
72  MapTiles _tiles;
73 private:
74  DungeonView(int x, int y, int columns, int rows);
75 public:
76  static DungeonView *_instance;
77  static DungeonView *getInstance();
78 
79  void drawInDungeon(Tile *tile, int x_offset, int distance, Direction orientation, bool tiled);
80  int graphicIndex(int xoffset, int distance, Direction orientation, DungeonGraphicType type);
81  void drawTile(Tile *tile, int x_offset, int distance, Direction orientation);
82  void drawWall(int xoffset, int distance, Direction orientation, DungeonGraphicType type);
83 
84  void display(Context *c, TileView *view);
85  DungeonGraphicType tilesToGraphic(const Std::vector<MapTile> &tiles);
86 
87  bool toggle3DDungeonView() {
88  return _screen3dDungeonViewEnabled = !_screen3dDungeonViewEnabled;
89  }
90 
91  Std::vector<MapTile> getTiles(int fwd, int side);
92 };
93 
94 } // End of namespace Ultima4
95 } // End of namespace Ultima
96 
97 #endif
Definition: vector.h:39
Definition: context.h:55
Definition: dungeonview.h:59
Definition: detection.h:27
Definition: tileview.h:42
Definition: map_tile.h:34
Definition: tile.h:65