all repos — mgba @ db2b56f418359e03f0505bac5e894cf821989cc3

mGBA Game Boy Advance Emulator

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 <mgba/core/tile-cache.h>
13
14namespace QGBA {
15
16class CoreController;
17
18class ObjView : public AssetView {
19Q_OBJECT
20
21public:
22	ObjView(std::shared_ptr<CoreController> 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	std::shared_ptr<CoreController> 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	int m_boundary;
60};
61
62}