Browse Source

💚 Fix remaning compiler warnings for GCC and CLang

pull/2302/head
Anders Jenbo 5 years ago
parent
commit
235b0ee06c
  1. 3
      Source/itemdat.h
  2. 2
      Source/pack.cpp
  3. 27
      Source/player.cpp
  4. 2
      Source/qol/itemlabels.cpp
  5. 2
      Source/qol/monhealthbar.cpp

3
Source/itemdat.h

@ -13,7 +13,7 @@
namespace devilution {
/** @todo add missing values and apply */
enum _item_indexes : uint16_t {
enum _item_indexes : int16_t {
IDI_GOLD,
IDI_WARRIOR,
IDI_WARRSHLD,
@ -64,6 +64,7 @@ enum _item_indexes : uint16_t {
IDI_FULLNOTE,
IDI_BROWNSUIT,
IDI_GREYSUIT,
IDI_NONE = -1,
};
enum item_drop_rate : uint8_t {

2
Source/pack.cpp

@ -126,7 +126,7 @@ void PackPlayer(PkPlayerStruct *pPack, const PlayerStruct &player, bool manashie
void UnPackItem(const PkItemStruct *is, ItemStruct *id, bool isHellfire)
{
auto idx = static_cast<_item_indexes>(SDL_SwapLE16(is->idx));
if (idx == 0xFFFF) {
if (idx == IDI_NONE) {
id->_itype = ITYPE_NONE;
return;
}

27
Source/player.cpp

@ -3671,17 +3671,22 @@ void SyncPlrAnim(int pnum)
case PM_BLOCK:
graphic = player_graphic::Block;
break;
case PM_SPELL: {
magic_type sType = STYPE_FIRE;
if (pnum == myplr)
sType = spelldata[player._pSpell].sType;
if (sType == STYPE_FIRE)
graphic = player_graphic::Fire;
else if (sType == STYPE_LIGHTNING)
graphic = player_graphic::Lightning;
else if (sType == STYPE_MAGIC)
graphic = player_graphic::Magic;
} break;
case PM_SPELL:
graphic = player_graphic::Fire;
if (pnum == myplr) {
switch (spelldata[player._pSpell].sType) {
case STYPE_FIRE:
graphic = player_graphic::Fire;
break;
case STYPE_LIGHTNING:
graphic = player_graphic::Lightning;
break;
case STYPE_MAGIC:
graphic = player_graphic::Magic;
break;
}
}
break;
case PM_GOTHIT:
graphic = player_graphic::Hit;
break;

2
Source/qol/itemlabels.cpp

@ -160,7 +160,7 @@ void DrawItemNameLabels(const Surface &out)
FillRect(out, label.pos.x, label.pos.y - Height + MarginY, label.width, Height, PAL8_BLUE + 6);
else
DrawHalfTransparentRectTo(out, label.pos.x, label.pos.y - Height + MarginY, label.width, Height);
DrawString(out, label.text.c_str(), { label.pos.x + MarginX, label.pos.y, label.width, Height }, itm.getTextColor());
DrawString(out, label.text.c_str(), { { label.pos.x + MarginX, label.pos.y }, { label.width, Height } }, itm.getTextColor());
}
labelQueue.clear();
}

2
Source/qol/monhealthbar.cpp

@ -96,7 +96,7 @@ void DrawMonsterHealthBar(const Surface &out)
}
int barLabelY = yPos + 10 + (height - 11) / 2;
DrawString(out, mon.mName, { xPos - 1, barLabelY + 1, width, height }, UIS_CENTER | UIS_BLACK);
DrawString(out, mon.mName, { { xPos - 1, barLabelY + 1 }, { width, height } }, UIS_CENTER | UIS_BLACK);
uint16_t style = UIS_SILVER;
if (mon._uniqtype != 0)
style = UIS_GOLD;

Loading…
Cancel
Save