diff --git a/blockdata.h b/blockdata.h index 2e6e743b..8d87eaa4 100755 --- a/blockdata.h +++ b/blockdata.h @@ -10,13 +10,13 @@ class Blockdata : public QObject { Q_OBJECT public: - explicit Blockdata(QObject *parent = 0); + explicit Blockdata(QObject *parent = nullptr); ~Blockdata() { if (blocks) delete blocks; } public: - QList *blocks = NULL; + QList *blocks = nullptr; void addBlock(uint16_t); void addBlock(Block); QByteArray serialize(); diff --git a/editor.cpp b/editor.cpp index d3853b91..375c4ebf 100755 --- a/editor.cpp +++ b/editor.cpp @@ -1017,7 +1017,7 @@ void MovementPermissionsPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent* ev if (x >= width) x = width - 1; if (y < 0) y = 0; if (y >= height) y = height - 1; - pick(x, y); + pick(static_cast(x), static_cast(y)); } void MovementPermissionsPixmapItem::mouseMoveEvent(QGraphicsSceneMouseEvent* event) { updateCurHoveredMetatile(event->pos()); diff --git a/editor.h b/editor.h index 61e40d29..eca36d5e 100755 --- a/editor.h +++ b/editor.h @@ -415,7 +415,7 @@ public: MovementPermissionsPixmapItem(Map *map_): MetatilesPixmapItem(map_) { connect(map, SIGNAL(paintCollisionChanged(Map*)), this, SLOT(paintCollisionChanged(Map *))); } - virtual void pick(int collision, int elevation) { + virtual void pick(uint16_t collision, uint16_t elevation) { map->paint_collision = collision; map->paint_elevation = elevation; draw(); diff --git a/event.cpp b/event.cpp index ee05ed08..80928d97 100755 --- a/event.cpp +++ b/event.cpp @@ -18,7 +18,7 @@ Event::Event() Event* Event::createNewEvent(QString event_type, QString map_name) { - Event *event; + Event *event = new Event; if (event_type == EventType::Object) { event = createNewObjectEvent(); } else if (event_type == EventType::Warp) { diff --git a/graphicsview.h b/graphicsview.h index 1d0711fc..d4e41b25 100755 --- a/graphicsview.h +++ b/graphicsview.h @@ -6,18 +6,6 @@ class Editor; -/* -class GraphicsView_Object : public QObject -{ - Q_OBJECT - -signals: - void onMousePress(QMouseEvent *event); - void onMouseMove(QMouseEvent *event); - void onMouseRelease(QMouseEvent *event); -}; -*/ - class GraphicsView : public QGraphicsView { public: diff --git a/mainwindow.h b/mainwindow.h index c2f26b89..e1191c3a 100755 --- a/mainwindow.h +++ b/mainwindow.h @@ -22,7 +22,7 @@ class MainWindow : public QMainWindow Q_OBJECT public: - explicit MainWindow(QWidget *parent = 0); + explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); public slots: @@ -125,7 +125,7 @@ private: Ui::MainWindow *ui; QStandardItemModel *mapListModel; QList *mapGroupsModel; - Editor *editor = NULL; + Editor *editor = nullptr; QIcon* mapIcon; void setMap(QString); void redrawMapScene(); diff --git a/map.h b/map.h index 8c3ecaa4..b7c36b2e 100755 --- a/map.h +++ b/map.h @@ -99,15 +99,15 @@ public: QString blockdata_path; QString tileset_primary_label; QString tileset_secondary_label; - Tileset *tileset_primary = NULL; - Tileset *tileset_secondary = NULL; - Blockdata* blockdata = NULL; + Tileset *tileset_primary = nullptr; + Tileset *tileset_secondary = nullptr; + Blockdata* blockdata = nullptr; QImage border_image; QPixmap border_pixmap; - Blockdata *border = NULL; - Blockdata *cached_blockdata = NULL; - Blockdata *cached_collision = NULL; - Blockdata *cached_border = NULL; + Blockdata *border = nullptr; + Blockdata *cached_blockdata = nullptr; + Blockdata *cached_collision = nullptr; + Blockdata *cached_border = nullptr; bool has_unsaved_changes = false; public: static QString getNameFromLabel(QString label) { @@ -120,7 +120,7 @@ class Map : public QObject { Q_OBJECT public: - explicit Map(QObject *parent = 0); + explicit Map(QObject *parent = nullptr); public: QString name; diff --git a/neweventtoolbutton.h b/neweventtoolbutton.h index d75be3b4..4d5d0a9c 100644 --- a/neweventtoolbutton.h +++ b/neweventtoolbutton.h @@ -8,7 +8,7 @@ class NewEventToolButton : public QToolButton { Q_OBJECT public: - explicit NewEventToolButton(QWidget *parent = 0); + explicit NewEventToolButton(QWidget *parent = nullptr); void initButton(); QString getSelectedEventType(); public slots: diff --git a/objectpropertiesframe.h b/objectpropertiesframe.h index 34b5f78e..63a23bb0 100755 --- a/objectpropertiesframe.h +++ b/objectpropertiesframe.h @@ -12,7 +12,7 @@ class ObjectPropertiesFrame : public QFrame Q_OBJECT public: - explicit ObjectPropertiesFrame(QWidget *parent = 0); + explicit ObjectPropertiesFrame(QWidget *parent = nullptr); ~ObjectPropertiesFrame(); public: diff --git a/project.h b/project.h index 49e348b2..454cb676 100755 --- a/project.h +++ b/project.h @@ -14,10 +14,10 @@ class Project public: Project(); QString root; - QStringList *groupNames = NULL; + QStringList *groupNames = nullptr; QMap *map_groups; QList groupedMapNames; - QStringList *mapNames = NULL; + QStringList *mapNames = nullptr; QList flyableMaps; QMap* mapConstantsToMapNames; QMap* mapNamesToMapConstants; @@ -25,24 +25,24 @@ public: QList mapLayoutsTableMaster; QMap mapLayouts; QMap mapLayoutsMaster; - QStringList *regionMapSections = NULL; - QStringList *itemNames = NULL; - QStringList *flagNames = NULL; - QStringList *varNames = NULL; - QStringList *movementTypes = NULL; - QStringList *mapTypes = NULL; - QStringList *mapBattleScenes = NULL; - QStringList *weatherNames = NULL; - QStringList *coordEventWeatherNames = NULL; - QStringList *secretBaseIds = NULL; - QStringList *bgEventFacingDirections = NULL; + QStringList *regionMapSections = nullptr; + QStringList *itemNames = nullptr; + QStringList *flagNames = nullptr; + QStringList *varNames = nullptr; + QStringList *movementTypes = nullptr; + QStringList *mapTypes = nullptr; + QStringList *mapBattleScenes = nullptr; + QStringList *weatherNames = nullptr; + QStringList *coordEventWeatherNames = nullptr; + QStringList *secretBaseIds = nullptr; + QStringList *bgEventFacingDirections = nullptr; QStringList mapsWithConnections; QMap *map_cache; Map* loadMap(QString); Map* getMap(QString); - QMap *tileset_cache = NULL; + QMap *tileset_cache = nullptr; Tileset* loadTileset(QString); Tileset* getTileset(QString); diff --git a/tileset.h b/tileset.h index f831857b..5cd22daa 100755 --- a/tileset.h +++ b/tileset.h @@ -21,9 +21,9 @@ public: QString callback_label; QString metatile_attrs_label; - QList *tiles = NULL; - QList *metatiles = NULL; - QList> *palettes = NULL; + QList *tiles = nullptr; + QList *metatiles = nullptr; + QList> *palettes = nullptr; }; class Metatile @@ -31,7 +31,7 @@ class Metatile public: Metatile(); public: - QList *tiles = NULL; + QList *tiles = nullptr; int attr; static QImage getMetatileImage(int, Tileset*, Tileset*);