22 #ifndef TWINE_SHARED_H 23 #define TWINE_SHARED_H 25 #include "common/scummsys.h" 28 #define NUM_GAME_FLAGS 256 29 #define NUM_GAME_FLAGS_LBA1 255 32 #define NUMOFCOLORS 256 34 #define MAX_HOLO_POS 150 35 #define MAX_HOLO_POS_2 334 37 #define NUM_INVENTORY_ITEMS 28 41 #define GAMEFLAG_INVENTORY_DISABLED 70 43 #define GAMEFLAG_VIDEO_BAFFE 200 45 #define GAMEFLAG_VIDEO_BAFFE2 201 47 #define GAMEFLAG_VIDEO_BAFFE3 202 49 #define GAMEFLAG_VIDEO_BATEAU 203 51 #define GAMEFLAG_VIDEO_TEMPLE 204 53 #define GAMEFLAG_VIDEO_FLUTE2 205 55 #define GAMEFLAG_VIDEO_NAVETTE 206 57 #define GAMEFLAG_VIDEO_NEIGE2 207 59 #define GAMEFLAG_VIDEO_SURF 208 61 #define GAMEFLAG_VIDEO_BATEAU2 209 63 #define GAMEFLAG_VIDEO_CAPTURE 210 65 #define GAMEFLAG_VIDEO_VERSER 211 67 #define GAMEFLAG_VIDEO_VERSER2 212 69 #define GAMEFLAG_VIDEO_FORTRESS 213 71 #define GAMEFLAG_VIDEO_SENDEL2 214 73 #define GAMEFLAG_VIDEO_BAFFE5 215 75 #define GAMEFLAG_VIDEO_EXPLODE 216 77 #define GAMEFLAG_VIDEO_GLASS2 217 79 #define GAMEFLAG_VIDEO_SENDEL 218 81 #define GAMEFLAG_VIDEO_EXPLODE2 219 84 #define GAMEFLAG_MONEY 8 86 #define GAMEFLAG_ARDOISE 28 89 #define OWN_ACTOR_SCENE_INDEX 0 90 #define IS_HERO(x) ((x) == OWN_ACTOR_SCENE_INDEX) 94 #include "common/pack-start.h" 100 #include "common/pack-end.h" 101 STATIC_ASSERT(
sizeof(
I16Vec3) == 6,
"Unexpected pointTab size");
104 constexpr
IVec2() : x(0), y(0) {}
105 constexpr IVec2(int32 _x, int32 _y) : x(_x), y(_y) {}
109 inline IVec2 &operator+=(
const IVec2 &other) {
115 inline IVec2 &operator-=(
const IVec2 &other) {
123 constexpr
IVec3() : x(0), y(0), z(0) {}
124 constexpr IVec3(int32 _x, int32 _y, int32 _z) : x(_x), y(_y), z(_z) {}
129 inline IVec3 &operator=(
const I16Vec3 &other) {
136 inline IVec3 &operator+=(
const IVec3 &other) {
143 inline IVec3 &operator-=(
const IVec3 &other) {
152 return IVec3{lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z};
156 return IVec3{lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z};
159 inline constexpr
IVec3 operator-(
const IVec3 &v) {
160 return IVec3{-v.x, -v.y, -v.z};
170 int32 getDistance2D(int32 x1, int32 z1, int32 x2, int32 z2);
171 int32 getDistance2D(
const IVec3 &v1,
const IVec3 &v2);
182 int32 getDistance3D(int32 x1, int32 y1, int32 z1, int32 x2, int32 y2, int32 z2);
183 int32 getDistance3D(
const IVec3 &v1,
const IVec3 &v2);
192 bool isValid()
const {
193 return mins.x <= maxs.x && mins.y <= maxs.y && mins.z <= maxs.z;
199 bool hasBoundingBox =
false;
202 enum class ActionType : uint8 {
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,
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,
226 ACTION_SUPER_HIT = 22,
227 ACTION_THROW_OBJ_3D = 23,
231 ACTION_THROW_DART = 27,
233 ACTION_SAMPLE_MAGIC = 29,
234 ACTION_THROW_3D_CONQUE = 30,
235 ACTION_ZV_ANIMIT = 31,
238 ACTION_RENVOYABLE = 34,
239 ACTION_TRANSPARENT = 35,
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
249 enum class ShapeType {
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,
269 enum class ControlMode {
288 enum class AnimationTypes {
318 kCarDrivingBackwards = 305,
324 enum class AnimType {
325 kAnimationTypeRepeat = 0,
329 kAnimationAllThen = 2,
331 kAnimationInsert = 3,
349 enum class HeroBehaviourType {
361 kSCAPH_EXT_NORM = 10,
362 kSCAPH_EXT_SPOR = 11,
370 #define CUBE_INTERIEUR 0 371 #define CUBE_EXTERIEUR 1 382 enum class BodyType {
406 enum class ExtraSpecialType {
412 enum class ZoneType {
426 #define SCENE_CEILING_GRID_FADE_1 (-1) 427 #define SCENE_CEILING_GRID_FADE_2 (-2) 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,
555 enum class TextBankId : int16 {
557 Options_and_menus = 0,
559 Inventory_Intro_and_Holomap = 2,
561 Principal_Island = 4,
562 White_Leaf_Desert = 5,
564 Rebellion_Island = 7,
565 Hamalayi_mountains_southern_range = 8,
566 Hamalayi_mountains_northern_range = 9,
569 Fortress_Island = 12,
574 enum class TextId : int16 {
576 kBehaviourNormal = 0,
577 kBehaviourSporty = 1,
578 kBehaviourAggressiveManual = 2,
579 kBehaviourHiding = 3,
580 kBehaviourAggressiveAuto = 4,
599 kVolumeSettings = 30,
600 kDetailsPolygonsHigh = 31,
601 kDetailsShadowHigh = 32,
603 kCreateNewPlayer = 40,
604 kCreateSaveGame = 41,
606 kPlayerAlreadyExists = 43,
607 kEnterYourNewName = 44,
608 kDeleteSaveGame = 45,
612 kTransferVoices = 49,
613 kPleaseWaitWhileVoicesAreSaved = 50,
614 kRemoveProtoPack = 105,
615 kDetailsPolygonsMiddle = 131,
616 kShadowsFigures = 132,
617 kSceneryZoomOn = 133,
623 kStarWarsFanBoy = 226,
624 kDetailsPolygonsLow = 231,
625 kShadowsDisabled = 232,
626 kNoSceneryZoom = 233,
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,
649 enum InventoryItems {
657 kSendellsMedallion = 6,
658 kFlaskOfClearWater = 7,
679 MaxInventoryItems = 28,
680 MaxInventoryItemsLba2 = 40
687 constexpr
TwineResource(
const char *_hqr, int32 _index) : hqr(_hqr), index(_index) {
695 constexpr
TwineImage(
const char *hqr, int32 index, int32 paletteIndex = -1) : image(hqr, index), palette(hqr, paletteIndex) {
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;
722 static void init(
int factor);
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) 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;
746 inline constexpr int32 ToAngle(int32 angle) {
755 inline constexpr int32 FromAngle(int32 angle) {
759 inline double AngleToDegree(int32 angle) {
760 return (
double)angle / (double)LBAAngles::ANGLE_360 * 360.0;
763 inline int DegreeToAngle(
double degree) {
764 return (
int)(degree * (double)LBAAngles::ANGLE_360) / 360.0;
767 inline int32 ClampAngle(int32 angle) {
768 return angle & (LBAAngles::ANGLE_360 - 1);
772 inline constexpr T bits(T value, uint8 offset, uint8 bits) {
773 return (((1 << bits) - 1) & (value >> offset));
776 #define COLOR_BLACK 0 777 #define COLOR_BRIGHT_BLUE 4 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 793 #define COLOR_73 73 // blue 795 #define COLOR_79 79 // blue bright 798 #define COLOR_BRIGHT_BLUE2 69 799 #define COLOR_WHITE 15 800 #define COLOR_GOLD 155 801 #define COLOR_158 158 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
Definition: achievements_tables.h:27
Axis aligned bounding box.
Definition: shared.h:188