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