silence compiler warnings

This commit is contained in:
garak 2019-08-06 23:35:02 -04:00
parent e87d669e1d
commit f89804dd16
16 changed files with 41 additions and 29 deletions

View file

@ -9,6 +9,10 @@
class CityMapPixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
private:
using QGraphicsPixmapItem::paint;
public:
CityMapPixmapItem(QString fname, TilemapTileSelector *tile_selector) {
this->file = fname;
@ -25,7 +29,7 @@ public:
void init();
void save();
void create(QString);
virtual void paint(QGraphicsSceneMouseEvent*);
virtual void paint(QGraphicsSceneMouseEvent *);
virtual void draw();
int getIndexAt(int, int);
int width();

View file

@ -35,6 +35,9 @@ protected:
void mousePressEvent(QGraphicsSceneMouseEvent*);
void mouseMoveEvent(QGraphicsSceneMouseEvent*);
void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
//private:
// using MapPixmapItem::paint;
};
#endif // COLLISIONPIXMAPITEM_H

View file

@ -27,8 +27,7 @@ public:
height + penWidth * 2);
}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget) override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
{
if (!(*enabled)) return;
int width = this->width;

View file

@ -8,6 +8,10 @@
class MapPixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
private:
using QGraphicsPixmapItem::paint;
public:
MapPixmapItem(Map *map_, MetatileSelector *metatileSelector, Settings *settings) {
this->map = map_;

View file

@ -18,8 +18,7 @@ public:
20 * 8 + penWidth * 2);
}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget) override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
{
painter->setPen(this->color);
painter->drawRect(-2, -2, this->width + 3, this->height + 3);

View file

@ -7,6 +7,10 @@
class RegionMapPixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
private:
using QGraphicsPixmapItem::paint;
public:
RegionMapPixmapItem(RegionMap *rmap, TilemapTileSelector *tile_selector) {
this->region_map = rmap;
@ -16,8 +20,8 @@ public:
RegionMap *region_map;
TilemapTileSelector *tile_selector;
virtual void paint(QGraphicsSceneMouseEvent*);
virtual void select(QGraphicsSceneMouseEvent*);
virtual void paint(QGraphicsSceneMouseEvent *);
virtual void select(QGraphicsSceneMouseEvent *);
virtual void draw();
signals:
@ -26,11 +30,11 @@ signals:
void hoveredRegionMapTileCleared();
protected:
void hoverMoveEvent(QGraphicsSceneHoverEvent*);
void hoverLeaveEvent(QGraphicsSceneHoverEvent*);
void mousePressEvent(QGraphicsSceneMouseEvent*);
void mouseMoveEvent(QGraphicsSceneMouseEvent*);
void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
void hoverMoveEvent(QGraphicsSceneHoverEvent *);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *);
void mousePressEvent(QGraphicsSceneMouseEvent *);
void mouseMoveEvent(QGraphicsSceneMouseEvent *);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *);
};
#endif // REGIONMAPPIXMAPITEM_H

View file

@ -34,7 +34,7 @@ protected:
private:
int numTilesWide;
int numTiles;
size_t numTiles;
void updateSelectedTile();
unsigned getTileId(int x, int y);
QPoint getTileIdCoords(unsigned);

View file

@ -12,7 +12,7 @@ TARGET = porymap
TEMPLATE = app
RC_ICONS = resources/icons/porymap-icon-1.ico
ICON = resources/icons/porymap.icns
QMAKE_CXXFLAGS += -std=c++11
QMAKE_CXXFLAGS += -std=c++11 -Wall
SOURCES += src/core/block.cpp \
src/core/blockdata.cpp \

View file

