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 "gba/renderers/tile-cache.h"
17}
18
19namespace QGBA {
20
21class TileView : public QWidget {
22Q_OBJECT
23
24public:
25 TileView(GameController* controller, QWidget* parent = nullptr);
26 virtual ~TileView();
27
28public slots:
29 void updateTiles(bool force = false);
30 void updatePalette(int);
31
32private slots:
33 void selectIndex(int);
34
35protected:
36 void resizeEvent(QResizeEvent*) override;
37 void showEvent(QShowEvent*) override;
38
39private:
40 Ui::TileView m_ui;
41
42 GameController* m_controller;
43 GBAVideoTileCache m_tileCache;
44 int m_paletteId;
45 QTimer m_updateTimer;
46};
47
48}
49
50#endif