diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2018-11-25 21:07:28 +0100 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2018-11-25 21:07:28 +0100 |
| commit | f8f976763b4d272b4801f8b99eb542caa12fc3fe (patch) | |
| tree | b7be6622c4a69d7a809305fe16a2b255090d2830 /Source/MapEditor/mainwindow.h | |
| parent | 64dbf5cdd5c16ab6ccdadcfd66949aba5b8fa1e2 (diff) | |
| download | airport-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.h | 32 |
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);
|
