ScummVM API documentation
star_field.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_FIELD_H
23 #define TITANIC_STAR_FIELD_H
24 
25 #include "titanic/star_control/star_field_base.h"
26 #include "titanic/star_control/star_closeup.h"
27 #include "titanic/star_control/star_markers.h"
28 #include "titanic/star_control/star_crosshairs.h"
29 #include "titanic/star_control/const_boundaries.h"
30 #include "titanic/star_control/constellations.h"
31 
32 namespace Titanic {
33 
34 #define STAR_SCALE 1024.0F
35 #define UNIVERSE_SCALE 3000000.0f
36 
37 class CStarField : public CStarFieldBase {
38 private:
39  CStarMarkers _markers;
40  CStarCrosshairs _crosshairs;
41  CConstBoundaries _constBounds;
42  CConstellations _constMap;
43  CStarCloseup _starCloseup;
44  bool _renderBoundaries;
45  bool _renderConstMap;
46  StarMode _mode;
47  bool _showBox;
48  bool _closeToMarker;
49  bool _isSolved;
50 private:
54  void drawBox(CSurfaceArea *surfaceArea);
55 
60  void renderLockLine(CSurfaceArea *surfaceArea, CCamera *camera);
61 public:
62  CStarField();
63 
67  void load(SimpleFile *file) override;
68 
72  void save(SimpleFile *file, int indent) override;
73 
74  bool initDocument();
75 
79  void render(CVideoSurface *surface, CCamera *camera);
80 
81  bool getBoundaryState() const;
82 
83  void setBoundaryState(bool state);
84 
85  bool getConstMapState() const;
86 
87  void setConstMapState(bool state);
88 
89  int get54() const;
90  void set54(int val);
91 
95  StarMode getMode() const;
96 
100  void setMode(StarMode mode);
101 
105  void toggleBox();
106 
110  bool setBoxVisible(bool isVisible);
111 
115  int getMatchedIndex() const;
116 
120  bool isCloseToMarker() const;
121 
125  void setSolved();
126 
130  bool isSolved() const;
131 
135  bool isSkipped() const;
136 
140  void skipPuzzle();
141 
145  int getMarkerCount() const {
146  return _markers.size();
147  }
148 
149  void fn1(CErrorCode *errorCode);
150 
154  double lockDistance(CSurfaceArea *surfaceArea, CCamera *camera,
155  FVector &screenCoord, FVector &worldCoord, FVector &photoPos);
156 
157  void fn6(CVideoSurface *surface, CCamera *camera);
158 
162  void incLockLevel();
163 
167  void decLockLevel(CVideoSurface *surface);
168 
169  void ToggleSolarRendering() { _starCloseup.fn1(); }
170 
174  bool mouseButtonDown(CVideoSurface *surface, CCamera *camera,
175  int flags, const Common::Point &pt);
176 
180  const CBaseStarEntry *getRandomStar() const;
181 
185  const CBaseStarEntry *getStar(int index) const;
186 };
187 
188 } // End of namespace Titanic
189 
190 #endif /* TITANIC_STAR_FIELD_H */
Definition: surface_area.h:36
void load(SimpleFile *file) override
void decLockLevel(CVideoSurface *surface)
Definition: constellations.h:33
Definition: star_closeup.h:39
bool setBoxVisible(bool isVisible)
Definition: star_markers.h:29
Definition: error_code.h:27
int getMarkerCount() const
Definition: star_field.h:145
const CBaseStarEntry * getRandomStar() const
Definition: star_field_base.h:29
Definition: simple_file.h:49
void render(CVideoSurface *surface, CCamera *camera)
double lockDistance(CSurfaceArea *surfaceArea, CCamera *camera, FVector &screenCoord, FVector &worldCoord, FVector &photoPos)
bool isCloseToMarker() const
Definition: camera.h:42
void save(SimpleFile *file, int indent) override
Definition: star_field.h:37
const CBaseStarEntry * getStar(int index) const
StarMode getMode() const
Definition: star_crosshairs.h:39
bool mouseButtonDown(CVideoSurface *surface, CCamera *camera, int flags, const Common::Point &pt)
Definition: const_boundaries.h:33
Definition: rect.h:45
Definition: arm.h:30
bool isSolved() const
int getMatchedIndex() const
void setMode(StarMode mode)
Definition: base_stars.h:42
Definition: video_surface.h:43
bool isSkipped() const
Definition: fvector.h:36