ScummVM API documentation
star_crosshairs.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_STAR_CROSSHAIRS_H
23 #define TITANIC_STAR_CROSSHAIRS_H
24 
25 #include "titanic/star_control/base_stars.h"
26 #include "titanic/star_control/fpoint.h"
27 #include "titanic/star_control/surface_area.h"
28 #include "titanic/support/video_surface.h"
29 #include "common/array.h"
30 #include "common/rect.h"
31 
32 namespace Titanic {
33 
34 class CStarField;
35 class CStarMarkers;
36 class CCamera;
37 class SimpleFile;
38 
40 private:
42  CStarPosition _entries[3];
43 private:
47  void allocate(int count);
48 
52  void clear();
53 public:
54  int _matchIndex;
55  int _entryIndex;
56 public:
58  ~CStarCrosshairs() { clear(); }
59 
63  void load(SimpleFile *file) {}
64 
68  void save(SimpleFile *file, int indent) {}
69 
73  bool isEmpty() const { return _entryIndex == -1; }
74 
75  void selectStar(int starNum, CVideoSurface *surface, CStarField *starField,
76  CStarMarkers *markers);
77 
78  void draw(CSurfaceArea *surfaceArea);
79 
80  bool fn1(CStarField *starField, CSurfaceArea *surfaceArea, CCamera *camera);
81 
85  void incMatches();
86 
90  void decMatches(CVideoSurface *surface, CStarField *starField, CStarMarkers *markers);
91 
95  void drawStar(int index, CSurfaceArea *surfaceArea);
96 
101  void drawEntry(int index, CVideoSurface *surface, CStarField *starField, CStarMarkers *markers);
102 
106  void eraseCurrent(CSurfaceArea *surfaceArea);
107 
111  void drawAt(const FPoint &pt, CSurfaceArea *surfaceArea);
112 
116  FPoint getPosition() const;
117 
121  int indexOf(const Common::Point &pt) const;
122 
126  bool isSolved() const { return _matchIndex >= 2; }
127 
131  bool isSkipped() const { return _matchIndex == 3; }
132 };
133 
134 } // End of namespace Titanic
135 
136 #endif /* TITANIC_STAR_CROSSHAIRS_H */
Definition: surface_area.h:36
FPoint getPosition() const
void drawAt(const FPoint &pt, CSurfaceArea *surfaceArea)
Definition: star_markers.h:29
Definition: array.h:52
Definition: simple_file.h:49
void drawEntry(int index, CVideoSurface *surface, CStarField *starField, CStarMarkers *markers)
int indexOf(const Common::Point &pt) const
void decMatches(CVideoSurface *surface, CStarField *starField, CStarMarkers *markers)
void eraseCurrent(CSurfaceArea *surfaceArea)
Definition: camera.h:42
Definition: base_stars.h:61
Definition: star_field.h:37
Definition: star_crosshairs.h:39
Definition: rect.h:45
Definition: arm.h:30
void drawStar(int index, CSurfaceArea *surfaceArea)
void load(SimpleFile *file)
Definition: star_crosshairs.h:63
bool isSolved() const
Definition: star_crosshairs.h:126
void save(SimpleFile *file, int indent)
Definition: star_crosshairs.h:68
Definition: video_surface.h:43
Definition: fpoint.h:32
bool isSkipped() const
Definition: star_crosshairs.h:131
bool isEmpty() const
Definition: star_crosshairs.h:73