| 1 | #ifndef SPRITEVIEWER_H |
| 2 | #define SPRITEVIEWER_H |
| 3 | |
| 4 | #include "ui_SpriteViewer.h" |
| 5 | #include <QDialog> |
| 6 | #include <cstdint> |
| 7 | #include <memory> |
| 8 | |
| 9 | class VramSpriteView; |
| 10 | |
| 11 | class SpriteViewer : public QDialog |
| 12 | { |
| 13 | Q_OBJECT |
| 14 | public: |
| 15 | explicit SpriteViewer(QWidget* parent = nullptr); |
| 16 | |
| 17 | void refresh(); |
| 18 | |
| 19 | private: |
| 20 | void VDPDataStoreDataRefreshed(); |
| 21 | void pgtwidget_mouseMoveEvent(int x, int y, int character); |
| 22 | void pgtwidget_mouseClickedEvent(int x, int y, int character, const QString& text); |
| 23 | void spatwidget_mouseMoveEvent(int x, int y, int character); |
| 24 | void spatwidget_mouseClickedEvent(int x, int y, int character, const QString& text); |
| 25 | |
| 26 | void setDrawGrid(int state); |
| 27 | |
| 28 | void on_le_patterntable_textChanged(const QString& arg1); |
| 29 | void on_le_attributentable_textChanged(const QString& arg1); |
| 30 | void on_useVDPRegisters_toggled(bool checked); |
| 31 | void on_cb_size_currentIndexChanged(int index); |
| 32 | void on_cb_spritemode_currentIndexChanged(int index); |
| 33 | void on_le_colortable_textChanged(const QString& arg1); |
| 34 | void on_sp_zoom_valueChanged(int arg1); |
| 35 | void on_cb_ecinfluence_toggled(bool checked); |
| 36 | void on_cb_mag_currentIndexChanged(int index); |
| 37 | void on_cb_alwaysShowColorTable_toggled(bool checked); |
| 38 | void on_useVDPPalette_stateChanged(int state); |
| 39 | void on_editPaletteButton_clicked(bool checked); |
| 40 | |
| 41 | void setPaletteSource(const uint8_t* palSource, bool useVDP); |
| 42 | void decodeVDPregs(); |
| 43 | void setCorrectEnabled(bool checked); |
| 44 | void setCorrectVDPData(); |
| 45 | |
| 46 | private: |
| 47 | static uint8_t defaultPalette[32]; |
| 48 | |
| 49 | std::unique_ptr<Ui::SpriteViewer> ui; |
| 50 | VramSpriteView* imageWidget; |
| 51 | VramSpriteView* imageWidgetSingle; |
| 52 | VramSpriteView* imageWidgetSpat; |
| 53 | VramSpriteView* imageWidgetColor; |
| 54 | |
| 55 | int spriteMode = 0; |
| 56 | bool size16x16 = false; |
| 57 | bool magnified = false; |
| 58 | bool spritesEnabled = false; |
| 59 | int spAtAddr = 0; |
| 60 | int pgtAddr = 0; |
| 61 | int spColAddr = 0; |
| 62 | }; |
| 63 | |
| 64 | #endif // SPRITEVIEWER_H |