ScummVM API documentation
shared.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_SHARED_H
23 #define TWINE_SHARED_H
24 
25 #include "common/scummsys.h"
26 
27 // lba1 255 - lba2 256
28 #define NUM_GAME_FLAGS 256
29 #define NUM_GAME_FLAGS_LBA1 255
30 
32 #define NUMOFCOLORS 256
33 
34 #define MAX_HOLO_POS 150 /* lba1 */
35 #define MAX_HOLO_POS_2 334 /* lba2 */
36 
37 #define NUM_INVENTORY_ITEMS 28
38 
41 #define GAMEFLAG_INVENTORY_DISABLED 70
42 // Hit
43 #define GAMEFLAG_VIDEO_BAFFE 200
44 // Hit, band-aid
45 #define GAMEFLAG_VIDEO_BAFFE2 201
46 // Hit, black eye
47 #define GAMEFLAG_VIDEO_BAFFE3 202
48 // Ferry #1
49 #define GAMEFLAG_VIDEO_BATEAU 203
50 // Temple of Bu
51 #define GAMEFLAG_VIDEO_TEMPLE 204
52 // White Leaf Desert, flute
53 #define GAMEFLAG_VIDEO_FLUTE2 205
54 // Hamalayi Mountains, chuttle
55 #define GAMEFLAG_VIDEO_NAVETTE 206
56 // Hamalayi Mountains, storm
57 #define GAMEFLAG_VIDEO_NEIGE2 207
58 // Hamalayi Mountains, ski lift
59 #define GAMEFLAG_VIDEO_SURF 208
60 // Ferry #2
61 #define GAMEFLAG_VIDEO_BATEAU2 209
62 // Fortress, Zoe Clone
63 #define GAMEFLAG_VIDEO_CAPTURE 210
64 // Fortress, Rune stone (cut from the game)
65 #define GAMEFLAG_VIDEO_VERSER 211
66 // Fortress, Rune stone
67 #define GAMEFLAG_VIDEO_VERSER2 212
68 // Fortress, explosion
69 #define GAMEFLAG_VIDEO_FORTRESS 213
70 // Sendel give powers to Twinsen and Zoe.
71 #define GAMEFLAG_VIDEO_SENDEL2 214
72 // Hit, reject
73 #define GAMEFLAG_VIDEO_BAFFE5 215
74 // Twinsun explosion (on top of the well)
75 #define GAMEFLAG_VIDEO_EXPLODE 216
76 // Clear water lake
77 #define GAMEFLAG_VIDEO_GLASS2 217
78 // Twinsen in Well of Sendell
79 #define GAMEFLAG_VIDEO_SENDEL 218
80 // Twinsun explosion
81 #define GAMEFLAG_VIDEO_EXPLODE2 219
82 
83 // lba2 Kashes or Zlitos
84 #define GAMEFLAG_MONEY 8
85 // FLAG_ARDOISE
86 #define GAMEFLAG_ARDOISE 28
87 
88 // NUM_PERSO
89 #define OWN_ACTOR_SCENE_INDEX 0
90 #define IS_HERO(x) ((x) == OWN_ACTOR_SCENE_INDEX)
91 
92 namespace TwinE {
93 
94 #include "common/pack-start.h"
95 struct I16Vec3 {
96  int16 x = 0;
97  int16 y = 0;
98  int16 z = 0;
99 };
100 #include "common/pack-end.h"
101 STATIC_ASSERT(sizeof(I16Vec3) == 6, "Unexpected pointTab size");
102 
103 struct IVec2 {
104  constexpr IVec2() : x(0), y(0) {}
105  constexpr IVec2(int32 _x, int32 _y) : x(_x), y(_y) {}
106  int32 x;
107  int32 y;
108 
109  inline IVec2 &operator+=(const IVec2 &other) {
110  x += other.x;
111  y += other.y;
112  return *this;
113  }
114 
115  inline IVec2 &operator-=(const IVec2 &other) {
116  x -= other.x;
117  y -= other.y;
118  return *this;
119  }
120 };
121 
122 struct IVec3 {
123  constexpr IVec3() : x(0), y(0), z(0) {}
124  constexpr IVec3(int32 _x, int32 _y, int32 _z) : x(_x), y(_y), z(_z) {}
125  int32 x;
126  int32 y;
127  int32 z;
128 
129  inline IVec3 &operator=(const I16Vec3 &other) {
130  x = other.x;
131  y = other.y;
132  z = other.z;
133  return *this;
134  }
135 
136  inline IVec3 &operator+=(const IVec3 &other) {
137  x += other.x;
138  y += other.y;
139  z += other.z;
140  return *this;
141  }
142 
143  inline IVec3 &operator-=(const IVec3 &other) {
144  x -= other.x;
145  y -= other.y;
146  z -= other.z;
147  return *this;
148  }
149 };
150 
151 inline constexpr IVec3 operator+(const IVec3 &lhs, const IVec3 &rhs) {
152  return IVec3{lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z};
153 }
154 
155 inline constexpr IVec3 operator-(const IVec3 &lhs, const IVec3 &rhs) {
156  return IVec3{lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z};
157 }
158 
159 inline constexpr IVec3 operator-(const IVec3 &v) {
160  return IVec3{-v.x, -v.y, -v.z};
161 }
162 
170 int32 getDistance2D(int32 x1, int32 z1, int32 x2, int32 z2);
171 int32 getDistance2D(const IVec3 &v1, const IVec3 &v2);
172 
182 int32 getDistance3D(int32 x1, int32 y1, int32 z1, int32 x2, int32 y2, int32 z2);
183 int32 getDistance3D(const IVec3 &v1, const IVec3 &v2);
184 
188 struct BoundingBox {
189  IVec3 mins;
190  IVec3 maxs;
191 
192  bool isValid() const {
193  return mins.x <= maxs.x && mins.y <= maxs.y && mins.z <= maxs.z;
194  }
195 };
196 
198  BoundingBox bbox;
199  bool hasBoundingBox = false;
200 };
201 
202 enum class ActionType : uint8 {
203  ACTION_NOP = 0,
204  ACTION_BODY = 1,
205  ACTION_BODP = 2,
206  ACTION_ANIM = 3,
207  ACTION_ANIP = 4,
208  ACTION_HITTING = 5,
209  ACTION_SAMPLE = 6,
210  ACTION_SAMPLE_FREQ = 7,
211  ACTION_THROW_EXTRA_BONUS = 8,
212  ACTION_THROW_MAGIC_BALL = 9,
213  ACTION_SAMPLE_REPEAT = 10,
214  ACTION_THROW_SEARCH = 11,
215  ACTION_THROW_ALPHA = 12,
216  ACTION_SAMPLE_STOP = 13,
217  ACTION_ZV = 14,
218  ACTION_LEFT_STEP = 15,
219  ACTION_RIGHT_STEP = 16,
220  ACTION_HERO_HITTING = 17,
221  ACTION_THROW_3D = 18,
222  ACTION_THROW_3D_ALPHA = 19,
223  ACTION_THROW_3D_SEARCH = 20,
224  ACTION_THROW_3D_MAGIC = 21,
225  // lba2
226  ACTION_SUPER_HIT = 22,
227  ACTION_THROW_OBJ_3D = 23,
228  ACTION_PATH = 24,
229  ACTION_FLOW = 25,
230  ACTION_FLOW_3D = 26,
231  ACTION_THROW_DART = 27,
232  ACTION_SHIELD = 28,
233  ACTION_SAMPLE_MAGIC = 29,
234  ACTION_THROW_3D_CONQUE = 30,
235  ACTION_ZV_ANIMIT = 31,
236  ACTION_IMPACT = 32,
237  ACTION_RENVOIE = 33,
238  ACTION_RENVOYABLE = 34,
239  ACTION_TRANSPARENT = 35,
240  ACTION_SCALE = 36,
241  ACTION_LEFT_JUMP = 37,
242  ACTION_RIGHT_JUMP = 38,
243  ACTION_NEW_SAMPLE = 39,
244  ACTION_IMPACT_3D = 40,
245  ACTION_THROW_MAGIC_EXTRA = 41,
246  ACTION_THROW_FOUDRE = 42
247 };
248 
249 enum class ShapeType {
250  kNone = 0,
251  kSolid = 1,
252  kStairsTopLeft = 2,
253  kStairsTopRight = 3,
254  kStairsBottomLeft = 4,
255  kStairsBottomRight = 5,
256  kDoubleSideStairsTop1 = 6,
257  kDoubleSideStairsBottom1 = 7,
258  kDoubleSideStairsLeft1 = 8,
259  kDoubleSideStairsRight1 = 9,
260  kDoubleSideStairsTop2 = 10,
261  kDoubleSideStairsBottom2 = 11,
262  kDoubleSideStairsLeft2 = 12,
263  kDoubleSideStairsRight2 = 13,
264  kFlatBottom1 = 14,
265  kFlatBottom2 = 15
266 };
267 
269 enum class ControlMode {
270  kNoMove = 0, // NO_MOVE
271  kManual = 1, // MOVE_MANUAL
272  kFollow = 2, // MOVE_FOLLOW
273  kTrack = 3, // MOVE_TRACK
274  kFollow2 = 4, // MOVE_FOLLOW_2
275  kTrackAttack = 5, // MOVE_TRACK_ATTACK
276  kSameXZ = 6, // MOVE_SAME_XZ
277  kRandom = 7, //
278  kPinguin = 7, // MOVE_PINGOUIN kRandom doesn't exist in lba2 ()
279  // lba2
280  kWagon = 8, // MOVE_WAGON
281  kCircle = 9, // MOVE_CIRCLE Beta = Tangent lines to circles
282  kCircle2 = 10, // MOVE_CIRCLE2 Beta = Facing the flag
283  kSameXYBeta = 11, // MOVE_SAME_XZ_BETA
284  kBuggy = 12, // MOVE_BUGGY
285  kBuggyManual = 13 // MOVE_BUGGY_MANUAL
286 };
287 
288 enum class AnimationTypes {
289  kAnimNone = -1,
290  kStanding = 0, // GEN_ANIM_RIEN
291  kForward = 1, // GEN_ANIM_MARCHE
292  kBackward = 2, // GEN_ANIM_RECULE
293  kTurnLeft = 3, // GEN_ANIM_GAUCHE
294  kTurnRight = 4, // GEN_ANIM_DROITE
295  kHit = 5,
296  kBigHit = 6,
297  kFall = 7,
298  kLanding = 8,
299  kLandingHit = 9,
300  kLandDeath = 10,
301  kAction = 11,
302  kClimbLadder = 12,
303  kTopLadder = 13,
304  kJump = 14,
305  kThrowBall = 15,
306  kHide = 16,
307  kKick = 17,
308  kRightPunch = 18,
309  kLeftPunch = 19,
310  kFoundItem = 20,
311  kDrawn = 21,
312  kHit2 = 22,
313  kSabreAttack = 23,
314  kPush = 27, // GEN_ANIM_POUSSE
315  kSabreUnknown = 24,
316  kCarStarting = 303,
317  kCarDriving = 304,
318  kCarDrivingBackwards = 305,
319  kCarStopping = 306,
320  kCarFrozen = 307,
321  kAnimInvalid = 255
322 };
323 
324 enum class AnimType {
325  kAnimationTypeRepeat = 0, // ANIM_REPEAT
326  kAnimationThen = 1, // ANIM_THEN
327  // play animation and let animExtra follow as next animation
328  // if there is already a next animation set - replace the value
329  kAnimationAllThen = 2, // ANIM_ALL_THEN
330  // replace animation and let the current animation follow
331  kAnimationInsert = 3, // ANIM_TEMPO
332  // play animation and let animExtra follow as next animation
333  // but don't take the current state in account
334  kAnimationSet = 4 // ANIM_FINAL
335 };
336 
349 enum class HeroBehaviourType {
350  kNormal = 0, // C_NORMAL
351  kAthletic = 1, // C_SPORTIF
352  kAggressive = 2, // C_AGRESSIF
353  kDiscrete = 3, // C_DISCRET
354  kProtoPack = 4, // C_PROTOPACK
355 #if 0
356  kDOUBLE = 5, // C_DOUBLE Twinsen + ZoĆ©
357  kCONQUE = 6, // C_CONQUE Conque
358  kSCAPH_INT_NORM = 7, // C_SCAPH_INT_NORM Scaphandre Interieur Normal
359  kJETPACK = 8, // C_JETPACK SuperJetPack
360  kSCAPH_INT_SPOR = 9, // C_SCAPH_INT_SPOR Scaphandre Interieur Sportif
361  kSCAPH_EXT_NORM = 10, // C_SCAPH_EXT_NORM Scaphandre Exterieur Normal
362  kSCAPH_EXT_SPOR = 11, // C_SCAPH_EXT_SPOR Scaphandre Exterieur Sportif
363  kBUGGY = 12, // C_BUGGY Conduite du buggy
364  kSKELETON = 13, // C_SKELETON Squelette Electrique
365 #endif
366  kMax
367 };
368 
369 // lba2
370 #define CUBE_INTERIEUR 0
371 #define CUBE_EXTERIEUR 1
372 
382 enum class BodyType {
383  btNone = -1, // Lba1/Lba2 NO_BODY (255)
384  btNormal = 0, // Lba1/Lba2 GEN_BODY_NORMAL
385  btTunic = 1, // Lba1/Lba2 GEN_BODY_TUNIQUE
386  btSabre = 2, // Lba1/Lba2 GEN_BODY_SABRE
387 
388  btPrisonSuit = 3, // Lba1
389  btNurseSuit = 4, // Lba1
390  btHorn = 5, // Lba1
391  btSnowboard = 6, // Lba1
392 
393  btBlowTube = 3, // Lba2 GEN_BODY_SARBACANE
394  btSarbatron = 4, // Lba2 GEN_BODY_SARBATRON
395  btGlove = 5, // Lba2 GEN_BODY_GANT
396 
397  btLaserPistole = 6, // Lba2 GEN_BODY_PISTOLASER
398  btMage = 7, // Lba2 GEN_BODY_MAGE
399  btMageBlowtube = 8, // Lba2 GEN_BODY_MAGE_SARBACANE
400  btBodyFire = 9, // Lba2 GEN_BODY_FEU
401  btTunicTir = 10, // Lba2 GEN_BODY_TUNIQUE_TIR
402  btMageTir = 11, // Lba2 GEN_BODY_MAGE_TIR
403  btLabyrinth = 12 // Lba2 GEN_BODY_LABYRINTHE
404 };
405 
406 enum class ExtraSpecialType {
407  kHitStars = 0,
408  kExplodeCloud = 1,
409  kFountain = 2
410 };
411 
412 enum class ZoneType {
413  kCube = 0, // Change to another scene
414  kCamera = 1, // Binds camera view
415  kSceneric = 2, // For use in Life Script
416  kGrid = 3, // Set disappearing Grid fragment
417  kObject = 4, // Give bonus
418  kText = 5, // Displays text message
419  kLadder = 6, // Hero can climb on it
420  // lba2
421  kEscalator = 7,
422  kHit = 8,
423  kRail = 9
424 };
425 
426 #define SCENE_CEILING_GRID_FADE_1 (-1)
427 #define SCENE_CEILING_GRID_FADE_2 (-2)
428 
429 enum LBA1SceneId {
430  Citadel_Island_Prison = 0,
431  Citadel_Island_outside_the_citadel = 1,
432  Citadel_Island_near_the_tavern = 2,
433  Citadel_Island_near_the_pharmacy = 3,
434  Citadel_Island_near_twinsens_house = 4,
435  Citadel_Island_inside_Twinsens_house = 5,
436  Citadel_Island_Harbor = 6,
437  Citadel_Island_Pharmacy = 7,
438  White_Leaf_Desert_Temple_of_Bu_1st_scene = 8,
439  Hamalayi_Mountains_landing_place = 9,
440  Principal_Island_Library = 10,
441  Principal_Island_Harbor = 11,
442  Principal_Island_outside_the_fortress = 12,
443  Principal_Island_Old_Burg = 13,
444  Citadel_Island_Tavern = 14,
445  Hamalayi_Mountains_Rabbibunny_village = 15,
446  Citadel_Island_inside_a_Rabbibunny_house = 16,
447  Principal_Island_Ruins = 17,
448  Principal_Island_outside_the_library = 18,
449  Principal_Island_Militairy_camp = 19,
450  Citadel_Island_Architects_house = 20,
451  Citadel_Island_secret_chamber_in_the_house = 21,
452  Principal_Island_Ticket_office = 22,
453  Principal_Island_Prison = 23,
454  Principal_Island_Port_Belooga = 24,
455  Principal_Island_Peg_Leg_Street = 25,
456  Principal_Island_Shop = 26,
457  Principal_Island_Locksmith = 27,
458  Principal_Island_inside_a_Rabbibunny_house = 28,
459  Principal_Island_Astronimers_House = 29,
460  Principal_Island_Tavern = 30,
461  Principal_Island_Basement_of_the_Astronomer = 31,
462  Principal_Island_Stables = 32,
463  Citadel_Island_Cellar_of_the_Tavern = 33,
464  Citadel_Island_Sewer_of_the_1st_scene = 34,
465  Citadel_Island_Warehouse = 35,
466  White_Leaf_Desert_outside_the_Temple_of_Bu = 36,
467  Principal_Island_outside_the_water_tower = 37,
468  Principal_Island_inside_the_water_tower = 38,
469  White_Leaf_Desert_Militairy_camp = 39,
470  White_Leaf_Desert_Temple_of_Bu_2nd_scene = 40,
471  White_Leaf_Desert_Temple_of_Bu_3rd_scene = 41,
472  Proxima_Island_Proxim_City = 42,
473  Proxima_Island_Museum = 43,
474  Proxima_Island_near_the_Inventors_house = 44,
475  Proxima_Island_upper_rune_stone = 45,
476  Proxima_Island_lower_rune_stone = 46,
477  Proxima_Island_befor_the_upper_rune_stone = 47,
478  Proxima_Island_Forgers_house = 48,
479  Proxima_Island_Prison = 49,
480  Proxima_Island_Shop = 50,
481  Proxima_Island_Sewer = 51,
482  Principal_Island_house_at_Peg_Leg_Street = 52,
483  Proxima_Island_Grobo_house = 53,
484  Proxima_Island_Inventors_house = 54,
485  Citadel_Island_Sewer_secret = 55,
486  Principal_Island_Sewer_secret = 56,
487  White_Leaf_Desert_Maze = 57,
488  Principal_Island_House_with_the_TV = 58,
489  Rebelion_Island_Harbor = 59,
490  Rebelion_Island_Rebel_camp = 60,
491  Some_room_cut_out = 61,
492  Hamalayi_Mountains_1st_fighting_scene = 62,
493  Hamalayi_Mountains_2nd_fighting_scene = 63,
494  Hamalayi_Mountains_Prison = 64,
495  Hamalayi_Mountains_outside_the_transporter = 65,
496  Hamalayi_Mountains_inside_the_transporter = 66,
497  Hamalayi_Mountains_Mutation_centre_1st_scene = 67,
498  Hamalayi_Mountains_Mutation_centre_2nd_scene = 68,
499  Hamalayi_Mountains_3rd_fighting_scene = 69,
500  Hamalayi_Mountains_Entrance_to_the_prison = 70,
501  Hamalayi_Mountains_outside_the_prison = 71,
502  Hamalayi_Mountains_Catamaran_dock = 72,
503  Hamalayi_Mountains_Bunker_near_clear_water = 73,
504  Tippet_Island_Village = 74,
505  Tippet_Island_Secret_passage_scene_2 = 75,
506  Tippet_Island_near_the_bar = 76,
507  Tippet_Island_Secret_passage_scene_1 = 77,
508  Tippet_Island_near_the_Dino_Fly = 78,
509  Tippet_Island_Secret_passage_scene_3 = 79,
510  Tippet_Island_Twinsun_Cafe = 80,
511  Hamalayi_Mountains_Sacret_Carrot = 81,
512  Hamalayi_Mountains_Backdoor_of_the_prison = 82,
513  Fortress_Island_inside_the_fortress = 83,
514  Fortress_Island_outside_the_forstress = 84,
515  Fortress_Island_Secret_passage_scene_1 = 85,
516  Fortress_Island_Secret_in_the_fortress = 86,
517  Fortress_Island_near_Zoes_cell = 87,
518  Fortress_Island_Swimming_pool = 88,
519  Fortress_Island_Cloning_centre = 89,
520  Fortress_Island_Rune_stone = 90,
521  Hamalayi_Mountains_Behind_the_sacret_carrot = 91,
522  Hamalayi_Mountains_Clear_water_lake = 92,
523  Fortress_Island_outside_fortress_destroyed = 93,
524  Brundle_Island_outside_the_teleportation = 94,
525  Brundle_Island_inside_the_teleportation = 95,
526  Hamalayi_Mountains_Ski_resort = 96,
527  Brundle_Island_Docks = 97,
528  Brundle_Island_Secret_room = 98,
529  Brundle_Island_near_the_telepods = 99,
530  Fortress_Island_Docks = 100,
531  Tippet_Island_Shop = 101,
532  Principal_Island_house_in_port_Belooga = 102,
533  Brundle_Island_Painters_house = 103,
534  Citadel_Island_Ticket_Office = 104,
535  Principal_Island_inside_the_fortress = 105,
536  Polar_Island_2nd_scene = 106,
537  Polar_Island_3rd_scene = 107,
538  Polar_Island_Before_the_rocky_peak = 108,
539  Polar_Island_4th_scene = 109,
540  Polar_Island_The_rocky_peak = 110,
541  Polar_Island_on_the_rocky_peak = 111,
542  Polar_Island_Before_the_end_room = 112,
543  Polar_Island_Final_Battle = 113,
544  Polar_Island_end_scene = 114,
545  Polar_Island_1st_scene = 115,
546  Citadel_Island_end_sequence_1 = 116,
547  Citadel_Island_end_sequence_2 = 117,
548  Citadel_Island_Twinsens_house_destroyed = 118,
549  Credits_List_Sequence = 119,
550 
551  SceneIdMax = 120
552 };
553 
554 // lba
555 enum class TextBankId : int16 {
556  None = -1,
557  Options_and_menus = 0,
558  Credits = 1,
559  Inventory_Intro_and_Holomap = 2,
560  Citadel_Island = 3,
561  Principal_Island = 4,
562  White_Leaf_Desert = 5,
563  Proxima_Island = 6,
564  Rebellion_Island = 7,
565  Hamalayi_mountains_southern_range = 8,
566  Hamalayi_mountains_northern_range = 9,
567  Tippet_Island = 10,
568  Brundle_Island = 11,
569  Fortress_Island = 12,
570  Polar_Island = 13
571 };
572 
574 enum class TextId : int16 {
575  kNone = -1,
576  kBehaviourNormal = 0,
577  kBehaviourSporty = 1,
578  kBehaviourAggressiveManual = 2,
579  kBehaviourHiding = 3,
580  kBehaviourAggressiveAuto = 4,
581  kUseProtopack = 5,
582  kSendell = 6,
583  kMusicVolume = 10,
584  kSoundVolume = 11,
585  kCDVolume = 12,
586  kSpeechVolume = 13,
587  kMasterVolume = 14,
588  kReturnGame = 15,
589  kSaveSettings = 16,
590  kNewGame = 20,
591  kNewGamePlus = 255,
592  kContinueGame = 21,
593  kQuit = 22,
594  kOptions = 23,
595  kDelete = 24,
596  kReturnMenu = 26,
597  kGiveUp = 27,
598  kContinue = 28,
599  kVolumeSettings = 30,
600  kDetailsPolygonsHigh = 31,
601  kDetailsShadowHigh = 32,
602  // kSceneryZoomOn = 33, // duplicate with 133 - TODO check if this is the same in all languages
603  kCreateNewPlayer = 40,
604  kCreateSaveGame = 41,
605  kEnterYourName = 42,
606  kPlayerAlreadyExists = 43,
607  kEnterYourNewName = 44,
608  kDeleteSaveGame = 45,
609  kSaveManage = 46,
610  kAdvanced = 47,
611  kDelete2 = 48, // difference between 24 and 48?
612  kTransferVoices = 49,
613  kPleaseWaitWhileVoicesAreSaved = 50,
614  kRemoveProtoPack = 105,
615  kDetailsPolygonsMiddle = 131,
616  kShadowsFigures = 132,
617  kSceneryZoomOn = 133,
618  kIntroText1 = 150,
619  kIntroText2 = 151,
620  kIntroText3 = 152,
621  kBookOfBu = 161,
622  kBonusList = 162,
623  kStarWarsFanBoy = 226,
624  kDetailsPolygonsLow = 231,
625  kShadowsDisabled = 232,
626  kNoSceneryZoom = 233,
627 
628  // custom strings (not originally included in the game)
629  kCustomHighResOptionOn = -2,
630  kCustomHighResOptionOff = -3,
631  kCustomWallCollisionOn = -4,
632  kCustomWallCollisionOff = -5,
633  kCustomLanguageOption = -6,
634  kCustomVoicesNone = -7,
635  kCustomVoicesEnglish = -8,
636  kCustomVoicesFrench = -9,
637  kCustomVoicesGerman = -10,
638 
639  // ------ lba2
640 
641  toContinueGame = 70,
642  toNewGame = 71,
643  toLoadGame = 72,
644  toSauver = 73,
645  toOptions = 74,
646  toQuit = 75
647 };
648 
649 enum InventoryItems {
650  kiHolomap = 0, // lba1/lba2
651  kiMagicBall = 1, // lba1/lba2
652  kiUseSabre = 2, // lba1
653  kiDart = 2, // lba2
654  kiGawleysHorn = 3, // lba1
655  kiTunic = 4, // lba1/lba2
656  kiBookOfBu = 5, // lba1
657  kSendellsMedallion = 6, // lba1
658  kFlaskOfClearWater = 7, // lba1
659  kRedCard = 8, // lba1
660  kBlueCard = 9, // lba1
661  kIDCard = 10, // lba1
662  kMrMiesPass = 11, // lba1
663  kiProtoPack = 12, // lba1/lba2
664  kSnowboard = 13, // lba1
665  kiPenguin = 14, // lba1/lba2
666  kGasItem = 15, // lba1/lba2 (GazoGem)
667  kPirateFlag = 16, // lba1
668  kMagicFlute = 17, // lba1
669  kSpaceGuitar = 18, // lba1
670  kHairDryer = 19, // lba1
671  kAncesteralKey = 20, // lba1
672  kBottleOfSyrup = 21, // lba1
673  kEmptyBottle = 22, // lba1
674  kFerryTicket = 23, // lba1
675  kKeypad = 24, // lba1
676  kCoffeeCan = 25, // lba1
677  kiBonusList = 26, // lba1
678  kiCloverLeaf = 27, // lba1
679  MaxInventoryItems = 28, // lba1
680  MaxInventoryItemsLba2 = 40 // lba2
681 };
682 
684  const char *hqr;
685  int32 index;
686 
687  constexpr TwineResource(const char *_hqr, int32 _index) : hqr(_hqr), index(_index) {
688  }
689 };
690 
691 struct TwineImage {
692  TwineResource image;
693  TwineResource palette;
694 
695  constexpr TwineImage(const char *hqr, int32 index, int32 paletteIndex = -1) : image(hqr, index), palette(hqr, paletteIndex) {
696  }
697 };
698 
699 struct LBAAngles {
700  static int32 ANGLE_360;
701  static int32 ANGLE_351;
702  static int32 ANGLE_334;
703  static int32 ANGLE_315;
704  static int32 ANGLE_270;
705  static int32 ANGLE_225;
706  static int32 ANGLE_210;
707  static int32 ANGLE_180;
708  static int32 ANGLE_157_5;
709  static int32 ANGLE_140;
710  static int32 ANGLE_135;
711  static int32 ANGLE_90;
712  static int32 ANGLE_70;
713  static int32 ANGLE_63;
714  static int32 ANGLE_45;
715  static int32 ANGLE_22_5;
716  static int32 ANGLE_17;
717  static int32 ANGLE_11_25;
718  static int32 ANGLE_2;
719  static int32 ANGLE_1;
720  static int32 ANGLE_0;
721 
722  static void init(int factor);
723 
724  static void lba1();
725  static void lba2();
726 };
727 
728 #define VIEW_X0 (-50)
729 #define VIEW_Y0 (-30)
730 #define VIEW_X1(engine) ((engine)->width() + 40)
731 #define VIEW_Y1(engine) ((engine)->height() + 100)
732 
733 inline int32 NormalizeAngle(int32 angle) {
734  if (angle < -LBAAngles::ANGLE_180) {
735  angle += LBAAngles::ANGLE_360;
736  } else if (angle > LBAAngles::ANGLE_180) {
737  angle -= LBAAngles::ANGLE_360;
738  }
739  return angle;
740 }
741 
746 inline constexpr int32 ToAngle(int32 angle) {
747  // TODO: lba2 handling of factor 4
748  return angle;
749 }
750 
755 inline constexpr int32 FromAngle(int32 angle) {
756  return angle;
757 }
758 
759 inline double AngleToDegree(int32 angle) {
760  return (double)angle / (double)LBAAngles::ANGLE_360 * 360.0;
761 }
762 
763 inline int DegreeToAngle(double degree) {
764  return (int)(degree * (double)LBAAngles::ANGLE_360) / 360.0;
765 }
766 
767 inline int32 ClampAngle(int32 angle) {
768  return angle & (LBAAngles::ANGLE_360 - 1);
769 }
770 
771 template<typename T>
772 inline constexpr T bits(T value, uint8 offset, uint8 bits) {
773  return (((1 << bits) - 1) & (value >> offset));
774 }
775 
776 #define COLOR_BLACK 0
777 #define COLOR_BRIGHT_BLUE 4
778 #define COLOR_9 9
779 #define COLOR_14 14
780 // color 1 = yellow
781 // color 2 - 15 = white
782 // color 16 - 19 = brown
783 // color 20 - 24 = orange to yellow
784 // color 25 orange
785 // color 26 - 30 = bright gray or white
786 #define COlOR_31 31 // green dark
787 #define COlOR_47 47 // green bright
788 #define COLOR_48 48 // brown dark
789 #define COLOR_63 63 // brown bright
790 #define COLOR_64 64 // blue dark
791 #define COLOR_SELECT_MENU 68 // blue
792 // TODO #define COLOR_SELECT_MENU 166 // blue lba2
793 #define COLOR_73 73 // blue
794 #define COLOR_75 75
795 #define COLOR_79 79 // blue bright
796 #define COLOR_80 80
797 #define COLOR_91 91
798 #define COLOR_BRIGHT_BLUE2 69
799 #define COLOR_WHITE 15
800 #define COLOR_GOLD 155
801 #define COLOR_158 158
802 
803 enum kDebugLevels {
804  kDebugScriptsMove = 1 << 0,
805  kDebugScriptsLife = 1 << 1,
806  kDebugTimers = 1 << 2,
807  kDebugResources = 1 << 3,
808  kDebugImGui = 1 << 4,
809  kDebugInput = 1 << 5,
810  kDebugMovies = 1 << 6,
811  kDebugPalette = 1 << 7,
812  kDebugCollision = 1 << 8,
813  kDebugAnimation = 1 << 9,
814  kDebugHolomap = 1 << 10
815 };
816 
817 } // namespace TwinE
818 
819 #endif
Definition: shared.h:103
Definition: shared.h:122
Definition: shared.h:691
Definition: shared.h:683
Definition: shared.h:95
Definition: achievements_tables.h:27
Axis aligned bounding box.
Definition: shared.h:188
Definition: shared.h:197
Definition: shared.h:699