summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-11-08 00:44:17 +0300
committerAndrei Karas <akaras@inbox.ru>2011-11-08 00:44:17 +0300
commit4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe (patch)
tree714897eca03fbcb764f5b450a29cc1aef8d33433 /src/gui
parent9e83411f7e4147d09af5a5006888dcc187ea0ef8 (diff)
downloadmv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.gz
mv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.bz2
mv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.xz
mv-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.zip
Fix more gcc 4.7 warnings.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/buydialog.cpp6
-rw-r--r--src/gui/buyselldialog.cpp10
-rw-r--r--src/gui/charcreatedialog.cpp10
-rw-r--r--src/gui/setup_relations.cpp8
-rw-r--r--src/gui/setup_video.cpp16
-rw-r--r--src/gui/shopwindow.cpp16
-rw-r--r--src/gui/skilldialog.cpp20
-rw-r--r--src/gui/socialwindow.cpp74
-rw-r--r--src/gui/specialswindow.cpp2
-rw-r--r--src/gui/statuswindow.cpp16
-rw-r--r--src/gui/textdialog.cpp4
-rw-r--r--src/gui/theme.cpp44
-rw-r--r--src/gui/tradewindow.cpp6
-rw-r--r--src/gui/unregisterdialog.cpp4
-rw-r--r--src/gui/updaterwindow.cpp4
-rw-r--r--src/gui/viewport.cpp28
-rw-r--r--src/gui/whoisonline.cpp12
-rw-r--r--src/gui/windowmenu.cpp12
-rw-r--r--src/gui/worldselectdialog.cpp4
19 files changed, 149 insertions, 147 deletions
diff --git a/src/gui/buydialog.cpp b/src/gui/buydialog.cpp
index 7fad622df..f5e556848 100644
--- a/src/gui/buydialog.cpp
+++ b/src/gui/buydialog.cpp
@@ -55,14 +55,14 @@
BuyDialog::DialogList BuyDialog::instances;
BuyDialog::BuyDialog(int npcId):
- Window(_("Buy"), false, 0, "buy.xml"),
+ Window(_("Buy"), false, nullptr, "buy.xml"),
mNpcId(npcId), mMoney(0), mAmountItems(0), mMaxItems(0), mNick("")
{
init();
}
BuyDialog::BuyDialog(std::string nick):
- Window(_("Buy"), false, 0, "buy.xml"),
+ Window(_("Buy"), false, nullptr, "buy.xml"),
mNpcId(-1), mMoney(0), mAmountItems(0), mMaxItems(0), mNick(nick)
{
init();
@@ -153,7 +153,7 @@ void BuyDialog::init()
BuyDialog::~BuyDialog()
{
delete mShopItems;
- mShopItems = 0;
+ mShopItems = nullptr;
instances.remove(this);
}
diff --git a/src/gui/buyselldialog.cpp b/src/gui/buyselldialog.cpp
index e1063192a..2a614ed74 100644
--- a/src/gui/buyselldialog.cpp
+++ b/src/gui/buyselldialog.cpp
@@ -37,19 +37,19 @@
BuySellDialog::DialogList BuySellDialog::instances;
BuySellDialog::BuySellDialog(int npcId):
- Window(_("Shop"), false, 0, "buysell.xml"),
+ Window(_("Shop"), false, nullptr, "buysell.xml"),
mNpcId(npcId),
mNick(""),
- mBuyButton(0)
+ mBuyButton(nullptr)
{
init();
}
BuySellDialog::BuySellDialog(std::string nick):
- Window(_("Shop"), false, 0, "buysell.xml"),
+ Window(_("Shop"), false, nullptr, "buysell.xml"),
mNpcId(-1),
mNick(nick),
- mBuyButton(0)
+ mBuyButton(nullptr)
{
init();
}
@@ -62,7 +62,7 @@ void BuySellDialog::init()
static const char *buttonNames[] =
{
- N_("Buy"), N_("Sell"), N_("Cancel"), 0
+ N_("Buy"), N_("Sell"), N_("Cancel"), nullptr
};
int x = 10, y = 10;
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp
index 0cde69386..42435f036 100644
--- a/src/gui/charcreatedialog.cpp
+++ b/src/gui/charcreatedialog.cpp
@@ -180,10 +180,10 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *parent, int slot):
CharCreateDialog::~CharCreateDialog()
{
delete mPlayer;
- mPlayer = 0;
+ mPlayer = nullptr;
// Make sure the char server handler knows that we're gone
- Net::getCharHandler()->setCharCreateDialog(0);
+ Net::getCharHandler()->setCharCreateDialog(nullptr);
}
void CharCreateDialog::action(const gcn::ActionEvent &event)
@@ -335,13 +335,13 @@ void CharCreateDialog::setAttributes(const std::vector<std::string> &labels,
{
remove(mAttributeLabel[i]);
delete mAttributeLabel[i];
- mAttributeLabel[i] = 0;
+ mAttributeLabel[i] = nullptr;
remove(mAttributeSlider[i]);
delete mAttributeSlider[i];
- mAttributeSlider[i] = 0;
+ mAttributeSlider[i] = nullptr;
remove(mAttributeValue[i]);
delete mAttributeValue[i];
- mAttributeValue[i] = 0;
+ mAttributeValue[i] = nullptr;
}
mAttributeLabel.resize(labels.size());
diff --git a/src/gui/setup_relations.cpp b/src/gui/setup_relations.cpp
index 1921ee267..8ac61f90c 100644
--- a/src/gui/setup_relations.cpp
+++ b/src/gui/setup_relations.cpp
@@ -108,9 +108,9 @@ public:
{
freeWidgets();
delete mListModel;
- mListModel = 0;
+ mListModel = nullptr;
delete mPlayers;
- mPlayers = 0;
+ mPlayers = nullptr;
}
virtual int getRows() const
@@ -185,7 +185,7 @@ public:
virtual void freeWidgets()
{
delete mPlayers;
- mPlayers = 0;
+ mPlayers = nullptr;
delete_all(mWidgets);
mWidgets.clear();
@@ -310,7 +310,7 @@ Setup_Relations::~Setup_Relations()
{
player_relations.removeListener(this);
delete mIgnoreActionChoicesModel;
- mIgnoreActionChoicesModel = 0;
+ mIgnoreActionChoicesModel = nullptr;
}
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index ea181ea14..794fd3324 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -133,7 +133,7 @@ ModeListModel::ModeListModel()
SDL_Rect **modes = SDL_ListModes(nullptr, SDL_FULLSCREEN | SDL_HWSURFACE);
/* Check which modes are available */
- if (modes == static_cast<SDL_Rect **>(0))
+ if (modes == static_cast<SDL_Rect **>(nullptr))
{
logger->log1("No modes available");
}
@@ -310,7 +310,7 @@ Setup_Video::Setup_Video():
mParticleDetail(3 - config.getIntValue("particleEmitterSkip")),
mParticleDetailSlider(new Slider(0, 3)),
mParticleDetailField(new Label),
- mDialog(0)
+ mDialog(nullptr)
{
setName(_("Video"));
@@ -446,13 +446,13 @@ Setup_Video::Setup_Video():
Setup_Video::~Setup_Video()
{
delete mModeListModel;
- mModeListModel = 0;
+ mModeListModel = nullptr;
delete mModeList;
- mModeList = 0;
+ mModeList = nullptr;
delete mOpenGLListModel;
- mOpenGLListModel = 0;
+ mOpenGLListModel = nullptr;
delete mDialog;
- mDialog = 0;
+ mDialog = nullptr;
}
void Setup_Video::apply()
@@ -594,7 +594,7 @@ void Setup_Video::action(const gcn::ActionEvent &event)
if (mDialog)
{
mode = mDialog->getText();
- mDialog = 0;
+ mDialog = nullptr;
}
else
{
@@ -632,7 +632,7 @@ void Setup_Video::action(const gcn::ActionEvent &event)
}
if (id == "~videomode")
{
- mDialog = 0;
+ mDialog = nullptr;
}
else if (id == "guialpha")
{
diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp
index 2215ce699..a50a485ec 100644
--- a/src/gui/shopwindow.cpp
+++ b/src/gui/shopwindow.cpp
@@ -72,14 +72,14 @@ extern std::string tradePartnerName;
ShopWindow::DialogList ShopWindow::instances;
ShopWindow::ShopWindow():
- Window(_("Personal Shop"), false, 0, "shop.xml"),
+ Window(_("Personal Shop"), false, nullptr, "shop.xml"),
mSelectedItem(-1),
mAnnonceTime(0),
mLastRequestTimeList(0),
mLastRequestTimeItem(0),
mRandCounter(0),
mAcceptPlayer(""),
- mTradeItem(0),
+ mTradeItem(nullptr),
mTradeNick(""),
mTradeMoney(0)
{
@@ -152,8 +152,8 @@ ShopWindow::ShopWindow():
}
else
{
- mBuyAuctionButton = 0;
- mSellAuctionButton = 0;
+ mBuyAuctionButton = nullptr;
+ mSellAuctionButton = nullptr;
}
Layout &layout = getLayout();
@@ -173,10 +173,10 @@ ShopWindow::~ShopWindow()
saveList();
delete mBuyShopItems;
- mBuyShopItems = 0;
+ mBuyShopItems = nullptr;
delete mSellShopItems;
- mSellShopItems = 0;
+ mSellShopItems = nullptr;
instances.remove(this);
}
@@ -602,8 +602,8 @@ void ShopWindow::sendMessage(const std::string &nick,
void ShopWindow::showList(const std::string &nick, std::string data)
{
- BuyDialog *buyDialog = 0;
- SellDialog *sellDialog = 0;
+ BuyDialog *buyDialog = nullptr;
+ SellDialog *sellDialog = nullptr;
if (data.find("B1") == 0)
{
data = data.substr(2);
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp
index 8f45be5d1..072a9cb85 100644
--- a/src/gui/skilldialog.cpp
+++ b/src/gui/skilldialog.cpp
@@ -81,8 +81,8 @@ struct SkillInfo
gcn::Color color;
SkillInfo() :
- id(0), name(""), dispName(""), icon(0), modifiable(false),
- visible(false), model(0), skillLevel(""), skillLevelWidth(0),
+ id(0), name(""), dispName(""), icon(nullptr), modifiable(false),
+ visible(false), model(nullptr), skillLevel(""), skillLevelWidth(0),
skillExp(""), progress(0.0f)
{
}
@@ -92,7 +92,7 @@ struct SkillInfo
if (icon)
{
icon->decRef();
- icon = 0;
+ icon = nullptr;
}
}
@@ -161,9 +161,9 @@ public:
~SkillListBox()
{
delete mModel;
- mModel = 0;
+ mModel = nullptr;
delete mPopup;
- mPopup = 0;
+ mPopup = nullptr;
}
SkillInfo *getSelectedInfo()
@@ -172,7 +172,7 @@ public:
if (!mListModel || selected < 0
|| selected > mListModel->getNumberOfElements())
{
- return 0;
+ return nullptr;
}
return static_cast<SkillModel*>(mListModel)->getSkillAt(selected);
@@ -257,7 +257,7 @@ public:
~SkillTab()
{
delete mListBox;
- mListBox = 0;
+ mListBox = nullptr;
}
SkillInfo *getSelectedInfo()
@@ -265,7 +265,7 @@ public:
if (mListBox)
return mListBox->getSelectedInfo();
else
- return 0;
+ return nullptr;
}
private:
@@ -273,7 +273,7 @@ private:
};
SkillDialog::SkillDialog():
- Window(_("Skills"), false, 0, "skills.xml")
+ Window(_("Skills"), false, nullptr, "skills.xml")
{
setWindowName("Skills");
setCloseButton(true);
@@ -286,7 +286,7 @@ SkillDialog::SkillDialog():
mTabs = new TabbedArea();
mPointsLabel = new Label("0");
mIncreaseButton = new Button(_("Up"), "inc", this);
- mDefaultModel = 0;
+ mDefaultModel = nullptr;
place(0, 0, mTabs, 5, 5);
place(0, 5, mPointsLabel, 4);
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index 6b07e109f..2bc8aba9b 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -66,10 +66,10 @@ protected:
friend class SocialWindow;
SocialTab():
- mInviteDialog(0),
- mConfirmDialog(0),
- mScroll(0),
- mList(0)
+ mInviteDialog(nullptr),
+ mConfirmDialog(nullptr),
+ mScroll(nullptr),
+ mList(nullptr)
{}
virtual ~SocialTab()
@@ -129,9 +129,9 @@ public:
~SocialGuildTab()
{
delete mList;
- mList = 0;
+ mList = nullptr;
delete mScroll;
- mScroll = 0;
+ mScroll = nullptr;
}
void action(const gcn::ActionEvent &event)
@@ -147,11 +147,11 @@ public:
_("Invited user %s to guild %s."),
name.c_str(), mGuild->getName().c_str()), BY_SERVER);
}
- mInviteDialog = 0;
+ mInviteDialog = nullptr;
}
else if (event.getId() == "~do invite")
{
- mInviteDialog = 0;
+ mInviteDialog = nullptr;
}
else if (event.getId() == "yes")
{
@@ -161,11 +161,11 @@ public:
localChatTab->chatLog(strprintf(_("Guild %s quit requested."),
mGuild->getName().c_str()), BY_SERVER);
}
- mConfirmDialog = 0;
+ mConfirmDialog = nullptr;
}
else if (event.getId() == "~yes")
{
- mConfirmDialog = 0;
+ mConfirmDialog = nullptr;
}
}
@@ -227,9 +227,9 @@ public:
~SocialGuildTab2()
{
delete mList;
- mList = 0;
+ mList = nullptr;
delete mScroll;
- mScroll = 0;
+ mScroll = nullptr;
}
void action(const gcn::ActionEvent &event A_UNUSED)
@@ -330,9 +330,9 @@ public:
~SocialPartyTab()
{
delete mList;
- mList = 0;
+ mList = nullptr;
delete mScroll;
- mScroll = 0;
+ mScroll = nullptr;
}
void action(const gcn::ActionEvent &event)
@@ -465,11 +465,11 @@ public:
~SocialPlayersTab()
{
delete mList;
- mList = 0;
+ mList = nullptr;
delete mScroll;
- mScroll = 0;
+ mScroll = nullptr;
delete mBeings;
- mBeings = 0;
+ mBeings = nullptr;
}
void updateList()
@@ -525,9 +525,9 @@ public:
{
std::vector<Avatar*> *avatars = mBeings->getMembers();
if (!avatars)
- return 0;
+ return nullptr;
- Avatar *ava = 0;
+ Avatar *ava = nullptr;
std::vector<Avatar*>::const_iterator i = avatars->begin();
while (i != avatars->end())
{
@@ -629,11 +629,11 @@ public:
~SocialNavigationTab()
{
delete mList;
- mList = 0;
+ mList = nullptr;
delete mScroll;
- mScroll = 0;
+ mScroll = nullptr;
delete mBeings;
- mBeings = 0;
+ mBeings = nullptr;
}
void invite()
@@ -751,7 +751,7 @@ public:
if (!map)
return;
- Avatar *ava = 0;
+ Avatar *ava = nullptr;
std::vector<Avatar*>::const_iterator i = avatars->begin();
while (i != avatars->end())
{
@@ -785,7 +785,7 @@ public:
if (!map)
return 01;
- Avatar *ava = 0;
+ Avatar *ava = nullptr;
std::vector<Avatar*>::const_iterator i = avatars->begin();
unsigned num = 0;
while (i != avatars->end())
@@ -906,11 +906,11 @@ public:
~SocialAttackTab()
{
delete mList;
- mList = 0;
+ mList = nullptr;
delete mScroll;
- mScroll = 0;
+ mScroll = nullptr;
delete mBeings;
- mBeings = 0;
+ mBeings = nullptr;
}
void invite()
@@ -1114,11 +1114,11 @@ private:
};
SocialWindow::SocialWindow() :
- Window(_("Social"), false, 0, "social.xml"),
+ Window(_("Social"), false, nullptr, "social.xml"),
mGuildInvited(0),
- mGuildAcceptDialog(0),
- mPartyAcceptDialog(0),
- mMap(0),
+ mGuildAcceptDialog(nullptr),
+ mPartyAcceptDialog(nullptr),
+ mMap(nullptr),
mLastUpdateTime(0),
mNeedUpdate(false),
mProcessedPortals(false)
@@ -1165,7 +1165,7 @@ SocialWindow::SocialWindow() :
}
else
{
- mAttackFilter = 0;
+ mAttackFilter = nullptr;
}
if (player_node && player_node->getParty())
@@ -1198,13 +1198,13 @@ SocialWindow::~SocialWindow()
mPartyInviter = "";
}
delete mCreatePopup;
- mCreatePopup = 0;
+ mCreatePopup = nullptr;
delete mPlayers;
- mPlayers = 0;
+ mPlayers = nullptr;
delete mNavigation;
- mNavigation = 0;
+ mNavigation = nullptr;
delete mAttackFilter;
- mAttackFilter = 0;
+ mAttackFilter = nullptr;
}
bool SocialWindow::addTab(Guild *guild)
@@ -1212,7 +1212,7 @@ bool SocialWindow::addTab(Guild *guild)
if (mGuilds.find(guild) != mGuilds.end())
return false;
- SocialTab *tab = 0;
+ SocialTab *tab = nullptr;
if (guild->getServerGuild())
tab = new SocialGuildTab(guild);
else
diff --git a/src/gui/specialswindow.cpp b/src/gui/specialswindow.cpp
index a52b30c62..6abff3796 100644
--- a/src/gui/specialswindow.cpp
+++ b/src/gui/specialswindow.cpp
@@ -76,7 +76,7 @@ class SpecialEntry : public Container
};
SpecialsWindow::SpecialsWindow():
- Window(_("Specials"), false, 0, "specials.xml")
+ Window(_("Specials"), false, nullptr, "specials.xml")
{
setWindowName("Specials");
setCloseButton(true);
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index bd88fad7e..37a706baf 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -123,7 +123,8 @@ class ChangeDisplay : public AttrDisplay, gcn::ActionListener
};
StatusWindow::StatusWindow():
- Window(player_node ? player_node->getName() : "?", false, 0, "status.xml")
+ Window(player_node ? player_node->getName() :
+ "?", false, nullptr, "status.xml")
{
listen(Mana::CHANNEL_ATTRIBUTES);
@@ -177,8 +178,8 @@ StatusWindow::StatusWindow():
}
else
{
- mMpLabel = 0;
- mMpBar = 0;
+ mMpLabel = nullptr;
+ mMpBar = nullptr;
}
place(0, 0, mLvlLabel, 3);
@@ -210,9 +211,9 @@ StatusWindow::StatusWindow():
}
else
{
- mJobLvlLabel = 0;
- mJobLabel = 0;
- mJobBar = 0;
+ mJobLvlLabel = nullptr;
+ mJobLabel = nullptr;
+ mJobBar = nullptr;
}
// ----------------------
@@ -963,6 +964,7 @@ AttrDisplay::AttrDisplay(int id, const std::string &name):
AttrDisplay::~AttrDisplay()
{
delete mLayout;
+ mLayout = nullptr;
}
std::string AttrDisplay::update()
@@ -1012,7 +1014,7 @@ ChangeDisplay::ChangeDisplay(int id, const std::string &name):
}
else
{
- mDec = 0;
+ mDec = nullptr;
}
update();
diff --git a/src/gui/textdialog.cpp b/src/gui/textdialog.cpp
index c1539684c..a32b13aa4 100644
--- a/src/gui/textdialog.cpp
+++ b/src/gui/textdialog.cpp
@@ -40,8 +40,8 @@ int TextDialog::instances = 0;
TextDialog::TextDialog(const std::string &title, const std::string &msg,
Window *parent, bool isPassword):
Window(title, true, parent, "textdialog.xml"),
- mTextField(0),
- mPasswordField(0)
+ mTextField(nullptr),
+ mPasswordField(nullptr)
{
mEnabledKeyboard = keyboard.isEnabled();
keyboard.setEnabled(false);
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 0a1a930a9..0246a5b62 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -48,7 +48,7 @@ static std::string defaultThemePath;
std::string Theme::mThemePath;
std::string Theme::mThemeName;
-Theme *Theme::mInstance = 0;
+Theme *Theme::mInstance = nullptr;
// Set the theme path...
static void initDefaultThemePath()
@@ -82,18 +82,18 @@ Skin::~Skin()
for (int i = 0; i < 9; i++)
{
delete mBorder.grid[i];
- mBorder.grid[i] = 0;
+ mBorder.grid[i] = nullptr;
}
if (mCloseImage)
{
mCloseImage->decRef();
- mCloseImage = 0;
+ mCloseImage = nullptr;
}
delete mStickyImageUp;
- mStickyImageUp = 0;
+ mStickyImageUp = nullptr;
delete mStickyImageDown;
- mStickyImageDown = 0;
+ mStickyImageDown = nullptr;
}
void Skin::updateAlpha(float minimumOpacityAllowed)
@@ -182,7 +182,7 @@ Theme *Theme::instance()
void Theme::deleteInstance()
{
delete mInstance;
- mInstance = 0;
+ mInstance = nullptr;
}
gcn::Color Theme::getProgressColor(int type, float progress)
@@ -295,7 +295,7 @@ void Theme::optionChanged(const std::string &)
Skin *Theme::readSkin(const std::string &filename)
{
if (filename.empty())
- return 0;
+ return nullptr;
// std::string filename = filename0;
// ResourceManager *resman = ResourceManager::getInstance();
@@ -306,14 +306,14 @@ Skin *Theme::readSkin(const std::string &filename)
xmlNodePtr rootNode = doc.rootNode();
if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "skinset"))
- return 0;
+ return nullptr;
const std::string skinSetImage = XML::getProperty(rootNode, "image", "");
if (skinSetImage.empty())
{
logger->log1("Theme::readSkin(): Skinset does not define an image!");
- return 0;
+ return nullptr;
}
logger->log("Theme::load(): <skinset> defines '%s' as a skin image.",
@@ -355,7 +355,7 @@ Skin *Theme::readSkin(const std::string &filename)
}
else
{
- border.grid[0] = 0;
+ border.grid[0] = nullptr;
}
}
else if (partType == "top-edge")
@@ -367,7 +367,7 @@ Skin *Theme::readSkin(const std::string &filename)
}
else
{
- border.grid[1] = 0;
+ border.grid[1] = nullptr;
}
}
else if (partType == "top-right-corner")
@@ -379,7 +379,7 @@ Skin *Theme::readSkin(const std::string &filename)
}
else
{
- border.grid[2] = 0;
+ border.grid[2] = nullptr;
}
}
@@ -393,7 +393,7 @@ Skin *Theme::readSkin(const std::string &filename)
}
else
{
- border.grid[3] = 0;
+ border.grid[3] = nullptr;
}
}
else if (partType == "bg-quad")
@@ -405,7 +405,7 @@ Skin *Theme::readSkin(const std::string &filename)
}
else
{
- border.grid[4] = 0;
+ border.grid[4] = nullptr;
}
}
else if (partType == "right-edge")
@@ -417,7 +417,7 @@ Skin *Theme::readSkin(const std::string &filename)
}
else
{
- border.grid[5] = 0;
+ border.grid[5] = nullptr;
}
}
@@ -431,7 +431,7 @@ Skin *Theme::readSkin(const std::string &filename)
}
else
{
- border.grid[6] = 0;
+ border.grid[6] = nullptr;
}
}
else if (partType == "bottom-edge")
@@ -443,7 +443,7 @@ Skin *Theme::readSkin(const std::string &filename)
}
else
{
- border.grid[7] = 0;
+ border.grid[7] = nullptr;
}
}
else if (partType == "bottom-right-corner")
@@ -455,7 +455,7 @@ Skin *Theme::readSkin(const std::string &filename)
}
else
{
- border.grid[8] = 0;
+ border.grid[8] = nullptr;
}
}
@@ -490,8 +490,8 @@ Skin *Theme::readSkin(const std::string &filename)
// to look for window buttons
Image *closeImage = Theme::getImageFromTheme("close_button.png");
Image *sticky = Theme::getImageFromTheme("sticky_button.png");
- Image *stickyImageUp = 0;
- Image *stickyImageDown = 0;
+ Image *stickyImageUp = nullptr;
+ Image *stickyImageDown = nullptr;
if (sticky)
{
stickyImageUp = sticky->getSubImage(0, 0, 15, 15);
@@ -526,7 +526,7 @@ void Theme::fillSkinsList(std::vector<std::string> &list)
char **skins = PHYSFS_enumerateFiles(
branding.getStringValue("guiThemePath").c_str());
- for (char **i = skins; *i != 0; i++)
+ for (char **i = skins; *i; i++)
{
if (PHYSFS_isDirectory((
branding.getStringValue("guiThemePath") + *i).c_str()))
@@ -544,7 +544,7 @@ void Theme::fillFontsList(std::vector<std::string> &list)
char **fonts = PHYSFS_enumerateFiles(
branding.getStringValue("fontsPath").c_str());
- for (char **i = fonts; *i != 0; i++)
+ for (char **i = fonts; *i; i++)
{
if (!PHYSFS_isDirectory((
branding.getStringValue("fontsPath") + *i).c_str()))
diff --git a/src/gui/tradewindow.cpp b/src/gui/tradewindow.cpp
index bd7e9bb1e..506bf65c9 100644
--- a/src/gui/tradewindow.cpp
+++ b/src/gui/tradewindow.cpp
@@ -63,11 +63,11 @@
#define CAPTION_ACCEPTED _("Agreed. Waiting...")
TradeWindow::TradeWindow():
- Window(_("Trade: You"), false, 0, "trade.xml"),
+ Window(_("Trade: You"), false, nullptr, "trade.xml"),
mMyInventory(new Inventory(Inventory::TRADE)),
mPartnerInventory(new Inventory(Inventory::TRADE)),
mStatus(PROPOSING),
- mAutoAddItem(0),
+ mAutoAddItem(nullptr),
mAutoAddToNick(""),
mGotMoney(0),
mGotMaxMoney(0),
@@ -390,7 +390,7 @@ void TradeWindow::close()
void TradeWindow::clear()
{
- mAutoAddItem = 0;
+ mAutoAddItem = nullptr;
mAutoAddToNick = "";
mAutoMoney = 0;
mAutoAddAmount = 0;
diff --git a/src/gui/unregisterdialog.cpp b/src/gui/unregisterdialog.cpp
index cc5caca60..c43f28400 100644
--- a/src/gui/unregisterdialog.cpp
+++ b/src/gui/unregisterdialog.cpp
@@ -47,7 +47,7 @@
#include "debug.h"
UnRegisterDialog::UnRegisterDialog(LoginData *data):
- Window(_("Unregister"), true, 0, "unregister.xml"),
+ Window(_("Unregister"), true, nullptr, "unregister.xml"),
mWrongDataNoticeListener(new WrongDataNoticeListener),
mLoginData(data)
{
@@ -92,7 +92,7 @@ UnRegisterDialog::UnRegisterDialog(LoginData *data):
UnRegisterDialog::~UnRegisterDialog()
{
delete mWrongDataNoticeListener;
- mWrongDataNoticeListener = 0;
+ mWrongDataNoticeListener = nullptr;
}
void UnRegisterDialog::action(const gcn::ActionEvent &event)
diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp
index b605d30df..ed745aa74 100644
--- a/src/gui/updaterwindow.cpp
+++ b/src/gui/updaterwindow.cpp
@@ -135,7 +135,7 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost,
const std::string &updatesDir,
bool applyUpdates,
int updateType):
- Window(_("Updating..."), false, 0, "update.xml"),
+ Window(_("Updating..."), false, nullptr, "update.xml"),
mDownloadStatus(UPDATE_NEWS),
mUpdateHost(updateHost),
mUpdatesDir(updatesDir),
@@ -202,7 +202,7 @@ UpdaterWindow::~UpdaterWindow()
mDownload->cancel();
delete mDownload;
- mDownload = 0;
+ mDownload = nullptr;
}
free(mMemoryBuffer);
}
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 13c0a8cc0..3086a027f 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -56,7 +56,7 @@
extern volatile int tick_time;
Viewport::Viewport():
- mMap(0),
+ mMap(nullptr),
mMouseX(0),
mMouseY(0),
mPixelViewX(0.0f),
@@ -65,9 +65,9 @@ Viewport::Viewport():
mCameraMode(0),
mPlayerFollowMouse(false),
mLocalWalkTime(-1),
- mHoverBeing(0),
- mHoverItem(0),
- mHoverSign(0),
+ mHoverBeing(nullptr),
+ mHoverItem(nullptr),
+ mHoverSign(nullptr),
mCameraRelativeX(0),
mCameraRelativeY(0)
{
@@ -104,11 +104,11 @@ Viewport::~Viewport()
config.removeListener("enableLazyScrolling", this);
delete mPopupMenu;
- mPopupMenu = 0;
+ mPopupMenu = nullptr;
delete mBeingPopup;
- mBeingPopup = 0;
+ mBeingPopup = nullptr;
delete mTextPopup;
- mTextPopup = 0;
+ mTextPopup = nullptr;
}
void Viewport::setMap(Map *map)
@@ -699,7 +699,7 @@ void Viewport::showUndressPopup(int x, int y, Being *being, Item *item)
void Viewport::closePopupMenu()
{
if (mPopupMenu)
- mPopupMenu->handleLink("cancel", 0);
+ mPopupMenu->handleLink("cancel", nullptr);
}
void Viewport::optionChanged(const std::string &name A_UNUSED)
@@ -738,7 +738,7 @@ void Viewport::mouseMoved(gcn::MouseEvent &event A_UNUSED)
mBeingPopup->setVisible(false);
}
- mHoverItem = 0;
+ mHoverItem = nullptr;
if (!mHoverBeing && actorSpriteManager)
{
mHoverItem = actorSpriteManager->findItem(x / mMap->getTileWidth(),
@@ -844,17 +844,17 @@ void Viewport::hideBeingPopup()
void Viewport::clearHover(ActorSprite *actor)
{
if (mHoverBeing == actor)
- mHoverBeing = 0;
+ mHoverBeing = nullptr;
if (mHoverItem == actor)
- mHoverItem = 0;
+ mHoverItem = nullptr;
}
void Viewport::cleanHoverItems()
{
- mHoverBeing = 0;
- mHoverItem = 0;
- mHoverSign = 0;
+ mHoverBeing = nullptr;
+ mHoverItem = nullptr;
+ mHoverSign = nullptr;
}
void Viewport::moveCamera(int dx, int dy)
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp
index b6d67fa83..ead38f42b 100644
--- a/src/gui/whoisonline.cpp
+++ b/src/gui/whoisonline.cpp
@@ -82,7 +82,7 @@ class NameFunctuator
} nameCompare;
WhoIsOnline::WhoIsOnline():
- Window(_("Who Is Online - Updating"), false, 0, "whoisonline.xml"),
+ Window(_("Who Is Online - Updating"), false, nullptr, "whoisonline.xml"),
mThread(nullptr),
mDownloadStatus(UPDATE_LIST),
mDownloadComplete(true),
@@ -140,7 +140,7 @@ WhoIsOnline::~WhoIsOnline()
SDL_WaitThread(mThread, nullptr);
free(mMemoryBuffer);
- mMemoryBuffer = 0;
+ mMemoryBuffer = nullptr;
// Remove possibly leftover temporary download
delete[] mCurlError;
@@ -333,7 +333,7 @@ void WhoIsOnline::loadList()
// Free the memory buffer now that we don't need it anymore
free(mMemoryBuffer);
- mMemoryBuffer = 0;
+ mMemoryBuffer = nullptr;
if (mScrollArea->getVerticalMaxScroll() <
mScrollArea->getVerticalScrollAmount())
@@ -377,7 +377,7 @@ int WhoIsOnline::downloadThread(void *ptr)
if (!wio->mAllowUpdate)
{
curl_easy_cleanup(curl);
- curl = 0;
+ curl = nullptr;
break;
}
wio->mDownloadedBytes = 0;
@@ -398,7 +398,7 @@ int WhoIsOnline::downloadThread(void *ptr)
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 7);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30);
- struct curl_slist *pHeaders = 0;
+ struct curl_slist *pHeaders = nullptr;
// Make sure the resources2.txt and news.txt aren't cached,
// in order to always get the latest version.
pHeaders = curl_slist_append(pHeaders, "pragma: no-cache");
@@ -422,7 +422,7 @@ int WhoIsOnline::downloadThread(void *ptr)
attempts++;
curl_easy_cleanup(curl);
curl_slist_free_all(pHeaders);
- curl = 0;
+ curl = nullptr;
continue;
}
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index 487035350..3f41be466 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -58,7 +58,7 @@ extern Window *botCheckerWindow;
extern Window *socialWindow;
WindowMenu::WindowMenu():
- mEmotePopup(0)
+ mEmotePopup(nullptr)
{
int x = 0, h = 0;
@@ -115,7 +115,7 @@ WindowMenu::WindowMenu():
WindowMenu::~WindowMenu()
{
delete mTextPopup;
- mTextPopup = 0;
+ mTextPopup = nullptr;
mButtonNames.clear();
std::vector <gcn::Button*>::iterator it, it_end;
for (it = mButtons.begin(), it_end = mButtons.end(); it != it_end; ++it)
@@ -132,7 +132,7 @@ WindowMenu::~WindowMenu()
void WindowMenu::action(const gcn::ActionEvent &event)
{
- Window *window = 0;
+ Window *window = nullptr;
if (event.getId() == ":-)")
{
@@ -153,14 +153,14 @@ void WindowMenu::action(const gcn::ActionEvent &event)
}
else
{
- mEmotePopup = 0;
+ mEmotePopup = nullptr;
}
}
else
{
if (windowContainer)
windowContainer->scheduleDelete(mEmotePopup);
- mEmotePopup = 0;
+ mEmotePopup = nullptr;
}
}
else if (event.getId() == "STA")
@@ -238,7 +238,7 @@ void WindowMenu::valueChanged(const gcn::SelectionEvent &event)
if (windowContainer)
windowContainer->scheduleDelete(mEmotePopup);
- mEmotePopup = 0;
+ mEmotePopup = nullptr;
}
}
diff --git a/src/gui/worldselectdialog.cpp b/src/gui/worldselectdialog.cpp
index 3749049fe..f7b505610 100644
--- a/src/gui/worldselectdialog.cpp
+++ b/src/gui/worldselectdialog.cpp
@@ -74,7 +74,7 @@ class WorldListModel : public gcn::ListModel
};
WorldSelectDialog::WorldSelectDialog(Worlds worlds):
- Window(_("Select World"), false, 0, "world.xml")
+ Window(_("Select World"), false, nullptr, "world.xml")
{
mWorldListModel = new WorldListModel(worlds);
mWorldList = new ListBox(mWorldListModel);
@@ -114,7 +114,7 @@ WorldSelectDialog::WorldSelectDialog(Worlds worlds):
WorldSelectDialog::~WorldSelectDialog()
{
delete mWorldListModel;
- mWorldListModel = 0;
+ mWorldListModel = nullptr;
}
void WorldSelectDialog::action(const gcn::ActionEvent &event)