Fix more warnings

This commit is contained in:
Marcus Huderle 2018-09-14 18:37:44 -05:00
parent 0b07ea63cb
commit a2d95bfc72
11 changed files with 35 additions and 47 deletions

View file

@ -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<Block> *blocks = NULL;
QList<Block> *blocks = nullptr;
void addBlock(uint16_t);
void addBlock(Block);
QByteArray serialize();

View file

@ -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<uint16_t>(x), static_cast<uint16_t>(y));
}
void MovementPermissionsPixmapItem::mouseMoveEvent(QGraphicsSceneMouseEvent* event) {
updateCurHoveredMetatile(event->pos());

View file

@ -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();

View file

@ -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) {

View file

@ -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:

View file

@ -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<QStandardItem*> *mapGroupsModel;
Editor *editor = NULL;
Editor *editor = nullptr;
QIcon* mapIcon;
void setMap(QString);
void redrawMapScene();

16
map.h
View file

@ -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;

View file

@ -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:

View file

@ -12,7 +12,7 @@ class ObjectPropertiesFrame : public QFrame
Q_OBJECT
public:
explicit ObjectPropertiesFrame(QWidget *parent = 0);
explicit ObjectPropertiesFrame(QWidget *parent = nullptr);
~ObjectPropertiesFrame();
public:

View file

@ -14,10 +14,10 @@ class Project
public:
Project();
QString root;
QStringList *groupNames = NULL;
QStringList *groupNames = nullptr;
QMap<QString, int> *map_groups;
QList<QStringList> groupedMapNames;
QStringList *mapNames = NULL;
QStringList *mapNames = nullptr;
QList<HealLocation> flyableMaps;
QMap<QString, QString>* mapConstantsToMapNames;
QMap<QString, QString>* mapNamesToMapConstants;
@ -25,24 +25,24 @@ public:
QList<QString> mapLayoutsTableMaster;
QMap<QString, MapLayout*> mapLayouts;
QMap<QString, MapLayout*> 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<QString, Map*> *map_cache;
Map* loadMap(QString);
Map* getMap(QString);
QMap<QString, Tileset*> *tileset_cache = NULL;
QMap<QString, Tileset*> *tileset_cache = nullptr;
Tileset* loadTileset(QString);
Tileset* getTileset(QString);

View file

@ -21,9 +21,9 @@ public:
QString callback_label;
QString metatile_attrs_label;
QList<QImage> *tiles = NULL;
QList<Metatile*> *metatiles = NULL;
QList<QList<QRgb>> *palettes = NULL;
QList<QImage> *tiles = nullptr;
QList<Metatile*> *metatiles = nullptr;
QList<QList<QRgb>> *palettes = nullptr;
};
class Metatile
@ -31,7 +31,7 @@ class Metatile
public:
Metatile();
public:
QList<Tile> *tiles = NULL;
QList<Tile> *tiles = nullptr;
int attr;
static QImage getMetatileImage(int, Tileset*, Tileset*);