ScummVM API documentation
mapimage.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 * Additional copyright for this file:
8 * Copyright (C) 1995-1997 Presto Studios, Inc.
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 *
23 */
24
25#ifndef PEGASUS_ITEMS_BIOCHIPS_MAPIMAGE_H
26#define PEGASUS_ITEMS_BIOCHIPS_MAPIMAGE_H
27
28#include "pegasus/elements.h"
29#include "pegasus/surface.h"
30#include "pegasus/util.h"
31#include "pegasus/neighborhood/mars/constants.h"
32
33namespace Common {
34 class ReadStream;
35 class WriteStream;
36}
37
38namespace Pegasus {
39
40class MapImage : public DisplayElement {
41public:
42 MapImage();
43 ~MapImage() override {}
44
45 void writeToStream(Common::WriteStream *);
46 void readFromStream(Common::ReadStream *);
47
48 void loadGearRoomIfNecessary();
49 void loadMazeIfNecessary();
50 void unloadImage();
51 void moveToMapLocation(const NeighborhoodID, const RoomID, const DirectionConstant);
52
53 void draw(const Common::Rect &) override;
54
55 bool anyFlagSet() { return _mappedRooms.anyFlagSet(); }
56
57 static const uint32 kNumMappingRooms = (kMars39 - kMars35 + 1) + (kMars60 - kMars60 + 1) +
58 (kMarsMaze200 - kMarsMaze004 + 1);
59 static const uint32 kNumMappingFlags = kNumMappingRooms * 4;
60
61protected:
62 enum MapArea {
63 kMapNoArea,
64 kMapMaze,
65 kMapGearRoom
66 };
67
68 void addFlagToMask(const int flag);
69 void getRevealedRects(const uint32, Common::Rect &);
70 void drawPlayer();
71
72 MapArea _whichArea;
73
75
76 uint32 _darkGreen, _lightGreen;
77
78 Surface _mapImage, _mapMask;
79};
80
81} // End of namespace Pegasus
82
83#endif
Definition: stream.h:385
Definition: stream.h:77
Definition: elements.h:43
Definition: mapimage.h:40
Definition: surface.h:50
Definition: algorithm.h:29
Definition: rect.h:536