cast currentpage
This commit is contained in:
@@ -155,7 +155,10 @@ std::string SleepActivity::getBookOverlayText(const std::string& bookPath) const
|
||||
if (Storage.openFileForRead("SLP", xtc.getCachePath() + "/progress.bin", f)) {
|
||||
uint8_t data[4];
|
||||
if (f.read(data, 4) == 4) {
|
||||
uint32_t currentPage = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
|
||||
uint32_t currentPage = static_cast<uint32_t>(data[0]) |
|
||||
(static_cast<uint32_t>(data[1]) << 8) |
|
||||
(static_cast<uint32_t>(data[2]) << 16) |
|
||||
(static_cast<uint32_t>(data[3]) << 24);
|
||||
uint32_t totalPages = xtc.getPageCount();
|
||||
float progress = xtc.calculateProgress(currentPage) * 100.0f;
|
||||
char progressStr[32];
|
||||
|
||||
Reference in New Issue
Block a user