ScummVM API documentation
holomap_v1.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 TWINE_HOLOMAPV1_H
23 #define TWINE_HOLOMAPV1_H
24 
25 #include "twine/holomap.h"
26 #include "twine/shared.h"
27 
28 #define NUM_HOLOMAPCOLORS 32
29 #define HOLOMAP_PALETTE_INDEX (12*16)
30 
31 namespace TwinE {
32 
38 class HolomapV1 : public Holomap {
39 private:
40  using Super = Holomap;
41 
42  struct Location {
43  int16 alpha;
44  int16 beta;
45  int16 size;
46  TextId mess = TextId::kNone;
47  char name[30] = "";
48  };
49 
50  IVec3 _holomapSurface[561];
51 
52  // original game size: 2244 (lba1)
53  struct HolomapSort {
54  int16 z = 0;
55  uint16 projectedPosIdx = 0;
56  };
57  HolomapSort _holomapSort[16 * 32];
58 
59  struct HolomapProjectedPos {
60  uint16 x1 = 0;
61  uint16 y1 = 0;
62  uint16 x2 = 0;
63  uint16 y2 = 0;
64  };
65  HolomapProjectedPos _projectedSurfacePositions[561];
66  int _projectedSurfaceIndex = 0;
67  // float _distanceModifier = 1.0f;
68 
69  int32 _numHoloPos = 0;
70  Location _listHoloPos[MAX_HOLO_POS];
71 
72  int32 _rotPalPos = 0;
73  uint8 _rotPal[NUMOFCOLORS * 3]{0};
74 
75  void drawTitle(int32 centerx, int32 top, const char *title);
76  int32 searchNextArrow(int32 num) const;
77  int32 searchPrevArrow(int32 num) const;
78  void drawCursor(); // DrawCurseur
79  void drawListPos(int xRot, int yRot, int zRot, bool lower);
80 
84  void drawHoloObj(const IVec3 &angle, int32 x, int32 y, int16 size);
85  void computeCoorGlobe(Common::SeekableReadStream *holomapSurfaceStream);
86  void computeCoorMapping();
87  void computeGlobeProj();
88  void drawHoloMap(uint8 *holomapImage, uint32 holomapImageSize);
89  void renderHolomapVehicle(uint &frameNumber, RealValue &move, AnimTimerDataStruct &animTimerData, BodyData &bodyData, AnimData &animData);
90 
94  int32 distance(float distance) const;
95  int32 scale(float val) const;
96 
97 public:
98  HolomapV1(TwinEEngine *engine) : Super(engine) {}
99  virtual ~HolomapV1() = default;
100 
101  int32 _current = 0;
102  int32 _otimer = 0;
103  int32 _dalpha = 0;
104  int32 _dbeta = 0;
105  int32 _calpha = 0;
106  int32 _cbeta = 0;
107  int32 _cgamma = 0;
108  int32 _oalpha = 0;
109  int32 _obeta = 0;
110  bool _automove = false;
111  bool _flagredraw = false;
112  bool _dialstat = false;
113  bool _flagpal = false;
114 
119  bool setHoloPos(int32 locationIdx) override;
120 
121  bool loadLocations() override;
122 
123  const char *getLocationName(int index) const override;
124 
129  void clrHoloPos(int32 locationIdx) override;
130 
131  void holoTraj(int32 trajectoryIndex) override;
132 
134  void initHoloDatas() override;
135 
137  void holoMap() override;
138 };
139 
140 } // namespace TwinE
141 
142 #endif
Definition: holomap.h:45
void initHoloDatas() override
Definition: shared.h:122
Definition: actor.h:55
Definition: holomap_v1.h:38
Definition: stream.h:745
Definition: actor.h:40
Definition: anim.h:58
Definition: twine.h:207
Definition: achievements_tables.h:27
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
void holoMap() override
bool setHoloPos(int32 locationIdx) override
void clrHoloPos(int32 locationIdx) override
Definition: body.h:35