[Scummvm-git-logs] scummvm master -> 148b918b62286abf79cc365c4e87896d488f6ac6
elasota
noreply at scummvm.org
Sat Jul 23 06:26:13 UTC 2022
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
47b6b66fc8 MTROPOLIS: Uninit fields cleanup
f14ca5b871 MTROPOLIS: Uninit field cleanup
dbe54975cb MTROPOLIS: Fix bad for loop
148b918b62 MTROPOLIS: Uninit field cleanup
Commit: 47b6b66fc8fe0d4cb41866052976796ef01eae05
https://github.com/scummvm/scummvm/commit/47b6b66fc8fe0d4cb41866052976796ef01eae05
Author: elasota (ejlasota at gmail.com)
Date: 2022-07-23T02:25:53-04:00
Commit Message:
MTROPOLIS: Uninit fields cleanup
Changed paths:
engines/mtropolis/data.cpp
engines/mtropolis/data.h
diff --git a/engines/mtropolis/data.cpp b/engines/mtropolis/data.cpp
index 2bb8b241568..f45b7ed272f 100644
--- a/engines/mtropolis/data.cpp
+++ b/engines/mtropolis/data.cpp
@@ -373,6 +373,8 @@ bool Event::load(DataReader& reader) {
return reader.readU32(eventID) && reader.readU32(eventInfo);
}
+ColorRGB16::ColorRGB16() : red(0), green(0), blue(0) {
+}
bool ColorRGB16::load(DataReader& reader) {
@@ -396,6 +398,13 @@ bool IntRange::load(DataReader& reader) {
return reader.readS32(min) && reader.readS32(max);
}
+IntRange IntRange::createDefault() {
+ IntRange intRange;
+ intRange.min = 0;
+ intRange.max = 0;
+ return intRange;
+}
+
bool XPFloatVector::load(DataReader& reader) {
return reader.readPlatformFloat(angleRadians) && reader.readPlatformFloat(magnitude);
}
@@ -947,6 +956,14 @@ DataReadErrorCode GlobalObjectInfo::load(DataReader &reader) {
return kDataReadErrorNone;
}
+ProjectCatalog::StreamDesc::StreamDesc()
+ : streamType { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ segmentIndexPlusOne(0), size(0), pos(0) {
+}
+
+ProjectCatalog::SegmentDesc::SegmentDesc() : segmentID(0) {
+};
+
ProjectCatalog::ProjectCatalog() : persistFlags(0), sizeOfStreamAndSegmentDescs(0), unknown1(0), unknown2(0), unknown3(0) {
}
@@ -1229,7 +1246,7 @@ DataReadErrorCode AliasModifier::load(DataReader& reader) {
}
ChangeSceneModifier::ChangeSceneModifier()
- : executeWhen(Event::createDefault()), targetSectionGUID(0), targetSubsectionGUID(0), targetSceneGUID(0) {
+ : executeWhen(Event::createDefault()), changeSceneFlags(0), targetSectionGUID(0), targetSubsectionGUID(0), targetSceneGUID(0) {
}
DataReadErrorCode ChangeSceneModifier::load(DataReader &reader) {
@@ -1279,6 +1296,17 @@ bool PathMotionModifierV2::PointDef::load(DataReader &reader) {
return true;
}
+
+PathMotionModifierV2::PointDef::PointDef()
+ : point(Point::createDefault()), frame(0), frameFlags(0), messageFlags(0), send(Event::createDefault()), unknown11(0),
+ destination(0), unknown13{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, withSourceLength(0), withStringLength(0) {
+}
+
+PathMotionModifierV2::PathMotionModifierV2()
+ : flags(0), executeWhen(Event::createDefault()), terminateWhen(Event::createDefault()), unknown2{0, 0}, numPoints(0), unknown3{0, 0, 0, 0},
+ frameDurationTimes10Million(0), unknown5{0, 0, 0, 0}, unknown6(0) {
+}
+
DataReadErrorCode PathMotionModifierV2::load(DataReader &reader) {
if (_revision != 1001)
return kDataReadErrorUnsupportedRevision;
@@ -1305,6 +1333,12 @@ DataReadErrorCode PathMotionModifierV2::load(DataReader &reader) {
return kDataReadErrorNone;
}
+DragMotionModifier::DragMotionModifier()
+ : enableWhen(Event::createDefault()), disableWhen(Event::createDefault()), haveMacPart(false), haveWinPart(false),
+ constraintMargin(Rect::createDefault()), unknown1(0) {
+ memset(&this->platform, 0, sizeof(this->platform));
+}
+
DataReadErrorCode DragMotionModifier::load(DataReader &reader) {
if (_revision != 1000)
return kDataReadErrorUnsupportedRevision;
@@ -1338,6 +1372,10 @@ DataReadErrorCode DragMotionModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+VectorMotionModifier::VectorMotionModifier()
+ : enableWhen(Event::createDefault()), disableWhen(Event::createDefault()), unknown1(0), vecSourceLength(0), vecStringLength(0) {
+}
+
DataReadErrorCode VectorMotionModifier::load(DataReader &reader) {
if (_revision != 1001)
return kDataReadErrorUnsupportedRevision;
@@ -1354,6 +1392,11 @@ DataReadErrorCode VectorMotionModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+SceneTransitionModifier::SceneTransitionModifier()
+ : enableWhen(Event::createDefault()), disableWhen(Event::createDefault()), transitionType(0), direction(0),
+ unknown3(0), steps(0), duration(0), unknown5{0, 0} {
+}
+
DataReadErrorCode SceneTransitionModifier::load(DataReader &reader) {
if (_revision != 1001)
return kDataReadErrorUnsupportedRevision;
@@ -1369,6 +1412,11 @@ DataReadErrorCode SceneTransitionModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+ElementTransitionModifier::ElementTransitionModifier()
+ : enableWhen(Event::createDefault()), disableWhen(Event::createDefault()), revealType(0), transitionType(0),
+ unknown3(0), unknown4(0), steps(0), rate(0) {
+}
+
DataReadErrorCode ElementTransitionModifier::load(DataReader &reader) {
if (_revision != 1001)
return kDataReadErrorUnsupportedRevision;
@@ -1384,6 +1432,11 @@ DataReadErrorCode ElementTransitionModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+IfMessengerModifier::IfMessengerModifier()
+ : messageFlags(0), send(Event::createDefault()), when(Event::createDefault()), unknown6(0), destination(0),
+ unknown7{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, unknown9{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, withSourceLength(0), withStringLength(0) {
+}
+
DataReadErrorCode IfMessengerModifier::load(DataReader &reader) {
if (_revision != 1002)
return kDataReadErrorUnsupportedRevision;
@@ -1402,6 +1455,12 @@ DataReadErrorCode IfMessengerModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+TimerMessengerModifier::TimerMessengerModifier()
+ : messageAndTimerFlags(0), executeWhen(Event::createDefault()), send(Event::createDefault()), terminateWhen(Event::createDefault()),
+ unknown2(0), destination(0), unknown4{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, unknown5(0), minutes(0), seconds(0), hundredthsOfSeconds(0),
+ unknown6(0), unknown7(0), unknown8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, withSourceLength(0), withStringLength(0) {
+}
+
DataReadErrorCode TimerMessengerModifier::load(DataReader &reader) {
if (_revision != 1002)
return kDataReadErrorUnsupportedRevision;
@@ -1421,6 +1480,11 @@ DataReadErrorCode TimerMessengerModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+BoundaryDetectionMessengerModifier::BoundaryDetectionMessengerModifier()
+ : messageFlagsHigh(0), enableWhen(Event::createDefault()), disableWhen(Event::createDefault()), send(Event::createDefault()),
+ unknown2(0), destination(0), unknown3{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, withSourceLength(0), withStringLength(0) {
+}
+
DataReadErrorCode BoundaryDetectionMessengerModifier::load(DataReader &reader) {
if (_revision != 1002)
return kDataReadErrorUnsupportedRevision;
@@ -1437,6 +1501,11 @@ DataReadErrorCode BoundaryDetectionMessengerModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+CollisionDetectionMessengerModifier::CollisionDetectionMessengerModifier()
+ : messageAndModifierFlags(0), enableWhen(Event::createDefault()), disableWhen(Event::createDefault()), send(Event::createDefault()),
+ unknown2(0), destination(0), unknown3{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, withSourceLength(0), withStringLength(0) {
+}
+
DataReadErrorCode CollisionDetectionMessengerModifier::load(DataReader &reader) {
if (_revision != 1002)
return kDataReadErrorUnsupportedRevision;
@@ -1453,6 +1522,12 @@ DataReadErrorCode CollisionDetectionMessengerModifier::load(DataReader &reader)
return kDataReadErrorNone;
}
+KeyboardMessengerModifier::KeyboardMessengerModifier()
+ : messageFlagsAndKeyStates(0), unknown2(0), keyModifiers(0), keycode(0), unknown4{0, 0, 0, 0},
+ message(Event::createDefault()), unknown7(0), destination(0), unknown9{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ withSourceLength(0), withStringLength(0) {
+}
+
DataReadErrorCode KeyboardMessengerModifier::load(DataReader &reader) {
if (_revision != 1003)
return kDataReadErrorUnsupportedRevision;
@@ -1470,6 +1545,11 @@ DataReadErrorCode KeyboardMessengerModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+TextStyleModifier::TextStyleModifier()
+ : unknown1{0, 0, 0, 0}, macFontID(0), flags(0), unknown2(0), size(0), alignment(0), unknown3(0),
+ applyWhen(Event::createDefault()), removeWhen(Event::createDefault()), lengthOfFontFamilyName(0) {
+}
+
DataReadErrorCode TextStyleModifier::load(DataReader &reader) {
if (_revision != 1000)
return kDataReadErrorUnsupportedRevision;
@@ -1484,6 +1564,12 @@ DataReadErrorCode TextStyleModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+GraphicModifier::GraphicModifier()
+ : unknown1(0), applyWhen(Event::createDefault()), removeWhen(Event::createDefault()), unknown2{0, 0}, inkMode(0), shape(0),
+ haveMacPart(false), haveWinPart(false), borderSize(0), shadowSize(0), numPolygonPoints(0), unknown6{0, 0, 0, 0, 0, 0, 0, 0} {
+ memset(&this->platform, 0, sizeof(this->platform));
+}
+
DataReadErrorCode GraphicModifier::load(DataReader &reader) {
if (_revision != 1001)
return kDataReadErrorUnsupportedRevision;
@@ -1524,6 +1610,11 @@ DataReadErrorCode GraphicModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+CompoundVariableModifier::CompoundVariableModifier()
+ : modifierFlags(0), sizeIncludingTag(0), unknown1{0, 0}, guid(0), unknown4{0, 0, 0, 0, 0, 0}, unknown5(0),
+ editorLayoutPosition(Point::createDefault()), lengthOfName(0), numChildren(0), unknown7{0, 0, 0, 0} {
+}
+
DataReadErrorCode CompoundVariableModifier::load(DataReader &reader) {
if (_revision != 1)
return kDataReadErrorUnsupportedRevision;
@@ -1537,6 +1628,9 @@ DataReadErrorCode CompoundVariableModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+BooleanVariableModifier::BooleanVariableModifier() : value(0), unknown5(0) {
+}
+
DataReadErrorCode BooleanVariableModifier::load(DataReader &reader) {
if (_revision != 1000)
return kDataReadErrorUnsupportedRevision;
@@ -1547,6 +1641,9 @@ DataReadErrorCode BooleanVariableModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+IntegerVariableModifier::IntegerVariableModifier() : unknown1{0, 0, 0, 0}, value(0) {
+}
+
DataReadErrorCode IntegerVariableModifier::load(DataReader &reader) {
if (_revision != 1000)
return kDataReadErrorUnsupportedRevision;
@@ -1557,6 +1654,9 @@ DataReadErrorCode IntegerVariableModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+IntegerRangeVariableModifier::IntegerRangeVariableModifier() : unknown1{0, 0, 0, 0}, range(IntRange::createDefault()) {
+}
+
DataReadErrorCode IntegerRangeVariableModifier::load(DataReader &reader) {
if (_revision != 1000)
return kDataReadErrorUnsupportedRevision;
@@ -1567,6 +1667,9 @@ DataReadErrorCode IntegerRangeVariableModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+VectorVariableModifier::VectorVariableModifier() : unknown1{0, 0, 0, 0} {
+}
+
DataReadErrorCode VectorVariableModifier::load(DataReader &reader) {
if (_revision != 1000)
return kDataReadErrorUnsupportedRevision;
@@ -1577,6 +1680,9 @@ DataReadErrorCode VectorVariableModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+PointVariableModifier::PointVariableModifier() : unknown5{0, 0, 0, 0}, value(Point::createDefault()) {
+}
+
DataReadErrorCode PointVariableModifier::load(DataReader &reader) {
if (_revision != 1000)
return kDataReadErrorUnsupportedRevision;
@@ -1587,6 +1693,9 @@ DataReadErrorCode PointVariableModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+FloatingPointVariableModifier::FloatingPointVariableModifier() : unknown1{0, 0, 0, 0} {
+}
+
DataReadErrorCode FloatingPointVariableModifier::load(DataReader &reader) {
if (_revision != 1000)
return kDataReadErrorUnsupportedRevision;
@@ -1597,6 +1706,9 @@ DataReadErrorCode FloatingPointVariableModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+StringVariableModifier::StringVariableModifier() : lengthOfString(0), unknown1{0, 0, 0, 0} {
+}
+
DataReadErrorCode StringVariableModifier::load(DataReader &reader) {
if (_revision != 1000)
return kDataReadErrorUnsupportedRevision;
@@ -1610,6 +1722,12 @@ DataReadErrorCode StringVariableModifier::load(DataReader &reader) {
PlugInModifierData::~PlugInModifierData() {
}
+PlugInModifier::PlugInModifier()
+ : modifierFlags(0), codedSize(0), modifierName{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ guid(0), unknown2{0, 0, 0, 0, 0, 0}, plugInRevision(0), unknown4(0), editorLayoutPosition(Point::createDefault()),
+ lengthOfName(0), subObjectSize(0) {
+}
+
DataReadErrorCode PlugInModifier::load(DataReader &reader) {
if (_revision != 1001)
return kDataReadErrorUnsupportedRevision;
@@ -1644,6 +1762,9 @@ DataReadErrorCode PlugInModifier::load(DataReader &reader) {
return kDataReadErrorNone;
}
+Debris::Debris() : persistFlags(0), sizeIncludingTag(0) {
+}
+
DataReadErrorCode Debris::load(DataReader &reader) {
if (_revision != 0)
return kDataReadErrorUnsupportedRevision;
@@ -1654,6 +1775,10 @@ DataReadErrorCode Debris::load(DataReader &reader) {
return kDataReadErrorNone;
}
+ColorTableAsset::ColorTableAsset()
+ : persistFlags(0), sizeIncludingTag(0), unknown1{0, 0, 0, 0}, assetID(0), unknown2(0) {
+}
+
DataReadErrorCode ColorTableAsset::load(DataReader &reader) {
if (_revision != 0)
return kDataReadErrorUnsupportedRevision;
@@ -1715,6 +1840,12 @@ DataReadErrorCode ColorTableAsset::load(DataReader &reader) {
return kDataReadErrorNone;
}
+MovieAsset::MovieAsset()
+ : persistFlags(0), assetAndDataCombinedSize(0), unknown1{0, 0, 0, 0}, assetID(0), unknown1_1{0, 0, 0, 0}, extFileNameLength(0),
+ movieDataPos(0), moovAtomPos(0), movieDataSize(0), haveMacPart(false), haveWinPart(false) {
+ memset(&this->platform, 0, sizeof(this->platform));
+}
+
DataReadErrorCode MovieAsset::load(DataReader &reader) {
if (_revision != 0)
return kDataReadErrorUnsupportedRevision;
@@ -1750,6 +1881,14 @@ DataReadErrorCode MovieAsset::load(DataReader &reader) {
return kDataReadErrorNone;
}
+AudioAsset::AudioAsset()
+ : persistFlags(0), assetAndDataCombinedSize(0), unknown2{0, 0, 0, 0}, assetID(0),
+ unknown3{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, sampleRate1(0), bitsPerSample(0),
+ encoding1(0), channels(0), codedDuration{0, 0, 0, 0}, sampleRate2(0), cuePointDataSize(0), numCuePoints(0),
+ unknown14{0, 0, 0, 0}, filePosition(0), size(0), haveMacPart(false), haveWinPart(false), isBigEndian(false) {
+ memset(&this->platform, 0, sizeof(this->platform));
+}
+
DataReadErrorCode AudioAsset::load(DataReader &reader) {
if (_revision != 2)
return kDataReadErrorUnsupportedRevision;
@@ -1799,6 +1938,13 @@ DataReadErrorCode AudioAsset::load(DataReader &reader) {
return kDataReadErrorNone;
}
+ImageAsset::ImageAsset()
+ : persistFlags(0), unknown1(0), unknown2{0, 0, 0, 0}, assetID(0), unknown3(0), rect1(Rect::createDefault()),
+ hdpiFixed(0), vdpiFixed(0), bitsPerPixel(0), unknown4{0, 0}, unknown5{0, 0, 0, 0}, unknown6{0, 0, 0, 0, 0, 0, 0, 0},
+ rect2(Rect::createDefault()), filePosition(0), size(0), haveMacPart(false), haveWinPart(false) {
+ memset(&this->platform, 0, sizeof(this->platform));
+}
+
DataReadErrorCode ImageAsset::load(DataReader &reader) {
if (_revision != 1)
return kDataReadErrorUnsupportedRevision;
@@ -1829,6 +1975,28 @@ DataReadErrorCode ImageAsset::load(DataReader &reader) {
return kDataReadErrorNone;
}
+MToonAsset::FrameDef::FrameDef()
+ : unknown12{0, 0, 0, 0}, rect1(Rect::createDefault()), dataOffset(0), unknown13{0, 0}, compressedSize(0), unknown14(0),
+ keyframeFlag(0), platformBit(0), unknown15(0), rect2(Rect::createDefault()), hdpiFixed(0), vdpiFixed(0), bitsPerPixel(0),
+ unknown16(0), decompressedBytesPerRow(0), decompressedSize(0) {
+ memset(&this->platform, 0, sizeof(this->platform));
+}
+
+MToonAsset::FrameRangeDef::FrameRangeDef() : startFrame(0), endFrame(0), lengthOfName(0), unknown14(0) {
+}
+
+
+MToonAsset::FrameRangePart::FrameRangePart() : tag(0), sizeIncludingTag(0), numFrameRanges(0) {
+}
+
+MToonAsset::MToonAsset()
+ : marker(0), unknown1{0, 0, 0, 0, 0, 0, 0, 0}, assetID(0), haveMacPart(false), haveWinPart(false), frameDataPosition(0), sizeOfFrameData(0),
+ mtoonHeader{0, 0}, version(0), unknown2{0, 0, 0, 0}, encodingFlags(0), rect(Rect::createDefault()), numFrames(0),
+ unknown3{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, bitsPerPixel(0), codecID(0), unknown4_1{0, 0, 0, 0, 0, 0, 0, 0},
+ codecDataSize(0), unknown4_2{0, 0, 0, 0} {
+ memset(&this->platform, 0, sizeof(this->platform));
+}
+
DataReadErrorCode MToonAsset::load(DataReader &reader) {
if (_revision != 1)
return kDataReadErrorUnsupportedRevision;
@@ -1918,6 +2086,15 @@ DataReadErrorCode MToonAsset::load(DataReader &reader) {
return kDataReadErrorNone;
}
+TextAsset::TextAsset()
+ : persistFlags(0), sizeIncludingTag(0), unknown1(0), assetID(0), unknown2(0), bitmapRect(Rect::createDefault()),
+ hdpi(0), vdpi(0), unknown5(0), pitchBigEndian{0, 0}, unknown6(0), bitmapSize(0),
+ unknown7{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, textSize(0),
+ unknown8{0, 0, 0, 0, 0, 0, 0, 0}, alignment(0), isBitmap(0), haveMacPart(false), haveWinPart(false), isBottomUp(false) {
+
+ memset(&this->platform, 0, sizeof(this->platform));
+}
+
DataReadErrorCode TextAsset::load(DataReader &reader) {
if (_revision != 3)
return kDataReadErrorReadFailed;
@@ -1974,6 +2151,9 @@ DataReadErrorCode TextAsset::load(DataReader &reader) {
return kDataReadErrorNone;
}
+AssetDataChunk::AssetDataChunk() : unknown1(0), sizeIncludingTag(0), filePosition(0) {
+}
+
DataReadErrorCode AssetDataChunk::load(DataReader &reader) {
if (_revision != 0)
return kDataReadErrorUnsupportedRevision;
diff --git a/engines/mtropolis/data.h b/engines/mtropolis/data.h
index bad8a0a873e..4fa246b4095 100644
--- a/engines/mtropolis/data.h
+++ b/engines/mtropolis/data.h
@@ -245,6 +245,8 @@ struct Event {
};
struct ColorRGB16 {
+ ColorRGB16();
+
bool load(DataReader &reader);
uint16 red;
@@ -254,6 +256,7 @@ struct ColorRGB16 {
struct IntRange {
bool load(DataReader &reader);
+ static IntRange createDefault();
int32 min;
int32 max;
@@ -781,6 +784,8 @@ protected:
class ProjectCatalog : public DataObject {
public:
struct StreamDesc {
+ StreamDesc();
+
char streamType[25];
uint16 segmentIndexPlusOne;
uint32 size;
@@ -788,6 +793,8 @@ public:
};
struct SegmentDesc {
+ SegmentDesc();
+
uint32 segmentID;
Common::String label;
Common::String exportedPath;
@@ -1060,6 +1067,8 @@ protected:
struct PathMotionModifierV2 : public DataObject {
struct PointDef {
+ PointDef();
+
enum FrameFlags {
kFrameFlagPlaySequentially = 1,
};
@@ -1089,6 +1098,8 @@ struct PathMotionModifierV2 : public DataObject {
kFlagStartAtBeginning = 0x08000000,
};
+ PathMotionModifierV2();
+
TypicalModifierHeader modHeader;
uint32 flags;
@@ -1109,6 +1120,8 @@ protected:
};
struct DragMotionModifier : public DataObject {
+ DragMotionModifier();
+
TypicalModifierHeader modHeader;
Event enableWhen;
@@ -1149,6 +1162,8 @@ protected:
};
struct VectorMotionModifier : public DataObject {
+ VectorMotionModifier();
+
TypicalModifierHeader modHeader;
Event enableWhen;
@@ -1166,6 +1181,8 @@ protected:
};
struct SceneTransitionModifier : public DataObject {
+ SceneTransitionModifier();
+
TypicalModifierHeader modHeader;
Event enableWhen;
@@ -1182,6 +1199,8 @@ protected:
};
struct ElementTransitionModifier : public DataObject {
+ ElementTransitionModifier();
+
enum TransitionType {
kTransitionTypeRectangularIris = 0x03e8,
kTransitionTypeOvalIris = 0x03f2,
@@ -1210,6 +1229,8 @@ protected:
};
struct IfMessengerModifier : public DataObject {
+ IfMessengerModifier();
+
TypicalModifierHeader modHeader;
uint32 messageFlags;
@@ -1232,6 +1253,8 @@ protected:
};
struct TimerMessengerModifier : public DataObject {
+ TimerMessengerModifier();
+
TypicalModifierHeader modHeader;
enum TimerFlags {
@@ -1264,6 +1287,8 @@ protected:
};
struct BoundaryDetectionMessengerModifier : public DataObject {
+ BoundaryDetectionMessengerModifier();
+
enum Flags {
kDetectTopEdge = 0x1000,
kDetectBottomEdge = 0x0800,
@@ -1293,6 +1318,8 @@ protected:
};
struct CollisionDetectionMessengerModifier : public DataObject {
+ CollisionDetectionMessengerModifier();
+
enum ModifierFlags {
kDetectLayerInFront = 0x10000000,
kDetectLayerBehind = 0x08000000,
@@ -1360,6 +1387,8 @@ struct KeyboardMessengerModifier : public DataObject {
kDelete = 0x7f,
};
+ KeyboardMessengerModifier();
+
TypicalModifierHeader modHeader;
uint32 messageFlagsAndKeyStates;
uint16 unknown2;
@@ -1382,9 +1411,10 @@ protected:
};
struct TextStyleModifier : public DataObject {
+ TextStyleModifier();
+
TypicalModifierHeader modHeader;
- TypicalModifierHeader m_modHeader;
uint8 unknown1[4];
uint16 macFontID;
uint8 flags;
@@ -1405,6 +1435,8 @@ protected:
};
struct GraphicModifier : public DataObject {
+ GraphicModifier();
+
TypicalModifierHeader modHeader;
uint16 unknown1;
@@ -1450,6 +1482,8 @@ protected:
};
struct CompoundVariableModifier : public DataObject {
+ CompoundVariableModifier();
+
// This doesn't follow the usual modifier header layout
uint32 modifierFlags;
uint32 sizeIncludingTag;
@@ -1469,6 +1503,8 @@ protected:
};
struct BooleanVariableModifier : public DataObject {
+ BooleanVariableModifier();
+
TypicalModifierHeader modHeader;
uint8 value;
uint8 unknown5;
@@ -1478,6 +1514,8 @@ protected:
};
struct IntegerVariableModifier : public DataObject {
+ IntegerVariableModifier();
+
TypicalModifierHeader modHeader;
uint8 unknown1[4];
int32 value;
@@ -1487,6 +1525,8 @@ protected:
};
struct IntegerRangeVariableModifier : public DataObject {
+ IntegerRangeVariableModifier();
+
TypicalModifierHeader modHeader;
uint8 unknown1[4];
IntRange range;
@@ -1496,6 +1536,8 @@ protected:
};
struct VectorVariableModifier : public DataObject {
+ VectorVariableModifier();
+
TypicalModifierHeader modHeader;
uint8 unknown1[4];
XPFloatVector vector;
@@ -1505,6 +1547,8 @@ protected:
};
struct PointVariableModifier : public DataObject {
+ PointVariableModifier();
+
TypicalModifierHeader modHeader;
uint8 unknown5[4];
@@ -1515,6 +1559,8 @@ protected:
};
struct FloatingPointVariableModifier : public DataObject {
+ FloatingPointVariableModifier();
+
TypicalModifierHeader modHeader;
uint8 unknown1[4];
Common::XPFloat value;
@@ -1524,6 +1570,8 @@ protected:
};
struct StringVariableModifier : public DataObject {
+ StringVariableModifier();
+
TypicalModifierHeader modHeader;
uint32 lengthOfString;
uint8 unknown1[4];
@@ -1539,6 +1587,8 @@ struct PlugInModifierData {
};
struct PlugInModifier : public DataObject {
+ PlugInModifier();
+
uint32 modifierFlags;
uint32 codedSize; // Total size on Mac but (size + (name length * 255)) on Windows for some reason
char modifierName[17];
@@ -1560,6 +1610,8 @@ protected:
};
struct Debris : public DataObject {
+ Debris();
+
uint32 persistFlags;
uint32 sizeIncludingTag;
@@ -1568,6 +1620,8 @@ protected:
};
struct ColorTableAsset : public DataObject {
+ ColorTableAsset();
+
uint32 persistFlags;
uint32 sizeIncludingTag;
uint8 unknown1[4];
@@ -1597,6 +1651,8 @@ struct MovieAsset : public DataObject {
WinPart win;
};
+ MovieAsset();
+
uint32 persistFlags;
uint32 assetAndDataCombinedSize;
uint8 unknown1[4];
@@ -1645,6 +1701,8 @@ struct AudioAsset : public DataObject {
uint32 cuePointID;
};
+ AudioAsset();
+
uint32 persistFlags;
uint32 assetAndDataCombinedSize;
uint8 unknown2[4];
@@ -1687,6 +1745,8 @@ struct ImageAsset : public DataObject {
MacPart mac;
};
+ ImageAsset();
+
uint32 persistFlags;
uint32 unknown1;
uint8 unknown2[4];
@@ -1721,6 +1781,11 @@ struct MToonAsset : public DataObject {
uint8 unknown11[54];
};
+ union PlatformUnion {
+ MacPart mac;
+ WinPart win;
+ };
+
struct FrameDef {
struct MacPart {
uint8 unknown17[4];
@@ -1735,6 +1800,8 @@ struct MToonAsset : public DataObject {
WinPart win;
};
+ FrameDef();
+
uint8 unknown12[4];
Rect rect1;
uint32 dataOffset;
@@ -1756,6 +1823,8 @@ struct MToonAsset : public DataObject {
};
struct FrameRangeDef {
+ FrameRangeDef();
+
uint32 startFrame;
uint32 endFrame;
uint8 lengthOfName;
@@ -1770,17 +1839,25 @@ struct MToonAsset : public DataObject {
kEncodingFlag_Trimming = 0x08,
};
+ struct FrameRangePart {
+ FrameRangePart();
+
+ uint32 tag;
+ uint32 sizeIncludingTag;
+
+ uint32 numFrameRanges;
+ Common::Array<FrameRangeDef> frameRanges;
+ };
+
+ MToonAsset();
+
uint32 marker;
uint8 unknown1[8];
uint32 assetID;
bool haveMacPart;
bool haveWinPart;
-
- union PlatformUnion {
- MacPart mac;
- WinPart win;
- } platform;
+ PlatformUnion platform;
uint32 frameDataPosition;
uint32 sizeOfFrameData;
@@ -1812,14 +1889,6 @@ struct MToonAsset : public DataObject {
// byte[8] unknown (all 0?)
Common::Array<uint8> codecData;
- struct FrameRangePart {
- uint32 tag;
- uint32 sizeIncludingTag;
-
- uint32 numFrameRanges;
- Common::Array<FrameRangeDef> frameRanges;
- };
-
FrameRangePart frameRangesPart;
protected:
@@ -1851,6 +1920,8 @@ struct TextAsset : public DataObject {
WinPart win;
};
+ TextAsset();
+
uint32 persistFlags;
uint32 sizeIncludingTag;
uint32 unknown1;
@@ -1886,6 +1957,8 @@ protected:
};
struct AssetDataChunk : public DataObject {
+ AssetDataChunk();
+
uint32 unknown1;
uint32 sizeIncludingTag;
int64 filePosition;
Commit: f14ca5b87182dfe73296bdaddaf4b57bac67a7be
https://github.com/scummvm/scummvm/commit/f14ca5b87182dfe73296bdaddaf4b57bac67a7be
Author: elasota (ejlasota at gmail.com)
Date: 2022-07-23T02:25:53-04:00
Commit Message:
MTROPOLIS: Uninit field cleanup
Changed paths:
engines/mtropolis/debug.cpp
engines/mtropolis/debug.h
engines/mtropolis/elements.cpp
engines/mtropolis/elements.h
engines/mtropolis/miniscript.cpp
engines/mtropolis/miniscript.h
engines/mtropolis/modifiers.cpp
engines/mtropolis/modifiers.h
engines/mtropolis/runtime.cpp
engines/mtropolis/runtime.h
diff --git a/engines/mtropolis/debug.cpp b/engines/mtropolis/debug.cpp
index 43b94c6f6a4..6d668e2f9b5 100644
--- a/engines/mtropolis/debug.cpp
+++ b/engines/mtropolis/debug.cpp
@@ -519,6 +519,8 @@ private:
};
struct SceneTreeEntry {
+ SceneTreeEntry();
+
SceneTreeEntryUIState uiState;
size_t parentIndex;
int level;
@@ -527,6 +529,8 @@ private:
};
struct RenderEntry {
+ RenderEntry();
+
size_t treeIndex;
size_t parentRenderIndex;
};
@@ -548,6 +552,13 @@ private:
DebugSceneTreeWindow::SceneTreeEntryUIState::SceneTreeEntryUIState() : expanded(false), selected(false) {
}
+
+DebugSceneTreeWindow::SceneTreeEntry::SceneTreeEntry() : parentIndex(0), level(0), hasChildren(false) {
+}
+
+DebugSceneTreeWindow::RenderEntry::RenderEntry() : treeIndex(0), parentRenderIndex(0) {
+}
+
DebugSceneTreeWindow::DebugSceneTreeWindow(Debugger *debugger, const WindowParameters &windowParams)
: DebugToolWindowBase(kDebuggerToolSceneTree, "Project", debugger, windowParams), _forceRender(true), _treeYOffset(20) {
}
@@ -1262,6 +1273,9 @@ const Common::String &DebugPrimaryTaskList::getName() const {
return _name;
}
+Debugger::ToastNotification::ToastNotification() : dismissTime(0) {
+}
+
Debugger::Debugger(Runtime *runtime) : _paused(false), _runtime(runtime) {
refreshSceneStatus();
diff --git a/engines/mtropolis/debug.h b/engines/mtropolis/debug.h
index 0c6942f3d83..8687e23cf31 100644
--- a/engines/mtropolis/debug.h
+++ b/engines/mtropolis/debug.h
@@ -178,6 +178,8 @@ private:
static void scanDebuggableStatus(IDebuggable *debuggable, Common::HashMap<Common::String, SupportStatus> &unfinished);
struct ToastNotification {
+ ToastNotification();
+
Common::SharedPtr<Window> window;
uint64 dismissTime;
};
diff --git a/engines/mtropolis/elements.cpp b/engines/mtropolis/elements.cpp
index 6814df980ce..8f82d82027d 100644
--- a/engines/mtropolis/elements.cpp
+++ b/engines/mtropolis/elements.cpp
@@ -423,9 +423,10 @@ MovieResizeFilter::~MovieResizeFilter() {
}
MovieElement::MovieElement()
- : _cacheBitmap(false), _reversed(false), _haveFiredAtFirstCel(false), _haveFiredAtLastCel(false)
- , _alternate(false), _playEveryFrame(false), _assetID(0), _runtime(nullptr), _displayFrame(nullptr)
- , _shouldPlayIfNotPaused(true), _needsReset(true), _currentPlayState(kMediaStateStopped), _playRange(IntRange::create(0, 0)) {
+ : _cacheBitmap(false), _alternate(false), _playEveryFrame(false), _reversed(false), _haveFiredAtLastCel(false),
+ _haveFiredAtFirstCel(false), _shouldPlayIfNotPaused(true), _needsReset(true), _currentPlayState(kMediaStateStopped),
+ _assetID(0), _maxTimestamp(0), _timeScale(0), _currentTimestamp(0), _volume(100), _playRange(IntRange::create(0, 0)),
+ _displayFrame(nullptr), _runtime(nullptr) {
}
MovieElement::~MovieElement() {
@@ -965,7 +966,7 @@ VThreadState MovieElement::seekToTimeTask(const SeekToTimeTaskData &taskData) {
return kVThreadReturn;
}
-ImageElement::ImageElement() : _cacheBitmap(false), _runtime(nullptr) {
+ImageElement::ImageElement() : _cacheBitmap(false), _assetID(0), _runtime(nullptr) {
}
ImageElement::~ImageElement() {
@@ -1064,7 +1065,9 @@ MiniscriptInstructionOutcome ImageElement::scriptSetFlushPriority(MiniscriptThre
return kMiniscriptInstructionOutcomeContinue;
}
-MToonElement::MToonElement() : _cel(1), _renderedFrame(0), _flushPriority(0), _celStartTimeMSec(0), _isPlaying(false), _playRange(IntRange::create(1, 1)) {
+MToonElement::MToonElement()
+ : _cacheBitmap(false), _maintainRate(false), _assetID(0), _rateTimes100000(0), _flushPriority(0), _celStartTimeMSec(0),
+ _isPlaying(false), _runtime(nullptr), _renderedFrame(0), _playRange(IntRange::create(1, 1)), _cel(1) {
}
MToonElement::~MToonElement() {
@@ -1550,7 +1553,9 @@ MiniscriptInstructionOutcome MToonElement::scriptSetRate(MiniscriptThread *threa
}
-TextLabelElement::TextLabelElement() : _needsRender(false), _isBitmap(false), _macFontID(0), _size(12), _alignment(kTextAlignmentLeft) {
+TextLabelElement::TextLabelElement()
+ : _cacheBitmap(false), _needsRender(false), _isBitmap(false), _assetID(0),
+ _macFontID(0), _size(12), _alignment(kTextAlignmentLeft), _runtime(nullptr) {
}
TextLabelElement::~TextLabelElement() {
@@ -1588,7 +1593,7 @@ bool TextLabelElement::readAttributeIndexed(MiniscriptThread *thread, DynamicVal
return false;
}
- size_t lineIndex = asInteger - 1;
+ size_t lineIndex = static_cast<size_t>(asInteger) - 1;
uint32 startPos;
uint32 endPos;
if (findLineRange(lineIndex, startPos, endPos))
@@ -1621,7 +1626,7 @@ MiniscriptInstructionOutcome TextLabelElement::writeRefAttributeIndexed(Miniscri
writeProxy.pod.ifc = DynamicValueWriteInterfaceGlue<TextLabelLineWriteInterface>::getInstance();
writeProxy.pod.objectRef = this;
- writeProxy.pod.ptrOrOffset = asInteger - 1;
+ writeProxy.pod.ptrOrOffset = static_cast<uintptr>(asInteger) - 1;
return kMiniscriptInstructionOutcomeContinue;
}
@@ -1940,7 +1945,9 @@ MiniscriptInstructionOutcome TextLabelElement::TextLabelLineWriteInterface::refA
return kMiniscriptInstructionOutcomeFailed;
}
-SoundElement::SoundElement() : _finishTime(0), _shouldPlayIfNotPaused(true), _needsReset(true) {
+SoundElement::SoundElement()
+ : _leftVolume(0), _rightVolume(0), _balance(0), _assetID(0), _finishTime(0),
+ _shouldPlayIfNotPaused(true), _needsReset(true), _runtime(nullptr) {
}
SoundElement::~SoundElement() {
diff --git a/engines/mtropolis/elements.h b/engines/mtropolis/elements.h
index 60609b32995..d431d9cea8f 100644
--- a/engines/mtropolis/elements.h
+++ b/engines/mtropolis/elements.h
@@ -124,10 +124,14 @@ private:
MiniscriptInstructionOutcome scriptSetRangeTyped(MiniscriptThread *thread, const IntRange &range);
struct StartPlayingTaskData {
+ StartPlayingTaskData() : runtime(nullptr) {}
+
Runtime *runtime;
};
struct SeekToTimeTaskData {
+ SeekToTimeTaskData() : runtime(nullptr), timestamp(0) {}
+
Runtime *runtime;
uint32 timestamp;
};
diff --git a/engines/mtropolis/miniscript.cpp b/engines/mtropolis/miniscript.cpp
index 482bddada5a..a0a5dcb8761 100644
--- a/engines/mtropolis/miniscript.cpp
+++ b/engines/mtropolis/miniscript.cpp
@@ -46,6 +46,9 @@ bool miniscriptEvaluateTruth(const DynamicValue &value) {
MiniscriptInstruction::~MiniscriptInstruction() {
}
+MiniscriptReferences::LocalRef::LocalRef() : guid(0) {
+}
+
MiniscriptReferences::MiniscriptReferences(const Common::Array<LocalRef> &localRefs) : _localRefs(localRefs) {
}
@@ -284,6 +287,10 @@ SIMiniscriptInstructionFactory MiniscriptInstructionFactory<T>::_instance = {
MiniscriptInstructionFactory<T>::getSizeAndAlignment
};
+MiniscriptParser::InstructionData::InstructionData()
+ : opcode(0), flags(0), pdPosition(0), instrFactory(nullptr) {
+}
+
bool MiniscriptParser::parse(const Data::MiniscriptProgram &program, Common::SharedPtr<MiniscriptProgram> &outProgram, Common::SharedPtr<MiniscriptReferences> &outReferences) {
Common::Array<MiniscriptReferences::LocalRef> localRefs;
Common::Array<MiniscriptProgram::Attribute> attributes;
@@ -311,14 +318,6 @@ bool MiniscriptParser::parse(const Data::MiniscriptProgram &program, Common::Sha
Common::MemoryReadStreamEndian stream(&program.bytecode[0], program.bytecode.size(), program.isBigEndian);
Data::DataReader reader(0, stream, program.projectFormat);
- struct InstructionData {
- uint16 opcode;
- uint16 flags;
- size_t pdPosition;
- SIMiniscriptInstructionFactory *instrFactory;
- Common::Array<uint8> contents;
- };
-
Common::Array<InstructionData> rawInstructions;
rawInstructions.resize(program.numOfInstructions);
@@ -1566,6 +1565,8 @@ MiniscriptInstructionOutcome GetChild::readRValueAttribIndexed(MiniscriptThread
PushValue::PushValue(DataType dataType, const void *value, bool isLValue)
: _dataType(dataType), _isLValue(isLValue) {
+ memset(&this->_value, 0, sizeof(this->_value));
+
switch (dataType) {
case DataType::kDataTypeBool:
_value.b = *static_cast<const bool *>(value);
@@ -1580,7 +1581,10 @@ PushValue::PushValue(DataType dataType, const void *value, bool isLValue)
case DataType::kDataTypeLabel:
_value.lbl = *static_cast<const Label *>(value);
break;
+ case DataType::kDataTypeNull:
+ break;
default:
+ warning("PushValue instruction has an unknown type of value, this will probably malfunction!");
break;
}
}
diff --git a/engines/mtropolis/miniscript.h b/engines/mtropolis/miniscript.h
index 8e05bf1749c..d866147bcd7 100644
--- a/engines/mtropolis/miniscript.h
+++ b/engines/mtropolis/miniscript.h
@@ -43,6 +43,8 @@ public:
class MiniscriptReferences {
public:
struct LocalRef {
+ LocalRef();
+
uint32 guid;
Common::String name;
Common::WeakPtr<RuntimeObject> resolution;
@@ -84,6 +86,17 @@ public:
static bool parse(const Data::MiniscriptProgram &programData, Common::SharedPtr<MiniscriptProgram> &outProgram, Common::SharedPtr<MiniscriptReferences> &outReferences);
static SIMiniscriptInstructionFactory *resolveOpcode(uint16 opcode);
+
+private:
+ struct InstructionData {
+ InstructionData();
+
+ uint16 opcode;
+ uint16 flags;
+ size_t pdPosition;
+ SIMiniscriptInstructionFactory *instrFactory;
+ Common::Array<uint8> contents;
+ };
};
namespace MiniscriptInstructions {
diff --git a/engines/mtropolis/modifiers.cpp b/engines/mtropolis/modifiers.cpp
index 8e623f50da8..1dbf9030f20 100644
--- a/engines/mtropolis/modifiers.cpp
+++ b/engines/mtropolis/modifiers.cpp
@@ -607,6 +607,14 @@ const char *SoundEffectModifier::getDefaultName() const {
return "Sound Effect Modifier";
}
+PathMotionModifierV2::PointDef::PointDef() : frame(0), useFrame(false) {
+}
+
+PathMotionModifierV2::PathMotionModifierV2()
+ : _executeWhen(Event::create()), _terminateWhen(Event::create()), _reverse(false), _loop(false), _alternate(false),
+ _startAtBeginning(false), _frameDurationTimes10Million(0) {
+}
+
bool PathMotionModifierV2::load(ModifierLoaderContext &context, const Data::PathMotionModifierV2 &data) {
if (!loadTypicalHeader(data.modHeader))
return false;
@@ -1386,9 +1394,9 @@ const char *BoundaryDetectionMessengerModifier::getDefaultName() const {
}
CollisionDetectionMessengerModifier::CollisionDetectionMessengerModifier()
- : _runtime(nullptr), _isActive(false),
- _enableWhen(Event::create()), _disableWhen(Event::create()), _detectionMode(kDetectionModeFirstContact),
- _detectInFront(true), _detectBehind(true), _ignoreParent(true), _sendToCollidingElement(false) {
+ : _enableWhen(Event::create()), _disableWhen(Event::create()), _detectionMode(kDetectionModeFirstContact),
+ _detectInFront(true), _detectBehind(true), _ignoreParent(true), _sendToCollidingElement(false),
+ _sendToOnlyFirstCollidingElement(false), _runtime(nullptr), _isActive(false) {
}
CollisionDetectionMessengerModifier::~CollisionDetectionMessengerModifier() {
@@ -1958,6 +1966,9 @@ Modifier *CompoundVariableModifier::findChildByName(const Common::String &name)
return nullptr;
}
+CompoundVariableModifier::SaveLoad::ChildSaveLoad::ChildSaveLoad() : modifier(nullptr) {
+}
+
CompoundVariableModifier::SaveLoad::SaveLoad(CompoundVariableModifier *modifier) : _modifier(modifier) {
for (const Common::SharedPtr<Modifier> &child : modifier->_children) {
Common::SharedPtr<ModifierSaveLoad> childSL = child->getSaveLoad();
diff --git a/engines/mtropolis/modifiers.h b/engines/mtropolis/modifiers.h
index 9ba409b8754..f0fbb0d2091 100644
--- a/engines/mtropolis/modifiers.h
+++ b/engines/mtropolis/modifiers.h
@@ -262,6 +262,8 @@ private:
class PathMotionModifierV2 : public Modifier {
public:
+ PathMotionModifierV2();
+
bool load(ModifierLoaderContext &context, const Data::PathMotionModifierV2 &data);
bool respondsToEvent(const Event &evt) const override;
@@ -274,6 +276,8 @@ public:
private:
struct PointDef {
+ PointDef();
+
Common::Point point;
uint32 frame;
bool useFrame;
@@ -735,6 +739,8 @@ private:
private:
struct ChildSaveLoad {
+ ChildSaveLoad();
+
Modifier *modifier;
Common::SharedPtr<ModifierSaveLoad> saveLoad;
};
diff --git a/engines/mtropolis/runtime.cpp b/engines/mtropolis/runtime.cpp
index 49e94c52ec2..2ee6d41a799 100644
--- a/engines/mtropolis/runtime.cpp
+++ b/engines/mtropolis/runtime.cpp
@@ -419,6 +419,17 @@ ColorRGB8 ColorRGB8::create(uint8 r, uint8 g, uint8 b) {
MessageFlags::MessageFlags() : relay(true), cascade(true), immediate(true) {
}
+DynamicValueWriteProxyPOD DynamicValueWriteProxyPOD::createDefault() {
+ DynamicValueWriteProxyPOD proxy;
+ proxy.ifc = nullptr;
+ proxy.objectRef = nullptr;
+ proxy.ptrOrOffset = 0;
+ return proxy;
+}
+
+DynamicValueWriteProxy::DynamicValueWriteProxy() : pod(DynamicValueWriteProxyPOD::createDefault()) {
+}
+
Common::Point Point16POD::toScummVMPoint() const {
return Common::Point(x, y);
}
@@ -3744,6 +3755,9 @@ Runtime::ConsumeCommandTaskData::ConsumeCommandTaskData() : structural(nullptr)
Runtime::UpdateMouseStateTaskData::UpdateMouseStateTaskData() : mouseDown(false) {
}
+DragMotionProperties::DragMotionProperties() : constraintDirection(kConstraintDirectionNone), constrainToParent(false) {
+}
+
SceneTransitionHooks::~SceneTransitionHooks() {
}
diff --git a/engines/mtropolis/runtime.h b/engines/mtropolis/runtime.h
index 4703efc4735..7e3fa951637 100644
--- a/engines/mtropolis/runtime.h
+++ b/engines/mtropolis/runtime.h
@@ -522,9 +522,13 @@ struct DynamicValueWriteProxyPOD {
uintptr ptrOrOffset;
void *objectRef;
const DynamicValueWriteInterface *ifc;
+
+ static DynamicValueWriteProxyPOD createDefault();
};
struct DynamicValueWriteProxy {
+ DynamicValueWriteProxy();
+
DynamicValueWriteProxyPOD pod;
Common::SharedPtr<DynamicList> containerList;
};
@@ -1451,6 +1455,8 @@ private:
};
struct DragMotionProperties {
+ DragMotionProperties();
+
ConstraintDirection constraintDirection;
Common::Rect constraintMargin;
bool constrainToParent;
@@ -2593,6 +2599,8 @@ protected:
Common::Point getCenterPosition() const;
struct ChangeFlagTaskData {
+ ChangeFlagTaskData() : desiredFlag(false), runtime(nullptr) {}
+
bool desiredFlag;
Runtime *runtime;
};
Commit: dbe54975cb87c16397ea3121e7e4978d04e6e77b
https://github.com/scummvm/scummvm/commit/dbe54975cb87c16397ea3121e7e4978d04e6e77b
Author: elasota (ejlasota at gmail.com)
Date: 2022-07-23T02:25:53-04:00
Commit Message:
MTROPOLIS: Fix bad for loop
Changed paths:
engines/mtropolis/mtropolis.cpp
diff --git a/engines/mtropolis/mtropolis.cpp b/engines/mtropolis/mtropolis.cpp
index b979208316d..8f3bdeec26e 100644
--- a/engines/mtropolis/mtropolis.cpp
+++ b/engines/mtropolis/mtropolis.cpp
@@ -208,7 +208,7 @@ Common::Error MTropolisEngine::run() {
// If that fails, then try to find the best one available
if (selectedMode == kColorDepthModeInvalid) {
- for (int i = preferredColorDepthMode - 1; i >= 0; i++) {
+ for (int i = preferredColorDepthMode - 1; i >= 0; i--) {
if (haveExactMode[i] || haveCloseMode[i]) {
selectedMode = static_cast<ColorDepthMode>(i);
break;
Commit: 148b918b62286abf79cc365c4e87896d488f6ac6
https://github.com/scummvm/scummvm/commit/148b918b62286abf79cc365c4e87896d488f6ac6
Author: elasota (ejlasota at gmail.com)
Date: 2022-07-23T02:25:53-04:00
Commit Message:
MTROPOLIS: Uninit field cleanup
Changed paths:
engines/mtropolis/elements.h
engines/mtropolis/modifiers.cpp
engines/mtropolis/modifiers.h
engines/mtropolis/runtime.cpp
engines/mtropolis/runtime.h
diff --git a/engines/mtropolis/elements.h b/engines/mtropolis/elements.h
index d431d9cea8f..787f09314ae 100644
--- a/engines/mtropolis/elements.h
+++ b/engines/mtropolis/elements.h
@@ -230,14 +230,20 @@ public:
private:
struct StartPlayingTaskData {
+ StartPlayingTaskData() : runtime(nullptr) {}
+
Runtime *runtime;
};
struct StopPlayingTaskData {
+ StopPlayingTaskData() : runtime(nullptr) {}
+
Runtime *runtime;
};
struct ChangeFrameTaskData {
+ ChangeFrameTaskData() : runtime(nullptr), frame(0) {}
+
Runtime *runtime;
uint32 frame;
};
@@ -377,6 +383,8 @@ private:
MiniscriptInstructionOutcome scriptSetBalance(MiniscriptThread *thread, const DynamicValue &value);
struct StartPlayingTaskData {
+ StartPlayingTaskData() : runtime(nullptr) {}
+
Runtime *runtime;
};
diff --git a/engines/mtropolis/modifiers.cpp b/engines/mtropolis/modifiers.cpp
index 1dbf9030f20..2f540eccd1f 100644
--- a/engines/mtropolis/modifiers.cpp
+++ b/engines/mtropolis/modifiers.cpp
@@ -1523,7 +1523,9 @@ void CollisionDetectionMessengerModifier::triggerCollision(Runtime *runtime, Str
KeyboardMessengerModifier::~KeyboardMessengerModifier() {
}
-KeyboardMessengerModifier::KeyboardMessengerModifier() : _isEnabled(false) {
+KeyboardMessengerModifier::KeyboardMessengerModifier()
+ : _send(Event::create()), _onDown(false), _onUp(false), _onRepeat(false), _keyModControl(false), _keyModCommand(false), _keyModOption(false),
+ _isEnabled(false), _keyCodeType(kAny), _macRomanChar(0) {
}
bool KeyboardMessengerModifier::isKeyboardMessenger() const {
diff --git a/engines/mtropolis/modifiers.h b/engines/mtropolis/modifiers.h
index f0fbb0d2091..168cc14ce2a 100644
--- a/engines/mtropolis/modifiers.h
+++ b/engines/mtropolis/modifiers.h
@@ -60,12 +60,16 @@ public:
private:
struct SwitchTaskData {
+ SwitchTaskData() : targetState(false), eventID(EventIDs::kNothing), runtime(nullptr) {}
+
bool targetState;
EventIDs::EventID eventID;
Runtime *runtime;
};
struct PropagateTaskData {
+ PropagateTaskData() : index(0), eventID(EventIDs::kNothing), runtime(nullptr) {}
+
size_t index;
EventIDs::EventID eventID;
Runtime *runtime;
@@ -449,6 +453,8 @@ public:
private:
struct EvaluateAndSendTaskData {
+ EvaluateAndSendTaskData() : runtime(nullptr) {}
+
Common::SharedPtr<MiniscriptThread> thread;
Runtime *runtime;
DynamicValue incomingData;
@@ -625,8 +631,6 @@ private:
void visitInternalReferences(IStructuralReferenceVisitor *visitor) override;
void linkInternalReferences(ObjectLinkingScope *scope) override;
- Event _send;
-
enum KeyCodeType {
kAny = 0x00,
kHome = 0x01,
@@ -647,6 +651,8 @@ private:
kMacRomanChar = 0xff,
};
+ Event _send;
+
bool _onDown : 1;
bool _onUp : 1;
bool _onRepeat : 1;
diff --git a/engines/mtropolis/runtime.cpp b/engines/mtropolis/runtime.cpp
index 2ee6d41a799..1d094953ed1 100644
--- a/engines/mtropolis/runtime.cpp
+++ b/engines/mtropolis/runtime.cpp
@@ -1148,6 +1148,7 @@ MiniscriptInstructionOutcome DynamicList::WriteProxyInterface::refAttribIndexed(
}
DynamicValue::DynamicValue() : _type(DynamicValueTypes::kNull) {
+ memset(&this->_value, 0, sizeof(this->_value));
}
DynamicValue::DynamicValue(const DynamicValue &other) : _type(DynamicValueTypes::kNull) {
@@ -1781,7 +1782,7 @@ void DynamicValueWriteObjectHelper::create(RuntimeObject *obj, DynamicValueWrite
proxy.pod.ptrOrOffset = 0;
}
-MessengerSendSpec::MessengerSendSpec() : destination(0), _linkType(kLinkTypeNotYetLinked) {
+MessengerSendSpec::MessengerSendSpec() : send(Event::create()), destination(0), _linkType(kLinkTypeNotYetLinked) {
}
bool MessengerSendSpec::load(const Data::Event &dataEvent, uint32 dataMessageFlags, const Data::InternalTypeTaggedValue &dataLocator, const Common::String &dataWithSource, const Common::String &dataWithString, uint32 dataDestination) {
@@ -2154,6 +2155,11 @@ Common::String AngleMagVector::toString() const {
return Common::String::format("(%g deg %g mag)", angleDegrees, magnitude);
}
+
+
+SegmentDescription::SegmentDescription() : volumeID(0), stream(nullptr) {
+}
+
void IPlugInModifierRegistrar::registerPlugInModifier(const char *name, const IPlugInModifierFactoryAndDataFactory *loaderFactory) {
return this->registerPlugInModifier(name, loaderFactory, loaderFactory);
}
@@ -3196,6 +3202,9 @@ MiniscriptInstructionOutcome Structural::scriptSetDebug(MiniscriptThread *thread
return kMiniscriptInstructionOutcomeContinue;
}
+VolumeState::VolumeState() : volumeID(0), isMounted(false) {
+}
+
ObjectLinkingScope::ObjectLinkingScope() : _parent(nullptr) {
}
@@ -3745,6 +3754,8 @@ Runtime::SceneStackEntry::SceneStackEntry() {
Runtime::Teardown::Teardown() : onlyRemoveChildren(false) {
}
+Runtime::SceneReturnListEntry::SceneReturnListEntry() : isAddToDestinationSceneTransition(false) {
+}
Runtime::ConsumeMessageTaskData::ConsumeMessageTaskData() : consumer(nullptr) {
}
@@ -3755,13 +3766,24 @@ Runtime::ConsumeCommandTaskData::ConsumeCommandTaskData() : structural(nullptr)
Runtime::UpdateMouseStateTaskData::UpdateMouseStateTaskData() : mouseDown(false) {
}
+Runtime::UpdateMousePositionTaskData::UpdateMousePositionTaskData() : x(0), y(0) {
+}
+
+Runtime::CollisionCheckState::CollisionCheckState() : collider(nullptr) {
+}
+
+Runtime::BoundaryCheckState::BoundaryCheckState() : detector(nullptr), currentContacts(0), positionResolved(false) {
+}
+
+Runtime::ColliderInfo::ColliderInfo() : sceneStackDepth(0), layer(0), element(nullptr) {
+}
+
DragMotionProperties::DragMotionProperties() : constraintDirection(kConstraintDirectionNone), constrainToParent(false) {
}
SceneTransitionHooks::~SceneTransitionHooks() {
}
-
void SceneTransitionHooks::onSceneTransitionSetup(Runtime *runtime, const Common::WeakPtr<Structural> &oldScene, const Common::WeakPtr<Structural> &newScene) {
}
@@ -3770,12 +3792,13 @@ void SceneTransitionHooks::onSceneTransitionEnded(Runtime *runtime, const Common
Runtime::Runtime(OSystem *system, Audio::Mixer *mixer, ISaveUIProvider *saveProvider, ILoadUIProvider *loadProvider)
: _system(system), _mixer(mixer), _saveProvider(saveProvider), _loadProvider(loadProvider),
- _nextRuntimeGUID(1), _realDisplayMode(kColorDepthModeInvalid), _fakeDisplayMode(kColorDepthModeInvalid),
- _displayWidth(1024), _displayHeight(768), _realTimeBase(0), _playTimeBase(0), _sceneTransitionState(kSceneTransitionStateNotTransitioning),
- _lastFrameCursor(nullptr), _defaultCursor(new DefaultCursorGraphic()), _platform(kProjectPlatformUnknown),
- _cachedMousePosition(Common::Point(0, 0)), _realMousePosition(Common::Point(0, 0)), _trackedMouseOutside(false),
- _forceCursorRefreshOnce(true), _autoResetCursor(false), _haveModifierOverrideCursor(false), _sceneGraphChanged(false), _isQuitting(false),
- _collisionCheckTime(0), _defaultVolumeState(true), _activeSceneTransitionEffect(nullptr), _sceneTransitionStartTime(0), _sceneTransitionEndTime(0) {
+ _nextRuntimeGUID(1), _realDisplayMode(kColorDepthModeInvalid), _fakeDisplayMode(kColorDepthModeInvalid),
+ _displayWidth(1024), _displayHeight(768), _realTime(0), _realTimeBase(0), _playTime(0), _playTimeBase(0), _sceneTransitionState(kSceneTransitionStateNotTransitioning),
+ _lastFrameCursor(nullptr), _defaultCursor(new DefaultCursorGraphic()), _platform(kProjectPlatformUnknown),
+ _cachedMousePosition(Common::Point(0, 0)), _realMousePosition(Common::Point(0, 0)), _trackedMouseOutside(false),
+ _forceCursorRefreshOnce(true), _autoResetCursor(false), _haveModifierOverrideCursor(false), _sceneGraphChanged(false), _isQuitting(false),
+ _collisionCheckTime(0), _defaultVolumeState(true), _activeSceneTransitionEffect(nullptr), _sceneTransitionStartTime(0), _sceneTransitionEndTime(0),
+ _modifierOverrideCursorID(0) {
_random.reset(new Common::RandomSource("mtropolis"));
_vthread.reset(new VThread());
@@ -6032,6 +6055,7 @@ const Common::Array<Common::SharedPtr<Modifier> > &IModifierContainer::getModifi
}
ChildLoaderContext::ChildLoaderContext() : remainingCount(0), type(kTypeUnknown) {
+ memset(&this->containerUnion, 0, sizeof(this->containerUnion));
}
ProjectPlugInRegistry::ProjectPlugInRegistry() {
@@ -6173,6 +6197,12 @@ Project::LabelTree::LabelTree() : firstChildIndex(0), numChildren(0), id(0) {
Project::Segment::Segment() : weakStream(nullptr) {
}
+Project::StreamDesc::StreamDesc() : streamType(kStreamTypeUnknown), segmentIndex(0), size(0), pos(0) {
+}
+
+Project::AssetDesc::AssetDesc() : typeCode(0), id(0) {
+}
+
Project::Project(Runtime *runtime)
: _runtime(runtime), _projectFormat(Data::kProjectFormatUnknown), _isBigEndian(false),
_haveGlobalObjectInfo(false), _haveProjectStructuralDef(false), _playMediaSignaller(new PlayMediaSignaller()),
@@ -7213,8 +7243,7 @@ VisualElementRenderProperties &VisualElementRenderProperties::operator=(const Vi
*/
VisualElement::VisualElement()
- : _rect(0, 0, 0, 0), _cachedAbsoluteOrigin(Common::Point(0, 0))
- , _contentsDirty(true) {
+ : _rect(0, 0, 0, 0), _cachedAbsoluteOrigin(Common::Point(0, 0)), _contentsDirty(true), _directToScreen(false), _visible(true), _layer(0) {
}
bool VisualElement::isVisual() const {
diff --git a/engines/mtropolis/runtime.h b/engines/mtropolis/runtime.h
index 7e3fa951637..abe8445f30d 100644
--- a/engines/mtropolis/runtime.h
+++ b/engines/mtropolis/runtime.h
@@ -1045,6 +1045,7 @@ struct DynamicValueWriteObjectHelper {
struct MessengerSendSpec {
MessengerSendSpec();
+
bool load(const Data::Event &dataEvent, uint32 dataMessageFlags, const Data::InternalTypeTaggedValue &dataLocator, const Common::String &dataWithSource, const Common::String &dataWithString, uint32 dataDestination);
bool load(const Data::PlugInTypeTaggedValue &dataEvent, const MessageFlags &dataMessageFlags, const Data::PlugInTypeTaggedValue &dataWith, uint32 dataDestination);
@@ -1057,11 +1058,6 @@ struct MessengerSendSpec {
void sendFromMessenger(Runtime *runtime, Modifier *sender, const DynamicValue &incomingData, RuntimeObject *customDestination) const;
void sendFromMessengerWithCustomData(Runtime *runtime, Modifier *sender, const DynamicValue &data, RuntimeObject *customDestination) const;
- Event send;
- MessageFlags messageFlags;
- DynamicValue with;
- uint32 destination; // May be a MessageDestination or GUID
-
enum LinkType {
kLinkTypeNotYetLinked,
kLinkTypeStructural,
@@ -1070,6 +1066,11 @@ struct MessengerSendSpec {
kLinkTypeUnresolved,
};
+ Event send;
+ MessageFlags messageFlags;
+ DynamicValue with;
+ uint32 destination; // May be a MessageDestination or GUID
+
LinkType _linkType;
Common::WeakPtr<Structural> _resolvedStructuralDest;
Common::WeakPtr<Modifier> _resolvedModifierDest;
@@ -1106,6 +1107,8 @@ enum MessageDestination {
};
struct SegmentDescription {
+ SegmentDescription();
+
int volumeID;
Common::String filePath;
Common::SeekableReadStream *stream;
@@ -1217,6 +1220,8 @@ private:
};
struct VolumeState {
+ VolumeState();
+
Common::String name;
int volumeID;
bool isMounted;
@@ -1626,6 +1631,8 @@ private:
};
struct SceneReturnListEntry {
+ SceneReturnListEntry();
+
Common::SharedPtr<Structural> scene;
bool isAddToDestinationSceneTransition;
};
@@ -1659,19 +1666,22 @@ private:
};
struct UpdateMousePositionTaskData {
- UpdateMousePositionTaskData() : x(0), y(0) {
- }
+ UpdateMousePositionTaskData();
int32 x;
int32 y;
};
struct CollisionCheckState {
+ CollisionCheckState();
+
Common::Array<Common::WeakPtr<VisualElement> > activeElements;
ICollider *collider;
};
struct BoundaryCheckState {
+ BoundaryCheckState();
+
IBoundaryDetector *detector;
uint currentContacts;
Common::Point position;
@@ -1679,6 +1689,8 @@ private:
};
struct ColliderInfo {
+ ColliderInfo();
+
size_t sceneStackDepth;
uint16 layer;
VisualElement *element;
@@ -2282,6 +2294,8 @@ private:
};
struct StreamDesc {
+ StreamDesc();
+
StreamType streamType;
uint16 segmentIndex;
uint32 size;
@@ -2289,6 +2303,8 @@ private:
};
struct AssetDesc {
+ AssetDesc();
+
uint32 typeCode;
size_t id;
Common::String name;
@@ -2555,6 +2571,8 @@ public:
void handleDragMotion(Runtime *runtime, const Common::Point &initialOrigin, const Common::Point &targetOrigin);
struct OffsetTranslateTaskData {
+ OffsetTranslateTaskData() : dx(0), dy(0) {}
+
int32 dx;
int32 dy;
};
More information about the Scummvm-git-logs
mailing list