Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed FATFileSystem
Diff: Menu/Menu.h
- Revision:
- 13:681192091568
- Parent:
- 12:7f7fadb5c106
- Child:
- 14:08ac9aaa34c3
diff -r 7f7fadb5c106 -r 681192091568 Menu/Menu.h
--- a/Menu/Menu.h Fri May 03 09:39:24 2019 +0000
+++ b/Menu/Menu.h Mon May 06 10:00:57 2019 +0000
@@ -4,6 +4,8 @@
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
+#include "SDFileSystem.h"
+#include <algorithm>
/** Menu Class
* @brief Library for navigating menu options
@@ -28,25 +30,10 @@
void print_welcome(N5110 &lcd);
/** Prints menu screen */
- void menu_screen(Gamepad &pad, N5110 &lcd);
-
- /** Prints start screen */
- bool start_screen(N5110 &lcd, Gamepad &pad);
-
- /** Prints highscore screen */
- void highscores_screen(N5110 &lcd, Gamepad &pad);
+ bool menu_loop(Gamepad &pad, N5110 &lcd, SDFileSystem &sd);
- /** Prints settings screen */
- void settings_screen(N5110 &lcd, Gamepad &pad);
-
- /** Changes screen to menu choice and returns start game message
- * @returns a bool: true to start game, false to stay in menu
- */
- bool menu_change(N5110 &lcd, Gamepad &pad);
-
- /** Updates cursor and returns menu choice*/
- void cursor_select(Gamepad &pad, N5110 &lcd);
-
+ void highscores_loop(Gamepad &pad, N5110 &lcd, SDFileSystem &sd);
+
/** Returns frame rate
* @returns frame rate chosen in settings
*/
@@ -54,12 +41,22 @@
private:
- void drawSettings(N5110 &lcd, Gamepad &pad);
+ void read_input(Gamepad &pad);
+
+ void sd_read(SDFileSystem &sd);
+
+ bool menu_change(Gamepad &pad, N5110 &lcd, SDFileSystem &sd);
+
+ bool start_loop(Gamepad &pad, N5110 &lcd);
+
+ void settings_loop(Gamepad &pad, N5110 &lcd, SDFileSystem &sd);
+
+ void drawSettings(N5110 &lcd);
void drawSettingsBars(N5110 &lcd);
void move_cursor(N5110 &lcd);
-
+
void drawCursor(N5110 &lcd);
int _cursor_pos;
@@ -72,6 +69,8 @@
int _frame_rate;
+ int *_highscores_array;
+
Direction _joy_direction;
};