Commit d52e8e7b authored by Frederik Schwarzer's avatar Frederik Schwarzer
Browse files

Use nullptr.

parent 9e7607db
......@@ -24,7 +24,7 @@ Block::Block(qreal p_x, qreal p_y, Arena* p_arena, const QString& p_imageId) : E
{
m_imageId = p_imageId;
m_type = Granatier::Element::BLOCK;
m_bonus = NULL;
m_bonus = nullptr;
}
Block::~Block()
......
......@@ -25,7 +25,7 @@
BlockItem::BlockItem(Block* p_model, KGameRenderer* renderer) : ElementItem (p_model, renderer)
{
setSpriteKey(p_model->getImageId());
m_destructionTimer = NULL;
m_destructionTimer = nullptr;
connect(p_model, SIGNAL(startDestructionAnimation()), this, SLOT(startDestructionAnimation()));
}
......@@ -54,7 +54,7 @@ void BlockItem::destructionAnimation()
{
m_destructionTimer->stop();
delete m_destructionTimer;
m_destructionTimer = 0;
m_destructionTimer = nullptr;
emit blockItemDestroyed(this);
}
}
......@@ -55,7 +55,7 @@ Bomb::Bomb(qreal fX, qreal fY, Arena* p_arena, int nBombID, int nDetonationCount
m_detonationCountdownTimer->start();
connect(m_detonationCountdownTimer, &QTimer::timeout, this, &Bomb::detonate);
m_mortarTimer = 0;
m_mortarTimer = nullptr;
m_mortarState = -1;
m_thrown = false;
m_stopOnCenter = false;
......@@ -474,7 +474,7 @@ void Bomb::detonate()
{
m_detonated = true;
delete m_detonationCountdownTimer;
m_detonationCountdownTimer = 0;
m_detonationCountdownTimer = nullptr;
emit bombDetonated(this);
emit releaseBombArmory();
}
......
......@@ -55,7 +55,7 @@ BombItem::BombItem(Bomb* p_model, KGameRenderer* renderer) : ElementItem (p_mode
m_pulseTimer->start();
connect(m_pulseTimer, &QTimer::timeout, this, &BombItem::pulse);
m_explosionTimer = NULL;
m_explosionTimer = nullptr;
m_listExplosionTiming.append(Settings::self()->blastTime1());
m_listExplosionTiming.append(Settings::self()->blastTime2());
m_listExplosionTiming.append(Settings::self()->blastTime3());
......@@ -127,7 +127,7 @@ void BombItem::startDetonation()
{
m_pulseTimer->stop();
delete m_pulseTimer;
m_pulseTimer = 0;
m_pulseTimer = nullptr;
}
m_animationCounter = 0;
QTransform transform;
......@@ -249,7 +249,7 @@ void BombItem::updateMortar(int nMortarState, int nMortarRampEnd, int nMortarPea
{
m_pulseTimer->stop();
delete m_pulseTimer;
m_pulseTimer = 0;
m_pulseTimer = nullptr;
}
if(nMortarState <= 0)
......
......@@ -26,7 +26,7 @@ BonusItem::BonusItem(Bonus* p_model, KGameRenderer* renderer) : ElementItem (p_m
{
setSpriteKey(p_model->getImageId());
m_undestroyableExplosionID = 0;
m_destructionTimer = NULL;
m_destructionTimer = nullptr;
m_destructionCounter = 0;
}
......@@ -65,7 +65,7 @@ void BonusItem::destructionAnimation()
{
m_destructionTimer->stop();
delete m_destructionTimer;
m_destructionTimer = 0;
m_destructionTimer = nullptr;
emit bonusItemDestroyed(this);
}
}
......@@ -39,8 +39,8 @@ bool Cell::isWalkable(Element* p_element) const
foreach(Element* element, m_elements)
{
if(element->getType() == Granatier::Element::BLOCK ||
(element->getType() == Granatier::Element::BOMB && (p_element == 0 || p_element != element)) ||
(element->getType() == Granatier::Element::PLAYER && (p_element == 0 || p_element->getType() != Granatier::Element::PLAYER)))
(element->getType() == Granatier::Element::BOMB && (p_element == nullptr || p_element != element)) ||
(element->getType() == Granatier::Element::PLAYER && (p_element == nullptr || p_element->getType() != Granatier::Element::PLAYER)))
{
return false;
}
......
......@@ -51,13 +51,13 @@ class ArenaSelector::Private
Ui::ArenaSelectorBase ui;
QString lookupDirectory;
QString groupName;
Arena* m_arena;
KGameRenderer* m_renderer;
QGraphicsScene* m_graphicsScene;
QList <KGameRenderedItem*> m_arenaItems;
qreal m_svgScaleFactor;
QStringList* m_randomArenaModeArenaList;
QStringList m_tempRandomArenaModeArenaList;
......@@ -66,7 +66,7 @@ class ArenaSelector::Private
QSize calculateSvgSize();
// private slots
void _k_updatePreview(QListWidgetItem* currentItem = NULL);
void _k_updatePreview(QListWidgetItem* currentItem = nullptr);
void _k_updateArenaList(const QString& strArena);
void _k_openKNewStuffDialog();
void _k_importArenasDialog();
......@@ -98,7 +98,7 @@ void ArenaSelector::showEvent(QShowEvent*)
d->_k_updatePreview();
}
ArenaSelector::Private::Private(ArenaSelector* parent, Options options) : q(parent), m_options(options), m_arena(NULL), m_graphicsScene(NULL), m_svgScaleFactor(1)
ArenaSelector::Private::Private(ArenaSelector* parent, Options options) : q(parent), m_options(options), m_arena(nullptr), m_graphicsScene(nullptr), m_svgScaleFactor(1)
{
KgTheme* theme = new KgTheme(QByteArray());
theme->setGraphicsPath(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("themes/granatier.svgz")));
......@@ -120,7 +120,7 @@ ArenaSelector::Private::~Private()
void ArenaSelector::Private::setupData(KConfigSkeleton * aconfig)
{
ui.setupUi(q);
//setup KNS button
if (m_options & EnableNewStuffDownload)
{
......@@ -131,18 +131,18 @@ void ArenaSelector::Private::setupData(KConfigSkeleton * aconfig)
{
ui.getNewButton->hide();
}
//The lineEdit widget holds our arena path for automatic connection via KConfigXT.
//But the user should not manipulate it directly, so we hide it.
ui.kcfg_Arena->hide();
connect(ui.kcfg_Arena, SIGNAL(textChanged(QString)), q, SLOT(_k_updateArenaList(QString)));
//graphicsscene for new arena preview
m_graphicsScene = new QGraphicsScene();
ui.arenaPreview->setScene(m_graphicsScene);
ui.arenaPreview->setBackgroundBrush(Qt::black);
//Get the last used arena path from the KConfigSkeleton
KConfigSkeletonItem * configItem = aconfig->findItem(QStringLiteral("Arena"));
QString lastUsedArena = configItem->property().toString();
......@@ -150,7 +150,7 @@ void ArenaSelector::Private::setupData(KConfigSkeleton * aconfig)
configItem = aconfig->findItem(QStringLiteral("RandomArenaModeArenaList"));
m_tempRandomArenaModeArenaList = configItem->property().toStringList();
m_tempRandomArenaModeArenaList.removeDuplicates();
//Now get our arenas into the list widget
findArenas(lastUsedArena);
......@@ -176,7 +176,7 @@ void ArenaSelector::Private::findArenas(const QString &initialSelection)
arenasAvailable.append(file);
}
}
QStringList::Iterator i = m_tempRandomArenaModeArenaList.begin();
while(i != m_tempRandomArenaModeArenaList.end())
{
......@@ -189,12 +189,12 @@ void ArenaSelector::Private::findArenas(const QString &initialSelection)
i = m_tempRandomArenaModeArenaList.erase(i);
}
}
if(m_tempRandomArenaModeArenaList.isEmpty())
{
m_tempRandomArenaModeArenaList = arenasAvailable;
}
bool initialFound = false;
foreach (const QString &file, arenasAvailable)
......@@ -268,7 +268,7 @@ void ArenaSelector::Private::findArenas(const QString &initialSelection)
void ArenaSelector::Private::_k_updatePreview(QListWidgetItem* currentItem)
{
if(currentItem != NULL)
if(currentItem != nullptr)
{
ArenaSettings * selArena = arenaMap.value(ui.arenaList->currentItem()->text());
//Sanity checkings. Should not happen.
......@@ -290,11 +290,11 @@ void ArenaSelector::Private::_k_updatePreview(QListWidgetItem* currentItem)
{
emailstr = QStringLiteral("<a href=\"mailto:%1\">%1</a>").arg(selArena->arenaProperty(contactstr));
}
ui.arenaAuthor->setText(i18nc("Author attribution, e.g. \"by Jack\"", "by %1", selArena->arenaProperty(authstr)));
ui.arenaContact->setText(emailstr);
ui.arenaDescription->setText(selArena->arenaProperty(descstr));
//show the arena without a preview pixmap
delete m_arena;
m_arena = new Arena;
......@@ -315,14 +315,14 @@ void ArenaSelector::Private::_k_updatePreview(QListWidgetItem* currentItem)
}
delete m_arenaItems.takeLast();
}
ui.arenaPreview->setSceneRect(0, 0, m_arena->getNbColumns()*Granatier::CellSize, m_arena->getNbRows()*Granatier::CellSize);
ui.arenaPreview->fitInView(ui.arenaPreview->sceneRect(), Qt::KeepAspectRatio);
}
qreal svgScaleFactor;
QRectF minSize = ui.arenaPreview->sceneRect();
if(minSize.width() == 0)
{
minSize.setWidth(1);
......@@ -331,7 +331,7 @@ void ArenaSelector::Private::_k_updatePreview(QListWidgetItem* currentItem)
{
minSize.setHeight(1);
}
//calculate the scaling factor for the SVGs
int horizontalPixelsPerCell = (ui.arenaPreview->size().width() - 4) / (minSize.width()/Granatier::CellSize);
int verticalPixelsPerCell = (ui.arenaPreview->size().height() - 4) / (minSize.height()/Granatier::CellSize);
......@@ -343,13 +343,13 @@ void ArenaSelector::Private::_k_updatePreview(QListWidgetItem* currentItem)
{
svgScaleFactor = Granatier::CellSize / verticalPixelsPerCell;
}
QTransform transform;
transform.scale(1/svgScaleFactor, 1/svgScaleFactor);
m_graphicsScene->views().first()->setTransform(transform);
m_graphicsScene->views().first()->centerOn( ui.arenaPreview->sceneRect().center());
if(currentItem == NULL)
if(currentItem == nullptr)
{
if(m_svgScaleFactor != svgScaleFactor)
{
......@@ -370,7 +370,7 @@ void ArenaSelector::Private::_k_updatePreview(QListWidgetItem* currentItem)
{
// Create the ArenaItem and set the image
ArenaItem* arenaItem = new ArenaItem(j * Granatier::CellSize, i * Granatier::CellSize, m_renderer, QStringLiteral(""));
switch(m_arena->getCell(i,j).getType())
{
case Granatier::Cell::WALL:
......@@ -418,7 +418,7 @@ void ArenaSelector::Private::_k_updatePreview(QListWidgetItem* currentItem)
{
arenaItem->setRenderSize(calculateSvgSize());
arenaItem->setScale(m_svgScaleFactor);
m_arenaItems.append(arenaItem);
m_graphicsScene->addItem(arenaItem);
}
......@@ -433,17 +433,17 @@ QSize ArenaSelector::Private::calculateSvgSize()
{
return QSize(1, 1);
}
QPoint topLeft(0, 0);
QPoint topLeft(0, 0);
topLeft = m_graphicsScene->views().first()->mapFromScene(topLeft);
QPoint bottomRight(Granatier::CellSize, Granatier::CellSize);
QPoint bottomRight(Granatier::CellSize, Granatier::CellSize);
bottomRight = m_graphicsScene->views().first()->mapFromScene(bottomRight);
QSize svgSize;
svgSize.setHeight(bottomRight.y() - topLeft.y());
svgSize.setWidth(bottomRight.x() - topLeft.x());
return svgSize;
}
......@@ -464,7 +464,7 @@ void ArenaSelector::Private::_k_updateArenaList(const QString& strArena)
}
void ArenaSelector::Private::_k_openKNewStuffDialog()
{
{
QPointer<KNS3::DownloadDialog> dialog = new KNS3::DownloadDialog (q);
if(dialog->exec() == QDialog::Accepted)
{
......@@ -494,7 +494,7 @@ void ArenaSelector::Private::_k_importArenasDialog()
{
continue;
}
QStringList listMaps;
listMaps = clanbomberDir.entryList(QStringList(QStringLiteral("*.map")));
for(int j = 0; j < listMaps.count(); j++)
......@@ -502,15 +502,15 @@ void ArenaSelector::Private::_k_importArenasDialog()
QFile mapFile(listClanbomberPaths[i] + listMaps[j]);
mapFile.open(QIODevice::ReadOnly | QIODevice::Text);
QTextStream readStream(&mapFile);
QString strAuthor = readStream.readLine();
QFile desktopFile;
QString strName = listMaps[j].left(listMaps[j].count()-4);
desktopFile.setFileName(QStringLiteral("%1clanbomber_%2.desktop").arg(arenaDir).arg(strName));
desktopFile.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream streamDesktopFile(&desktopFile);
streamDesktopFile << "[Arena]\n";
streamDesktopFile << "Name=" << strName << "\n";
streamDesktopFile << "Description=Clanbomber Import\n";
......@@ -518,10 +518,10 @@ void ArenaSelector::Private::_k_importArenasDialog()
streamDesktopFile << "FileName=clanbomber_" << strName << ".xml\n";
streamDesktopFile << "Author=" << strAuthor << "\n";
streamDesktopFile << "AuthorEmail=-\n";
streamDesktopFile.flush();
desktopFile.close();
QStringList arena;
do
{
......@@ -550,9 +550,9 @@ void ArenaSelector::Private::_k_importArenasDialog()
QFile arenaFile;
arenaFile.setFileName(QStringLiteral("%1clanbomber_%2.xml").arg(arenaDir).arg(strName));
arenaFile.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream streamArenaFile(&arenaFile);
streamArenaFile << "<?xml version=\"1.0\"?>\n";
streamArenaFile << "<Arena arenaFileVersion=\"1\" rowCount=\"" << arena.count() << "\" colCount=\"" << arena[0].count() << "\">\n";
for(int j = 0; j < arena.count(); j++)
......@@ -565,7 +565,7 @@ void ArenaSelector::Private::_k_importArenasDialog()
arenaFile.close();
}
}
ArenaSettings* selArena = arenaMap.value(ui.arenaList->currentItem()->text());
findArenas(selArena->fileName());
}
......@@ -576,9 +576,9 @@ void ArenaSelector::Private::_k_setRandomArenaMode(bool randomModeEnabled)
{
disconnect(ui.arenaList, SIGNAL(itemChanged(QListWidgetItem*)), q, SLOT(_k_updateRandomArenaModeArenaList(QListWidgetItem*)));
}
m_randomArenaModeArenaList->clear();
int numberOfItems = ui.arenaList->count();
for(int i = 0; i < numberOfItems; i++)
{
......@@ -603,7 +603,7 @@ void ArenaSelector::Private::_k_setRandomArenaMode(bool randomModeEnabled)
item->setFlags(item->flags() & ~Qt::ItemIsUserCheckable);
}
}
if(randomModeEnabled)
{
*m_randomArenaModeArenaList = m_tempRandomArenaModeArenaList;
......
......@@ -46,7 +46,7 @@
class PlayerSelectorDelegate : public QStyledItemDelegate
{
public:
PlayerSelectorDelegate(QObject* parent = 0);
PlayerSelectorDelegate(QObject* parent = nullptr);
virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
///@note The implementation is independent of @a option and @a index.
virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
......@@ -64,7 +64,7 @@ struct PlayerSelector::Private
void fillList();
Private(PlayerSettings* playerSettings, Options options, PlayerSelector* q) : q(q), m_playerSettings(playerSettings), m_options(options), m_knsButton(0) {}
Private(PlayerSettings* playerSettings, Options options, PlayerSelector* q) : q(q), m_playerSettings(playerSettings), m_options(options), m_knsButton(nullptr) {}
void _k_showNewStuffDialog();
};
......@@ -105,35 +105,35 @@ PlayerSelector::~PlayerSelector()
void PlayerSelector::Private::fillList()
{
m_list->clear();
QModelIndex modelIndex;
PlayerSelectorItem* playerSelectorItem;
QSvgRenderer renderer;
QPixmap pixmap(QSize(64, 64));
pixmap.fill(QColor(0, 0, 0, 0));
QPainter pixPainter(&pixmap);
QStringList playerIDs = m_playerSettings->playerIDs();
for(int i = 0; i < playerIDs.count(); i++)
{
QListWidgetItem* item = new QListWidgetItem(playerIDs[i], m_list);
item->setFlags(item->flags() & ~Qt::ItemIsSelectable);
playerSelectorItem = new PlayerSelectorItem(playerIDs[i], m_playerSettings, m_list);
renderer.load(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("players/%1").arg(m_playerSettings->playerGraphicsFile(playerIDs[i]))));
renderer.render(&pixPainter, QStringLiteral("player_0"));
playerSelectorItem->setPlayerPreviewPixmap(pixmap);
KConfig desktopFile(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("players/%1").arg(playerIDs[i])), KConfig::SimpleConfig);
QString author = desktopFile.group("KGameTheme").readEntry<QString>("Author", QStringLiteral(""));
QString authorEmail = QStringLiteral("<a href=\"mailto:%1\">%1</a>").arg(desktopFile.group("KGameTheme").readEntry<QString>("AuthorEmail", QStringLiteral("")));
//TODO: QString description = desktopFile.group("KGameTheme").readEntry<QString>("Description", "");
playerSelectorItem->setPlayerAuthor(author, authorEmail);
modelIndex = m_list->model()->index(i, 0, m_list->rootIndex());
m_list->setIndexWidget(modelIndex, playerSelectorItem);
}
......@@ -167,7 +167,7 @@ PlayerSelectorDelegate::PlayerSelectorDelegate(QObject* parent)
void PlayerSelectorDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& /*index*/) const
{
//draw background
QApplication::style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &option, painter, 0);
QApplication::style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &option, painter, nullptr);
}
QSize PlayerSelectorDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
......
......@@ -51,9 +51,9 @@ Game::Game(PlayerSettings* playerSettings)
m_soundFalling = new KgSound(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("sounds/deepfall.wav")));
m_soundDie = new KgSound(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("sounds/die.wav")));
m_arena = 0;
m_arena = nullptr;
m_randomArenaModeArenaList.clear();
m_gameScene = 0;
m_gameScene = nullptr;
m_winPoints = Settings::self()->pointsToWin();
QStringList strPlayerIDs = m_playerSettings->playerIDs();
......@@ -236,13 +236,13 @@ void Game::cleanUp()
qDeleteAll(m_bombs);
m_bombs.clear();
delete m_arena;
m_arena = 0;
m_arena = nullptr;
delete m_timer;
m_timer = 0;
m_timer = nullptr;
delete m_roundTimer;
m_roundTimer = 0;
m_roundTimer = nullptr;
delete m_setRoundFinishedTimer;
m_setRoundFinishedTimer = 0;
m_setRoundFinishedTimer = nullptr;
}
void Game::setGameScene(GameScene* p_gameScene)
......@@ -582,7 +582,7 @@ void Game::decrementRemainingRoundTime()
nRow = m_arena->getNbRows() * (qrand()/1.0)/RAND_MAX;
nCol = m_arena->getNbColumns() * (qrand()/1.0)/RAND_MAX;
cellType = m_arena->getCell(nRow, nCol).getType();
if(cellType != Granatier::Cell::WALL && cellType != Granatier::Cell::HOLE && m_arena->getCell(nRow, nCol).isWalkable(0))
if(cellType != Granatier::Cell::WALL && cellType != Granatier::Cell::HOLE && m_arena->getCell(nRow, nCol).isWalkable(nullptr))
{
bFound = true;
}
......
......@@ -98,7 +98,7 @@ GameScene::GameScene(Game* p_game, KgThemeProvider* p_themeProvider) : m_game(p_
// setup the theme renderer
m_rendererSelectedTheme = new KGameRenderer(m_themeProvider);
m_rendererDefaultTheme = 0;
m_rendererDefaultTheme = nullptr;
setupThemeRenderer();
connect(m_themeProvider, &KgThemeProvider::currentThemeChanged, this, &GameScene::themeChanged);
......@@ -118,7 +118,7 @@ void GameScene::setupThemeRenderer()
{
// Load the default SVG file as fallback
selectedThemeIsDefault = false;
if(m_rendererDefaultTheme == 0)
if(m_rendererDefaultTheme == nullptr)
{
KgTheme* theme = new KgTheme(m_themeProvider->defaultTheme()->identifier());
theme->setGraphicsPath(m_themeProvider->defaultTheme()->graphicsPath());
......@@ -293,7 +293,7 @@ void GameScene::initItemsWithGraphicsFromTheme()
break;
case Granatier::Cell::HOLE:
delete arenaItem;
arenaItem = NULL;
arenaItem = nullptr;
break;
case Granatier::Cell::ICE:
arenaItem->setSpriteKey(QStringLiteral("arena_ice"));
......@@ -425,14 +425,14 @@ void GameScene::initItemsWithGraphicsFromTheme()
}
else
{
m_bonusItems[i][j] = NULL;
m_bonusItems[i][j] = nullptr;
}
}
}
else
{
m_blockItems[i][j] = NULL;
m_bonusItems[i][j] = NULL;
m_blockItems[i][j] = nullptr;
m_bonusItems[i][j] = nullptr;
}
}
}
......@@ -457,7 +457,7 @@ void GameScene::initItemsWithGraphicsFromTheme()
{
for (int j = 0; j < m_game->getArena()->getNbColumns(); ++j)
{
if(m_arenaItem[i][j] != NULL)
if(m_arenaItem[i][j] != nullptr)
{
addItem(m_arenaItem[i][j]);
}
......@@ -469,7 +469,7 @@ void GameScene::initItemsWithGraphicsFromTheme()
{
for (int j = 0; j < m_game->getArena()->getNbColumns(); ++j)
{
if (m_blockItems[i][j] != NULL)
if (m_blockItems[i][j] != nullptr)
{
if (!items().contains(m_blockItems[i][j]))
{
......@@ -543,7 +543,7 @@ void GameScene::cleanUpItemsWithGraphicsFromTheme()
{
for (int j = 0; j < m_game->getArena()->getNbColumns(); ++j)
{
if (m_arenaItem[i][j] != NULL)
if (m_arenaItem[i][j] != nullptr)
{
if (items().contains(m_arenaItem[i][j]))
{
......@@ -587,7 +587,7 @@ void GameScene::cleanUpItemsWithGraphicsFromTheme()
{
for (int j = 0; j < m_game->getArena()->getNbColumns(); ++j)
{
if (m_blockItems[i][j] != NULL)
if (m_blockItems[i][j] != nullptr)
{
if (items().contains(m_blockItems[i][j]))
{
......@@ -595,7 +595,7 @@ void GameScene::cleanUpItemsWithGraphicsFromTheme()
}
delete m_blockItems[i][j];
}
if (m_bonusItems[i][j] != NULL)
if (m_bonusItems[i][j] != nullptr)
{
if (items().contains(m_bonusItems[i][j]))
{
......@@ -651,7 +651,7 @@ KGameRenderer* GameScene::renderer(Granatier::Element::Type type, Player* player
case Granatier::Element::SCORE:
return m_rendererScoreItems;
default:
return NULL;
return nullptr;
}
}
......@@ -773,12 +773,12 @@ void GameScene::removeBlockItem(BlockItem* blockItem)
{
for (int j = 0; j < m_game->getArena()->getNbColumns(); ++j)
{
if (m_blockItems[i][j] != NULL && m_blockItems[i][j] == blockItem)
if (m_blockItems[i][j] != nullptr && m_blockItems[i][j] == blockItem)
{
if (items().contains(m_blockItems[i][j]))
{
removeItem(m_blockItems[i][j]);
m_blockItems[i][j] = NULL;
m_blockItems[i][j] = nullptr;
m_game->blockDestroyed(i, j, dynamic_cast <Block*> (blockItem->getModel()));
delete blockItem;
}
......@@ -794,12 +794,12 @@ void GameScene::removeBonusItem(BonusItem* bonusItem)
{
for (int j = 0; j < m_game->getArena()->getNbColumns(); ++j)
{
if (m_bonusItems[i][j] != NULL && m_bonusItems[i][j] == bonusItem)
if (m_bonusItems[i][j] != nullptr && m_bonusItems[i][j] == bonusItem)
{
if (items().contains(m_bonusItems[i][j]))
{
removeItem(m_bonusItems[i][j]);