diff options
| author | Bendegúz Nagy | 2016-09-03 16:01:31 +0200 | 
|---|---|---|
| committer | Bendegúz Nagy | 2016-09-03 16:01:31 +0200 | 
| commit | 3191f2605bbb28704a88ecbf9faa72b62bcb12e7 (patch) | |
| tree | 413ce7400974973147382e0d9948e993d1fa81c8 | |
| parent | d0bae5b805797fa44dc6a68f925fdad718d36284 (diff) | |
| parent | fbe9c92ce1418238d5aaed3e88f7982d80fd375d (diff) | |
| download | scummvm-rg350-3191f2605bbb28704a88ecbf9faa72b62bcb12e7.tar.gz scummvm-rg350-3191f2605bbb28704a88ecbf9faa72b62bcb12e7.tar.bz2 scummvm-rg350-3191f2605bbb28704a88ecbf9faa72b62bcb12e7.zip | |
Merge branch 'dm' of https://github.com/WinterGrascph/scummvm into dm
| -rw-r--r-- | engines/dm/dm.h | 2 | ||||
| -rw-r--r-- | engines/dm/dungeonman.cpp | 382 | ||||
| -rw-r--r-- | engines/dm/eventman.cpp | 4 | ||||
| -rw-r--r-- | engines/dm/eventman.h | 6 | ||||
| -rw-r--r-- | engines/dm/gfx.h | 10 | ||||
| -rw-r--r-- | engines/dm/group.cpp | 8 | ||||
| -rw-r--r-- | engines/dm/group.h | 4 | ||||
| -rw-r--r-- | engines/dm/inventory.cpp | 300 | ||||
| -rw-r--r-- | engines/dm/menus.cpp | 7 | 
9 files changed, 338 insertions, 385 deletions
| diff --git a/engines/dm/dm.h b/engines/dm/dm.h index 35a1f394c7..6127da0038 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -324,7 +324,7 @@ public:  	int16 _waitForInputMaxVerticalBlankCount; // @ G0318_i_WaitForInputMaximumVerticalBlankCount  }; -bool readSaveGameHeader(Common::InSaveFile* in, SaveGameHeader* header); +bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader *header);  } // End of namespace DM diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index 67f0ac730e..1356120388 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -49,31 +49,31 @@ void DungeonMan::setupConstants() {  	ObjectInfo objectInfo[180] = { // @ G0237_as_Graphic559_ObjectInfo  		/* { Type, ObjectAspectIndex, ActionSetIndex, AllowedSlots } */  		ObjectInfo(30,  1,  0, 0x0500),   /* COMPASS        Pouch/Chest */ -		ObjectInfo(144,  0,  0, 0x0200),   /* COMPASS        Hands */ -		ObjectInfo(148, 67,  0, 0x0500),   /* COMPASS        Pouch/Chest */ -		ObjectInfo(149, 67,  0, 0x0500),   /* COMPASS        Pouch/Chest */ -		ObjectInfo(150, 67,  0, 0x0500),   /* TORCH          Pouch/Chest */ -		ObjectInfo(151, 67, 42, 0x0500),   /* TORCH          Pouch/Chest */ -		ObjectInfo(152, 67,  0, 0x0500),   /* TORCH          Pouch/Chest */ -		ObjectInfo(153, 67,  0, 0x0500),   /* TORCH          Pouch/Chest */ -		ObjectInfo(154,  2,  0, 0x0501),   /* WATERSKIN      Mouth/Pouch/Chest */ -		ObjectInfo(155,  2,  0, 0x0501),   /* WATER          Mouth/Pouch/Chest */ -		ObjectInfo(156,  2,  0, 0x0501),   /* JEWEL SYMAL    Mouth/Pouch/Chest */ -		ObjectInfo(157,  2,  0, 0x0501),   /* JEWEL SYMAL    Mouth/Pouch/Chest */ -		ObjectInfo(158,  2,  0, 0x0501),   /* ILLUMULET      Mouth/Pouch/Chest */ -		ObjectInfo(159,  2,  0, 0x0501),   /* ILLUMULET      Mouth/Pouch/Chest */ -		ObjectInfo(160,  2,  0, 0x0501),   /* FLAMITT        Mouth/Pouch/Chest */ -		ObjectInfo(161,  2,  0, 0x0501),   /* FLAMITT        Mouth/Pouch/Chest */ -		ObjectInfo(162,  2,  0, 0x0501),   /* EYE OF TIME    Mouth/Pouch/Chest */ -		ObjectInfo(163,  2,  0, 0x0501),   /* EYE OF TIME    Mouth/Pouch/Chest */ -		ObjectInfo(164, 68,  0, 0x0500),   /* STORMRING      Pouch/Chest */ -		ObjectInfo(165, 68,  0, 0x0500),   /* STORMRING      Pouch/Chest */ -		ObjectInfo(166, 68,  0, 0x0500),   /* STAFF OF CLAWS Pouch/Chest */ -		ObjectInfo(167, 68, 42, 0x0500),   /* STAFF OF CLAWS Pouch/Chest */ -		ObjectInfo(195, 80,  0, 0x0500),   /* STAFF OF CLAWS Pouch/Chest */ +		ObjectInfo(144,  0,  0, 0x0200),  /* COMPASS        Hands */ +		ObjectInfo(148, 67,  0, 0x0500),  /* COMPASS        Pouch/Chest */ +		ObjectInfo(149, 67,  0, 0x0500),  /* COMPASS        Pouch/Chest */ +		ObjectInfo(150, 67,  0, 0x0500),  /* TORCH          Pouch/Chest */ +		ObjectInfo(151, 67, 42, 0x0500),  /* TORCH          Pouch/Chest */ +		ObjectInfo(152, 67,  0, 0x0500),  /* TORCH          Pouch/Chest */ +		ObjectInfo(153, 67,  0, 0x0500),  /* TORCH          Pouch/Chest */ +		ObjectInfo(154,  2,  0, 0x0501),  /* WATERSKIN      Mouth/Pouch/Chest */ +		ObjectInfo(155,  2,  0, 0x0501),  /* WATER          Mouth/Pouch/Chest */ +		ObjectInfo(156,  2,  0, 0x0501),  /* JEWEL SYMAL    Mouth/Pouch/Chest */ +		ObjectInfo(157,  2,  0, 0x0501),  /* JEWEL SYMAL    Mouth/Pouch/Chest */ +		ObjectInfo(158,  2,  0, 0x0501),  /* ILLUMULET      Mouth/Pouch/Chest */ +		ObjectInfo(159,  2,  0, 0x0501),  /* ILLUMULET      Mouth/Pouch/Chest */ +		ObjectInfo(160,  2,  0, 0x0501),  /* FLAMITT        Mouth/Pouch/Chest */ +		ObjectInfo(161,  2,  0, 0x0501),  /* FLAMITT        Mouth/Pouch/Chest */ +		ObjectInfo(162,  2,  0, 0x0501),  /* EYE OF TIME    Mouth/Pouch/Chest */ +		ObjectInfo(163,  2,  0, 0x0501),  /* EYE OF TIME    Mouth/Pouch/Chest */ +		ObjectInfo(164, 68,  0, 0x0500),  /* STORMRING      Pouch/Chest */ +		ObjectInfo(165, 68,  0, 0x0500),  /* STORMRING      Pouch/Chest */ +		ObjectInfo(166, 68,  0, 0x0500),  /* STAFF OF CLAWS Pouch/Chest */ +		ObjectInfo(167, 68, 42, 0x0500),  /* STAFF OF CLAWS Pouch/Chest */ +		ObjectInfo(195, 80,  0, 0x0500),  /* STAFF OF CLAWS Pouch/Chest */  		ObjectInfo(16, 38, 43, 0x0500),   /* BOLT BLADE     Pouch/Chest */  		ObjectInfo(18, 38,  7, 0x0500),   /* BOLT BLADE     Pouch/Chest */ -		ObjectInfo(4, 35,  5, 0x0400),   /* FURY           Chest */ +		ObjectInfo(4, 35,  5, 0x0400),    /* FURY           Chest */  		ObjectInfo(14, 37,  6, 0x0400),   /* FURY           Chest */  		ObjectInfo(20, 11,  8, 0x0040),   /* THE FIRESTAFF  Quiver 1 */  		ObjectInfo(23, 12,  9, 0x0040),   /* THE FIRESTAFF  Quiver 1 */ @@ -114,14 +114,14 @@ void DungeonMan::setupConstants() {  		ObjectInfo(64, 51, 33, 0x0040),   /* SNAKE STAFF    Quiver 1 */  		ObjectInfo(65, 32,  5, 0x0440),   /* THE CONDUIT    Quiver 1/Chest */  		ObjectInfo(66, 30, 35, 0x0040),   /* DRAGON SPIT    Quiver 1 */ -		ObjectInfo(135, 65, 36, 0x0440),   /* SCEPTRE OF LYF Quiver 1/Chest */ -		ObjectInfo(143, 45, 27, 0x0040),   /* ROBE           Quiver 1 */ +		ObjectInfo(135, 65, 36, 0x0440),  /* SCEPTRE OF LYF Quiver 1/Chest */ +		ObjectInfo(143, 45, 27, 0x0040),  /* ROBE           Quiver 1 */  		ObjectInfo(28, 82,  1, 0x0040),   /* FINE ROBE      Quiver 1 */  		ObjectInfo(80, 23,  0, 0x040C),   /* KIRTLE         Neck/Torso/Chest */  		ObjectInfo(81, 23,  0, 0x040C),   /* SILK SHIRT     Neck/Torso/Chest */  		ObjectInfo(82, 23,  0, 0x0410),   /* ELVEN DOUBLET  Legs/Chest */ -		ObjectInfo(112, 55,  0, 0x0420),   /* LEATHER JERKIN Feet/Chest */ -		ObjectInfo(114,  8,  0, 0x0420),   /* TUNIC          Feet/Chest */ +		ObjectInfo(112, 55,  0, 0x0420),  /* LEATHER JERKIN Feet/Chest */ +		ObjectInfo(114,  8,  0, 0x0420),  /* TUNIC          Feet/Chest */  		ObjectInfo(67, 24,  0, 0x0408),   /* GHI            Torso/Chest */  		ObjectInfo(83, 24,  0, 0x0410),   /* MAIL AKETON    Legs/Chest */  		ObjectInfo(68, 24,  0, 0x0408),   /* MITHRAL AKETON Torso/Chest */ @@ -132,102 +132,102 @@ void DungeonMan::setupConstants() {  		ObjectInfo(86, 69,  0, 0x0410),   /* CLOAK OF NIGHT Legs/Chest */  		ObjectInfo(71,  7,  0, 0x0408),   /* BARBARIAN HIDE Torso/Chest */  		ObjectInfo(87,  7,  0, 0x0410),   /* ROBE           Legs/Chest */ -		ObjectInfo(119, 57,  0, 0x0420),   /* FINE ROBE      Feet/Chest */ +		ObjectInfo(119, 57,  0, 0x0420),  /* FINE ROBE      Feet/Chest */  		ObjectInfo(72, 23,  0, 0x0408),   /* TABARD         Torso/Chest */  		ObjectInfo(88, 23,  0, 0x0410),   /* GUNNA          Legs/Chest */ -		ObjectInfo(113, 29,  0, 0x0420),   /* ELVEN HUKE     Feet/Chest */ +		ObjectInfo(113, 29,  0, 0x0420),  /* ELVEN HUKE     Feet/Chest */  		ObjectInfo(89, 69,  0, 0x0410),   /* LEATHER PANTS  Legs/Chest */  		ObjectInfo(73, 69,  0, 0x0408),   /* BLUE PANTS     Torso/Chest */  		ObjectInfo(74, 24,  0, 0x0408),   /* GHI TROUSERS   Torso/Chest */  		ObjectInfo(90, 24,  0, 0x0410),   /* LEG MAIL       Legs/Chest */ -		ObjectInfo(103, 53,  0, 0x0402),   /* MITHRAL MAIL   Head/Chest */ -		ObjectInfo(104, 53,  0, 0x0402),   /* LEG PLATE      Head/Chest */ +		ObjectInfo(103, 53,  0, 0x0402),  /* MITHRAL MAIL   Head/Chest */ +		ObjectInfo(104, 53,  0, 0x0402),  /* LEG PLATE      Head/Chest */  		ObjectInfo(96,  9,  0, 0x0402),   /* POLEYN OF LYTE Head/Chest */  		ObjectInfo(97,  9,  0, 0x0402),   /* POLEYN OF DARC Head/Chest */  		ObjectInfo(98,  9,  0, 0x0402),   /* BEZERKER HELM  Head/Chest */ -		ObjectInfo(105, 54, 41, 0x0400),   /* HELMET         Chest */ -		ObjectInfo(106, 54, 41, 0x0200),   /* BASINET        Hands */ -		ObjectInfo(108, 10, 41, 0x0200),   /* CASQUE 'N COIF Hands */ -		ObjectInfo(107, 54, 41, 0x0200),   /* ARMET          Hands */ +		ObjectInfo(105, 54, 41, 0x0400),  /* HELMET         Chest */ +		ObjectInfo(106, 54, 41, 0x0200),  /* BASINET        Hands */ +		ObjectInfo(108, 10, 41, 0x0200),  /* CASQUE 'N COIF Hands */ +		ObjectInfo(107, 54, 41, 0x0200),  /* ARMET          Hands */  		ObjectInfo(75, 19,  0, 0x0408),   /* HELM OF LYTE   Torso/Chest */  		ObjectInfo(91, 19,  0, 0x0410),   /* HELM OF DARC   Legs/Chest */  		ObjectInfo(76, 19,  0, 0x0408),   /* CALISTA        Torso/Chest */  		ObjectInfo(92, 19,  0, 0x0410),   /* CROWN OF NERRA Legs/Chest */  		ObjectInfo(99,  9,  0, 0x0402),   /* BUCKLER        Head/Chest */ -		ObjectInfo(115, 19,  0, 0x0420),   /* HIDE SHIELD    Feet/Chest */ -		ObjectInfo(100, 52,  0, 0x0402),   /* SMALL SHIELD   Head/Chest */ +		ObjectInfo(115, 19,  0, 0x0420),  /* HIDE SHIELD    Feet/Chest */ +		ObjectInfo(100, 52,  0, 0x0402),  /* SMALL SHIELD   Head/Chest */  		ObjectInfo(77, 20,  0, 0x0008),   /* WOODEN SHIELD  Torso */  		ObjectInfo(93, 22,  0, 0x0010),   /* LARGE SHIELD   Legs */ -		ObjectInfo(116, 56,  0, 0x0420),   /* SHIELD OF LYTE Feet/Chest */ -		ObjectInfo(109, 10, 41, 0x0200),   /* SHIELD OF DARC Hands */ -		ObjectInfo(101, 52,  0, 0x0402),   /* SANDALS        Head/Chest */ +		ObjectInfo(116, 56,  0, 0x0420),  /* SHIELD OF LYTE Feet/Chest */ +		ObjectInfo(109, 10, 41, 0x0200),  /* SHIELD OF DARC Hands */ +		ObjectInfo(101, 52,  0, 0x0402),  /* SANDALS        Head/Chest */  		ObjectInfo(78, 20,  0, 0x0008),   /* SUEDE BOOTS    Torso */  		ObjectInfo(94, 22,  0, 0x0010),   /* LEATHER BOOTS  Legs */ -		ObjectInfo(117, 56,  0, 0x0420),   /* HOSEN          Feet/Chest */ -		ObjectInfo(110, 10, 41, 0x0200),   /* FOOT PLATE     Hands */ -		ObjectInfo(102, 52,  0, 0x0402),   /* GREAVE OF LYTE Head/Chest */ +		ObjectInfo(117, 56,  0, 0x0420),  /* HOSEN          Feet/Chest */ +		ObjectInfo(110, 10, 41, 0x0200),  /* FOOT PLATE     Hands */ +		ObjectInfo(102, 52,  0, 0x0402),  /* GREAVE OF LYTE Head/Chest */  		ObjectInfo(79, 20,  0, 0x0008),   /* GREAVE OF DARC Torso */  		ObjectInfo(95, 22,  0, 0x0010),   /* ELVEN BOOTS    Legs */ -		ObjectInfo(118, 56,  0, 0x0420),   /* GEM OF AGES    Feet/Chest */ -		ObjectInfo(111, 10, 41, 0x0200),   /* EKKHARD CROSS  Hands */ -		ObjectInfo(140, 52,  0, 0x0402),   /* MOONSTONE      Head/Chest */ -		ObjectInfo(141, 19,  0, 0x0408),   /* THE HELLION    Torso/Chest */ -		ObjectInfo(142, 22,  0, 0x0010),   /* PENDANT FERAL  Legs */ -		ObjectInfo(194, 81,  0, 0x0420),   /* COPPER COIN    Feet/Chest */ -		ObjectInfo(196, 84,  0, 0x0408),   /* SILVER COIN    Torso/Chest */ -		ObjectInfo(0, 34,  0, 0x0500),   /* GOLD COIN      Pouch/Chest */ -		ObjectInfo(8,  6,  0, 0x0501),   /* BOULDER        Mouth/Pouch/Chest */ +		ObjectInfo(118, 56,  0, 0x0420),  /* GEM OF AGES    Feet/Chest */ +		ObjectInfo(111, 10, 41, 0x0200),  /* EKKHARD CROSS  Hands */ +		ObjectInfo(140, 52,  0, 0x0402),  /* MOONSTONE      Head/Chest */ +		ObjectInfo(141, 19,  0, 0x0408),  /* THE HELLION    Torso/Chest */ +		ObjectInfo(142, 22,  0, 0x0010),  /* PENDANT FERAL  Legs */ +		ObjectInfo(194, 81,  0, 0x0420),  /* COPPER COIN    Feet/Chest */ +		ObjectInfo(196, 84,  0, 0x0408),  /* SILVER COIN    Torso/Chest */ +		ObjectInfo(0, 34,  0, 0x0500),    /* GOLD COIN      Pouch/Chest */ +		ObjectInfo(8,  6,  0, 0x0501),    /* BOULDER        Mouth/Pouch/Chest */  		ObjectInfo(10, 15,  0, 0x0504),   /* BLUE GEM       Neck/Pouch/Chest */  		ObjectInfo(12, 15,  0, 0x0504),   /* ORANGE GEM     Neck/Pouch/Chest */ -		ObjectInfo(146, 40,  0, 0x0500),   /* GREEN GEM      Pouch/Chest */ -		ObjectInfo(147, 41,  0, 0x0400),   /* MAGICAL BOX    Chest */ -		ObjectInfo(125,  4, 37, 0x0500),   /* MAGICAL BOX    Pouch/Chest */ -		ObjectInfo(126, 83, 37, 0x0500),   /* MIRROR OF DAWN Pouch/Chest */ -		ObjectInfo(127,  4, 37, 0x0500),   /* HORN OF FEAR   Pouch/Chest */ -		ObjectInfo(176, 18,  0, 0x0500),   /* ROPE           Pouch/Chest */ -		ObjectInfo(177, 18,  0, 0x0500),   /* RABBIT'S FOOT  Pouch/Chest */ -		ObjectInfo(178, 18,  0, 0x0500),   /* CORBAMITE      Pouch/Chest */ -		ObjectInfo(179, 18,  0, 0x0500),   /* CHOKER         Pouch/Chest */ -		ObjectInfo(180, 18,  0, 0x0500),   /* DEXHELM        Pouch/Chest */ -		ObjectInfo(181, 18,  0, 0x0500),   /* FLAMEBAIN      Pouch/Chest */ -		ObjectInfo(182, 18,  0, 0x0500),   /* POWERTOWERS    Pouch/Chest */ -		ObjectInfo(183, 18,  0, 0x0500),   /* SPEEDBOW       Pouch/Chest */ -		ObjectInfo(184, 62,  0, 0x0500),   /* CHEST          Pouch/Chest */ -		ObjectInfo(185, 62,  0, 0x0500),   /* OPEN CHEST     Pouch/Chest */ -		ObjectInfo(186, 62,  0, 0x0500),   /* ASHES          Pouch/Chest */ -		ObjectInfo(187, 62,  0, 0x0500),   /* BONES          Pouch/Chest */ -		ObjectInfo(188, 62,  0, 0x0500),   /* MON POTION     Pouch/Chest */ -		ObjectInfo(189, 62,  0, 0x0500),   /* UM POTION      Pouch/Chest */ -		ObjectInfo(190, 62,  0, 0x0500),   /* DES POTION     Pouch/Chest */ -		ObjectInfo(191, 62,  0, 0x0500),   /* VEN POTION     Pouch/Chest */ -		ObjectInfo(128, 76,  0, 0x0200),   /* SAR POTION     Hands */ -		ObjectInfo(129,  3,  0, 0x0500),   /* ZO POTION      Pouch/Chest */ -		ObjectInfo(130, 60,  0, 0x0500),   /* ROS POTION     Pouch/Chest */ -		ObjectInfo(131, 61,  0, 0x0500),   /* KU POTION      Pouch/Chest */ -		ObjectInfo(168, 27,  0, 0x0501),   /* DANE POTION    Mouth/Pouch/Chest */ -		ObjectInfo(169, 28,  0, 0x0501),   /* NETA POTION    Mouth/Pouch/Chest */ -		ObjectInfo(170, 25,  0, 0x0501),   /* BRO POTION     Mouth/Pouch/Chest */ -		ObjectInfo(171, 26,  0, 0x0501),   /* MA POTION      Mouth/Pouch/Chest */ -		ObjectInfo(172, 71,  0, 0x0401),   /* YA POTION      Mouth/Chest */ -		ObjectInfo(173, 70,  0, 0x0401),   /* EE POTION      Mouth/Chest */ -		ObjectInfo(174,  5,  0, 0x0501),   /* VI POTION      Mouth/Pouch/Chest */ -		ObjectInfo(175, 66,  0, 0x0501),   /* WATER FLASK    Mouth/Pouch/Chest */ -		ObjectInfo(120, 15,  0, 0x0504),   /* KATH BOMB      Neck/Pouch/Chest */ -		ObjectInfo(121, 15,  0, 0x0504),   /* PEW BOMB       Neck/Pouch/Chest */ -		ObjectInfo(122, 58,  0, 0x0504),   /* RA BOMB        Neck/Pouch/Chest */ -		ObjectInfo(123, 59,  0, 0x0504),   /* FUL BOMB       Neck/Pouch/Chest */ -		ObjectInfo(124, 59,  0, 0x0504),   /* APPLE          Neck/Pouch/Chest */ -		ObjectInfo(132, 79, 38, 0x0500),   /* CORN           Pouch/Chest */ -		ObjectInfo(133, 63, 38, 0x0500),   /* BREAD          Pouch/Chest */ -		ObjectInfo(134, 64,  0, 0x0500),   /* CHEESE         Pouch/Chest */ -		ObjectInfo(136, 72, 39, 0x0400),   /* SCREAMER SLICE Chest */ -		ObjectInfo(137, 73,  0, 0x0500),   /* WORM ROUND     Pouch/Chest */ -		ObjectInfo(138, 74,  0, 0x0500),   /* DRUMSTICK      Pouch/Chest */ -		ObjectInfo(139, 75,  0, 0x0504),   /* DRAGON STEAK   Neck/Pouch/Chest */ -		ObjectInfo(192, 77,  0, 0x0500),   /* IRON KEY       Pouch/Chest */ -		ObjectInfo(193, 78,  0, 0x0500),   /* KEY OF B       Pouch/Chest */ -		ObjectInfo(197, 74,  0, 0x0000),   /* SOLID KEY */ -		ObjectInfo(198, 41,  0, 0x0400)    /* SQUARE KEY     Chest */ +		ObjectInfo(146, 40,  0, 0x0500),  /* GREEN GEM      Pouch/Chest */ +		ObjectInfo(147, 41,  0, 0x0400),  /* MAGICAL BOX    Chest */ +		ObjectInfo(125,  4, 37, 0x0500),  /* MAGICAL BOX    Pouch/Chest */ +		ObjectInfo(126, 83, 37, 0x0500),  /* MIRROR OF DAWN Pouch/Chest */ +		ObjectInfo(127,  4, 37, 0x0500),  /* HORN OF FEAR   Pouch/Chest */ +		ObjectInfo(176, 18,  0, 0x0500),  /* ROPE           Pouch/Chest */ +		ObjectInfo(177, 18,  0, 0x0500),  /* RABBIT'S FOOT  Pouch/Chest */ +		ObjectInfo(178, 18,  0, 0x0500),  /* CORBAMITE      Pouch/Chest */ +		ObjectInfo(179, 18,  0, 0x0500),  /* CHOKER         Pouch/Chest */ +		ObjectInfo(180, 18,  0, 0x0500),  /* DEXHELM        Pouch/Chest */ +		ObjectInfo(181, 18,  0, 0x0500),  /* FLAMEBAIN      Pouch/Chest */ +		ObjectInfo(182, 18,  0, 0x0500),  /* POWERTOWERS    Pouch/Chest */ +		ObjectInfo(183, 18,  0, 0x0500),  /* SPEEDBOW       Pouch/Chest */ +		ObjectInfo(184, 62,  0, 0x0500),  /* CHEST          Pouch/Chest */ +		ObjectInfo(185, 62,  0, 0x0500),  /* OPEN CHEST     Pouch/Chest */ +		ObjectInfo(186, 62,  0, 0x0500),  /* ASHES          Pouch/Chest */ +		ObjectInfo(187, 62,  0, 0x0500),  /* BONES          Pouch/Chest */ +		ObjectInfo(188, 62,  0, 0x0500),  /* MON POTION     Pouch/Chest */ +		ObjectInfo(189, 62,  0, 0x0500),  /* UM POTION      Pouch/Chest */ +		ObjectInfo(190, 62,  0, 0x0500),  /* DES POTION     Pouch/Chest */ +		ObjectInfo(191, 62,  0, 0x0500),  /* VEN POTION     Pouch/Chest */ +		ObjectInfo(128, 76,  0, 0x0200),  /* SAR POTION     Hands */ +		ObjectInfo(129,  3,  0, 0x0500),  /* ZO POTION      Pouch/Chest */ +		ObjectInfo(130, 60,  0, 0x0500),  /* ROS POTION     Pouch/Chest */ +		ObjectInfo(131, 61,  0, 0x0500),  /* KU POTION      Pouch/Chest */ +		ObjectInfo(168, 27,  0, 0x0501),  /* DANE POTION    Mouth/Pouch/Chest */ +		ObjectInfo(169, 28,  0, 0x0501),  /* NETA POTION    Mouth/Pouch/Chest */ +		ObjectInfo(170, 25,  0, 0x0501),  /* BRO POTION     Mouth/Pouch/Chest */ +		ObjectInfo(171, 26,  0, 0x0501),  /* MA POTION      Mouth/Pouch/Chest */ +		ObjectInfo(172, 71,  0, 0x0401),  /* YA POTION      Mouth/Chest */ +		ObjectInfo(173, 70,  0, 0x0401),  /* EE POTION      Mouth/Chest */ +		ObjectInfo(174,  5,  0, 0x0501),  /* VI POTION      Mouth/Pouch/Chest */ +		ObjectInfo(175, 66,  0, 0x0501),  /* WATER FLASK    Mouth/Pouch/Chest */ +		ObjectInfo(120, 15,  0, 0x0504),  /* KATH BOMB      Neck/Pouch/Chest */ +		ObjectInfo(121, 15,  0, 0x0504),  /* PEW BOMB       Neck/Pouch/Chest */ +		ObjectInfo(122, 58,  0, 0x0504),  /* RA BOMB        Neck/Pouch/Chest */ +		ObjectInfo(123, 59,  0, 0x0504),  /* FUL BOMB       Neck/Pouch/Chest */ +		ObjectInfo(124, 59,  0, 0x0504),  /* APPLE          Neck/Pouch/Chest */ +		ObjectInfo(132, 79, 38, 0x0500),  /* CORN           Pouch/Chest */ +		ObjectInfo(133, 63, 38, 0x0500),  /* BREAD          Pouch/Chest */ +		ObjectInfo(134, 64,  0, 0x0500),  /* CHEESE         Pouch/Chest */ +		ObjectInfo(136, 72, 39, 0x0400),  /* SCREAMER SLICE Chest */ +		ObjectInfo(137, 73,  0, 0x0500),  /* WORM ROUND     Pouch/Chest */ +		ObjectInfo(138, 74,  0, 0x0500),  /* DRUMSTICK      Pouch/Chest */ +		ObjectInfo(139, 75,  0, 0x0504),  /* DRAGON STEAK   Neck/Pouch/Chest */ +		ObjectInfo(192, 77,  0, 0x0500),  /* IRON KEY       Pouch/Chest */ +		ObjectInfo(193, 78,  0, 0x0500),  /* KEY OF B       Pouch/Chest */ +		ObjectInfo(197, 74,  0, 0x0000),  /* SOLID KEY */ +		ObjectInfo(198, 41,  0, 0x0400)   /* SQUARE KEY     Chest */  	};  	ArmourInfo armourInfo[58] = { // G0239_as_Graphic559_ArmourInfo  		/* { Weight, Defense, Attributes, Unreferenced } */ @@ -235,7 +235,7 @@ void DungeonMan::setupConstants() {  		ArmourInfo(4,  10, 0x01),   /* CLOAK OF NIGHT */  		ArmourInfo(3,   4, 0x01),   /* BARBARIAN HIDE */  		ArmourInfo(6,   5, 0x02),   /* SANDALS */ -		ArmourInfo(16,  25, 0x04),   /* LEATHER BOOTS */ +		ArmourInfo(16,  25, 0x04),  /* LEATHER BOOTS */  		ArmourInfo(4,   5, 0x00),   /* ROBE */  		ArmourInfo(4,   5, 0x00),   /* ROBE */  		ArmourInfo(3,   7, 0x01),   /* FINE ROBE */ @@ -249,59 +249,59 @@ void DungeonMan::setupConstants() {  		ArmourInfo(4,  13, 0x02),   /* ELVEN BOOTS */  		ArmourInfo(6,  17, 0x03),   /* LEATHER JERKIN */  		ArmourInfo(8,  20, 0x03),   /* LEATHER PANTS */ -		ArmourInfo(14,  20, 0x03),   /* SUEDE BOOTS */ +		ArmourInfo(14,  20, 0x03),  /* SUEDE BOOTS */  		ArmourInfo(6,  12, 0x02),   /* BLUE PANTS */  		ArmourInfo(5,   9, 0x01),   /* TUNIC */  		ArmourInfo(5,   8, 0x01),   /* GHI */  		ArmourInfo(5,   9, 0x01),   /* GHI TROUSERS */  		ArmourInfo(4,   1, 0x04),   /* CALISTA */  		ArmourInfo(6,   5, 0x04),   /* CROWN OF NERRA */ -		ArmourInfo(11,  12, 0x05),   /* BEZERKER HELM */ -		ArmourInfo(14,  17, 0x05),   /* HELMET */ -		ArmourInfo(15,  20, 0x05),   /* BASINET */ -		ArmourInfo(11,  22, 0x85),   /* BUCKLER */ -		ArmourInfo(10,  16, 0x82),   /* HIDE SHIELD */ -		ArmourInfo(14,  20, 0x83),   /* WOODEN SHIELD */ -		ArmourInfo(21,  35, 0x84),   /* SMALL SHIELD */ -		ArmourInfo(65,  35, 0x05),   /* MAIL AKETON */ -		ArmourInfo(53,  35, 0x05),   /* LEG MAIL */ -		ArmourInfo(52,  70, 0x07),   /* MITHRAL AKETON */ -		ArmourInfo(41,  55, 0x07),   /* MITHRAL MAIL */ -		ArmourInfo(16,  25, 0x06),   /* CASQUE 'N COIF */ -		ArmourInfo(16,  30, 0x06),   /* HOSEN */ -		ArmourInfo(19,  40, 0x07),   /* ARMET */ -		ArmourInfo(120,  65, 0x04),   /* TORSO PLATE */ -		ArmourInfo(80,  56, 0x04),   /* LEG PLATE */ -		ArmourInfo(28,  37, 0x05),   /* FOOT PLATE */ -		ArmourInfo(34,  56, 0x84),   /* LARGE SHIELD */ -		ArmourInfo(17,  62, 0x05),   /* HELM OF LYTE */ -		ArmourInfo(108, 125, 0x04),   /* PLATE OF LYTE */ -		ArmourInfo(72,  90, 0x04),   /* POLEYN OF LYTE */ -		ArmourInfo(24,  50, 0x05),   /* GREAVE OF LYTE */ -		ArmourInfo(30,  85, 0x84),   /* SHIELD OF LYTE */ -		ArmourInfo(35,  76, 0x04),   /* HELM OF DARC */ -		ArmourInfo(141, 160, 0x04),   /* PLATE OF DARC */ -		ArmourInfo(90, 101, 0x04),   /* POLEYN OF DARC */ -		ArmourInfo(31,  60, 0x05),   /* GREAVE OF DARC */ -		ArmourInfo(40, 100, 0x84),   /* SHIELD OF DARC */ -		ArmourInfo(14,  54, 0x06),   /* DEXHELM */ -		ArmourInfo(57,  60, 0x07),   /* FLAMEBAIN */ -		ArmourInfo(81,  88, 0x04),   /* POWERTOWERS */ +		ArmourInfo(11,  12, 0x05),  /* BEZERKER HELM */ +		ArmourInfo(14,  17, 0x05),  /* HELMET */ +		ArmourInfo(15,  20, 0x05),  /* BASINET */ +		ArmourInfo(11,  22, 0x85),  /* BUCKLER */ +		ArmourInfo(10,  16, 0x82),  /* HIDE SHIELD */ +		ArmourInfo(14,  20, 0x83),  /* WOODEN SHIELD */ +		ArmourInfo(21,  35, 0x84),  /* SMALL SHIELD */ +		ArmourInfo(65,  35, 0x05),  /* MAIL AKETON */ +		ArmourInfo(53,  35, 0x05),  /* LEG MAIL */ +		ArmourInfo(52,  70, 0x07),  /* MITHRAL AKETON */ +		ArmourInfo(41,  55, 0x07),  /* MITHRAL MAIL */ +		ArmourInfo(16,  25, 0x06),  /* CASQUE 'N COIF */ +		ArmourInfo(16,  30, 0x06),  /* HOSEN */ +		ArmourInfo(19,  40, 0x07),  /* ARMET */ +		ArmourInfo(120,  65, 0x04), /* TORSO PLATE */ +		ArmourInfo(80,  56, 0x04),  /* LEG PLATE */ +		ArmourInfo(28,  37, 0x05),  /* FOOT PLATE */ +		ArmourInfo(34,  56, 0x84),  /* LARGE SHIELD */ +		ArmourInfo(17,  62, 0x05),  /* HELM OF LYTE */ +		ArmourInfo(108, 125, 0x04), /* PLATE OF LYTE */ +		ArmourInfo(72,  90, 0x04),  /* POLEYN OF LYTE */ +		ArmourInfo(24,  50, 0x05),  /* GREAVE OF LYTE */ +		ArmourInfo(30,  85, 0x84),  /* SHIELD OF LYTE */ +		ArmourInfo(35,  76, 0x04),  /* HELM OF DARC */ +		ArmourInfo(141, 160, 0x04), /* PLATE OF DARC */ +		ArmourInfo(90, 101, 0x04),  /* POLEYN OF DARC */ +		ArmourInfo(31,  60, 0x05),  /* GREAVE OF DARC */ +		ArmourInfo(40, 100, 0x84),  /* SHIELD OF DARC */ +		ArmourInfo(14,  54, 0x06),  /* DEXHELM */ +		ArmourInfo(57,  60, 0x07),  /* FLAMEBAIN */ +		ArmourInfo(81,  88, 0x04),  /* POWERTOWERS */  		ArmourInfo(3,  16, 0x02),   /* BOOTS OF SPEED */  		ArmourInfo(2,   3, 0x03)    /* HALTER */  	};  	WeaponInfo weaponInfo[46] = { // @ G0238_as_Graphic559_WeaponInfo  		/* { Weight, Class, Strength, KineticEnergy, Attributes } */ -		WeaponInfo(1, 130,   2,   0, 0x2000),   /* EYE OF TIME */ -		WeaponInfo(1, 131,   2,   0, 0x2000),   /* STORMRING */ +		WeaponInfo(1, 130,   2,   0, 0x2000),  /* EYE OF TIME */ +		WeaponInfo(1, 131,   2,   0, 0x2000),  /* STORMRING */  		WeaponInfo(11, 0,   8,   2, 0x2000),   /* TORCH */ -		WeaponInfo(12, 112,  10,  80, 0x2028),   /* FLAMITT */ -		WeaponInfo(9, 129,  16,   7, 0x2000),   /* STAFF OF CLAWS */ -		WeaponInfo(30, 113,  49, 110, 0x0942),   /* BOLT BLADE */ +		WeaponInfo(12, 112,  10,  80, 0x2028), /* FLAMITT */ +		WeaponInfo(9, 129,  16,   7, 0x2000),  /* STAFF OF CLAWS */ +		WeaponInfo(30, 113,  49, 110, 0x0942), /* BOLT BLADE */  		WeaponInfo(47, 0,  55,  20, 0x0900),   /* FURY */ -		WeaponInfo(24, 255,  25,  10, 0x20FF),   /* THE FIRESTAFF */ -		WeaponInfo(5, 2,  10,  19, 0x0200),   /* DAGGER */ +		WeaponInfo(24, 255,  25,  10, 0x20FF), /* THE FIRESTAFF */ +		WeaponInfo(5, 2,  10,  19, 0x0200),    /* DAGGER */  		WeaponInfo(33, 0,  30,   8, 0x0900),   /* FALCHION */  		WeaponInfo(32, 0,  34,  10, 0x0900),   /* SWORD */  		WeaponInfo(26, 0,  38,  10, 0x0900),   /* RAPIER */ @@ -317,28 +317,28 @@ void DungeonMan::setupConstants() {  		WeaponInfo(41, 0,  42,  13, 0x2000),   /* MACE OF ORDER */  		WeaponInfo(50, 0,  60,  15, 0x2000),   /* MORNINGSTAR */  		WeaponInfo(36, 0,  19,  10, 0x2700),   /* CLUB */ -		WeaponInfo(110, 0,  44,  22, 0x2600),   /* STONE CLUB */ -		WeaponInfo(10, 20,   1,  50, 0x2032),   /* BOW */ -		WeaponInfo(28, 30,   1, 180, 0x2078),   /* CROSSBOW */ +		WeaponInfo(110, 0,  44,  22, 0x2600),  /* STONE CLUB */ +		WeaponInfo(10, 20,   1,  50, 0x2032),  /* BOW */ +		WeaponInfo(28, 30,   1, 180, 0x2078),  /* CROSSBOW */  		WeaponInfo(2, 10,   2,  10, 0x0100),   /* ARROW */  		WeaponInfo(2, 10,   2,  28, 0x0500),   /* SLAYER */ -		WeaponInfo(19, 39,   5,  20, 0x2032),   /* SLING */ -		WeaponInfo(10, 11,   6,  18, 0x2000),   /* ROCK */ +		WeaponInfo(19, 39,   5,  20, 0x2032),  /* SLING */ +		WeaponInfo(10, 11,   6,  18, 0x2000),  /* ROCK */  		WeaponInfo(3, 12,   7,  23, 0x0800),   /* POISON DART */ -		WeaponInfo(1, 1,   3,  19, 0x0A00),   /* THROWING STAR */ -		WeaponInfo(8, 0,   4,   4, 0x2000),   /* STICK */ -		WeaponInfo(26, 129,  12,   4, 0x2000),   /* STAFF */ -		WeaponInfo(1, 130,   0,   0, 0x2000),   /* WAND */ -		WeaponInfo(2, 140,   1,  20, 0x2000),   /* TEOWAND */ -		WeaponInfo(35, 128,  18,   6, 0x2000),   /* YEW STAFF */ -		WeaponInfo(29, 159,   0,   4, 0x2000),   /* STAFF OF MANAR */ -		WeaponInfo(21, 131,   0,   3, 0x2000),   /* SNAKE STAFF */ -		WeaponInfo(33, 136,   0,   7, 0x2000),   /* THE CONDUIT */ -		WeaponInfo(8, 132,   3,   1, 0x2000),   /* DRAGON SPIT */ -		WeaponInfo(18, 131,   9,   4, 0x2000),   /* SCEPTRE OF LYF */ -		WeaponInfo(8, 192,   1,   1, 0x2000),   /* HORN OF FEAR */ -		WeaponInfo(30, 26,   1, 220, 0x207D),   /* SPEEDBOW */ -		WeaponInfo(36, 255, 100,  50, 0x20FF)   /* THE FIRESTAFF */ +		WeaponInfo(1, 1,   3,  19, 0x0A00),    /* THROWING STAR */ +		WeaponInfo(8, 0,   4,   4, 0x2000),    /* STICK */ +		WeaponInfo(26, 129,  12,   4, 0x2000), /* STAFF */ +		WeaponInfo(1, 130,   0,   0, 0x2000),  /* WAND */ +		WeaponInfo(2, 140,   1,  20, 0x2000),  /* TEOWAND */ +		WeaponInfo(35, 128,  18,   6, 0x2000), /* YEW STAFF */ +		WeaponInfo(29, 159,   0,   4, 0x2000), /* STAFF OF MANAR */ +		WeaponInfo(21, 131,   0,   3, 0x2000), /* SNAKE STAFF */ +		WeaponInfo(33, 136,   0,   7, 0x2000), /* THE CONDUIT */ +		WeaponInfo(8, 132,   3,   1, 0x2000),  /* DRAGON SPIT */ +		WeaponInfo(18, 131,   9,   4, 0x2000), /* SCEPTRE OF LYF */ +		WeaponInfo(8, 192,   1,   1, 0x2000),  /* HORN OF FEAR */ +		WeaponInfo(30, 26,   1, 220, 0x207D),  /* SPEEDBOW */ +		WeaponInfo(36, 255, 100,  50, 0x20FF)  /* THE FIRESTAFF */  	};  	CreatureInfo creatureInfo[k27_CreatureTypeCount] = { // @ G0243_as_Graphic559_CreatureInfo @@ -735,7 +735,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {  		uint8 mapCount = _dungeonFileHeader._mapCount;  		delete[] _dungeonMapData;  		_dungeonMapData = new byte**[_dungeonColumCount + mapCount]; -		byte **colFirstSquares = (byte**)_dungeonMapData + mapCount; +		byte **colFirstSquares = (byte **)_dungeonMapData + mapCount;  		for (uint8 i = 0; i < mapCount; ++i) {  			_dungeonMapData[i] = colFirstSquares;  			byte *square = _dungeonRawMapData + _dungeonMaps[i]._rawDunDataOffset; @@ -897,9 +897,9 @@ T0172010_ClosedFakeWall:  			ThingType curThingType = curThing.getType();  			int16 AL0310_i_SideIndex = normalizeModulo4(curThing.getCell() - dir);  			if (AL0310_i_SideIndex) { /* Invisible on the back wall if 0 */ -				Sensor *curSensor = (Sensor*)getThingData(curThing); +				Sensor *curSensor = (Sensor *)getThingData(curThing);  				if (curThingType == k2_TextstringType) { -					if (((TextString*)curSensor)->isVisible()) { +					if (((TextString *)curSensor)->isVisible()) {  						aspectArray[AL0310_i_SideIndex + 1] = _currMapInscriptionWallOrnIndex + 1;  						_vm->_displayMan->_inscriptionThing = curThing; /* BUG0_76 The same text is drawn on multiple sides of a wall square. The engine stores only a single text to draw on a wall in a global variable. Even if different texts are placed on different sides of the wall, the same text is drawn on each affected side */  					} @@ -948,7 +948,7 @@ T0172010_ClosedFakeWall:  		while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType)) {  			if (curThing.getType() == k3_SensorThingType) { -				Sensor *curSensor = (Sensor*)getThingData(curThing); +				Sensor *curSensor = (Sensor *)getThingData(curThing);  				aspectArray[k4_FloorOrnOrdAspect] = curSensor->getAttrOrnOrdinal();  			}  			curThing = getNextThing(curThing); @@ -1027,7 +1027,7 @@ uint16 *DungeonMan::getThingData(Thing thing) {  	return _thingData[thing.getType()] + thing.getIndex() * _thingDataWordCount[thing.getType()];  } -uint16* DungeonMan::getSquareFirstThingData(int16 mapX, int16 mapY) { +uint16 *DungeonMan::getSquareFirstThingData(int16 mapX, int16 mapY) {  	return getThingData(getSquareFirstThing(mapX, mapY));  } @@ -1263,14 +1263,14 @@ uint16 DungeonMan::getObjectWeight(Thing thing) {  		break;  	case k9_ContainerThingType:  		weight = 50; -		thing = ((Container*)junk)->getSlot(); +		thing = ((Container *)junk)->getSlot();  		while (thing != Thing::_endOfList) {  			weight += getObjectWeight(thing);  			thing = getNextThing(thing);  		}  		break;  	case k8_PotionThingType: -		if (((Potion*)junk)->getType() == k20_PotionTypeEmptyFlask) +		if (((Potion *)junk)->getType() == k20_PotionTypeEmptyFlask)  			weight = 1;  		else  			weight = 3; @@ -1318,7 +1318,7 @@ void DungeonMan::linkThingToList(Thing thingToLink, Thing thingInList, int16 map  			thingInList = getSquareFirstThing(mapX, mapY);  		} else {  			setFlag(*currSquare, k0x0010_ThingListPresent); -			uint16 * tmp = _currMapColCumulativeSquareFirstThingCount + mapX + 1; +			uint16 *tmp = _currMapColCumulativeSquareFirstThingCount + mapX + 1;  			uint16 currColumn = _dungeonColumCount - (_dungeonMapsFirstColumnIndex[_currMapIndex] + mapX) - 1;  			while (currColumn--) { /* For each column starting from and after the column containing the square where the thing is added */  				(*tmp++)++; /* Increment the cumulative first thing count */ @@ -1347,8 +1347,8 @@ void DungeonMan::linkThingToList(Thing thingToLink, Thing thingInList, int16 map  	*thingPtr = thingToLink;  } -WeaponInfo* DungeonMan::getWeaponInfo(Thing thing) { -	Weapon* weapon = (Weapon*)getThingData(thing); +WeaponInfo *DungeonMan::getWeaponInfo(Thing thing) { +	Weapon *weapon = (Weapon *)getThingData(thing);  	return &_weaponInfos[weapon->getType()];  } @@ -1375,7 +1375,7 @@ int16 DungeonMan::getProjectileAspect(Thing thing) {  	return _objectInfos[getObjectInfoIndex(thing)]._objectAspectIndex;  } -int16 DungeonMan::getLocationAfterLevelChange(int16 mapIndex, int16 levelDelta, int16* mapX, int16* mapY) { +int16 DungeonMan::getLocationAfterLevelChange(int16 mapIndex, int16 levelDelta, int16 *mapX, int16 *mapY) {  	if (_partyMapIndex == k255_mapIndexEntrance)  		return kM1_mapIndexNone; @@ -1406,7 +1406,7 @@ Thing DungeonMan::getSquareFirstObject(int16 mapX, int16 mapY) {  	return thing;  } -uint16 DungeonMan::getArmourDefense(ArmourInfo* armourInfo, bool useSharpDefense) { +uint16 DungeonMan::getArmourDefense(ArmourInfo *armourInfo, bool useSharpDefense) {  	uint16 defense = armourInfo->_defense;  	if (useSharpDefense)  		defense = _vm->getScaledProduct(defense, 3, getFlag(armourInfo->_attributes, k0x0007_ArmourAttributeSharpDefense) + 4); @@ -1443,14 +1443,14 @@ Thing DungeonMan::getDiscardThing(uint16 thingType) {  					do {  						ThingType squareThingType = squareThing.getType();  						if (squareThingType == k3_SensorThingType) { -							Thing *squareThingData = (Thing*)getThingData(squareThing); -							if (((Sensor*)squareThingData)->getType()) /* If sensor is not disabled */ +							Thing *squareThingData = (Thing *)getThingData(squareThing); +							if (((Sensor *)squareThingData)->getType()) /* If sensor is not disabled */  								break;  						} else if (squareThingType == thingType) { -							Thing *squareThingData = (Thing*)getThingData(squareThing); +							Thing *squareThingData = (Thing *)getThingData(squareThing);  							switch (thingType) {  							case k4_GroupThingType: -								if (((Group*)squareThingData)->getDoNotDiscard()) +								if (((Group *)squareThingData)->getDoNotDiscard())  									continue;  							case k14_ProjectileThingType:  								setCurrentMap(mapIndex); @@ -1464,28 +1464,28 @@ Thing DungeonMan::getDiscardThing(uint16 thingType) {  								}  								break;  							case k6_ArmourThingType: -								if (((Armour*)squareThingData)->getDoNotDiscard()) +								if (((Armour *)squareThingData)->getDoNotDiscard())  									continue;  								setCurrentMap(mapIndex);  								_vm->_moveSens->getMoveResult(squareThing, currMapX, currMapY, kM1_MapXNotOnASquare, 0);  								break;  							case k5_WeaponThingType: -								if (((Weapon*)squareThingData)->getDoNotDiscard()) +								if (((Weapon *)squareThingData)->getDoNotDiscard())  									continue;  								setCurrentMap(mapIndex);  								_vm->_moveSens->getMoveResult(squareThing, currMapX, currMapY, kM1_MapXNotOnASquare, 0);  								break;  							case k10_JunkThingType: -								if (((Junk*)squareThingData)->getDoNotDiscard()) +								if (((Junk *)squareThingData)->getDoNotDiscard())  									continue;  								setCurrentMap(mapIndex);  								_vm->_moveSens->getMoveResult(squareThing, currMapX, currMapY, kM1_MapXNotOnASquare, 0);  								break;  							case k8_PotionThingType: -								if (((Potion*)squareThingData)->getDoNotDiscard()) +								if (((Potion *)squareThingData)->getDoNotDiscard())  									continue;  								setCurrentMap(mapIndex); @@ -1520,14 +1520,14 @@ uint16 DungeonMan::getCreatureAttributes(Thing thing) {  	return _creatureInfos[currGroup->_type]._attributes;  } -void DungeonMan::setGroupCells(Group* group, uint16 cells, uint16 mapIndex) { +void DungeonMan::setGroupCells(Group *group, uint16 cells, uint16 mapIndex) {  	if (mapIndex == _partyMapIndex)  		_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()]._cells = cells;  	else  		group->_cells = cells;  } -void DungeonMan::setGroupDirections(Group* group, int16 dir, uint16 mapIndex) { +void DungeonMan::setGroupDirections(Group *group, int16 dir, uint16 mapIndex) {  	if (mapIndex == _partyMapIndex)  		_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()]._directions = (Direction)dir;  	else @@ -1535,7 +1535,7 @@ void DungeonMan::setGroupDirections(Group* group, int16 dir, uint16 mapIndex) {  }  bool DungeonMan::isCreatureAllowedOnMap(Thing thing, uint16 mapIndex) { -	int16 creatureType = ((Group*)getThingData(thing))->_type; +	int16 creatureType = ((Group *)getThingData(thing))->_type;  	Map *map = &_dungeonMaps[mapIndex];  	byte *allowedCreatureType = _dungeonMapData[mapIndex][map->_width] + map->_height + 1;  	for (int16 L0234_i_Counter = map->_creatureTypeCount; L0234_i_Counter > 0; L0234_i_Counter--) { @@ -1555,10 +1555,10 @@ void DungeonMan::unlinkThingFromList(Thing thingToUnlink, Thing thingInList, int  	Thing *thingPtr = nullptr;  	if (mapX >= 0) { -		thingPtr = (Thing*)getThingData(thingToUnlink); +		thingPtr = (Thing *)getThingData(thingToUnlink);  		uint16 firstThingIndex = getSquareFirstThingIndex(mapX, mapY);  		Thing *currThing = &_squareFirstThings[firstThingIndex]; /* BUG0_01 Coding error without consequence. The engine does not check that there are things at the specified square coordinates. f160_getSquareFirstThingIndex would return -1 for an empty square. No consequence as the function is never called with the coordinates of an empty square (except in the case of BUG0_59) */ -		if ((*thingPtr == Thing::_endOfList) && (((Thing*)currThing)->getTypeAndIndex() == thingToUnlink.toUint16())) { /* If the thing to unlink is the last thing on the square */ +		if ((*thingPtr == Thing::_endOfList) && (((Thing *)currThing)->getTypeAndIndex() == thingToUnlink.toUint16())) { /* If the thing to unlink is the last thing on the square */  			clearFlag(_currMapData[mapX][mapY], k0x0010_ThingListPresent);  			uint16 squareFirstThingIdx = _dungeonFileHeader._squareFirstThingCount - 1;  			for (uint16 i = 0; i < squareFirstThingIdx - firstThingIndex; ++i) @@ -1573,7 +1573,7 @@ void DungeonMan::unlinkThingFromList(Thing thingToUnlink, Thing thingInList, int  			*thingPtr = Thing::_endOfList;  			return;  		} -		if (((Thing*)currThing)->getTypeAndIndex() == thingToUnlink.toUint16()) { +		if (((Thing *)currThing)->getTypeAndIndex() == thingToUnlink.toUint16()) {  			*currThing = *thingPtr;  			*thingPtr = Thing::_endOfList;  			return; @@ -1589,9 +1589,9 @@ void DungeonMan::unlinkThingFromList(Thing thingToUnlink, Thing thingInList, int  		}  		currThing = getNextThing(thingInList = currThing);  	} -	thingPtr = (Thing*)getThingData(thingInList); +	thingPtr = (Thing *)getThingData(thingInList);  	*thingPtr = getNextThing(currThing); -	thingPtr = (Thing*)getThingData(thingToUnlink); +	thingPtr = (Thing *)getThingData(thingToUnlink);  	*thingPtr = Thing::_endOfList;  } @@ -1655,10 +1655,10 @@ Thing DungeonMan::getObjForProjectileLaucherOrObjGen(uint16 iconIndex) {  	if (unusedThing == Thing::_none)  		return Thing::_none; -	Junk *junkPtr = (Junk*)getThingData(unusedThing); +	Junk *junkPtr = (Junk *)getThingData(unusedThing);  	junkPtr->setType(junkType); /* Also works for WEAPON in cases other than Boulder */ -	if ((iconIndex == k4_IconIndiceWeaponTorchUnlit) && ((Weapon*)junkPtr)->isLit()) /* BUG0_65 Torches created by object generator or projectile launcher sensors have no charges. Charges are only defined if the Torch is lit which is not possible at the time it is created */ -		((Weapon*)junkPtr)->setChargeCount(15); +	if ((iconIndex == k4_IconIndiceWeaponTorchUnlit) && ((Weapon *)junkPtr)->isLit()) /* BUG0_65 Torches created by object generator or projectile launcher sensors have no charges. Charges are only defined if the Torch is lit which is not possible at the time it is created */ +		((Weapon *)junkPtr)->setChargeCount(15);  	return unusedThing;  } diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index d478d4cd7f..4ccd9bab0f 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -441,7 +441,7 @@ void EventManager::setMousePointerToNormal(int16 mousePointer) {  	buildpointerScreenArea(_mousePos.x, _mousePos.y);  } -void EventManager::setPointerToObject(byte* bitmap) { +void EventManager::setPointerToObject(byte *bitmap) {  	static byte palChangesMousepointerOjbectIconShadow[16] = {120, 120, 120, 120, 120, 120, 120, 120,  		120, 120, 120, 120, 0, 120, 120, 120}; // @ K0027_auc_PaletteChanges_MousePointerObjectIconShadow  	static byte palChangesMousePointerIcon[16] = {120, 10, 20, 30, 40, 50, 60, 70, 80, 90, @@ -1079,7 +1079,7 @@ bool EventManager::isLeaderHandObjThrown(int16 posX, int16 posY) {  	return objectThrownFl;  } -void EventManager::setMousePointerFromSpriteData(byte* mouseSprite) { +void EventManager::setMousePointerFromSpriteData(byte *mouseSprite) {  	byte bitmap[16 * 18];  	memset(bitmap, 0, sizeof(bitmap));  	for (int16 imgPart = 1; imgPart < 3; ++imgPart) { diff --git a/engines/dm/eventman.h b/engines/dm/eventman.h index 649bc393b5..34984f1dff 100644 --- a/engines/dm/eventman.h +++ b/engines/dm/eventman.h @@ -224,15 +224,15 @@ class EventManager {  	void commandTurnParty(CommandType cmdType); // @ F0365_COMMAND_ProcessTypes1To2_TurnParty  	void commandMoveParty(CommandType cmdType); // @ F0366_COMMAND_ProcessTypes3To6_MoveParty  	bool isLeaderHandObjThrown(int16 posX, int16 posY); // @ F0375_COMMAND_ProcessType80_ClickInDungeonView_IsLeaderHandObjectThrown -	void setMousePointerFromSpriteData(byte* mouseSprite); +	void setMousePointerFromSpriteData(byte *mouseSprite);  	Box _highlightScreenBox; // @ G0336_i_HighlightBoxX1  public:  	explicit EventManager(DMEngine *vm);  	~EventManager(); -	MouseInput* _primaryMouseInput;// @ G0441_ps_PrimaryMouseInput -	MouseInput* _secondaryMouseInput;// @ G0442_ps_SecondaryMouseInput +	MouseInput *_primaryMouseInput;// @ G0441_ps_PrimaryMouseInput +	MouseInput *_secondaryMouseInput;// @ G0442_ps_SecondaryMouseInput  	bool _mousePointerBitmapUpdated; // @ G0598_B_MousePointerBitmapUpdated  	bool _refreshMousePointerInMainLoop; // @ G0326_B_RefreshMousePointerInMainLoop  	bool _highlightBoxEnabled; // @ G0341_B_HighlightBoxEnabled diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h index 319ac90b57..1d1f8c4338 100644 --- a/engines/dm/gfx.h +++ b/engines/dm/gfx.h @@ -727,8 +727,8 @@ public:  	void blitToViewport(byte *bitmap, Box &box, int16 byteWidth, Color transparent, int16 height); // @ F0020_MAIN_BlitToViewport  	void blitToViewport(byte *bitmap, int16 *box, int16 byteWidth, Color transparent, int16 height); // @ F0020_MAIN_BlitToViewport -	void blitToScreen(byte *bitmap, int16* box, int16 byteWidth, Color transparent, int16 height); // @ F0021_MAIN_BlitToScreen -	void blitToScreen(byte* bitmap, Box* box, int16 byteWidth, Color transparent, int16 height); // @ F0021_MAIN_BlitToScreen +	void blitToScreen(byte *bitmap, int16 *box, int16 byteWidth, Color transparent, int16 height); // @ F0021_MAIN_BlitToScreen +	void blitToScreen(byte *bitmap, Box *box, int16 byteWidth, Color transparent, int16 height); // @ F0021_MAIN_BlitToScreen  	/* srcHeight and destHeight are not necessary for blitting, only error checking, thus they are defaulted for existing code which @@ -752,7 +752,7 @@ public:  	void fillScreen(Color color);  	/* Expects inclusive boundaries in box */  	void fillScreenBox(Box &box, Color color); // @ D24_FillScreenBox, F0550_VIDEO_FillScreenBox -/* Expects inclusive boundaries in box */ +	/* Expects inclusive boundaries in box */  	void fillBoxBitmap(byte *destBitmap, Box &box, Color color, int16 byteWidth, int16 height); // @ F0135_VIDEO_FillBox  	void drawDungeon(Direction dir, int16 posX, int16 posY); // @ F0128_DUNGEONVIEW_Draw_CPSF  	void drawFloorAndCeiling(); // @ F0098_DUNGEONVIEW_DrawFloorAndCeiling @@ -821,8 +821,8 @@ public:  	void releaseBlock(uint16 index); // @ F0480_CACHE_ReleaseBlock  	uint16 getDarkenedColor(uint16 RGBcolor);  	void startEndFadeToPalette(uint16 *P0849_pui_Palette); // @ F0436_STARTEND_FadeToPalette -	void buildPaletteChangeCopperList(uint16* middleScreen, uint16* topAndBottom); // @ F0508_AMIGA_BuildPaletteChangeCopperList -	void shadeScreenBox(Box* box, Color color) { warning("STUB METHOD: shadeScreenBox"); } // @ F0136_VIDEO_ShadeScreenBox +	void buildPaletteChangeCopperList(uint16 *middleScreen, uint16 *topAndBottom); // @ F0508_AMIGA_BuildPaletteChangeCopperList +	void shadeScreenBox(Box *box, Color color) { warning("STUB METHOD: shadeScreenBox"); } // @ F0136_VIDEO_ShadeScreenBox  private:  	void initConstants(); diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index 09581f72ae..fe80a1013c 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -280,7 +280,7 @@ void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int  			continue;  		Weapon *currWeapon = (Weapon *)_vm->_dungeonMan->getThingData(nextUnusedThing); -/* The same pointer type is used no matter the actual type k5_WeaponThingType, k6_ArmourThingType or k10_JunkThingType */ +		/* The same pointer type is used no matter the actual type k5_WeaponThingType, k6_ArmourThingType or k10_JunkThingType */  		currWeapon->setType(currFixedPossession);  		currWeapon->setCursed(cursedPossessions);  		nextUnusedThing = thingWithNewCell(nextUnusedThing, ((cell == k255_CreatureTypeSingleCenteredCreature) || !_vm->getRandomNumber(4)) ? _vm->getRandomNumber(4) : cell); @@ -1789,7 +1789,7 @@ int16 GroupMan::getMeleeTargetCreatureOrdinal(int16 groupX, int16 groupY, int16  	}  } -int16 GroupMan::getMeleeActionDamage(Champion* champ, int16 champIndex, Group* group, int16 creatureIndex, int16 mapX, int16 mapY, uint16 actionHitProbability, uint16 actionDamageFactor, int16 skillIndex) { +int16 GroupMan::getMeleeActionDamage(Champion *champ, int16 champIndex, Group *group, int16 creatureIndex, int16 mapX, int16 mapY, uint16 actionHitProbability, uint16 actionDamageFactor, int16 skillIndex) {  	int16 L0565_i_Damage = 0;  	int16 L0566_i_Damage = 0;  	int16 L0568_i_Defense; @@ -1996,7 +1996,7 @@ void GroupMan::fuseAction(uint16 mapX, uint16 mapY) {  	}  } -void GroupMan::saveActiveGroupPart(Common::OutSaveFile* file) { +void GroupMan::saveActiveGroupPart(Common::OutSaveFile *file) {  	for (uint16 i = 0; i < _maxActiveGroupCount; ++i) {  		ActiveGroup *group = &_activeGroups[i];  		file->writeUint16BE(group->_groupThingIndex); @@ -2015,7 +2015,7 @@ void GroupMan::saveActiveGroupPart(Common::OutSaveFile* file) {  	}  } -void GroupMan::loadActiveGroupPart(Common::InSaveFile* file) { +void GroupMan::loadActiveGroupPart(Common::InSaveFile *file) {  	for (uint16 i = 0; i < _maxActiveGroupCount; ++i) {  		ActiveGroup *group = &_activeGroups[i];  		group->_groupThingIndex = file->readUint16BE(); diff --git a/engines/dm/group.h b/engines/dm/group.h index 38c3a0d207..53d80c6e4d 100644 --- a/engines/dm/group.h +++ b/engines/dm/group.h @@ -223,7 +223,7 @@ public:  	void stopAttacking(ActiveGroup *group, int16 mapX, int16 mapY);// @ F0182_GROUP_StopAttacking  	bool isArchenemyDoubleMovementPossible(CreatureInfo *info, int16 mapX, int16 mapY, uint16 dir); // @ F0204_GROUP_IsArchenemyDoubleMovementPossible  	bool isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16 creatureIndex); // @ F0207_GROUP_IsCreatureAttacking -	void setOrderedCellsToAttack(signed char * orderedCellsToAttack, int16 targetMapX, +	void setOrderedCellsToAttack(signed char *orderedCellsToAttack, int16 targetMapX,  	                                  int16 targetMapY, int16 attackerMapX, int16 attackerMapY, uint16 cellSource); // @ F0229_GROUP_SetOrderedCellsToAttack  	void stealFromChampion(Group *group, uint16 championIndex); // @ F0193_GROUP_StealFromChampion  	int16 getChampionDamage(Group *group, uint16 champIndex); // @ F0230_GROUP_GetChampionDamage @@ -244,7 +244,7 @@ public:  	bool isFluxcageOnSquare(int16 mapX, int16 mapY); // @ F0221_GROUP_IsFluxcageOnSquare  	void fuseAction(uint16 mapX, uint16 mapY); // @ F0225_GROUP_FuseAction  	void saveActiveGroupPart(Common::OutSaveFile *file); -	void loadActiveGroupPart(Common::InSaveFile* file); +	void loadActiveGroupPart(Common::InSaveFile *file);  };  } diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index 516bc467dc..9c12835973 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -499,21 +499,16 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {  		dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k29_ObjectDescCircleIndice),  								   boxObjectDescCircle, k16_byteWidth, k12_ColorDarkestGray, 27); -		const char *descString = nullptr; -		char str[40]; +		Common::String descString; +		Common::String str;  		if (iconIndex == k147_IconIndiceJunkChampionBones) {  			switch (_vm->getGameLanguage()) { // localized -			default: -			case Common::EN_ANY: -			case Common::DE_DEU: // german and english versions are the same -				strcpy(str, champMan._champions[((Junk *)rawThingPtr)->getChargeCount()]._name); -				strcat(str, " "); -				strcat(str, objMan._objectNames[iconIndex]); -				break;  			case Common::FR_FRA: -				strcat(str, objMan._objectNames[iconIndex]); -				strcat(str, " "); -				strcpy(str, champMan._champions[((Junk *)rawThingPtr)->getChargeCount()]._name); +				// Fix original bug dur to a cut&paste error: string was concatenated then overwritten by the name +				str = Common::String::format("%s %s", objMan._objectNames[iconIndex], champMan._champions[((Junk *)rawThingPtr)->getChargeCount()]._name); +				break; +			default: // German and English versions are the same +				str = Common::String::format("%s %s", champMan._champions[((Junk *)rawThingPtr)->getChargeCount()]._name, objMan._objectNames[iconIndex]);  				break;  			} @@ -521,16 +516,15 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {  		} else if ((thingType == k8_PotionThingType)  				   && (iconIndex != k163_IconIndicePotionWaterFlask)  				   && (champMan.getSkillLevel((ChampionIndex)_vm->ordinalToIndex(_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) { -			str[0] = '_' + ((Potion *)rawThingPtr)->getPower() / 40; -			str[1] = ' '; -			str[2] = '\0'; -			strcat(str, objMan._objectNames[iconIndex]); +			str = ('_' + ((Potion *)rawThingPtr)->getPower() / 40); +			str += " "; +			str += objMan._objectNames[iconIndex];  			descString = str;  		} else {  			descString = objMan._objectNames[iconIndex];  		} -		textMan.printToViewport(134, 68, k13_ColorLightestGray, descString); +		textMan.printToViewport(134, 68, k13_ColorLightestGray, descString.c_str());  		drawIconToViewport(iconIndex, 111, 59); @@ -577,59 +571,47 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {  		case k10_JunkThingType: {  			if ((iconIndex >= k8_IconIndiceJunkWater) && (iconIndex <= k9_IconIndiceJunkWaterSkin)) {  				potentialAttribMask = 0; -				const char *descString_EN_ANY[4] = {"(EMPTY)", "(ALMOST EMPTY)", "(ALMOST FULL)", "(FULL)"}; -				const char *descString_DE_DEU[4] = {"(LEER)", "(FAST LEER)", "(FAST VOLL)", "(VOLL)"}; -				const char *descString_FR_FRA[4] = {"(VIDE)", "(PRESQUE VIDE)", "(PRESQUE PLEINE)", "(PLEINE)"}; +				const char *descStringEN[4] = {"(EMPTY)", "(ALMOST EMPTY)", "(ALMOST FULL)", "(FULL)"}; +				const char *descStringDE[4] = {"(LEER)", "(FAST LEER)", "(FAST VOLL)", "(VOLL)"}; +				const char *descStringFR[4] = {"(VIDE)", "(PRESQUE VIDE)", "(PRESQUE PLEINE)", "(PLEINE)"};  				Junk *junk = (Junk *)rawThingPtr;  				switch (_vm->getGameLanguage()) { // localized -				default: -				case Common::EN_ANY: -					descString = descString_EN_ANY[junk->getChargeCount()]; -					break;  				case Common::DE_DEU: -					descString = descString_DE_DEU[junk->getChargeCount()]; +					descString = descStringDE[junk->getChargeCount()];  					break;  				case Common::FR_FRA: -					descString = descString_FR_FRA[junk->getChargeCount()]; +					descString = descStringFR[junk->getChargeCount()]; +					break; +				default: +					descString = descStringEN[junk->getChargeCount()];  					break;  				} -				drawPanelObjectDescriptionString(descString); +				drawPanelObjectDescriptionString(descString.c_str());  			} else if ((iconIndex >= k0_IconIndiceJunkCompassNorth) && (iconIndex <= k3_IconIndiceJunkCompassWest)) { +				const static char *directionNameEN[4] = {"NORTH", "EAST", "SOUTH", "WEST"}; +				const static char *directionNameDE[4] = {"NORDEN", "OSTEN", "SUEDEN", "WESTEN"}; +				const static char *directionNameFR[4] = {"AU NORD", "A L'EST", "AU SUD", "A L'OUEST"}; +  				potentialAttribMask = 0;  				switch (_vm->getGameLanguage()) { // localized -				default: -				case Common::EN_ANY: -					strcpy(str, "PARTY FACING "); -					break;  				case Common::DE_DEU: -					strcpy(str, "GRUPPE BLICKT NACH "); +					str = "GRUPPE BLICKT NACH "; +					str += directionNameDE[iconIndex];  					break;  				case Common::FR_FRA: -					strcpy(str, "GROUPE FACE "); +					str = "GROUPE FACE "; +					str += directionNameFR[iconIndex];  					break; -				} - - -				const static char* directionName_EN_ANY[4] = {"NORTH", "EAST", "SOUTH", "WEST"}; -				const static char* directionName_DE_DEU[4] = {"NORDEN", "OSTEN", "SUEDEN", "WESTEN"}; -				const static char* directionName_FR_FRA[4] = {"AU NORD", "A L'EST", "AU SUD", "A L'OUEST"}; -				switch (_vm->getGameLanguage()) { // localized  				default: -				case Common::EN_ANY: -					strcat(str, directionName_EN_ANY[iconIndex]); -					break; -				case Common::DE_DEU: -					strcat(str, directionName_DE_DEU[iconIndex]); -					break; -				case Common::FR_FRA: -					strcat(str, directionName_FR_FRA[iconIndex]); +					str = "PARTY FACING "; +					str += directionNameEN[iconIndex];  					break;  				} -				drawPanelObjectDescriptionString(str); +				drawPanelObjectDescriptionString(str.c_str());  			} else {  				Junk *junk = (Junk *)rawThingPtr;  				potentialAttribMask = k0x0001_DescriptionMaskConsumable; @@ -642,73 +624,54 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {  		} // end of switch   		if (potentialAttribMask) { -			static const char *attribString_EN_ANY[4] = {"CONSUMABLE", "POISONED", "BROKEN", "CURSED"}; -			static const char *attribString_DE_DEU[4] = {"ESSBAR", "VERGIFTET", "DEFEKT", "VERFLUCHT"}; -			static const char *attribString_FR_FRA[4] = {"COMESTIBLE", "EMPOISONNE", "BRISE", "MAUDIT"}; +			static const char *attribStringEN[4] = {"CONSUMABLE", "POISONED", "BROKEN", "CURSED"}; +			static const char *attribStringDE[4] = {"ESSBAR", "VERGIFTET", "DEFEKT", "VERFLUCHT"}; +			static const char *attribStringFR[4] = {"COMESTIBLE", "EMPOISONNE", "BRISE", "MAUDIT"};  			const char **attribString = nullptr;  			switch (_vm->getGameLanguage()) { // localized -			default: -			case Common::EN_ANY: -				attribString = attribString_EN_ANY; -				break;  			case Common::DE_DEU: -				attribString = attribString_DE_DEU; +				attribString = attribStringDE;  				break;  			case Common::FR_FRA: -				attribString = attribString_FR_FRA; +				attribString = attribStringFR; +				break; +			default: +				attribString = attribStringEN;  				break;  			} -			buildObjectAttributeString(potentialAttribMask, actualAttribMask, attribString, str, "(", ")"); -			drawPanelObjectDescriptionString(str); +			char destString[40]; +			buildObjectAttributeString(potentialAttribMask, actualAttribMask, attribString, destString, "(", ")"); +			drawPanelObjectDescriptionString(destString);  		} +		uint16 weight = dunMan.getObjectWeight(thingToDraw);  		switch (_vm->getGameLanguage()) { // localized -		default: -		case Common::EN_ANY: -			strcpy(str, "WEIGHS "); -			break;  		case Common::DE_DEU: -			strcpy(str, "WIEGT "); +			str = "WIEGT " + champMan.getStringFromInteger(weight / 10, false, 3) + ",";  			break;  		case Common::FR_FRA: -			strcpy(str, "PESE "); +			str = "PESE " + champMan.getStringFromInteger(weight / 10, false, 3) + "KG,";  			break; -		} - - -		uint16 weight = dunMan.getObjectWeight(thingToDraw); -		strcat(str, champMan.getStringFromInteger(weight / 10, false, 3).c_str()); - -		switch (_vm->getGameLanguage()) { // localized  		default: -		case Common::EN_ANY: -			strcat(str, "."); -			break; -		case Common::DE_DEU: -			strcat(str, ","); -			break; -		case Common::FR_FRA: -			strcat(str, "KG,"); +			str = "WEIGHS " + champMan.getStringFromInteger(weight / 10, false, 3) + ".";  			break;  		}  		weight -= (weight / 10) * 10; -		strcat(str, champMan.getStringFromInteger(weight, false, 1).c_str()); +		str += champMan.getStringFromInteger(weight, false, 1);  		switch (_vm->getGameLanguage()) { // localized -		default: -		case Common::EN_ANY: -		case Common::DE_DEU: -			strcat(str, " KG."); -			break;  		case Common::FR_FRA: -			strcat(str, "."); +			str += "."; +			break; +		default: +			str += " KG.";  			break;  		} -		drawPanelObjectDescriptionString(str); +		drawPanelObjectDescriptionString(str.c_str());  	}  	drawPanelArrowOrEye(pressingEye);  } @@ -786,105 +749,95 @@ void InventoryMan::setDungeonViewPalette() {  }  void InventoryMan::decreaseTorchesLightPower() { -	bool L1048_B_TorchChargeCountChanged = false; -	int16 L1046_i_ChampionCount = _vm->_championMan->_partyChampionCount; -	if (_vm->_championMan->_candidateChampionOrdinal) { -		L1046_i_ChampionCount--; -	} -	Champion *L1050_ps_Champion = _vm->_championMan->_champions; -	while (L1046_i_ChampionCount--) { -		int16 L1047_i_SlotIndex = k1_ChampionSlotActionHand + 1; -		while (L1047_i_SlotIndex--) { -			int16 L1049_i_IconIndex = _vm->_objectMan->getIconIndex(L1050_ps_Champion->_slots[L1047_i_SlotIndex]); -			if ((L1049_i_IconIndex >= k4_IconIndiceWeaponTorchUnlit) && (L1049_i_IconIndex <= k7_IconIndiceWeaponTorchLit)) { -				Weapon *L1051_ps_Weapon = (Weapon *)_vm->_dungeonMan->getThingData(L1050_ps_Champion->_slots[L1047_i_SlotIndex]); -				if (L1051_ps_Weapon->getChargeCount()) { -					if (L1051_ps_Weapon->setChargeCount(L1051_ps_Weapon->getChargeCount() - 1) == 0) { -						L1051_ps_Weapon->setDoNotDiscard(false); +	bool torchChargeCountChanged = false; +	int16 championCount = _vm->_championMan->_partyChampionCount; +	if (_vm->_championMan->_candidateChampionOrdinal) +		championCount--; + +	Champion *curChampion = _vm->_championMan->_champions; +	while (championCount--) { +		int16 slotIndex = k1_ChampionSlotActionHand + 1; +		while (slotIndex--) { +			int16 iconIndex = _vm->_objectMan->getIconIndex(curChampion->_slots[slotIndex]); +			if ((iconIndex >= k4_IconIndiceWeaponTorchUnlit) && (iconIndex <= k7_IconIndiceWeaponTorchLit)) { +				Weapon *curWeapon = (Weapon *)_vm->_dungeonMan->getThingData(curChampion->_slots[slotIndex]); +				if (curWeapon->getChargeCount()) { +					if (curWeapon->setChargeCount(curWeapon->getChargeCount() - 1) == 0) { +						curWeapon->setDoNotDiscard(false);  					} -					L1048_B_TorchChargeCountChanged = true; +					torchChargeCountChanged = true;  				}  			}  		} -		L1050_ps_Champion++; +		curChampion++;  	} -	if (L1048_B_TorchChargeCountChanged) { + +	if (torchChargeCountChanged) {  		setDungeonViewPalette();  		_vm->_championMan->drawChangedObjectIcons();  	}  }  void InventoryMan::drawChampionSkillsAndStatistics() { +	static const char* statisticNamesEN[7] = {"L", "STRENGTH", "DEXTERITY", "WISDOM", "VITALITY", "ANTI-MAGIC", "ANTI-FIRE"}; +	static const char* statisticNamesDE[7] = {"L", "STAERKE", "FLINKHEIT", "WEISHEIT", "VITALITAET", "ANTI-MAGIE", "ANTI-FEUER"}; +	static const char* statisticNamesFR[7] = {"L", "FORCE", "DEXTERITE", "SAGESSE", "VITALITE", "ANTI-MAGIE", "ANTI-FEU"}; + +	const char **statisticNames; -	uint16 L1090_ui_Multiple; -#define AL1090_ui_SkillIndex     L1090_ui_Multiple -#define AL1090_ui_StatisticIndex L1090_ui_Multiple -	int16 L1091_i_Y; -	int16 L1092_i_Multiple; -#define AL1092_i_SkillLevel            L1092_i_Multiple -#define AL1092_i_StatisticCurrentValue L1092_i_Multiple -	uint16 L1093_ui_ChampionIndex; -	Champion* L1094_ps_Champion; -	int16 L1095_i_StatisticColor; -	uint16 L1096_ui_StatisticMaximumValue; -	char L1097_ac_String[20]; - -	static const char* G0431_apc_StatisticNames_EN_ANY[7] = {"L", "STRENGTH", "DEXTERITY", "WISDOM", "VITALITY", "ANTI-MAGIC", "ANTI-FIRE"}; -	static const char* G0431_apc_StatisticNames_DE_DEU[7] = {"L", "STAERKE", "FLINKHEIT", "WEISHEIT", "VITALITAET", "ANTI-MAGIE", "ANTI-FEUER"}; -	static const char* G0431_apc_StatisticNames_FR_FRA[7] = {"L", "FORCE", "DEXTERITE", "SAGESSE", "VITALITE", "ANTI-MAGIE", "ANTI-FEU"}; -	const char **G0431_apc_StatisticNames;  	switch (_vm->getGameLanguage()) { // localized +	case Common::DE_DEU: +		statisticNames = statisticNamesDE; +		break; +	case Common::FR_FRA: +		statisticNames = statisticNamesFR; +		break;  	default: -	case Common::EN_ANY: G0431_apc_StatisticNames = G0431_apc_StatisticNames_EN_ANY; break; -	case Common::DE_DEU: G0431_apc_StatisticNames = G0431_apc_StatisticNames_DE_DEU; break; -	case Common::FR_FRA: G0431_apc_StatisticNames = G0431_apc_StatisticNames_FR_FRA; break; +		statisticNames = statisticNamesEN; +		break;  	}  	closeChest(); -	L1094_ps_Champion = &_vm->_championMan->_champions[L1093_ui_ChampionIndex = _vm->ordinalToIndex(_inventoryChampionOrdinal)]; +	uint16 championIndex = _vm->ordinalToIndex(_inventoryChampionOrdinal); +	Champion *curChampion = &_vm->_championMan->_champions[championIndex];  	_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k20_PanelEmptyIndice), _boxPanel, k72_byteWidth, k8_ColorRed, 73); -	L1091_i_Y = 58; -	for (AL1090_ui_SkillIndex = k0_ChampionSkillFighter; AL1090_ui_SkillIndex <= k3_ChampionSkillWizard; AL1090_ui_SkillIndex++) { -		AL1092_i_SkillLevel = MIN((uint16)16, _vm->_championMan->getSkillLevel(L1093_ui_ChampionIndex, AL1090_ui_SkillIndex | k0x8000_IgnoreTemporaryExperience)); -		if (AL1092_i_SkillLevel == 1) +	int16 textPosY = 58; +	for (uint16 idx = k0_ChampionSkillFighter; idx <= k3_ChampionSkillWizard; idx++) { +		int16 skillLevel = MIN((uint16)16, _vm->_championMan->getSkillLevel(championIndex, idx | k0x8000_IgnoreTemporaryExperience)); +		if (skillLevel == 1)  			continue; +		Common::String displayString; +  		switch (_vm->getGameLanguage()) { // localized -		default: -		case Common::EN_ANY: -		case Common::DE_DEU: // english and german versions are the same -			strcpy(L1097_ac_String, _skillLevelNames[AL1092_i_SkillLevel - 2]); -			strcat(L1097_ac_String, " "); -			strcat(L1097_ac_String, _vm->_championMan->_baseSkillName[AL1090_ui_SkillIndex]); -			break;  		case Common::FR_FRA: -			strcat(L1097_ac_String, _vm->_championMan->_baseSkillName[AL1090_ui_SkillIndex]); -			strcat(L1097_ac_String, " "); -			strcpy(L1097_ac_String, _skillLevelNames[AL1092_i_SkillLevel - 2]); +			// Fix original bug: Due to a copy&paste error, the string was concatenate then overwritten be the last part +			displayString = Common::String::format("%s %s", _vm->_championMan->_baseSkillName[idx], _skillLevelNames[skillLevel - 2]); +			break; +		default: // English and German versions are built the same way +			displayString = Common::String::format("%s %s", _skillLevelNames[skillLevel - 2], _vm->_championMan->_baseSkillName[idx]);  			break;  		} -		_vm->_textMan->printToViewport(108, L1091_i_Y, k13_ColorLightestGray, L1097_ac_String); -		L1091_i_Y += 7; +		_vm->_textMan->printToViewport(108, textPosY, k13_ColorLightestGray, displayString.c_str()); +		textPosY += 7;  	} -	L1091_i_Y = 86; -	for (AL1090_ui_StatisticIndex = k1_ChampionStatStrength; AL1090_ui_StatisticIndex <= k6_ChampionStatAntifire; AL1090_ui_StatisticIndex++) { -		_vm->_textMan->printToViewport(108, L1091_i_Y, k13_ColorLightestGray, G0431_apc_StatisticNames[AL1090_ui_StatisticIndex]); -		AL1092_i_StatisticCurrentValue = L1094_ps_Champion->_statistics[AL1090_ui_StatisticIndex][k1_ChampionStatCurrent]; -		L1096_ui_StatisticMaximumValue = L1094_ps_Champion->_statistics[AL1090_ui_StatisticIndex][k0_ChampionStatMaximum]; -		if (AL1092_i_StatisticCurrentValue < L1096_ui_StatisticMaximumValue) { -			L1095_i_StatisticColor = k8_ColorRed; -		} else { -			if (AL1092_i_StatisticCurrentValue > L1096_ui_StatisticMaximumValue) { -				L1095_i_StatisticColor = k7_ColorLightGreen; -			} else { -				L1095_i_StatisticColor = k13_ColorLightestGray; -			} -		} -		_vm->_textMan->printToViewport(174, L1091_i_Y, (Color)L1095_i_StatisticColor, _vm->_championMan->getStringFromInteger(AL1092_i_StatisticCurrentValue, true, 3).c_str()); -		strcpy(L1097_ac_String, "/"); -		strcat(L1097_ac_String, _vm->_championMan->getStringFromInteger(L1096_ui_StatisticMaximumValue, true, 3).c_str()); -		_vm->_textMan->printToViewport(192, L1091_i_Y, k13_ColorLightestGray, L1097_ac_String); -		L1091_i_Y += 7; +	textPosY = 86; +	for (uint16 idx = k1_ChampionStatStrength; idx <= k6_ChampionStatAntifire; idx++) { +		_vm->_textMan->printToViewport(108, textPosY, k13_ColorLightestGray, statisticNames[idx]); +		int16 statisticCurrentValue = curChampion->_statistics[idx][k1_ChampionStatCurrent]; +		uint16 statisticMaximumValue = curChampion->_statistics[idx][k0_ChampionStatMaximum]; +		int16 statisticColor; +		if (statisticCurrentValue < statisticMaximumValue) +			statisticColor = k8_ColorRed; +		else if (statisticCurrentValue > statisticMaximumValue) +			statisticColor = k7_ColorLightGreen; +		else +			statisticColor = k13_ColorLightestGray; + +		_vm->_textMan->printToViewport(174, textPosY, (Color)statisticColor, _vm->_championMan->getStringFromInteger(statisticCurrentValue, true, 3).c_str()); +		Common::String displayString = "/" + _vm->_championMan->getStringFromInteger(statisticMaximumValue, true, 3); +		_vm->_textMan->printToViewport(192, textPosY, k13_ColorLightestGray, displayString.c_str()); +		textPosY += 7;  	}  } @@ -898,14 +851,13 @@ void InventoryMan::drawStopPressingMouth() {  }  void InventoryMan::drawStopPressingEye() { -	Thing L1100_T_LeaderHandObject; -  	drawIconToViewport(k202_IconIndiceEyeNotLooking, 12, 13);  	drawPanel();  	_vm->_displayMan->drawViewport(k0_viewportNotDungeonView); -	if ((L1100_T_LeaderHandObject = _vm->_championMan->_leaderHandObject) != Thing::_none) { -		_vm->_objectMan->drawLeaderObjectName(L1100_T_LeaderHandObject); -	} +	Thing leaderHandObject = _vm->_championMan->_leaderHandObject; +	if (leaderHandObject != Thing::_none) +		_vm->_objectMan->drawLeaderObjectName(leaderHandObject); +  	_vm->_eventMan->showMouse();  	_vm->_eventMan->showMouse();  	_vm->_eventMan->showMouse(); @@ -943,9 +895,9 @@ void InventoryMan::clickOnMouth() {  	if (_vm->_championMan->_leaderEmptyHanded) { -		if (_panelContent == k0_PanelContentFoodWaterPoisoned) { +		if (_panelContent == k0_PanelContentFoodWaterPoisoned)  			return; -		} +  		_vm->_eventMan->_ignoreMouseMovements = true;  		_vm->_pressingMouth = true;  		if (!_vm->_eventMan->isMouseButtonDown(k1_LeftMouseButton)) { @@ -960,14 +912,14 @@ void InventoryMan::clickOnMouth() {  		}  		return;  	} -	if (_vm->_championMan->_candidateChampionOrdinal) { + +	if (_vm->_championMan->_candidateChampionOrdinal)  		return; -	}  	L1078_T_Thing = _vm->_championMan->_leaderHandObject; -	if (!getFlag(_vm->_dungeonMan->_objectInfos[_vm->_dungeonMan->getObjectInfoIndex(L1078_T_Thing)]._allowedSlots, k0x0001_ObjectAllowedSlotMouth)) { +	if (!getFlag(_vm->_dungeonMan->_objectInfos[_vm->_dungeonMan->getObjectInfoIndex(L1078_T_Thing)]._allowedSlots, k0x0001_ObjectAllowedSlotMouth))  		return; -	} +  	L1079_ui_IconIndex = _vm->_objectMan->getIconIndex(L1078_T_Thing);  	AL1088_ui_ThingType = L1078_T_Thing.getType();  	L1089_ui_Weight = _vm->_dungeonMan->getObjectWeight(L1078_T_Thing); diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index 32d6c62565..687e619661 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -837,13 +837,14 @@ void MenuMan::addChampionSymbol(int16 symbolIndex) {  		{1, 2, 3, 4, 5, 6},   /* Power 1 */  		{2, 3, 4, 5, 6, 7},   /* Power 2 */  		{4, 5, 6, 7, 7, 9},   /* Power 3 */ -		{2, 2, 3, 4, 6, 7}}; /* Power 4 */ +		{2, 2, 3, 4, 6, 7}    /* Power 4 */ +	};  	static byte G0486_auc_Graphic560_SymbolManaCostMultiplier[6] = {8, 12, 16, 20, 24, 28};  	uint16 L1222_ui_SymbolStep;  	uint16 L1223_ui_ManaCost;  	uint16 L1224_ui_SymbolIndex; -	Champion* L1225_ps_Champion; +	Champion *L1225_ps_Champion;  	L1225_ps_Champion = &_vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex];  	L1222_ui_SymbolStep = L1225_ps_Champion->_symbolStep; @@ -867,7 +868,7 @@ void MenuMan::addChampionSymbol(int16 symbolIndex) {  void MenuMan::deleteChampionSymbol() {  	int16 L1226_ui_SymbolStep; -	Champion* L1228_ps_Champion; +	Champion *L1228_ps_Champion;  	L1228_ps_Champion = &_vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex];  	if (!strlen(L1228_ps_Champion->_symbols)) { | 
