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
24public slots:
25 void exportObj();
26
27private slots:
28 void selectObj(int);
29 void translateIndex(int);
30
31private:
32#ifdef M_CORE_GBA
33 void updateTilesGBA(bool force) override;
34#endif
35#ifdef M_CORE_GB
36 void updateTilesGB(bool force) override;
37#endif
38
39 Ui::ObjView m_ui;
40
41 GameController* m_controller;
42 mTileCacheEntry m_tileStatus[1024 * 32]; // TODO: Correct size
43 int m_objId;
44 struct ObjInfo {
45 unsigned tile;
46 unsigned width;
47 unsigned height;
48 unsigned stride;
49 unsigned paletteId;
50 unsigned paletteSet;
51 unsigned bits;
52
53 bool operator!=(const ObjInfo&);
54 } m_objInfo;
55
56 int m_tileOffset;
57};
58
59}
60
61#endif