ScummVM API documentation
scalpel_map.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 SHERLOCK_SCALPEL_MAP_H
23 #define SHERLOCK_SCALPEL_MAP_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 #include "common/rect.h"
28 #include "common/str-array.h"
29 #include "sherlock/surface.h"
30 #include "sherlock/map.h"
31 #include "sherlock/resources.h"
32 
33 namespace Sherlock {
34 
35 class SherlockEngine;
36 
37 namespace Scalpel {
38 
39 
41  int _translate;
42 
43  MapEntry() : Common::Point(), _translate(-1) {}
44 
45  MapEntry(int posX, int posY, int translate) : Common::Point(posX, posY), _translate(translate) {}
46 };
47 
48 class MapPaths {
49 private:
50  int _numLocations;
52 
53 public:
54  MapPaths();
55 
59  void load(int numLocations, Common::SeekableReadStream &s);
60 
64  const byte *getPath(int srcLocation, int destLocation);
65 };
66 
67 class ScalpelMap: public Map {
68 private:
69  Common::Array<MapEntry> _points; // Map locations for each scene
70  Common::StringArray _locationNames;
71  MapPaths _paths;
72  Common::Array<Common::Point> _pathPoints;
73  Common::Point _savedPos;
74  Common::Point _savedSize;
75  Surface _topLine;
76  ImageFile *_mapCursors;
77  ImageFile *_shapes;
78  ImageFile *_iconShapes;
79  WalkSequences _walkSequences;
80  Point32 _lDrawnPos;
81  int _point;
82  bool _placesShown;
83  int _cursorIndex;
84  bool _drawMap;
85  Surface _iconSave;
86 protected:
90  void loadData();
91 
95  void setupSprites();
96 
100  void freeSprites();
101 
105  void showPlaces();
106 
110  void saveTopLine();
111 
115  void eraseTopLine();
116 
120  void showPlaceName(int idx, bool highlighted);
121 
125  void updateMap(bool flushScreen);
126 
130  void walkTheStreets();
131 
135  void saveIcon(ImageFrame *src, const Common::Point &pt);
136 
140  void restoreIcon();
141 
145  void highlightIcon(const Common::Point &pt);
146 public:
148  ~ScalpelMap() override {}
149 
150  const MapEntry &operator[](int idx) { return _points[idx]; }
151 
155  void loadPoints(int count, const int *xList, const int *yList, const int *transList);
156 
160  void loadSequences(int count, const byte *seq);
161 
165  int show() override;
166 };
167 
168 } // End of namespace Scalpel
169 
170 } // End of namespace Sherlock
171 
172 #endif
Definition: surface.h:118
Definition: array.h:52
Definition: animation.h:29
Definition: stream.h:745
Definition: image_file.h:36
Definition: scalpel_map.h:40
Definition: map.h:32
Definition: sherlock.h:76
Definition: scalpel_map.h:67
Definition: rect.h:45
Definition: image_file.h:78
Definition: objects.h:101
Definition: objects.h:146
Definition: scalpel_map.h:48