ScummVM API documentation
holomap.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_HOLOMAP_H
23 #define TWINE_HOLOMAP_H
24 
25 #include "twine/shared.h"
26 #include "common/scummsys.h"
27 
28 #define NUM_HOLOMAPCOLORS 32
29 #define HOLOMAP_PALETTE_INDEX 192
30 
31 namespace Common {
32 class SeekableReadStream;
33 }
34 
35 namespace TwinE {
36 
37 class TwinEEngine;
38 class BodyData;
39 class AnimData;
40 struct ActorMoveStruct;
41 struct Vertex;
42 struct AnimTimerDataStruct;
43 
49 class Holomap {
50 private:
51  TwinEEngine *_engine;
52 
53  struct Location {
54  int16 angleX;
55  int16 angleY;
56  int16 size;
57  TextId textIndex = TextId::kNone;
58  char name[30] = "";
59  };
60 
61  IVec3 _holomapSurface[561];
62 
63  // original game size: 2244 (lba1)
64  struct HolomapSort {
65  int16 z = 0;
66  uint16 projectedPosIdx = 0;
67  };
68  HolomapSort _holomapSort[16 * 32];
69 
70  struct HolomapProjectedPos {
71  uint16 x1 = 0;
72  uint16 y1 = 0;
73  uint16 x2 = 0;
74  uint16 y2 = 0;
75  };
76  HolomapProjectedPos _projectedSurfacePositions[561];
77  int _projectedSurfaceIndex = 0;
78  //float _distanceModifier = 1.0f;
79 
80  int32 _numLocations = 0;
81  Location _locations[NUM_LOCATIONS];
82 
83  int32 _holomapPaletteIndex = 0;
84  uint8 _paletteHolomap[NUMOFCOLORS * 3]{0};
85 
86  void drawHolomapText(int32 centerx, int32 top, const char *title);
87  int32 searchNextArrow(int32 currentLocation, int32 dir) const;
88 
89  void drawListPos(int xRot, int yRot, int zRot, bool lower);
90 
94  void drawHoloObj(const IVec3 &angle, int32 x, int32 y);
95  void computeCoorGlobe(Common::SeekableReadStream *holomapSurfaceStream);
96  void computeCoorMapping();
97  void computeGlobeProj();
98  void drawHoloMap(uint8 *holomapImage, uint32 holomapImageSize);
99  void renderHolomapVehicle(uint &frameNumber, ActorMoveStruct &move, AnimTimerDataStruct &animTimerData, BodyData &bodyData, AnimData &animData);
100 
104  int32 distance(float distance) const;
105  int32 scale(float val) const;
106 
107 public:
108  Holomap(TwinEEngine *engine);
109 
114  void setHolomapPosition(int32 locationIdx);
115 
116  bool loadLocations();
117 
118  const char *getLocationName(int index) const;
119 
124  void clearHolomapPosition(int32 locationIdx);
125 
126  void drawHolomapTrajectory(int32 trajectoryIndex);
127 
129  void initHoloDatas();
130 
132  void holoMap();
133 };
134 
135 } // namespace TwinE
136 
137 #endif
Definition: holomap.h:49
Definition: shared.h:113
Definition: actor.h:55
Definition: stream.h:745
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
constexpr remove_reference_t< T > && move(T &&t) noexcept
Definition: util.h:209
Definition: algorithm.h:29
Definition: anim.h:57
Definition: twine.h:200
Definition: achievements_tables.h:27
Definition: display_client.h:53
Definition: actor.h:40
Definition: body.h:35