-
Notifications
You must be signed in to change notification settings - Fork 0
/
nt3screen.h
executable file
·81 lines (51 loc) · 2 KB
/
nt3screen.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef NT3SCREEN_H
#define NT3SCREEN_H
#include <QResizeEvent>
#include <QPainter>
#include <QScreen>
#include <QMediaPlayer>
#include <QAudioOutput>
#include "common.h"
#include "imagefont.h"
class NT3Screen : public QObject
{
Q_OBJECT
public:
explicit NT3Screen(QObject *parent = nullptr);
virtual ~NT3Screen();
virtual void init();
virtual void calcScaleFactors();
virtual void render(QPainter& painter);
virtual void colorizeResources();
virtual void keyPressEvent(QKeyEvent* ev);
virtual void keyReleaseEvent(QKeyEvent* ev);
virtual void doGameStep();
virtual void resetBlinkTimer();
bool lockAR(QSize newSize);
QPixmap colorize(QPixmap pixmap);
QUrl music_path;
const double select_blink_rate = 0.29; //seconds
double blink_timer = 0;
bool blink_on;
ImageFont BOW_font = ImageFont(
"0123456789abcdefghijklmnopqrstTuvwxyz.,'C-#_>:<! ",
QImage(":/resources/graphics/font.png")
);
ImageFont WOB_font = ImageFont(
"0123456789abcdefghijklmnopqrstTuvwxyz.,'C-#_>:<!+ ",
QImage(":/resources/graphics/fontwhite.png")
);
QRectF ui_field_in = QRectF(0, 0, 160, 144);
QRectF ui_field_px = SCALE_QRECTF(ui_field_in, 1);
double aspect_ratio = ui_field_in.width()*1.0/ui_field_in.height();
double aspect_ratio_epsilon = aspect_ratio - (ui_field_in.width()-1)*1.0/ui_field_in.height();
const double min_graphics_scale_px_in = 1;
double ui_to_screen_scale_px_in = min_graphics_scale_px_in;
const QString default_option_name = "error";
signals:
void close();
void stateEnd(NT3_state_enum nextState, bool stopMusic = true);
void resize(const QSize size);
void changeMusic(QUrl new_path);
};
#endif // NT3SCREEN_H