1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add download rate to media progress bar (non http mode only!)

Minor coding style fixes
This commit is contained in:
sapier 2014-04-26 01:15:46 +02:00
parent 088b18da3d
commit c03d7dc8a7
8 changed files with 286 additions and 132 deletions

View file

@ -1432,10 +1432,24 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
}
else
{
wchar_t* text = wgettext("Media...");
std::stringstream message;
message.precision(3);
message << gettext("Media...");
if ( ( USE_CURL == 0) ||
(!g_settings->getBool("enable_remote_media_server"))) {
float cur = client.getCurRate();
std::string cur_unit = gettext(" KB/s");
if (cur > 900) {
cur /= 1024.0;
cur_unit = gettext(" MB/s");
}
message << " ( " << cur << cur_unit << " )";
}
progress = 50+client.mediaReceiveProgress()*50+0.5;
draw_load_screen(text, device, font, dtime, progress);
delete[] text;
draw_load_screen(narrow_to_wide(message.str().c_str()), device, font, dtime, progress);
}
// On some computers framerate doesn't seem to be