1 /***************************************************************************
2     Heads-Up Display (HUD) Code
3 
4     - Score Rendering
5     - Timer Rendering
6     - Rev Rendering
7     - Minimap Rendering
8     - Text Rendering
9 
10     Copyright Chris White.
11     See license.txt for more details.
12 ***************************************************************************/
13 
14 #pragma once
15 
16 #include "outrun.hpp"
17 
18 class OHud
19 {
20 public:
21 
22     // Colours for default text palette
23     enum
24     {
25         GREY  = 0x84,
26         PINK  = 0x86,
27         GREEN = 0x92,
28     } colors;
29 
30     // Base for digits, for fast digit drawing
31     const static uint16_t DIGIT_BASE = 0x30;
32 
33     OHud(void);
34     ~OHud(void);
35 
36     void draw_main_hud();
37     void draw_fps_counter(int16_t);
38     void clear_timetrial_text();
39     void do_mini_map();
40     void draw_timer1(uint16_t);
41     void draw_timer2(uint16_t, uint32_t, uint16_t);
42     void draw_lap_timer(uint32_t, uint8_t*, uint8_t);
43     void draw_score_ingame(uint32_t);
44     void draw_score(uint32_t, const uint32_t, const uint8_t);
45     void draw_score_tile(uint32_t, const uint32_t, const uint8_t);
46     void draw_stage_number(uint32_t, uint8_t, uint16_t col = GREEN);
47     void draw_rev_counter();
48     void draw_debug_info(uint32_t pos, uint16_t height_pat, uint8_t sprite_pat);
49 	void blit_text1(uint32_t);
50     void blit_text1(uint8_t x, uint8_t y, uint32_t src_addr);
51 	void blit_text2(uint32_t);
52     void blit_text_big(const uint8_t Y, const char* text, bool do_notes = false);
53     void blit_text_new(uint16_t, uint16_t, const char* text, uint16_t col = GREY);
54     void blit_speed(uint32_t, uint16_t);
55     void blit_large_digit(uint32_t*, uint8_t);
56 	void draw_copyright_text();
57     void draw_insert_coin();
58     void draw_credits();
59     uint32_t setup_mini_map();
60     uint32_t translate(const uint16_t x, const uint16_t y, const uint32_t BASE_POS = 0x110030);
61 
62 private:
63     void draw_mini_map(uint32_t);
64 };
65 
66 extern OHud ohud;