Reimplemented switch battery hud

This commit is contained in:
KiritoDev 2021-06-20 12:31:44 -05:00
parent 39859aff11
commit af74e37b4c
2 changed files with 12 additions and 12 deletions

View File

@ -441,19 +441,19 @@ void render_hud_camera_status(void) {
#ifdef TARGET_SWITCH
#define COLOR(r, g, b) (struct Color) {r, g, b, 255}
void render_nx_hud(void){
s16 x = 40;
s16 y = 212;
s16 w = x + 12;
s16 h = y + 4;
struct Color color;
//color = { .r = 57, .g = 57, .b = 57, .a = 255 }
//moon_draw_rectangle(x - 1, y - 1, w + 1, h + 1, COLOR(57, 57, 57, 255));
//moon_draw_rectangle(w, y, w + 2, y + 4, color);
//color = { .r = 57, .g = 57, .b = 57, .a = 255 }
//moon_draw_rectangle(x, y, w, h, COLOR(194, 194, 194, 255));
//color = { .r = 57, .g = 57, .b = 57, .a = 255 }
//moon_draw_rectangle(x, y, x + (s16)(12 * getBatteryPercentage()), h, COLOR(78, 235, 52, 255));
float y = 212.5;
s16 w = 12;
s16 h = 6;
float battery = getBatteryPercentage();
moon_draw_rectangle(x - 1, y - 1, w + 2, h + 1, COLOR(57, 57, 57), false);
moon_draw_rectangle(x + w, y + 0.5, 2, 4, COLOR(57, 57, 57), false);
moon_draw_rectangle(x, y, w, h - 1, COLOR(194, 194, 194), false);
moon_draw_rectangle(x, y, (w * battery), h - 1, COLOR(76, 235, 52), false);
x = GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(20);
y = 207;

View File

@ -109,7 +109,7 @@ static void controller_sdl_init(void) {
if (rw) {
int nummaps = SDL_GameControllerAddMappingsFromRW(rw, SDL_TRUE);
if (nummaps >= 0)
printf("loaded %d controller mappings from 'db/gamecontrollerdb.txt'\n", nummaps);
printf("[Moon64 - SDL] Loaded %d controller mappings\n", nummaps);
}
}
#endif