diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
commit | 5afe88df2538274859a162ffd63ed52118e80c19 (patch) | |
tree | b610dfd58dc748fd63f49565b2a43eea2316714f /src/gui/equipmentwindow.cpp | |
parent | 73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff) | |
download | mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2 mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz mana-5afe88df2538274859a162ffd63ed52118e80c19.zip |
Apply C++11 fixits
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
Diffstat (limited to 'src/gui/equipmentwindow.cpp')
-rw-r--r-- | src/gui/equipmentwindow.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index 85a4c766..d646b78c 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -52,7 +52,7 @@ static const int BOX_HEIGHT = 36; EquipmentWindow::EquipmentWindow(Equipment *equipment): Window(_("Equipment")), - mEquipBox(0), + mEquipBox(nullptr), mSelected(-1), mEquipment(equipment), mBoxesNumber(0) @@ -61,7 +61,7 @@ EquipmentWindow::EquipmentWindow(Equipment *equipment): setupWindow->registerWindowForReset(this); // Control that shows the Player - PlayerBox *playerBox = new PlayerBox; + auto *playerBox = new PlayerBox; playerBox->setDimension(gcn::Rectangle(50, 80, 74, 123)); playerBox->setPlayer(local_player); @@ -122,7 +122,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) Window::drawChildren(graphics); // Draw equipment boxes - Graphics *g = static_cast<Graphics*>(graphics); + auto *g = static_cast<Graphics*>(graphics); for (int i = 0; i < mBoxesNumber; i++) { @@ -194,7 +194,7 @@ Item *EquipmentWindow::getItem(int x, int y) const if (tRect.isPointInRect(x, y)) return mEquipment->getEquipment(i); } - return 0; + return nullptr; } std::string EquipmentWindow::getSlotName(int x, int y) const @@ -216,7 +216,7 @@ void EquipmentWindow::mousePressed(gcn::MouseEvent& mouseEvent) const int x = mouseEvent.getX(); const int y = mouseEvent.getY(); - Item *item = 0; + Item *item = nullptr; // Checks if any of the presses were in the equip boxes. for (int i = 0; i < mBoxesNumber; ++i) |