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