src/platform/qt/MapView.h (view raw)
1/* Copyright (c) 2013-2017 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#pragma once
7
8#include "AssetView.h"
9
10#include "ui_MapView.h"
11
12#include <mgba/core/map-cache.h>
13
14namespace QGBA {
15
16class CoreController;
17
18class MapView : public AssetView {
19Q_OBJECT
20
21public:
22 MapView(std::shared_ptr<CoreController> controller, QWidget* parent = nullptr);
23
24#ifdef USE_PNG
25public slots:
26 void exportMap();
27#endif
28
29private slots:
30 void selectMap(int);
31 void selectTile(int x, int y);
32
33protected:
34 bool eventFilter(QObject*, QEvent*) override;
35
36private:
37#ifdef M_CORE_GBA
38 void updateTilesGBA(bool force) override;
39#endif
40#ifdef M_CORE_GB
41 void updateTilesGB(bool force) override;
42#endif
43
44 Ui::MapView m_ui;
45
46 std::shared_ptr<CoreController> m_controller;
47 mMapCacheEntry m_mapStatus[128 * 128] = {}; // TODO: Correct size
48 mBitmapCacheEntry m_bitmapStatus[512 * 2] = {}; // TODO: Correct size
49 int m_map = 0;
50 QImage m_rawMap;
51 int m_boundary;
52 int m_addressBase;
53 int m_addressWidth;
54};
55
56}