all repos — mgba @ ae60489d990dfaf413846958aa08c971ff6ecaf3

mGBA Game Boy Advance Emulator

src/platform/qt/AssetView.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_ASSET_VIEW
 7#define QGBA_ASSET_VIEW
 8
 9#include <QWidget>
10
11#include "GameController.h"
12
13namespace QGBA {
14
15class AssetView : public QWidget {
16Q_OBJECT
17
18public:
19	AssetView(GameController* controller, QWidget* parent = nullptr);
20
21	void compositeTile(unsigned tileId, void* image, size_t stride, size_t x, size_t y, int depth = 8);
22
23protected slots:
24	void updateTiles(bool force = false);
25
26protected:
27#ifdef M_CORE_GBA
28	virtual void updateTilesGBA(bool force) = 0;
29#endif
30#ifdef M_CORE_GB
31	virtual void updateTilesGB(bool force) = 0;
32#endif
33
34	void resizeEvent(QResizeEvent*) override;
35	void showEvent(QShowEvent*) override;
36
37	const std::shared_ptr<mTileCache> m_tileCache;
38
39private:
40	GameController* m_controller;
41	QTimer m_updateTimer;
42};
43
44}
45
46#endif