support all values returned from PTMU_GetBatteryLevel (#116)
and change the battery images style to look more like a battery
@@ -55,6 +55,7 @@ enum TextureID {
|
|||||||
TEXTURE_FONT_RESERVED = 0, // used by pp2d for the font
|
TEXTURE_FONT_RESERVED = 0, // used by pp2d for the font
|
||||||
TEXTURE_ARROW,
|
TEXTURE_ARROW,
|
||||||
TEXTURE_SHUFFLE,
|
TEXTURE_SHUFFLE,
|
||||||
|
TEXTURE_BATTERY_0,
|
||||||
TEXTURE_BATTERY_1,
|
TEXTURE_BATTERY_1,
|
||||||
TEXTURE_BATTERY_2,
|
TEXTURE_BATTERY_2,
|
||||||
TEXTURE_BATTERY_3,
|
TEXTURE_BATTERY_3,
|
||||||
|
|||||||
BIN
romfs/battery0.png
Normal file
|
After Width: | Height: | Size: 498 B |
|
Before Width: | Height: | Size: 443 B After Width: | Height: | Size: 303 B |
|
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 319 B |
|
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 323 B |
|
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 323 B |
|
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 323 B |
@@ -41,6 +41,7 @@ void init_screens(void)
|
|||||||
|
|
||||||
pp2d_load_texture_png(TEXTURE_ARROW, "romfs:/arrow.png");
|
pp2d_load_texture_png(TEXTURE_ARROW, "romfs:/arrow.png");
|
||||||
pp2d_load_texture_png(TEXTURE_SHUFFLE, "romfs:/shuffle.png");
|
pp2d_load_texture_png(TEXTURE_SHUFFLE, "romfs:/shuffle.png");
|
||||||
|
pp2d_load_texture_png(TEXTURE_BATTERY_0, "romfs:/battery0.png");
|
||||||
pp2d_load_texture_png(TEXTURE_BATTERY_1, "romfs:/battery1.png");
|
pp2d_load_texture_png(TEXTURE_BATTERY_1, "romfs:/battery1.png");
|
||||||
pp2d_load_texture_png(TEXTURE_BATTERY_2, "romfs:/battery2.png");
|
pp2d_load_texture_png(TEXTURE_BATTERY_2, "romfs:/battery2.png");
|
||||||
pp2d_load_texture_png(TEXTURE_BATTERY_3, "romfs:/battery3.png");
|
pp2d_load_texture_png(TEXTURE_BATTERY_3, "romfs:/battery3.png");
|
||||||
@@ -71,9 +72,9 @@ static void draw_base_interface(void)
|
|||||||
#ifndef CITRA_MODE
|
#ifndef CITRA_MODE
|
||||||
u8 battery_charging = 0;
|
u8 battery_charging = 0;
|
||||||
PTMU_GetBatteryChargeState(&battery_charging);
|
PTMU_GetBatteryChargeState(&battery_charging);
|
||||||
u8 battery_status = 1;
|
u8 battery_status = 0;
|
||||||
PTMU_GetBatteryLevel(&battery_status);
|
PTMU_GetBatteryLevel(&battery_status);
|
||||||
pp2d_draw_texture(TEXTURE_BATTERY_1 + battery_status - 1, 357, 2);
|
pp2d_draw_texture(TEXTURE_BATTERY_0 + battery_status, 357, 2);
|
||||||
|
|
||||||
if(battery_charging)
|
if(battery_charging)
|
||||||
pp2d_draw_texture(TEXTURE_BATTERY_CHARGE, 357, 2);
|
pp2d_draw_texture(TEXTURE_BATTERY_CHARGE, 357, 2);
|
||||||
|
|||||||