diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2018-11-18 20:25:04 +0100 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2018-11-18 20:25:04 +0100 |
| commit | e7e764e7aa6ab13e7c0bb7025da5031c8fef6e47 (patch) | |
| tree | da7329464cad53b6617835a54ceb4c877e0cf864 /Source/MapEditor/mainwindow.cpp | |
| parent | 2ccc0f5edd5f8e61bd0760f30b2d66f2d977b2bf (diff) | |
Removed warning caused by implicit casting from double to int.
Windows-like path was being incorrectly used.
Added tileset.ini
Diffstat (limited to 'Source/MapEditor/mainwindow.cpp')
| -rw-r--r-- | Source/MapEditor/mainwindow.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/MapEditor/mainwindow.cpp b/Source/MapEditor/mainwindow.cpp index 2da1d1b..fe1cfaa 100644 --- a/Source/MapEditor/mainwindow.cpp +++ b/Source/MapEditor/mainwindow.cpp @@ -46,8 +46,8 @@ void MainWindow::onMapItemClicked(QPointF pos) pos.setX(pos.x() - (TILE_SIZE / 2));
- realPos.setX(pos.x() + (pos.y() * 2));
- realPos.setY((pos.y() * 2) - pos.x());
+ realPos.setX(static_cast<int>(pos.x() + (pos.y() * 2)));
+ realPos.setY(static_cast<int>((pos.y() * 2) - pos.x()));
int tile_no = 0;
@@ -238,7 +238,9 @@ void MainWindow::onProcessMapFile(QByteArray data) level_size = ch;
- QPixmap tile1("..\\..\\Sprites\\TILESET1.bmp");
+ const QString filePath = "../../Sprites/TILESET1.bmp";
+
+ QPixmap tile1(filePath);
int expected_filesize = (DATA_HEADER_SIZE + (level_size * level_size));
|
