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