all repos — mgba @ 1ac4a716cc6d0d5ec7ec3733116d28d45049b5fd

mGBA Game Boy Advance Emulator

src/platform/qt/TileView.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_TILE_VIEW
 7#define QGBA_TILE_VIEW
 8
 9#include <QWidget>
10
11#include "GameController.h"
12
13#include "ui_TileView.h"
14
15extern "C" {
16#include "core/tile-cache.h"
17}
18
19namespace QGBA {
20
21class TileView : public QWidget {
22Q_OBJECT
23
24public:
25	TileView(GameController* controller, QWidget* parent = nullptr);
26
27public slots:
28	void updateTiles(bool force = false);
29	void updatePalette(int);
30
31private slots:
32	void selectIndex(int);
33
34protected:
35	void resizeEvent(QResizeEvent*) override;
36	void showEvent(QShowEvent*) override;
37
38private:
39#ifdef M_CORE_GBA
40	void updateTilesGBA(bool force);
41#endif
42#ifdef M_CORE_GB
43	void updateTilesGB(bool force);
44#endif
45
46	Ui::TileView m_ui;
47
48	GameController* m_controller;
49	std::shared_ptr<mTileCache> m_tileCache;
50	mTileCacheEntry m_tileStatus[3072 * 32]; // TODO: Correct size
51	int m_paletteId;
52	QTimer m_updateTimer;
53};
54
55}
56
57#endif