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#ifndef QGBA_OBJ_VIEW
7#define QGBA_OBJ_VIEW
8
9#include "AssetView.h"
10
11#include "ui_ObjView.h"
12
13#include <mgba/core/tile-cache.h>
14
15namespace QGBA {
16
17class CoreController;
18
19class ObjView : public AssetView {
20Q_OBJECT
21
22public:
23 ObjView(std::shared_ptr<CoreController> controller, QWidget* parent = nullptr);
24
25#ifdef USE_PNG
26public slots:
27 void exportObj();
28#endif
29
30private slots:
31 void selectObj(int);
32 void translateIndex(int);
33
34private:
35#ifdef M_CORE_GBA
36 void updateTilesGBA(bool force) override;
37#endif
38#ifdef M_CORE_GB
39 void updateTilesGB(bool force) override;
40#endif
41
42 Ui::ObjView m_ui;
43
44 std::shared_ptr<CoreController> m_controller;
45 mTileCacheEntry m_tileStatus[1024 * 32] = {}; // TODO: Correct size
46 int m_objId = 0;
47 struct ObjInfo {
48 unsigned tile;
49 unsigned width;
50 unsigned height;
51 unsigned stride;
52 unsigned paletteId;
53 unsigned paletteSet;
54 unsigned bits;
55
56 bool operator!=(const ObjInfo&);
57 } m_objInfo = {};
58
59 int m_tileOffset;
60};
61
62}
63
64#endif