aboutsummaryrefslogtreecommitdiff
path: root/Source/MapEditor/mainwindow.h
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2018-11-25 21:07:28 +0100
committerXavier ASUS <xavi92psx@gmail.com>2018-11-25 21:07:28 +0100
commitf8f976763b4d272b4801f8b99eb542caa12fc3fe (patch)
treeb7be6622c4a69d7a809305fe16a2b255090d2830 /Source/MapEditor/mainwindow.h
parent64dbf5cdd5c16ab6ccdadcfd66949aba5b8fa1e2 (diff)
downloadairport-f8f976763b4d272b4801f8b99eb542caa12fc3fe.tar.gz
Removed city background.
Fixed some serious issues regarding building and tile data.
Diffstat (limited to 'Source/MapEditor/mainwindow.h')
-rw-r--r--Source/MapEditor/mainwindow.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/Source/MapEditor/mainwindow.h b/Source/MapEditor/mainwindow.h
index 97e39ef..6b27128 100644
--- a/Source/MapEditor/mainwindow.h
+++ b/Source/MapEditor/mainwindow.h
@@ -33,11 +33,39 @@ public:
void closeEvent(QCloseEvent*);
private:
+ struct IsometricPos
+ {
+ short x;
+ short y;
+ short z;
+ };
+
+ struct CartesianPos
+ {
+ short x;
+ short y;
+ };
+
bool checkFile(QFile &f, QFile::OpenModeFlag flags = QFile::ReadOnly);
void appSettings(void);
void loadTilesetData(void);
void loadBuildingData(void);
- void parseMapData(QDataStream &ds, const QPixmap &tileSet, const QPixmap &tileSet2);
+ void parseMapData(QDataStream &ds);
+ void addTile(quint8 CurrentTile, const int i, const int j);
+ void addBuilding(quint8 CurrentBuilding, const int i, const int j);
+ CartesianPos isometricToCartesian(const IsometricPos& ptrIsoPos) const
+ {
+ CartesianPos retCartPos;
+
+ retCartPos.x = ptrIsoPos.x - (ptrIsoPos.x >> 1);
+ retCartPos.x -= ptrIsoPos.y >> 1;
+
+ retCartPos.y = ptrIsoPos.y >> 2;
+ retCartPos.y += ptrIsoPos.x >> 2;
+ retCartPos.y -= ptrIsoPos.z;
+
+ return retCartPos;
+ }
Ui::MainWindow ui;
QString _last_dir;
@@ -46,10 +74,12 @@ private:
QByteArray map_buffer;
int selected_item;
QHash<int, QString> tilesetData;
+ QHash<int, QString> buildingData;
QList<QGraphicsTextItem*> textItems;
QShortcut tileSet;
QShortcut tileMoveUp;
QString tilesetPaths[2];
+ QString buildingPath;
private slots:
void loadMap(void);