diff options
Diffstat (limited to 'vr_ui.cpp')
-rw-r--r-- | vr_ui.cpp | 44 |
1 files changed, 37 insertions, 7 deletions
@@ -20,16 +20,46 @@ | |||
20 | 20 | ||
21 | VrRecoveryUI::VrRecoveryUI() : kStereoOffset(RECOVERY_UI_VR_STEREO_OFFSET) {} | 21 | VrRecoveryUI::VrRecoveryUI() : kStereoOffset(RECOVERY_UI_VR_STEREO_OFFSET) {} |
22 | 22 | ||
23 | bool VrRecoveryUI::InitTextParams() { | 23 | int VrRecoveryUI::ScreenWidth() const { |
24 | if (!ScreenRecoveryUI::InitTextParams()) return false; | 24 | return gr_fb_width() / 2; |
25 | int mid_divide = gr_fb_width() / 2; | 25 | } |
26 | text_cols_ = (mid_divide - kMarginWidth - kStereoOffset) / char_width_; | 26 | |
27 | return true; | 27 | int VrRecoveryUI::ScreenHeight() const { |
28 | return gr_fb_height(); | ||
29 | } | ||
30 | |||
31 | void VrRecoveryUI::DrawSurface(GRSurface* surface, int sx, int sy, int w, int h, int dx, | ||
32 | int dy) const { | ||
33 | gr_blit(surface, sx, sy, w, h, dx + kStereoOffset, dy); | ||
34 | gr_blit(surface, sx, sy, w, h, dx - kStereoOffset + ScreenWidth(), dy); | ||
35 | } | ||
36 | |||
37 | void VrRecoveryUI::DrawTextIcon(int x, int y, GRSurface* surface) const { | ||
38 | gr_texticon(x + kStereoOffset, y, surface); | ||
39 | gr_texticon(x - kStereoOffset + ScreenWidth(), y, surface); | ||
28 | } | 40 | } |
29 | 41 | ||
30 | int VrRecoveryUI::DrawTextLine(int x, int y, const char* line, bool bold) const { | 42 | int VrRecoveryUI::DrawTextLine(int x, int y, const char* line, bool bold) const { |
31 | int mid_divide = gr_fb_width() / 2; | ||
32 | gr_text(gr_sys_font(), x + kStereoOffset, y, line, bold); | 43 | gr_text(gr_sys_font(), x + kStereoOffset, y, line, bold); |
33 | gr_text(gr_sys_font(), x - kStereoOffset + mid_divide, y, line, bold); | 44 | gr_text(gr_sys_font(), x - kStereoOffset + ScreenWidth(), y, line, bold); |
34 | return char_height_ + 4; | 45 | return char_height_ + 4; |
35 | } | 46 | } |
47 | |||
48 | int VrRecoveryUI::DrawHorizontalRule(int y) const { | ||
49 | y += 4; | ||
50 | gr_fill(kMarginWidth + kStereoOffset, y, ScreenWidth() - kMarginWidth + kStereoOffset, y + 2); | ||
51 | gr_fill(ScreenWidth() + kMarginWidth - kStereoOffset, y, | ||
52 | gr_fb_width() - kMarginWidth - kStereoOffset, y + 2); | ||
53 | return y + 4; | ||
54 | } | ||
55 | |||
56 | void VrRecoveryUI::DrawHighlightBar(int x, int y, int width, int height) const { | ||
57 | gr_fill(kMarginWidth + kStereoOffset, y, ScreenWidth() - kMarginWidth + kStereoOffset, y + height); | ||
58 | gr_fill(ScreenWidth() + kMarginWidth - kStereoOffset, y, | ||
59 | gr_fb_width() - kMarginWidth - kStereoOffset, y + height); | ||
60 | } | ||
61 | |||
62 | void VrRecoveryUI::DrawFill(int x, int y, int w, int h) const { | ||
63 | gr_fill(x + kStereoOffset, y, w, h); | ||
64 | gr_fill(x - kStereoOffset + ScreenWidth(), y, w, h); | ||
65 | } | ||