1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 03:40:14 +00:00

Use std::unique_ptr in HUD

This commit is contained in:
Evil Eye 2022-08-31 18:03:46 +02:00
parent b21c77a026
commit fd720c0a7b
2 changed files with 4 additions and 4 deletions

View File

@ -163,7 +163,7 @@ namespace MWGui
mMainWidget->eventMouseMove += MyGUI::newDelegate(this, &HUD::onWorldMouseOver);
mMainWidget->eventMouseLostFocus += MyGUI::newDelegate(this, &HUD::onWorldMouseLostFocus);
mSpellIcons = new SpellIcons();
mSpellIcons = std::make_unique<SpellIcons>();
}
HUD::~HUD()
@ -171,8 +171,6 @@ namespace MWGui
mMainWidget->eventMouseLostFocus.clear();
mMainWidget->eventMouseMove.clear();
mMainWidget->eventMouseButtonClick.clear();
delete mSpellIcons;
}
void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat<float>& value)

View File

@ -1,6 +1,8 @@
#ifndef OPENMW_GAME_MWGUI_HUD_H
#define OPENMW_GAME_MWGUI_HUD_H
#include <memory>
#include "mapwindow.hpp"
#include "statswatcher.hpp"
@ -95,7 +97,7 @@ namespace MWGui
bool mWorldMouseOver;
SpellIcons* mSpellIcons;
std::unique_ptr<SpellIcons> mSpellIcons;
int mEnemyActorId;
float mEnemyHealthTimer;