[Scummvm-git-logs] scummvm master -> 7398a027b3662c6fbc809600dd2491446b6c23dc
sev-
sev at scummvm.org
Sat Oct 24 21:08:09 UTC 2020
This automated email contains information about 10 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8e5efc0fda HADESCH: Add missing override keywords
79ea974574 HADESCH: Put all statue fields into single struct
c2d0593690 HADESCH: Remove several unused variables
25200d6815 HADESCH: Restruct BirdInfo to void global constructor
d424dcebfe HADESCH: ferry: restructure structs to avoid global constructors
6150169978 HADESCH: fix forward declaration of MacCursor
8bf5109950 HADESCH: typhoon: Reorganize structure to avoid global constructors
e59357eb3a HADESCH: change const to define when it removes global constructor
fb6c0d8749 HADESCH: name enums to avoid anonymous enum templates
7398a027b3 HADESCH: replace Common::Point with a struct in init tables
Commit: 8e5efc0fdaf5d6724f90c2bbafa604fc55ad2f26
https://github.com/scummvm/scummvm/commit/8e5efc0fdaf5d6724f90c2bbafa604fc55ad2f26
Author: Vladimir Serbinenko (phcoder at google.com)
Date: 2020-10-24T23:07:59+02:00
Commit Message:
HADESCH: Add missing override keywords
Changed paths:
engines/hadesch/metaengine.cpp
diff --git a/engines/hadesch/metaengine.cpp b/engines/hadesch/metaengine.cpp
index 41a68317b6..752a1bc730 100644
--- a/engines/hadesch/metaengine.cpp
+++ b/engines/hadesch/metaengine.cpp
@@ -29,7 +29,7 @@
class HadeschMetaEngine : public AdvancedMetaEngine {
public:
- bool hasFeature(MetaEngineFeature f) const {
+ bool hasFeature(MetaEngineFeature f) const override {
return
(f == kSupportsListSaves) ||
(f == kSupportsDeleteSave) ||
@@ -40,7 +40,7 @@ public:
(f == kSavesUseExtendedFormat);
}
- bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
+ bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override {
if (desc)
*engine = new Hadesch::HadeschEngine(syst, desc);
Commit: 79ea9745741b8b83e783c0acf735d6c596ce3bc6
https://github.com/scummvm/scummvm/commit/79ea9745741b8b83e783c0acf735d6c596ce3bc6
Author: Vladimir Serbinenko (phcoder at google.com)
Date: 2020-10-24T23:07:59+02:00
Commit Message:
HADESCH: Put all statue fields into single struct
This is nicer and avoids the need for global constructor
Changed paths:
engines/hadesch/rooms/medisle.cpp
diff --git a/engines/hadesch/rooms/medisle.cpp b/engines/hadesch/rooms/medisle.cpp
index 50e6edf7d3..46535466b0 100644
--- a/engines/hadesch/rooms/medisle.cpp
+++ b/engines/hadesch/rooms/medisle.cpp
@@ -91,97 +91,45 @@ static const char *perseusItemSounds[] = {
"m1230na0"
};
-static const int kBagPuzzleNumElements = 10;
-
-static const char *statueFullElements[kBagPuzzleNumElements] = {
- "m1010or0",
- "m1010or1",
- "m1010ov0",
- "m1010ow0",
- "m1010os0",
- "m1010ot0",
- "m1010ou0",
- "m1010op0",
- "m1010oq0",
- "m1010oo0"
-};
-
-static const char *statueEmptyElements[kBagPuzzleNumElements] = {
- "m1010or2",
- "m1010or3",
- "m1010ov1",
- "m1010ow1",
- "m1010os1",
- "m1010ot1",
- "m1010ou1",
- "m1010op1",
- "m1010oq1",
- "m1010oo1"
-};
-
-static const int statuesZvals1[kBagPuzzleNumElements] = {
- 2009,
- 2008,
- 2010,
- 2006,
- 2007,
- 2005,
- 2004,
- 2002,
- 2001,
- 2003
-};
-
-static Common::Point statuesOffsets1[kBagPuzzleNumElements] = {
- Common::Point(519, 282),
- Common::Point(571, 276),
- Common::Point(528, 225),
- Common::Point(547, 225),
- Common::Point(518, 159),
- Common::Point(500, 161),
- Common::Point(563, 173),
- Common::Point(471, 132),
- Common::Point(565, 193),
- Common::Point(539, 107)
-};
+struct StatuePiece {
+ const char *name;
+ const char *fullElement;
+ const char *emptyElement;
+ int statuex;
+ int statuey;
+ int statuez;
+ int brokenx;
+ int brokeny;
+ int hotspotx;
+ int hotspoty;
+ int dep1;
+ int dep2;
+
+ Common::Point getStatueOffset() const {
+ return Common::Point(statuex, statuey);
+ }
-static Common::Point statueBrokenPiecesOffsets[kBagPuzzleNumElements] = {
- Common::Point(461, 395),
- Common::Point(339, 358),
- Common::Point(590, 356),
- Common::Point(298, 415),
- Common::Point(517, 407),
- Common::Point(582, 453),
- Common::Point(381, 362),
- Common::Point(483, 357),
- Common::Point(426, 360),
- Common::Point(406, 307)
-};
+ Common::Point getBrokenOffset() const {
+ return Common::Point(brokenx, brokeny);
+ }
-static Common::Point statuePieceHotspot[kBagPuzzleNumElements] = {
- Common::Point(26, 28),
- Common::Point(15, 30),
- Common::Point(11, 24),
- Common::Point(15, 25),
- Common::Point(23, 26),
- Common::Point(13, 10),
- Common::Point(10, 13),
- Common::Point(20, 24),
- Common::Point(25, 35),
- Common::Point(24, 32)
+ Common::Point getHotspot() const {
+ return Common::Point(hotspotx, hotspoty);
+ }
};
+
+static const StatuePiece statuePieces[] = {
+ {"LowerLeg1", "m1010or0", "m1010or2", 519, 282, 2009, 461, 395, 26, 28, -1, -1 },
+ {"LowerLeg2", "m1010or1", "m1010or3", 571, 276, 2008, 339, 358, 15, 30, -1, -1 },
+ {"UpperLeg1", "m1010ov0", "m1010ov1", 528, 225, 2010, 590, 356, 11, 24, 0, -1 },
+ {"UpperLeg2", "m1010ow0", "m1010ow1", 547, 225, 2006, 298, 415, 15, 25, 1, -1 },
+ {"Torso" , "m1010os0", "m1010os1", 518, 159, 2007, 517, 407, 23, 26, 2, 3 },
+ {"UpperArm1", "m1010ot0", "m1010ot1", 500, 161, 2005, 582, 453, 13, 10, 4, -1 },
+ {"UpperArm2", "m1010ou0", "m1010ou1", 563, 173, 2004, 381, 362, 10, 13, 4, -1 },
+ {"LowerArm1", "m1010op0", "m1010op1", 471, 132, 2002, 483, 357, 20, 24, 5, -1 },
+ {"LowerArm2", "m1010oq0", "m1010oq1", 565, 193, 2001, 426, 360, 25, 35, 6, -1 },
+ {"Head" , "m1010oo0", "m1010oo1", 539, 107, 2003, 406, 307, 24, 32, 4, -1 }
-static const char *statuePieceNames[kBagPuzzleNumElements] = {
- "LowerLeg1",
- "LowerLeg2",
- "UpperLeg1",
- "UpperLeg2",
- "Torso",
- "UpperArm1",
- "UpperArm2",
- "LowerArm1",
- "LowerArm2",
- "Head"
};
static const char *fatesHotzoneNames[kNumFates] = {
@@ -198,19 +146,6 @@ static const char *itemNames[] = {
"sandals"
};
-static const int statuePiecesDepMap[kBagPuzzleNumElements][2] = {
- { -1, -1 },
- { -1, -1 },
- { 0, -1 },
- { 1, -1 },
- { 2, 3 },
- { 4, -1 },
- { 4, -1 },
- { 5, -1 },
- { 6, -1 },
- { 4, -1 }
-};
-
static const struct {
const char *image;
int minint, maxint;
@@ -290,12 +225,12 @@ public:
Persistent *persistent = g_vm->getPersistent();
Quest quest = persistent->_quest;
- for (int i = 0; i < kBagPuzzleNumElements; i++) {
- if (name == Common::String("D") + statuePieceNames[i]) {
+ for (int i = 0; i < ARRAYSIZE(statuePieces); i++) {
+ if (name == Common::String("D") + statuePieces[i].name) {
statueDClick(i);
return;
}
- if (name == Common::String("S") + statuePieceNames[i]) {
+ if (name == Common::String("S") + statuePieces[i].name) {
statueSClick(i);
return;
}
@@ -914,7 +849,7 @@ TODO (medusa quest):
room->enableHotzone("FatesLair");
if (quest == kMedusaQuest && persistent->_medisleBagPuzzleState == 2) {
- for (int i = 0; i < kBagPuzzleNumElements; i++) {
+ for (int i = 0; i < ARRAYSIZE(statuePieces); i++) {
_statueState[i] = true;
}
renderStatue();
@@ -923,7 +858,7 @@ TODO (medusa quest):
} else if (quest == kMedusaQuest && persistent->_medisleBagPuzzleState == 1) {
startBagPuzzle();
} else {
- for (int i = 0; i < kBagPuzzleNumElements; i++) {
+ for (int i = 0; i < ARRAYSIZE(statuePieces); i++) {
_statueState[i] = true;
}
renderStatue();
@@ -1152,25 +1087,25 @@ private:
void renderStatue() {
Common::SharedPtr<VideoRoom> room = g_vm->getVideoRoom();
- for (int i = 0; i < kBagPuzzleNumElements; i++) {
+ for (int i = 0; i < ARRAYSIZE(statuePieces); i++) {
if (_statueState[i]) {
- room->stopAnim(statueEmptyElements[i]);
- room->selectFrame(statueFullElements[i], statuesZvals1[i], 0, statuesOffsets1[i]);
- room->disableHotzone(Common::String("D") + statuePieceNames[i]);
+ room->stopAnim(statuePieces[i].emptyElement);
+ room->selectFrame(statuePieces[i].fullElement, statuePieces[i].statuez, 0, statuePieces[i].getStatueOffset());
+ room->disableHotzone(Common::String("D") + statuePieces[i].name);
} else if (_statueDrag == i) {
- room->stopAnim(statueFullElements[i]);
- room->selectFrame(statueEmptyElements[i], statuesZvals1[i], 0, statuesOffsets1[i]);
- room->disableHotzone(Common::String("D") + statuePieceNames[i]);
+ room->stopAnim(statuePieces[i].fullElement);
+ room->selectFrame(statuePieces[i].emptyElement, statuePieces[i].statuez, 0, statuePieces[i].getStatueOffset());
+ room->disableHotzone(Common::String("D") + statuePieces[i].name);
} else {
- room->selectFrame(statueEmptyElements[i], statuesZvals1[i], 0, statuesOffsets1[i]);
- room->selectFrame(statueFullElements[i], kStatuesZVal2, 0, statueBrokenPiecesOffsets[i]);
- room->enableHotzone(Common::String("D") + statuePieceNames[i]);
- room->setHotZoneOffset(Common::String("D") + statuePieceNames[i], statueBrokenPiecesOffsets[i]);
+ room->selectFrame(statuePieces[i].emptyElement, statuePieces[i].statuez, 0, statuePieces[i].getStatueOffset());
+ room->selectFrame(statuePieces[i].fullElement, kStatuesZVal2, 0, statuePieces[i].getBrokenOffset());
+ room->enableHotzone(Common::String("D") + statuePieces[i].name);
+ room->setHotZoneOffset(Common::String("D") + statuePieces[i].name, statuePieces[i].getBrokenOffset());
}
}
if (_statueDrag >= 0) {
- room->drag(statueFullElements[_statueDrag], 0, statuePieceHotspot[_statueDrag]);
+ room->drag(statuePieces[_statueDrag].fullElement, 0, statuePieces[_statueDrag].getHotspot());
room->setPannable(false);
} else {
room->clearDrag();
@@ -1180,13 +1115,13 @@ private:
void startBagPuzzle() {
Common::SharedPtr<VideoRoom> room = g_vm->getVideoRoom();
- for (int i = 0; i < kBagPuzzleNumElements; i++) {
+ for (int i = 0; i < ARRAYSIZE(statuePieces); i++) {
_statueState[i] = false;
}
renderStatue();
- for (int i = 0; i < kBagPuzzleNumElements; i++) {
- room->enableHotzone(Common::String("D") + statuePieceNames[i]);
- room->enableHotzone(Common::String("S") + statuePieceNames[i]);
+ for (int i = 0; i < ARRAYSIZE(statuePieces); i++) {
+ room->enableHotzone(Common::String("D") + statuePieces[i].name);
+ room->enableHotzone(Common::String("S") + statuePieces[i].name);
}
}
@@ -1197,11 +1132,11 @@ private:
}
bool checkDep(int pieceNum) {
- if (statuePiecesDepMap[pieceNum][0] >= 0
- && !_statueState[statuePiecesDepMap[pieceNum][0]])
+ if (statuePieces[pieceNum].dep1 >= 0
+ && !_statueState[statuePieces[pieceNum].dep1])
return false;
- if (statuePiecesDepMap[pieceNum][1] >= 0
- && !_statueState[statuePiecesDepMap[pieceNum][1]])
+ if (statuePieces[pieceNum].dep2 >= 0
+ && !_statueState[statuePieces[pieceNum].dep2])
return false;
return true;
}
@@ -1222,7 +1157,7 @@ private:
}
bool isAllPlaced() {
- for (int i = 0; i < kBagPuzzleNumElements; i++) {
+ for (int i = 0; i < ARRAYSIZE(statuePieces); i++) {
if (!_statueState[i])
return false;
}
@@ -1235,9 +1170,9 @@ private:
room->playAnimLoop("m1270bg0", 500);
room->enableHotzone("MagicBag");
renderStatue();
- for (int i = 0; i < kBagPuzzleNumElements; i++) {
- room->disableHotzone(Common::String("D") + statuePieceNames[i]);
- room->disableHotzone(Common::String("S") + statuePieceNames[i]);
+ for (int i = 0; i < ARRAYSIZE(statuePieces); i++) {
+ room->disableHotzone(Common::String("D") + statuePieces[i].name);
+ room->disableHotzone(Common::String("S") + statuePieces[i].name);
}
}
Commit: c2d05936902fbf7a6f2449096344d1d735ce22f6
https://github.com/scummvm/scummvm/commit/c2d05936902fbf7a6f2449096344d1d735ce22f6
Author: Vladimir Serbinenko (phcoder at google.com)
Date: 2020-10-24T23:07:59+02:00
Commit Message:
HADESCH: Remove several unused variables
Changed paths:
engines/hadesch/herobelt.h
engines/hadesch/rooms/medisle.cpp
engines/hadesch/rooms/monster.h
diff --git a/engines/hadesch/herobelt.h b/engines/hadesch/herobelt.h
index fd559efcb8..053de7764d 100644
--- a/engines/hadesch/herobelt.h
+++ b/engines/hadesch/herobelt.h
@@ -119,7 +119,6 @@ private:
int _animateItemStartTime;
int _currentTime;
int _animItemTime;
- int _cursor;
int _hotZone;
int _startHotTime;
int _branchOfLifeFrame;
diff --git a/engines/hadesch/rooms/medisle.cpp b/engines/hadesch/rooms/medisle.cpp
index 46535466b0..71073870ad 100644
--- a/engines/hadesch/rooms/medisle.cpp
+++ b/engines/hadesch/rooms/medisle.cpp
@@ -1202,7 +1202,6 @@ private:
int _eyeInsistCounter;
bool _eyeIsGivenBack, _eyeIsPickedUp;
bool _fatesShadowIsActive;
- bool _fates[3];
bool _isFirstFates;
bool _statueState[10];
bool _fatesAreBusy;
diff --git a/engines/hadesch/rooms/monster.h b/engines/hadesch/rooms/monster.h
index b257cc9aea..a18603182f 100644
--- a/engines/hadesch/rooms/monster.h
+++ b/engines/hadesch/rooms/monster.h
@@ -62,10 +62,6 @@ private:
int _level;
bool _isMiss;
- int _minStartX;
- int _maxStartX;
- int _minStartY;
- int _maxStartY;
int _flightCounterMs;
int _flightStart;
int _projectileId;
Commit: 25200d681558cac0aaff560fb984985e6a5dc18b
https://github.com/scummvm/scummvm/commit/25200d681558cac0aaff560fb984985e6a5dc18b
Author: Vladimir Serbinenko (phcoder at google.com)
Date: 2020-10-24T23:07:59+02:00
Commit Message:
HADESCH: Restruct BirdInfo to void global constructor
Changed paths:
engines/hadesch/rooms/monster/illusion.cpp
diff --git a/engines/hadesch/rooms/monster/illusion.cpp b/engines/hadesch/rooms/monster/illusion.cpp
index e88c14c2f6..8f7079779d 100644
--- a/engines/hadesch/rooms/monster/illusion.cpp
+++ b/engines/hadesch/rooms/monster/illusion.cpp
@@ -28,77 +28,89 @@
namespace Hadesch {
-static const struct {
+struct BirdInfo {
int _projectileFrame;
const char *_flyAnim;
- Common::Point _birdSize;
+ int _birdWidth;
+ int _birdHeight;
const char *_interceptAnim;
const char *_shootAnim;
- Common::Point _birdShootSize;
-} birdInfo[] = {
+ int _birdShootWidth;
+ int _birdShootHeight;
+
+ Common::Point getBirdSize() const {
+ return Common::Point(_birdWidth, _birdHeight);
+ }
+
+ Common::Point getBirdShootSize() const {
+ return Common::Point(_birdShootWidth, _birdShootHeight);
+ }
+};
+
+static const BirdInfo birdInfo[] = {
{
10,
"v7220bh2",
- Common::Point(151, 111),
+ 151, 111,
"v7220bp2",
"v7220bl2",
- Common::Point(154, 192),
+ 154, 192,
},
{
6,
"v7220bi2",
- Common::Point(167, 175),
+ 167, 175,
"v7220bq2",
"v7220bm2",
- Common::Point(190, 233),
+ 190, 233,
},
{
10,
"v7220bh3",
- Common::Point(151, 111),
+ 151, 111,
"v7220bp3",
"v7220bl3",
- Common::Point(154, 192),
+ 154, 192,
},
{
6,
"v7220bi3",
- Common::Point(167, 175),
+ 167, 175,
"v7220bq3",
"v7220bm3",
- Common::Point(190, 233),
+ 190, 233,
},
{
10,
"v7220bh0",
- Common::Point(141, 109),
+ 141, 109,
"v7220bp0",
"v7220bl0",
- Common::Point(141, 192),
+ 141, 192,
},
{
6,
"v7220bi0",
- Common::Point(110, 172),
+ 110, 172,
"v7220bq0",
"v7220bm0",
- Common::Point(94, 233),
+ 94, 233,
},
{
10,
"v7220bh1",
- Common::Point(141, 109),
+ 141, 109,
"v7220bp1",
"v7220bl1",
- Common::Point(141, 192),
+ 141, 192,
},
{
6,
"v7220bi1",
- Common::Point(110, 172),
+ 110, 172,
"v7220bq1",
"v7220bm1",
- Common::Point(94, 233),
+ 94, 233,
}
};
@@ -207,19 +219,19 @@ void Bird::tick(Common::SharedPtr<Bird> backRef, Common::SharedPtr<Battleground>
int scale = fp.scale;
if (frame < _flightShootAnimFrame) {
Common::Point cornerPos = fp.centerPos - (scale / 100.0)
- * birdInfo[_birdType]._birdSize;
+ * birdInfo[_birdType].getBirdSize();
room->selectFrame(flyLayer, 500, frame % 5, cornerPos);
room->setScale(flyLayer, scale);
room->stopAnim(shootLayer);
} else if (frame < _flightShootEndFrame) {
Common::Point cornerPos = fp.centerPos - (scale / 100.0)
- * birdInfo[_birdType]._birdShootSize;
+ * birdInfo[_birdType].getBirdShootSize();
room->selectFrame(shootLayer, 500, frame - _flightShootAnimFrame, cornerPos);
room->setScale(shootLayer, scale);
room->stopAnim(flyLayer);
} else { // 15204
Common::Point cornerPos = fp.centerPos - (scale / 100.0)
- * birdInfo[_birdType]._birdSize;
+ * birdInfo[_birdType].getBirdSize();
room->selectFrame(flyLayer, 500, (frame - _flightShootEndFrame) % 5, cornerPos);
room->setScale(flyLayer, scale);
room->stopAnim(shootLayer);
@@ -251,8 +263,9 @@ void Bird::handleAbsoluteClick(Common::Point p) {
_isActive = false;
LayerId l = LayerId(birdInfo[_birdType]._interceptAnim, _id, "bird");
room->playAnimWithSound(l, "v7220ec0", 500, PlayAnimParams::disappear(),
- EventHandlerWrapper(),
- fp.centerPos - birdInfo[_birdType]._birdSize * (fp.scale / 100.0));
+ EventHandlerWrapper(),
+ fp.centerPos - birdInfo[_birdType].getBirdSize()
+ * (fp.scale / 100.0));
}
Illusion::Illusion(Common::SharedPtr<Battleground> battleground) {
Commit: d424dcebfef16ab1e92c1b9ee3c155d9d70a0811
https://github.com/scummvm/scummvm/commit/d424dcebfef16ab1e92c1b9ee3c155d9d70a0811
Author: Vladimir Serbinenko (phcoder at google.com)
Date: 2020-10-24T23:07:59+02:00
Commit Message:
HADESCH: ferry: restructure structs to avoid global constructors
Changed paths:
engines/hadesch/rooms/ferry.cpp
diff --git a/engines/hadesch/rooms/ferry.cpp b/engines/hadesch/rooms/ferry.cpp
index fcc42f5f1e..b9ac55f94d 100644
--- a/engines/hadesch/rooms/ferry.cpp
+++ b/engines/hadesch/rooms/ferry.cpp
@@ -60,7 +60,7 @@ enum {
kDog = 1 << 26
};
-static const struct {
+struct ShadowInfo {
const char *image;
const char *nameImage;
const char *name;
@@ -68,103 +68,120 @@ static const struct {
int priorityleft;
int priorityright;
int attributes;
- Common::Point waitBubble;
- Common::Point starboardBubble;
- Common::Point portBubble;
+ int waitBubbleX;
+ int waitBubbleY;
+ int starboardBubbleX;
+ int starboardBubbleY;
+ int portBubbleX;
+ int portBubbleY;
int portFrame;
int starboardFrame;
const char *animSound;
int animPlayCount;
-} shadows[] = {
+
+ Common::Point getWaitBubblePos() const {
+ return Common::Point(waitBubbleX, waitBubbleY);
+ }
+
+ Common::Point getPortBubblePos() const {
+ return Common::Point(portBubbleX, portBubbleY);
+ }
+
+ Common::Point getStarboardBubblePos() const {
+ return Common::Point(starboardBubbleX, starboardBubbleY);
+ }
+};
+
+static const ShadowInfo shadows[] = {
{
"xxxxxxxx", "" , "Chariot Wheel Guy" , 0, 0, 0 , kHuman | kFlat | kCrushed,
- Common::Point(0, 0), Common::Point(0, 0), Common::Point(0, 0), 2, 3,
+ 0, 0, 0, 0, 0, 0, 2, 3,
nullptr, 0
},
{"V9070bD0", "V9520tD0", "Chariot Wheel Dog" , 40, 20, 5 , kAnimal | kFlat | kCrushed | kDog,
- Common::Point(113, 177), Common::Point(66, 134), Common::Point(106, 176), 16, 32,
+ 113, 177, 66, 134, 106, 176, 16, 32,
nullptr, 0
},
{"V9070bE0", "V9520tE0", "Drowned Guy" , 0, 10, 15 , kHuman | kWet | kDrownedGuy,
- Common::Point(124, 84), Common::Point(78, 67), Common::Point(104, 80), 19, 35,
+ 124, 84, 78, 67, 104, 80, 19, 35,
"V9070eE0", 1
},
{"V9070bI0", "V9520tI0", "Holey Guy" , 0, 15, 20 , kHuman | kPierced | kWeaponInjury | kWithHoles,
- Common::Point(84, 107), Common::Point(68, 66), Common::Point(92, 100), 6, 13,
+ 84, 107, 68, 66, 92, 100, 6, 13,
nullptr, 0
},
{"V9070bP0", "V9520tO0", "Cyclops" , 14, 50, 50 , kMonster | kPierced | kWeaponInjury | kHeadInjury | kCrushed | kTwoHeaded,
- Common::Point(77, 64), Common::Point(73, 72), Common::Point(63, 68), 14, 33,
+ 77, 64, 73, 72, 63, 68, 14, 33,
nullptr, 0
},
{"V9070bM0", "V9520tM0", "Toasted Guy" , -13, 40, 50 , kHuman | kSmoking | kHot,
- Common::Point(115, 89), Common::Point(78, 71), Common::Point(104, 73), 14, 28,
+ 115, 89, 78, 71, 104, 73, 14, 28,
nullptr, 0
},
{"V9070bJ0", "V9520tJ0", "Minotaur" , 0, 25, 20 , kMonster | kHorned,
- Common::Point(111, 100), Common::Point(63, 79), Common::Point(106, 111), 12, 45,
+ 111, 100, 63, 79, 106, 111, 12, 45,
nullptr, 0
},
{"V9070bA0", "V9520tA0", "Ball Chain Monster", 0, 20, 20 , kMonster | kWeaponInjury | kHeadInjury | kHeadless,
- Common::Point(79, 92), Common::Point(85, 91), Common::Point(83, 102), 13, 26,
+ 79, 92, 85, 91, 83, 102, 13, 26,
nullptr, 0
},
{"V9070bL0", "V9520tL0", "Snake Man" , 0, 25, 40 , kHuman | kAnimal | kCrushed | kSnakeKilled,
- Common::Point(82, 65), Common::Point(93, 62), Common::Point(74, 45), 4, 8,
+ 82, 65, 93, 62, 74, 45, 4, 8,
"V9070eL0", 3
},
{"xxxxxxxx", "" , "Arrow Guy" , 0, 0, 0 , kHuman | kPierced | kWeaponInjury,
- Common::Point(0, 0), Common::Point(0, 0), Common::Point(0, 0), 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
nullptr, 0 },
// 10
{"V9070bC0", "V9520tC0", "Choked Dog" , 46, 30, 5 , kAnimal | kDog | kChokedDog,
- Common::Point(97, 91), Common::Point(83, 85), Common::Point(81, 85), 11, 22,
+ 97, 91, 83, 85, 81, 85, 11, 22,
"V9070eC0", 2
},
{"V9070bK0", "V9520tK0", "Mounted Aries" , 23, 35, 40 , kAnimal | kHeadInjury | kHorned,
- Common::Point(121, 62), Common::Point(75, 54), Common::Point(113, 52), 6, 12,
+ 121, 62, 75, 54, 113, 52, 6, 12,
"V9070eK0", 1
},
{"V9070bF0", "V9520tF0", "Flat Cat" , 43, 40, 5 , kAnimal | kFlat | kCrushed | kCat,
- Common::Point(75, 142), Common::Point(72, 142), Common::Point(72, 142), 5, 19,
+ 75, 142, 72, 142, 72, 142, 5, 19,
nullptr, 0
},
{"V9070bH0", "V9520tH0", "Headless Guy" , -14, 5, 15 , kHuman | kDismembered | kWeaponInjury | kHeadInjury | kHeadless,
- Common::Point(110, 119), Common::Point(50, 98), Common::Point(115, 117), 26, 52,
+ 110, 119, 50, 98, 115, 117, 26, 52,
nullptr, 0
},
{"V9070bG0", "V9520tG0", "Frozen Guy" , 0, 15, 40 , kHuman | kCold | kWet | kFrozen,
- Common::Point(71, 67), Common::Point(91, 80), Common::Point(74, 58), 9, 18,
+ 71, 67, 91, 80, 74, 58, 9, 18,
"V9070eG0", 2
},
// 15
{"xxxxxxxx", "" , "Caesar" , 0, 0, 0 , kHuman | kPierced | kWeaponInjury,
- Common::Point(0, 0), Common::Point(0, 0), Common::Point(0, 0), 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
nullptr, 0 },
{"V9070bN0", "V9520tN0", "Trident Guy" , 9, 5, 10 , kHuman | kPierced | kWeaponInjury | kHeadInjury | kTridentInjured,
- Common::Point(89, 91), Common::Point(81, 88), Common::Point(94, 88), 5, 10,
+ 89, 91, 81, 88, 94, 88, 5, 10,
nullptr, 0
},
{"xxxxxxxx", "" , "BeeSting Guy" , 0, 0, 0 , kHuman | kPierced,
- Common::Point(0, 0), Common::Point(0, 0), Common::Point(0, 0), 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
nullptr, 0 },
{"xxxxxxxx", "" , "Half Man" , 0, 0, 0 , kHuman | kDismembered,
- Common::Point(0, 0), Common::Point(0, 0), Common::Point(0, 0), 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
nullptr, 0 },
{"V9070bQ0", "V9520tP0", "Toasted Cat" , 41, 45, 5 , kAnimal | kSmoking | kHot | kCat,
- Common::Point(111, 158), Common::Point(59, 135), Common::Point(105, 161), 6, 12,
+ 111, 158, 59, 135, 105, 161, 6, 12,
"V9070eQ0", 3
},
// 20
{"V9070bR0", "V9520tQ0", "Pillar Guy" , 0, 15, 10 , kHuman | kFlat | kHeadInjury | kCrushed,
- Common::Point(86, 188), Common::Point(78, 186), Common::Point(92, 186), 15, 30,
+ 86, 188, 78, 186, 92, 186, 15, 30,
"V9070eR0", 1
},
{"xxxxxxxx", "" , "Ax-Head Guy" , 0, 0, 0 , kHuman | kWeaponInjury | kHeadInjury,
- Common::Point(0, 0), Common::Point(0, 0), Common::Point(0, 0), 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
nullptr, 0 },
{"V9070bB0", "V9520tB0", "Boiled Guy" , 45, 5, 10 , kHuman | kHot | kWet,
- Common::Point(80, 62), Common::Point(81, 68), Common::Point(79, 60), 13, 42,
+ 80, 62, 81, 68, 79, 60, 13, 42,
nullptr, 0
}
};
@@ -289,12 +306,19 @@ static const char *charonAnims[] = {
"V9140BC0"
};
-static struct {
+struct CharonIdleVideoInfo {
const char *name;
- Common::Point offset;
-} charonIdleVideos[] = {
- {"V9140BD0", Common::Point(418, 40)},
- {"V9140BE0", Common::Point(370, 64)}
+ int offsetX;
+ int offsetY;
+
+ Common::Point getOffset() const {
+ return Common::Point(offsetX, offsetY);
+ }
+};
+
+static CharonIdleVideoInfo charonIdleVideos[] = {
+ {"V9140BD0", 418, 40},
+ {"V9140BE0", 370, 64}
};
struct Shade {
@@ -564,7 +588,7 @@ public:
hideCharon();
int vid = g_vm->getRnd().getRandomNumberRng(0, ARRAYSIZE(charonIdleVideos) - 1);
room->playVideo(charonIdleVideos[vid].name,
- kCharonZ, 24811, charonIdleVideos[vid].offset);
+ kCharonZ, 24811, charonIdleVideos[vid].getOffset());
break;
}
case k24801_arg1:
@@ -718,11 +742,11 @@ private:
hideThought();
bubblePos = getShadowPos(id) - Common::Point(71, 71);
if (_shades[id].currentPos >= 0 && _shades[id].currentPos <= 4) {
- bubblePos += shadows[_shades[id].shadowId].starboardBubble;
+ bubblePos += shadows[_shades[id].shadowId].getStarboardBubblePos();
} else if (_shades[id].currentPos >= 5) {
- bubblePos += shadows[_shades[id].shadowId].portBubble;
+ bubblePos += shadows[_shades[id].shadowId].getPortBubblePos();
} else
- bubblePos += shadows[_shades[id].shadowId].waitBubble;
+ bubblePos += shadows[_shades[id].shadowId].getWaitBubblePos();
bubblePos.x = MAX<int>(bubblePos.x, -10);
bubblePos.y = MAX<int>(bubblePos.y, 0);
if (!silent) {
Commit: 6150169978fce054fde1cbd0402a171e1933a19b
https://github.com/scummvm/scummvm/commit/6150169978fce054fde1cbd0402a171e1933a19b
Author: Vladimir Serbinenko (phcoder at google.com)
Date: 2020-10-24T23:07:59+02:00
Commit Message:
HADESCH: fix forward declaration of MacCursor
Changed paths:
engines/hadesch/hadesch.h
diff --git a/engines/hadesch/hadesch.h b/engines/hadesch/hadesch.h
index 182e7f0e58..7892c17a26 100644
--- a/engines/hadesch/hadesch.h
+++ b/engines/hadesch/hadesch.h
@@ -50,7 +50,7 @@ class PEResources;
namespace Graphics {
struct WinCursorGroup;
-struct MacCursor;
+class MacCursor;
}
namespace Hadesch {
Commit: 8bf5109950b15bf856489b026fb3098fb2955346
https://github.com/scummvm/scummvm/commit/8bf5109950b15bf856489b026fb3098fb2955346
Author: Vladimir Serbinenko (phcoder at google.com)
Date: 2020-10-24T23:07:59+02:00
Commit Message:
HADESCH: typhoon: Reorganize structure to avoid global constructors
Changed paths:
engines/hadesch/rooms/monster/typhoon.cpp
diff --git a/engines/hadesch/rooms/monster/typhoon.cpp b/engines/hadesch/rooms/monster/typhoon.cpp
index 8abeb06907..324d7df6b8 100644
--- a/engines/hadesch/rooms/monster/typhoon.cpp
+++ b/engines/hadesch/rooms/monster/typhoon.cpp
@@ -32,32 +32,39 @@ enum {
kTyphoonZ = 500
};
-static const struct {
+struct TyphoonHeadInfo {
const char *_animDie;
const char *_animRespawn;
const char * _animNormal;
const char * _hotZone;
- Common::Point _position;
+ int _xVal;
+ int _yVal;
int _zVal;
-} typhonHeadInfo[] = {
- {"V7210BO1", "V7210BS1", "V7210BC1", "head00c1", Common::Point(275, 186), 480},
- {"V7210BO0", "V7210BS0", "V7210BC0", "head01c0", Common::Point(320, 166), 481},
- {"V7210BO0", "V7210BS0", "V7210BC0", "head02c0", Common::Point(313, 221), 482},
- {"V7210BO1", "V7210BS1", "V7210BC1", "head03c1", Common::Point(279, 223), 483},
- {"V7210BP1", "V7210BT1", "V7210BD1", "head04d1", Common::Point(237, 221), 484},
- {"V7210BP0", "V7210BT0", "V7210BD0", "head05d0", Common::Point(234, 189), 485},
- {"V7210BP1", "V7210BT1", "V7210BD1", "head06d1", Common::Point(234, 160), 486},
- {"V7210BP0", "V7210BT0", "V7210BD0", "head07d0", Common::Point(289, 137), 487},
- {"V7210BO0", "V7210BS0", "V7210BC0", "head08c0", Common::Point(253, 135), 488},
- {"V7210BP0", "V7210BT0", "V7210BD0", "head09d0", Common::Point(355, 219), 489},
- {"V7210BP0", "V7210BT0", "V7210BD0", "head10d0", Common::Point(368, 182), 490},
- {"V7210BP0", "V7210BT0", "V7210BD0", "head11d0", Common::Point(351, 152), 491},
- {"V7210BP0", "V7210BT0", "V7210BD0", "head12d0", Common::Point(329, 126), 492},
- {"V7210BO0", "V7210BS0", "V7210BC0", "head13c0", Common::Point(289, 99), 493},
- {"V7210BP0", "V7210BT0", "V7210BD0", "head14d0", Common::Point(333, 107), 494},
- {"V7210BO0", "V7210BS0", "V7210BC0", "head15c0", Common::Point(360, 135), 495},
- {"V7210BO1", "V7210BS1", "V7210BC1", "head16c1", Common::Point(226, 147), 496},
- {"V7210BP0", "V7210BT0", "V7210BD0", "head17d0", Common::Point(257, 107), 497}
+
+ Common::Point getPosition() const {
+ return Common::Point(_xVal, _yVal);
+ }
+};
+
+static const TyphoonHeadInfo typhonHeadInfo[] = {
+ {"V7210BO1", "V7210BS1", "V7210BC1", "head00c1", 275, 186, 480},
+ {"V7210BO0", "V7210BS0", "V7210BC0", "head01c0", 320, 166, 481},
+ {"V7210BO0", "V7210BS0", "V7210BC0", "head02c0", 313, 221, 482},
+ {"V7210BO1", "V7210BS1", "V7210BC1", "head03c1", 279, 223, 483},
+ {"V7210BP1", "V7210BT1", "V7210BD1", "head04d1", 237, 221, 484},
+ {"V7210BP0", "V7210BT0", "V7210BD0", "head05d0", 234, 189, 485},
+ {"V7210BP1", "V7210BT1", "V7210BD1", "head06d1", 234, 160, 486},
+ {"V7210BP0", "V7210BT0", "V7210BD0", "head07d0", 289, 137, 487},
+ {"V7210BO0", "V7210BS0", "V7210BC0", "head08c0", 253, 135, 488},
+ {"V7210BP0", "V7210BT0", "V7210BD0", "head09d0", 355, 219, 489},
+ {"V7210BP0", "V7210BT0", "V7210BD0", "head10d0", 368, 182, 490},
+ {"V7210BP0", "V7210BT0", "V7210BD0", "head11d0", 351, 152, 491},
+ {"V7210BP0", "V7210BT0", "V7210BD0", "head12d0", 329, 126, 492},
+ {"V7210BO0", "V7210BS0", "V7210BC0", "head13c0", 289, 99, 493},
+ {"V7210BP0", "V7210BT0", "V7210BD0", "head14d0", 333, 107, 494},
+ {"V7210BO0", "V7210BS0", "V7210BC0", "head15c0", 360, 135, 495},
+ {"V7210BO1", "V7210BS1", "V7210BC1", "head16c1", 226, 147, 496},
+ {"V7210BP0", "V7210BT0", "V7210BD0", "head17d0", 257, 107, 497}
};
Typhoon::Typhoon(Common::SharedPtr<Battleground> battleground) {
@@ -142,7 +149,7 @@ void Typhoon::enterTyphoon(int level) {
room->playSound("v7050eb0");
for (unsigned i = 0; i < ARRAYSIZE(typhonHeadInfo); i++) {
room->enableHotzone(typhonHeadInfo[i]._hotZone);
- room->setHotZoneOffset(typhonHeadInfo[i]._hotZone, typhonHeadInfo[i]._position);
+ room->setHotZoneOffset(typhonHeadInfo[i]._hotZone, typhonHeadInfo[i].getPosition());
}
for (unsigned i = 0; i < 6; i++)
room->disableHotzone(Common::String::format("Phil%d", i));
@@ -208,7 +215,7 @@ void Typhoon::showHeadNormal(int idx) {
hideHead(idx);
room->playAnimLoop(LayerId(typhonHeadInfo[idx]._animNormal, idx, "head"),
typhonHeadInfo[idx]._zVal,
- typhonHeadInfo[idx]._position);
+ typhonHeadInfo[idx].getPosition());
}
// 15103
@@ -245,7 +252,7 @@ public:
typhonHeadInfo[_idx]._zVal,
PlayAnimParams::disappear(),
Common::SharedPtr<EventHandler>(new TyphoonHeadRespawnComplete(_typhoon, _idx)),
- typhonHeadInfo[_idx]._position);
+ typhonHeadInfo[_idx].getPosition());
}
TyphoonHeadRespawnEvent(Common::SharedPtr<Typhoon> typhoon, int idx) {
@@ -309,7 +316,7 @@ void Typhoon::hitTyphoonHead(Common::SharedPtr<Typhoon> backRef, int idx) {
room->playAnimKeepLastFrame(LayerId(typhonHeadInfo[idx]._animDie, idx, "head"),
typhonHeadInfo[idx]._zVal,
Common::SharedPtr<EventHandler>(new TyphoonHeadDieAnimFinishedEvent(backRef, idx, _battleground->_level)),
- typhonHeadInfo[idx]._position);
+ typhonHeadInfo[idx].getPosition());
room->disableHotzone(typhonHeadInfo[idx]._hotZone);
bool isKilled = true;
for (unsigned i = 0; i < ARRAYSIZE(_headIsAlive); i++) {
Commit: e59357eb3a09b444fa619460f188ae9220bbc8fd
https://github.com/scummvm/scummvm/commit/e59357eb3a09b444fa619460f188ae9220bbc8fd
Author: Vladimir Serbinenko (phcoder at google.com)
Date: 2020-10-24T23:07:59+02:00
Commit Message:
HADESCH: change const to define when it removes global constructor
It's a bit less nice but avoids global constructors
Changed paths:
engines/hadesch/rooms/walloffame.cpp
engines/hadesch/video.h
diff --git a/engines/hadesch/rooms/walloffame.cpp b/engines/hadesch/rooms/walloffame.cpp
index 2099ba153b..aa348fba13 100644
--- a/engines/hadesch/rooms/walloffame.cpp
+++ b/engines/hadesch/rooms/walloffame.cpp
@@ -64,13 +64,13 @@ static const char *kHadesBurstsIn = "hades bursts in";
static const char *kHadesNoMoreHeroes = "hades no more heroes got it";
static const char *kHadesNoMoreHeroines = "hades no more heroines got it";
-static const char *kPhilWalksCenterToLeft = "phil walks center to left";
-static const char *kPhilSighsLeft = "phil sighs left";
+#define kPhilWalksCenterToLeft "phil walks center to left"
+#define kPhilSighsLeft "phil sighs left"
-static const char *kPhilSnores = "phil snores";
+#define kPhilSnores "phil snores"
static const char *kPhilSnoresSound = "phil snores sound";
-static const char *kPhilRollsOver = "phil rolls over";
-static const char *kPhilJumpsOffPillow = "phil jumps off pillow";
+#define kPhilRollsOver "phil rolls over"
+#define kPhilJumpsOffPillow "phil jumps off pillow"
static const char *kPhilOfCourseIdo = "phil of course i do";
static const char *kPhilWhatAHothead = "phil what a hothead";
static const char *kPhilTimeToGetStarted = "phil time to get started";
@@ -87,20 +87,20 @@ static const char *kPhilRightNotches = "phil right notches";
static const char *kPhilEyeOfFates = "phil eye of fates";
static const char *kPhilBadNews = "phil bad news";
static const char *kPhilFirstQuest = "phil first quest";
-static const char *kPhilTakesScroll = "phil takes scroll";
-static const char *kPhilDropsScroll = "phil drops scroll";
+#define kPhilTakesScroll "phil takes scroll"
+#define kPhilDropsScroll "phil drops scroll"
static const char *kPhilDaedalusNeedsHelp = "phil daedalus needs help";
static const char *kPhilOffToCrete = "phil off to crete";
static const char *kPhilArgo = "phil argo";
-static const char *kPhilYapsWithoutSound = "phil yaps without sound";
+#define kPhilYapsWithoutSound "phil yaps without sound"
static const char *kMugshot = "mug shot";
static const char *kMugshotSound = "mug shot sound";
static const char *kPanicAndPainSting = "pain and panic sting";
-static const char *kHeroStatue = "hero statue";
-static const char *kHeroineStatue = "heroine statue";
+#define kHeroStatue "hero statue"
+#define kHeroineStatue "heroine statue"
static const char *kScroll = "scroll";
static const char *kScrollSound = "scroll sound";
diff --git a/engines/hadesch/video.h b/engines/hadesch/video.h
index 6b95012961..ea254bb93e 100644
--- a/engines/hadesch/video.h
+++ b/engines/hadesch/video.h
@@ -355,8 +355,8 @@ private:
static const int kVideoWidth = 640;
static const int kVideoHeight = 480;
-static const Common::Point kOffsetRightRoom = Common::Point(kVideoWidth, 0);
-static const Common::Point kZeroPoint = Common::Point(10, 50);
+#define kOffsetRightRoom (Common::Point(kVideoWidth, 0))
+#define kZeroPoint (Common::Point(10, 50))
}
#endif
Commit: fb6c0d8749fabaaf31cd9f1782c60f317ad4c746
https://github.com/scummvm/scummvm/commit/fb6c0d8749fabaaf31cd9f1782c60f317ad4c746
Author: Vladimir Serbinenko (phcoder at google.com)
Date: 2020-10-24T23:07:59+02:00
Commit Message:
HADESCH: name enums to avoid anonymous enum templates
Changed paths:
engines/hadesch/persistent.h
diff --git a/engines/hadesch/persistent.h b/engines/hadesch/persistent.h
index c5b5c04660..44f18d858c 100644
--- a/engines/hadesch/persistent.h
+++ b/engines/hadesch/persistent.h
@@ -85,13 +85,14 @@ struct Persistent {
bool _creteIntroAtlantisBoat;
bool _creteIntroAtlantisWood;
bool _creteAlchemistExploded;
- enum {
+ enum CreteSandalsState {
SANDALS_NOT_SOLVED,
SANDALS_SOLVED,
SANDALS_TAKEN
} _creteSandalsState;
- enum { BOX_CLOSED, BOX_OPEN,
- BOX_OPEN_POTION, BOX_OPEN_NO_POTION } _creteStrongBoxState;
+ enum CreteStrongBoxState {
+ BOX_CLOSED, BOX_OPEN,
+ BOX_OPEN_POTION, BOX_OPEN_NO_POTION } _creteStrongBoxState;
bool _cretePlayedPhilAlchemist;
bool _cretePlayedZeusCheckOutThatBox;
bool _creteHadesPusnishesPainAndPanic;
@@ -123,7 +124,7 @@ struct Persistent {
bool _medisleShowFatesIntro;
bool _medisleEyeballIsActive;
FateId _medisleEyePosition;
- enum {
+ enum MedisleBagPuzzleState {
BAG_NOT_STARTED,
BAG_STARTED,
BAG_SOLVED,
@@ -138,7 +139,7 @@ struct Persistent {
bool _troyIsDefeated;
bool _troyPlayOdysseus;
bool _troyMessageIsDelivered;
- enum {
+ enum TroyKeyAndDecreeState {
KEY_AND_DECREE_NOT_GIVEN,
KEY_AND_DECREE_THROWN,
KEY_AND_DECREE_TAKEN
@@ -159,7 +160,7 @@ struct Persistent {
// Volcano
bool _volcanoPainAndPanicIntroDone;
bool _volcanoHeyKid;
- enum {
+ enum VolcanoPuzzleState {
VOLCANO_NO_BOULDERS_THROWN,
VOLCANO_SQUASHED_PANIC,
VOLCANO_BOULDER_ON_VOLCANO,
Commit: 7398a027b3662c6fbc809600dd2491446b6c23dc
https://github.com/scummvm/scummvm/commit/7398a027b3662c6fbc809600dd2491446b6c23dc
Author: Vladimir Serbinenko (phcoder at google.com)
Date: 2020-10-24T23:07:59+02:00
Commit Message:
HADESCH: replace Common::Point with a struct in init tables
This avoids global constructors.
Changed paths:
engines/hadesch/rooms/crete.cpp
engines/hadesch/rooms/monster/cyclops.cpp
engines/hadesch/video.h
diff --git a/engines/hadesch/rooms/crete.cpp b/engines/hadesch/rooms/crete.cpp
index c9ad845da8..76f398749b 100644
--- a/engines/hadesch/rooms/crete.cpp
+++ b/engines/hadesch/rooms/crete.cpp
@@ -105,26 +105,26 @@ enum {
kSandalsPlaced = 1012011
};
-static const Common::Point strongBoxSideDotOffsets[] = {
- Common::Point(1060, 278),
- Common::Point(1090, 310),
- Common::Point(1060, 339),
- Common::Point(1032, 305)
+static const PrePoint strongBoxSideDotOffsets[] = {
+ {1060, 278},
+ {1090, 310},
+ {1060, 339},
+ {1032, 305}
};
-static const Common::Point strongBoxTileOffsets[] = {
- Common::Point(1005, 274),
- Common::Point(1035, 276),
- Common::Point(1064, 278),
- Common::Point(1093, 280),
- Common::Point(1005, 304),
- Common::Point(1035, 306),
- Common::Point(1064, 308),
- Common::Point(1093, 310),
- Common::Point(1035, 246),
- Common::Point(1064, 248),
- Common::Point(1035, 337),
- Common::Point(1064, 339)
+static const PrePoint strongBoxTileOffsets[] = {
+ {1005, 274},
+ {1035, 276},
+ {1064, 278},
+ {1093, 280},
+ {1005, 304},
+ {1035, 306},
+ {1064, 308},
+ {1093, 310},
+ {1035, 246},
+ {1064, 248},
+ {1035, 337},
+ {1064, 339}
};
static const int baseFrame[4][8] = {
@@ -162,10 +162,10 @@ public:
_position = _nextPosition;
_nextPosition = -1;
}
- Common::Point pos = strongBoxTileOffsets[_position];
+ Common::Point pos = strongBoxTileOffsets[_position].get();
if (_nextPosition != -1) {
double frac = (g_vm->getCurrentTime() - _movementStartTime + 0.0) / kTileMovementTime;
- pos = strongBoxTileOffsets[_position] * (1-frac) + strongBoxTileOffsets[_nextPosition] * frac;
+ pos = strongBoxTileOffsets[_position].get() * (1-frac) + strongBoxTileOffsets[_nextPosition].get() * frac;
}
int zVal = 500;
switch (_rotationPhase) {
@@ -1497,7 +1497,7 @@ private:
room->selectFrame(LayerId("r2010om1", 0, "center"), 400, 0, Common::Point(1060, 308));
for (int i = 0; i < 4; i++) {
room->selectFrame(LayerId("r2010om1", i, "side"), 400, 1,
- strongBoxSideDotOffsets[i]);
+ strongBoxSideDotOffsets[i].get());
}
{
bool wasMoving = strongBoxIsBusy();
@@ -1514,7 +1514,7 @@ private:
room->selectFrame(LayerId("r2010om1", 0, "center"), 400, 0, Common::Point(1060, 308));
for (int i = 0; i < 4; i++) {
room->selectFrame(LayerId("r2010om1", i, "side"), 400, 1,
- strongBoxSideDotOffsets[i]);
+ strongBoxSideDotOffsets[i].get());
}
for (int i = 0; i < 12; i++) {
_strongBoxTiles[i].show();
diff --git a/engines/hadesch/rooms/monster/cyclops.cpp b/engines/hadesch/rooms/monster/cyclops.cpp
index 66529baa35..de7f856246 100644
--- a/engines/hadesch/rooms/monster/cyclops.cpp
+++ b/engines/hadesch/rooms/monster/cyclops.cpp
@@ -34,39 +34,39 @@ enum {
kCyclopsZ = 500
};
-static const Common::Point cyclopsEyePositions[21] = {
- Common::Point(247, 175),
- Common::Point(235, 187),
- Common::Point(227, 183),
- Common::Point(221, 178),
- Common::Point(220, 170),
- Common::Point(230, 168),
- Common::Point(230, 168),
- Common::Point(224, 170),
- Common::Point(0, 0),
- Common::Point(0, 0),
- Common::Point(0, 0),
- Common::Point(281, 175),
- Common::Point(282, 170),
- Common::Point(282, 170),
- Common::Point(284, 175),
- Common::Point(270, 178),
- Common::Point(257, 179),
- Common::Point(250, 176),
- Common::Point(249, 176),
- Common::Point(248, 176),
- Common::Point(246, 176)
+static const PrePoint cyclopsEyePositions[21] = {
+ {247, 175},
+ {235, 187},
+ {227, 183},
+ {221, 178},
+ {220, 170},
+ {230, 168},
+ {230, 168},
+ {224, 170},
+ {0, 0},
+ {0, 0},
+ {0, 0},
+ {281, 175},
+ {282, 170},
+ {282, 170},
+ {284, 175},
+ {270, 178},
+ {257, 179},
+ {250, 176},
+ {249, 176},
+ {248, 176},
+ {246, 176}
};
-static const Common::Point cyclopsEyePositionsBA0[8] = {
- Common::Point(246, 176),
- Common::Point(248, 174),
- Common::Point(249, 166),
- Common::Point(248, 171),
- Common::Point(0, 0),
- Common::Point(241, 183),
- Common::Point(244, 181),
- Common::Point(246, 176)
+static const PrePoint cyclopsEyePositionsBA0[8] = {
+ {246, 176},
+ {248, 174},
+ {249, 166},
+ {248, 171},
+ {0, 0},
+ {241, 183},
+ {244, 181},
+ {246, 176}
};
void Cyclops::handleClick(Common::Point p) {
@@ -95,15 +95,15 @@ void Cyclops::handleClick(Common::Point p) {
}
bool Cyclops::cyclopsIsHit(Common::Point p, int frame) {
- if (frame < 0 || frame >= ARRAYSIZE(cyclopsEyePositions) || cyclopsEyePositions[frame] == Common::Point(0, 0))
+ if (frame < 0 || frame >= ARRAYSIZE(cyclopsEyePositions) || cyclopsEyePositions[frame].get() == Common::Point(0, 0))
return false;
- return cyclopsEyePositions[frame].sqrDist(p) <= getSquareOfPrecision();
+ return cyclopsEyePositions[frame].get().sqrDist(p) <= getSquareOfPrecision();
}
bool Cyclops::cyclopsIsHitBA0(Common::Point p, int frame) {
- if (frame < 0 || frame >= ARRAYSIZE(cyclopsEyePositionsBA0) || cyclopsEyePositionsBA0[frame] == Common::Point(0, 0))
+ if (frame < 0 || frame >= ARRAYSIZE(cyclopsEyePositionsBA0) || cyclopsEyePositionsBA0[frame].get() == Common::Point(0, 0))
return false;
- return cyclopsEyePositionsBA0[frame].sqrDist(p) <= getSquareOfPrecision();
+ return cyclopsEyePositionsBA0[frame].get().sqrDist(p) <= getSquareOfPrecision();
}
unsigned Cyclops::getSquareOfPrecision() {
diff --git a/engines/hadesch/video.h b/engines/hadesch/video.h
index ea254bb93e..c13ae1809a 100644
--- a/engines/hadesch/video.h
+++ b/engines/hadesch/video.h
@@ -358,5 +358,13 @@ static const int kVideoHeight = 480;
#define kOffsetRightRoom (Common::Point(kVideoWidth, 0))
#define kZeroPoint (Common::Point(10, 50))
+struct PrePoint {
+ int x, y;
+
+ Common::Point get() const {
+ return Common::Point(x, y);
+ }
+};
+
}
#endif
More information about the Scummvm-git-logs
mailing list