From e7e764e7aa6ab13e7c0bb7025da5031c8fef6e47 Mon Sep 17 00:00:00 2001 From: Xavier ASUS Date: Sun, 18 Nov 2018 20:25:04 +0100 Subject: Removed warning caused by implicit casting from double to int. Windows-like path was being incorrectly used. Added tileset.ini --- Source/MapEditor/MapEditor.pro | 2 +- Source/MapEditor/MapEditor.pro.user | 338 ++++++++++++++++++++++++++++++++++++ Source/MapEditor/mainwindow.cpp | 8 +- Source/MapEditor/settings.ini | 4 +- Source/MapEditor/tileset.ini | 40 ++--- 5 files changed, 366 insertions(+), 26 deletions(-) create mode 100644 Source/MapEditor/MapEditor.pro.user mode change 100644 => 100755 Source/MapEditor/tileset.ini (limited to 'Source/MapEditor') diff --git a/Source/MapEditor/MapEditor.pro b/Source/MapEditor/MapEditor.pro index cce1ab2..3a7473f 100644 --- a/Source/MapEditor/MapEditor.pro +++ b/Source/MapEditor/MapEditor.pro @@ -10,7 +10,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = MapEditor TEMPLATE = app - +CONFIG += static SOURCES += main.cpp\ mainwindow.cpp \ diff --git a/Source/MapEditor/MapEditor.pro.user b/Source/MapEditor/MapEditor.pro.user new file mode 100644 index 0000000..9e4bfd4 --- /dev/null +++ b/Source/MapEditor/MapEditor.pro.user @@ -0,0 +1,338 @@ + + + + + + EnvironmentId + {d6535ac5-a5f5-4846-9e3e-4106349e1444} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.0 GCC 64bit + Desktop Qt 5.12.0 GCC 64bit + qt.qt5.5120.gcc_64_kit + 0 + 0 + 0 + + /home/xavier/Airport/Source/build-MapEditor-Desktop_Qt_5_12_0_GCC_64bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/xavier/Airport/Source/build-MapEditor-Desktop_Qt_5_12_0_GCC_64bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/xavier/Airport/Source/build-MapEditor-Desktop_Qt_5_12_0_GCC_64bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + MapEditor + + Qt4ProjectManager.Qt4RunConfiguration:/home/xavier/Airport/Source/MapEditor/MapEditor.pro + true + + MapEditor.pro + /home/xavier/Airport/Source/MapEditor + /home/xavier/Airport/Source/build-MapEditor-Desktop_Qt_5_12_0_GCC_64bit-Debug + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + + 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(pos.x() + (pos.y() * 2))); + realPos.setY(static_cast((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)); diff --git a/Source/MapEditor/settings.ini b/Source/MapEditor/settings.ini index 83bee36..c825412 100644 --- a/Source/MapEditor/settings.ini +++ b/Source/MapEditor/settings.ini @@ -1,2 +1,2 @@ -[app_settings] -last_dir=C:/cygwin/home/Xavier/Airport/Levels/TEST_LEVEL2.LVL +[app_settings] +last_dir=/home/xavier/Airport/Levels/LEVEL2.LVL diff --git a/Source/MapEditor/tileset.ini b/Source/MapEditor/tileset.ini old mode 100644 new mode 100755 index 81fe066..488e023 --- a/Source/MapEditor/tileset.ini +++ b/Source/MapEditor/tileset.ini @@ -1,21 +1,21 @@ -[tileset1] -tile0 = "Grass" -tile1 = "Asphalt with borders" -tile2 = "Water" -tile3 = "Asphalt" -tile4 = "Runway mid" -tile5 = "Runway start/end 1" -tile6 = "Runway start/end 2" -tile7 = "Parking 1" -tile8 = "Parking 2" -tile9 = "Taxiway crossing, grass border" -tile10 = "Taxiway, grass border" -tile11 = "Taxiway corner, grass border 1" -tile12 = "Water grass border 1" -tile13 = "Water grass border 2" -tile14 = "Runway holding point 1" -tile15 = "Runway holding point 2" -tile16 = "Runway enter/exit, asphalt border 1" -tile17 = "Taxiway corner, grass border 2" -tile18 = "Taxiway 4-way crossing, grass border" +[tileset1] +tile0 = "Grass" +tile1 = "Asphalt with borders" +tile2 = "Water" +tile3 = "Asphalt" +tile4 = "Runway mid" +tile5 = "Runway start/end 1" +tile6 = "Runway start/end 2" +tile7 = "Parking 1" +tile8 = "Parking 2" +tile9 = "Taxiway crossing, grass border" +tile10 = "Taxiway, grass border" +tile11 = "Taxiway corner, grass border 1" +tile12 = "Water grass border 1" +tile13 = "Water grass border 2" +tile14 = "Runway holding point 1" +tile15 = "Runway holding point 2" +tile16 = "Runway enter/exit, asphalt border 1" +tile17 = "Taxiway corner, grass border 2" +tile18 = "Taxiway 4-way crossing, grass border" tile19 = "Runway enter/exit, asphalt border 2" \ No newline at end of file -- cgit v1.2.3