src/platform/qt/ObjView.h (view raw)
1/* Copyright (c) 2013-2016 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_ObjView.h"
11
12#include <QList>
13
14#include <mgba/core/tile-cache.h>
15
16class QListWidgetItem;
17
18namespace QGBA {
19
20class CoreController;
21
22class ObjView : public AssetView {
23Q_OBJECT
24
25public:
26 ObjView(std::shared_ptr<CoreController> controller, QWidget* parent = nullptr);
27
28public slots:
29 void exportObj();
30 void copyObj();
31
32private slots:
33 void selectObj(int);
34 void translateIndex(int);
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 void updateObjList(int maxObj);
45
46 Ui::ObjView m_ui;
47
48 std::shared_ptr<CoreController> m_controller;
49 mTileCacheEntry m_tileStatus[1024 * 32] = {}; // TODO: Correct size
50 int m_objId = 0;
51 ObjInfo m_objInfo = {};
52
53 QList<QListWidgetItem*> m_objs;
54
55 int m_tileOffset;
56 int m_boundary;
57};
58
59}