[Scummvm-git-logs] scummvm master -> fbf2dec2322c091e71f67f0c57dce89d1985a962
Strangerke
noreply at scummvm.org
Mon May 1 21:38:35 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
fbf2dec232 DM: Fix a couple of issues pointed by PVS-Studio
Commit: fbf2dec2322c091e71f67f0c57dce89d1985a962
https://github.com/scummvm/scummvm/commit/fbf2dec2322c091e71f67f0c57dce89d1985a962
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2023-05-01T22:37:51+01:00
Commit Message:
DM: Fix a couple of issues pointed by PVS-Studio
Changed paths:
engines/dm/champion.cpp
engines/dm/dm.cpp
engines/dm/gfx.h
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index ef854e31809..e81dc5750dc 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -334,26 +334,20 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
} else {
switch (iconIndex) {
case kDMIconIndiceWeaponDeltaSideSplitter:
+ case kDMIconIndiceWeaponWand:
modifier = 1;
break;
case kDMIconIndiceWeaponTheInquisitorDragonFang:
+ case kDMIconIndiceWeaponStaff:
modifier = 2;
break;
case kDMIconIndiceWeaponVorpalBlade:
+ case kDMIconIndiceWeaponYewStaff:
modifier = 4;
break;
- case kDMIconIndiceWeaponStaff:
- modifier = 2;
- break;
- case kDMIconIndiceWeaponWand:
- modifier = 1;
- break;
case kDMIconIndiceWeaponTeowand:
modifier = 6;
break;
- case kDMIconIndiceWeaponYewStaff:
- modifier = 4;
- break;
case kDMIconIndiceWeaponStaffOfManarStaffOfIrra:
modifier = 10;
break;
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index 224ab37ce2f..79038fe7b49 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -142,7 +142,6 @@ DMEngine::DMEngine(OSystem *syst, const DMADGameDescription *desc) :
_groupMan = nullptr;
_timeline = nullptr;
_projexpl = nullptr;
- _displayMan = nullptr;
_sound = nullptr;
_engineShouldQuit = false;
@@ -752,7 +751,7 @@ void DMEngine::drawEntrance() {
/* Atari ST: { 0x000, 0x333, 0x444, 0x420, 0x654, 0x210, 0x040, 0x050, 0x432, 0x700, 0x543, 0x321, 0x222, 0x555, 0x310, 0x777 }, RGB colors are different */
static uint16 palEntrance[16] = {0x000, 0x666, 0x888, 0x840, 0xCA8, 0x0C0, 0x080, 0x0A0, 0x864, 0xF00, 0xA86, 0x642, 0x444, 0xAAA, 0x620, 0xFFF}; // @ G0020_aui_Graphic562_Palette_Entrance
- byte *microDungeonCurrentMapData[32];
+ byte **microDungeonCurrentMapData = new byte*[32];
_dungeonMan->_partyMapIndex = kDMMapIndexEntrance;
_displayMan->_drawFloorAndCeilingRequested = true;
@@ -845,7 +844,7 @@ void DMEngine::drawTittle() {
_displayMan->startEndFadeToPalette(blitPalette);
_displayMan->fillScreen(kDMColorBlack);
// uncomment this to draw 'Presents'
- //_displayMan->f132_blitToBitmap(L1384_puc_Bitmap_Title, _displayMan->_g348_bitmapScreen, G0005_s_Graphic562_Box_Title_Presents, 0, 137, k160_byteWidthScreen, k160_byteWidthScreen, kM1_ColorNoTransparency, k200_heightScreen, k200_heightScreen);
+ _displayMan->blitToBitmap(bitmapTitle, _displayMan->_bitmapScreen, boxTitlePresents, 0, 137, k160_byteWidthScreen, k160_byteWidthScreen, kDMColorNoTransparency, k200_heightScreen, k200_heightScreen);
blitPalette[15] = D09_RGB_WHITE;
_displayMan->startEndFadeToPalette(blitPalette);
byte *masterStrikesBack = titleSteps;
diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h
index c9e12fa79b8..4e734110113 100644
--- a/engines/dm/gfx.h
+++ b/engines/dm/gfx.h
@@ -378,7 +378,7 @@ public:
_rect = Common::Rect(x1, y1, x2, y2);
}
- Box() {}
+ Box() = default;
bool isPointInside(Common::Point point) {
// not using Common::Rect::contains() because we need both boundaries to be included
@@ -400,9 +400,13 @@ public:
uint16 _srcByteWidth, _srcHeight;
uint16 _srcX, _srcY;
- Frame() {}
+ Frame(){
+ _srcByteWidth = _srcHeight = 0;
+ _srcX = _srcY = 0;
+ }
+
Frame(uint16 destFromX, uint16 destToX, uint16 destFromY, uint16 destToY,
- uint16 srcWidth, uint16 srcHeight, uint16 srcX, uint16 srcY) :
+ uint16 srcWidth, uint16 srcHeight, uint16 srcX, uint16 srcY) :
_box(destFromX, destToX, destFromY, destToY),
_srcByteWidth(srcWidth), _srcHeight(srcHeight), _srcX(srcX), _srcY(srcY) {}
};
More information about the Scummvm-git-logs
mailing list