@ -467,7 +467,7 @@ void Editor::onMapStartPaint(QGraphicsSceneMouseEvent *event, MapPixmapItem *ite
}
}
void Editor::onMapEndPaint(QGraphicsSceneMouseEvent *event, MapPixmapItem *item) {
void Editor::onMapEndPaint(QGraphicsSceneMouseEvent *, MapPixmapItem *item) {
if (!item->paintingEnabled) {
return;
}

View file

@ -161,6 +161,8 @@ void MainWindow::setProjectSpecificUIVisibility()
ui->label_AllowBiking->setVisible(true);
ui->label_AllowEscapeRope->setVisible(true);
break;
case BaseGameVersion::pokefirered:
break;
}
}
@ -2122,7 +2124,7 @@ void MainWindow::on_pushButton_DeleteCustomHeaderField_clicked()
}
}
void MainWindow::on_tableWidget_CustomHeaderFields_cellChanged(int row, int column)
void MainWindow::on_tableWidget_CustomHeaderFields_cellChanged(int, int)
{
this->editor->updateCustomMapHeaderValues(this->ui->tableWidget_CustomHeaderFields);
}

View file

@ -671,7 +671,7 @@ void Project::saveTilesetTilesImage(Tileset *tileset) {
tileset->tilesImage.save(tileset->tilesImagePath);
}
void Project::saveTilesetPalettes(Tileset *tileset, bool primary) {
void Project::saveTilesetPalettes(Tileset *tileset, bool /*primary*/) {
PaletteUtil paletteParser;
for (int i = 0; i < Project::getNumPalettesTotal(); i++) {
QString filepath = tileset->palettePaths.at(i);

View file

@ -93,6 +93,8 @@ void NewMapPopup::setDefaultValues(int groupNum, QString mapSec) {
ui->label_NewMap_Allow_Biking->setVisible(true);
ui->label_NewMap_Allow_Escape_Rope->setVisible(true);
break;
case BaseGameVersion::pokefirered:
break;
}
}

View file

@ -445,11 +445,6 @@ void RegionMapEditor::mouseEvent_region_map(QGraphicsSceneMouseEvent *event, Reg
}
void RegionMapEditor::mouseEvent_city_map(QGraphicsSceneMouseEvent *event, CityMapPixmapItem *item) {
QPointF pos = event->pos();
int x = static_cast<int>(pos.x()) / 8;
int y = static_cast<int>(pos.y()) / 8;
int index = this->city_map_item->getIndexAt(x, y);
if (cityMapFirstDraw) {
RegionMapHistoryItem *commit = new RegionMapHistoryItem(
RegionMapEditorBox::CityMapImage, this->city_map_item->getTiles(), this->city_map_item->file
@ -548,7 +543,7 @@ void RegionMapEditor::on_spinBox_RM_Entry_height_valueChanged(int height) {
this->hasUnsavedChanges = true;
}
void RegionMapEditor::on_lineEdit_RM_MapName_textEdited(const QString &text) {
void RegionMapEditor::on_lineEdit_RM_MapName_textEdited(const QString &) {
this->hasUnsavedChanges = true;
}

View file

@ -115,7 +115,7 @@ void RegionMapEntriesPixmapItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
}
void RegionMapEntriesPixmapItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
void RegionMapEntriesPixmapItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *) {
this->draggingEntry = false;
}
@ -123,7 +123,7 @@ void RegionMapEntriesPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
event->ignore();
}
void RegionMapEntriesPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent* event) {
void RegionMapEntriesPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
event->ignore();
}

View file

@ -70,7 +70,7 @@ void RegionMapLayoutPixmapItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
mousePressEvent(event);
}
void RegionMapLayoutPixmapItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {}
void RegionMapLayoutPixmapItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *) {}
void RegionMapLayoutPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
QPoint pos = this->getCellPos(event->pos());
@ -78,7 +78,7 @@ void RegionMapLayoutPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
emit this->hoveredTileChanged(tileId);
}
void RegionMapLayoutPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent* event) {
void RegionMapLayoutPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {
emit this->hoveredTileCleared();
}

View file

@ -33,7 +33,7 @@ unsigned TilemapTileSelector::getSelectedTile() {
}
unsigned TilemapTileSelector::getTileId(int x, int y) {
int index = y * this->numTilesWide + x;
unsigned index = y * this->numTilesWide + x;
return index < this->numTiles ? index : this->numTiles % index;
}
@ -72,6 +72,6 @@ void TilemapTileSelector::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
emit this->hoveredTileChanged(tileId);
}
void TilemapTileSelector::hoverLeaveEvent(QGraphicsSceneHoverEvent* event) {
void TilemapTileSelector::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {
emit this->hoveredTileCleared();
}