![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Game For ECE 2035
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
speech.cpp@0:35660d7952f7, 2018-03-30 (annotated)
- Committer:
- rconnorlawson
- Date:
- Fri Mar 30 17:07:25 2018 +0000
- Revision:
- 0:35660d7952f7
- Child:
- 4:37d3935365f8
Hollowed out shell code.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rconnorlawson | 0:35660d7952f7 | 1 | #include "speech.h" |
rconnorlawson | 0:35660d7952f7 | 2 | |
rconnorlawson | 0:35660d7952f7 | 3 | #include "globals.h" |
rconnorlawson | 0:35660d7952f7 | 4 | #include "hardware.h" |
rconnorlawson | 0:35660d7952f7 | 5 | |
rconnorlawson | 0:35660d7952f7 | 6 | /** |
rconnorlawson | 0:35660d7952f7 | 7 | * Draw the speech bubble background. |
rconnorlawson | 0:35660d7952f7 | 8 | */ |
rconnorlawson | 0:35660d7952f7 | 9 | static void draw_speech_bubble(); |
rconnorlawson | 0:35660d7952f7 | 10 | |
rconnorlawson | 0:35660d7952f7 | 11 | /** |
rconnorlawson | 0:35660d7952f7 | 12 | * Erase the speech bubble. |
rconnorlawson | 0:35660d7952f7 | 13 | */ |
rconnorlawson | 0:35660d7952f7 | 14 | static void erase_speech_bubble(); |
rconnorlawson | 0:35660d7952f7 | 15 | |
rconnorlawson | 0:35660d7952f7 | 16 | /** |
rconnorlawson | 0:35660d7952f7 | 17 | * Draw a single line of the speech bubble. |
rconnorlawson | 0:35660d7952f7 | 18 | * @param line The text to display |
rconnorlawson | 0:35660d7952f7 | 19 | * @param which If TOP, the first line; if BOTTOM, the second line. |
rconnorlawson | 0:35660d7952f7 | 20 | */ |
rconnorlawson | 0:35660d7952f7 | 21 | #define TOP 0 |
rconnorlawson | 0:35660d7952f7 | 22 | #define BOTTOM 1 |
rconnorlawson | 0:35660d7952f7 | 23 | static void draw_speech_line(const char* line, int which); |
rconnorlawson | 0:35660d7952f7 | 24 | |
rconnorlawson | 0:35660d7952f7 | 25 | /** |
rconnorlawson | 0:35660d7952f7 | 26 | * Delay until it is time to scroll. |
rconnorlawson | 0:35660d7952f7 | 27 | */ |
rconnorlawson | 0:35660d7952f7 | 28 | static void speech_bubble_wait(); |
rconnorlawson | 0:35660d7952f7 | 29 | |
rconnorlawson | 0:35660d7952f7 | 30 | void draw_speech_bubble() |
rconnorlawson | 0:35660d7952f7 | 31 | { |
rconnorlawson | 0:35660d7952f7 | 32 | } |
rconnorlawson | 0:35660d7952f7 | 33 | |
rconnorlawson | 0:35660d7952f7 | 34 | void erase_speech_bubble() |
rconnorlawson | 0:35660d7952f7 | 35 | { |
rconnorlawson | 0:35660d7952f7 | 36 | } |
rconnorlawson | 0:35660d7952f7 | 37 | |
rconnorlawson | 0:35660d7952f7 | 38 | void draw_speech_line(const char* line, int which) |
rconnorlawson | 0:35660d7952f7 | 39 | { |
rconnorlawson | 0:35660d7952f7 | 40 | } |
rconnorlawson | 0:35660d7952f7 | 41 | |
rconnorlawson | 0:35660d7952f7 | 42 | void speech_bubble_wait() |
rconnorlawson | 0:35660d7952f7 | 43 | { |
rconnorlawson | 0:35660d7952f7 | 44 | } |
rconnorlawson | 0:35660d7952f7 | 45 | |
rconnorlawson | 0:35660d7952f7 | 46 | void speech(const char* line1, const char* line2) |
rconnorlawson | 0:35660d7952f7 | 47 | { |
rconnorlawson | 0:35660d7952f7 | 48 | draw_speech_bubble(); |
rconnorlawson | 0:35660d7952f7 | 49 | draw_speech_line(line1, TOP); |
rconnorlawson | 0:35660d7952f7 | 50 | draw_speech_line(line2, BOTTOM); |
rconnorlawson | 0:35660d7952f7 | 51 | speech_bubble_wait(); |
rconnorlawson | 0:35660d7952f7 | 52 | erase_speech_bubble(); |
rconnorlawson | 0:35660d7952f7 | 53 | } |
rconnorlawson | 0:35660d7952f7 | 54 | |
rconnorlawson | 0:35660d7952f7 | 55 | void long_speech(const char* lines[], int n) |
rconnorlawson | 0:35660d7952f7 | 56 | { |
rconnorlawson | 0:35660d7952f7 | 57 | } |