ScummVM API documentation
base_stars.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_BASE_STARS_H
23#define TITANIC_BASE_STARS_H
24
25#include "titanic/star_control/frange.h"
26#include "common/array.h"
27
28namespace Common {
29class SeekableReadStream;
30}
31
32namespace Titanic {
33
34enum StarMode { MODE_STARFIELD = 0, MODE_PHOTO = 1 };
35
36class CCamera;
37class CStarCloseup;
38class CString;
39class CSurfaceArea;
40class SimpleFile;
41
43 byte _red;
44 byte _green;
45 byte _blue;
46 byte _thickness;
47 double _value;
48 FVector _position;
49 uint _data[5];
50
52
57
58 bool operator==(const CBaseStarEntry &s) const;
59};
60
62 int _index1;
63 int _index2;
64 CStarPosition() : _index1(0), _index2(0) {}
65
66 bool operator==(const CStarPosition &sp) const {
67 return x == sp.x && y == sp.y && _index1 == sp._index1 && _index2 == sp._index2;
68 }
69};
70
75private:
76 void draw1(CSurfaceArea *surfaceArea, CCamera *camera, CStarCloseup *closeup);
77 void draw2(CSurfaceArea *surfaceArea, CCamera *camera, CStarCloseup *closeup);
78 void draw3(CSurfaceArea *surfaceArea, CCamera *camera, CStarCloseup *closeup);
79 void draw4(CSurfaceArea *surfaceArea, CCamera *camera, CStarCloseup *closeup);
80protected:
81 FRange _minMax;
82 double _minVal;
83 double _maxVal;
84 double _range;
85 double _value1, _value2;
86 double _value3, _value4;
87protected:
92
96 void loadData(const CString &resName);
97
102public:
104public:
105 CBaseStars();
106 virtual ~CBaseStars() {}
107
111 virtual void draw(CSurfaceArea *surfaceArea, CCamera *camera, CStarCloseup *closeup);
112
113 virtual bool loadYale(int v1) { return true; }
114
118 virtual bool selectStar(CSurfaceArea *surfaceArea, CCamera *camera,
119 const Common::Point &pt, void *handler = nullptr) { return false; }
120
124 virtual bool addStar(const CBaseStarEntry *entry) { return false; }
125
126 virtual bool loadStar() { return false; }
127
131 virtual void load(SimpleFile *file) {}
132
136 virtual void save(SimpleFile *file, int indent) {}
137
141 void clear();
142
143 void initialize();
144
145 int size() const { return _data.size(); }
146
150 const CBaseStarEntry *getDataPtr(int index) const;
151
156 int findStar(CSurfaceArea *surfaceArea, CCamera *camera,
157 const Common::Point &pt);
158
159 int baseFn2(CSurfaceArea *surfaceArea, CCamera *camera);
160};
161
162} // End of namespace Titanic
163
164#endif /* TITANIC_BASE_STARS_H */
Definition: array.h:52
size_type size() const
Definition: array.h:316
Definition: stream.h:745
Definition: base_stars.h:74
void loadData(const CString &resName)
virtual void save(SimpleFile *file, int indent)
Definition: base_stars.h:136
int findStar(CSurfaceArea *surfaceArea, CCamera *camera, const Common::Point &pt)
virtual bool addStar(const CBaseStarEntry *entry)
Definition: base_stars.h:124
const CBaseStarEntry * getDataPtr(int index) const
void loadData(Common::SeekableReadStream &s)
virtual bool selectStar(CSurfaceArea *surfaceArea, CCamera *camera, const Common::Point &pt, void *handler=nullptr)
Definition: base_stars.h:118
virtual void draw(CSurfaceArea *surfaceArea, CCamera *camera, CStarCloseup *closeup)
virtual void load(SimpleFile *file)
Definition: base_stars.h:131
void resetEntry(CBaseStarEntry &entry)
Definition: camera.h:42
Definition: star_closeup.h:39
Definition: string.h:40
Definition: surface_area.h:36
Definition: frange.h:29
Definition: fvector.h:36
Definition: simple_file.h:49
Definition: algorithm.h:29
int16 y
Definition: rect.h:49
int16 x
Definition: rect.h:48
Definition: rect.h:144
Definition: base_stars.h:42
void load(Common::SeekableReadStream &s)
Definition: base_stars.h:61