mirror of
https://github.com/joel16/CMFileManager-PSP.git
synced 2024-11-23 03:39:42 +00:00
app/launcher/libs: Clean up imports and display battery percent if battery is present
This commit is contained in:
parent
40127cee08
commit
8affe7f631
@ -1,6 +1,8 @@
|
||||
#ifndef _CMFILEMANAGER_ARCHIVE_HELPER_H_
|
||||
#define _CMFILEMANAGER_ARCHIVE_HELPER_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace ArchiveHelper {
|
||||
int Extract(const std::string &path);
|
||||
}
|
||||
|
@ -38,9 +38,12 @@ namespace GUI {
|
||||
G2D::FontSetStyle(1.f, WHITE, INTRAFONT_ALIGN_LEFT);
|
||||
G2D::DrawText(5, 14, time_string);
|
||||
|
||||
int state = scePowerIsBatteryCharging();
|
||||
int percent = scePowerGetBatteryLifePercent();
|
||||
int battery_val = (percent / 20);
|
||||
int state = 0, percent = 0, battery_val = 0;
|
||||
if (scePowerIsBatteryExist()) {
|
||||
state = scePowerIsBatteryCharging();
|
||||
percent = scePowerGetBatteryLifePercent();
|
||||
battery_val = (percent / 20);
|
||||
}
|
||||
|
||||
static char percent_string[10];
|
||||
std::snprintf(percent_string, 10, "%d", percent);
|
||||
|
@ -168,7 +168,7 @@ namespace AudioPlayer {
|
||||
G2D::DrawText(455 - length_time_width, 240, length_time);
|
||||
|
||||
G2D::DrawRect(230, 245, 225, 2, G2D_RGBA(97, 97, 97, 150));
|
||||
G2D::DrawRect(230, 245, ((static_cast<double>(Audio::GetPosition())/static_cast<double>(Audio::GetLength())) * 225.0), 2, WHITE);
|
||||
G2D::DrawRect(230, 245, ((static_cast<float>(Audio::GetPosition())/static_cast<float>(Audio::GetLength())) * 225.0), 2, WHITE);
|
||||
|
||||
g2dFlip(G2D_VSYNC);
|
||||
int ctrl = Utils::ReadControls();
|
||||
|
@ -28,7 +28,7 @@ namespace GUI {
|
||||
G2D::DrawRect(40, 43, 400, 3, SELECTOR_COLOUR);
|
||||
|
||||
if ((device == BROWSE_STATE_INTERNAL) || (device == BROWSE_STATE_EXTERNAL)) {
|
||||
float fill = (static_cast<double>(item.used_storage)/static_cast<double>(item.total_storage)) * 400.f;
|
||||
float fill = (static_cast<float>(item.used_storage)/static_cast<float>(item.total_storage)) * 400.f;
|
||||
G2D::DrawRect(40, 43, fill, 3, TITLE_COLOUR);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include <pspkernel.h>
|
||||
#include <pspsdk.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -5,6 +5,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <pspsdk.h>
|
||||
#include <pspkernel.h>
|
||||
#include <psploadexec_kernel.h>
|
||||
|
Loading…
Reference in New Issue
Block a user