summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-16 14:44:15 +0200
committerGitHub <noreply@github.com>2017-04-16 14:44:15 +0200
commit73de17afa821ccea84a119096b267e05a77db3ff (patch)
treeccb05343e11982058c8550533f6b54483be09474 /src/game.cpp
parentd17636484dedab91b820667a82ec23cf6168ac7a (diff)
downloadminetest-73de17afa821ccea84a119096b267e05a77db3ff.tar.gz
minetest-73de17afa821ccea84a119096b267e05a77db3ff.tar.bz2
minetest-73de17afa821ccea84a119096b267e05a77db3ff.zip
Android progressbar fix (#5601)
* Fix progressbar for Android Fixes #5599 Fixed #5403 * draw_load_screen: use texturesource this permits to unify texture loading code * scale progress bar * Add gl version check for GL_OES_texture_npot. This fixed the texture on loading screen * Remove two sanity checks pointed by @celeron55 * sfan5 comments + android ratio fixes
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 6ef471c9e..f584a58ef 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1725,9 +1725,10 @@ bool Game::init(
u16 port,
const SubgameSpec &gamespec)
{
+ texture_src = createTextureSource(device);
+
showOverlayMessage(wgettext("Loading..."), 0, 0);
- texture_src = createTextureSource(device);
shader_src = createShaderSource(device);
itemdef_manager = createItemDefManager();
@@ -2183,12 +2184,14 @@ bool Game::getServerContent(bool *aborted)
if (!client->itemdefReceived()) {
const wchar_t *text = wgettext("Item definitions...");
progress = 25;
- draw_load_screen(text, device, guienv, dtime, progress);
+ draw_load_screen(text, device, guienv, texture_src,
+ dtime, progress);
delete[] text;
} else if (!client->nodedefReceived()) {
const wchar_t *text = wgettext("Node definitions...");
progress = 30;
- draw_load_screen(text, device, guienv, dtime, progress);
+ draw_load_screen(text, device, guienv, texture_src,
+ dtime, progress);
delete[] text;
} else {
std::stringstream message;
@@ -2212,7 +2215,7 @@ bool Game::getServerContent(bool *aborted)
progress = 30 + client->mediaReceiveProgress() * 35 + 0.5;
draw_load_screen(utf8_to_wide(message.str()), device,
- guienv, dtime, progress);
+ guienv, texture_src, dtime, progress);
}
}
@@ -4357,7 +4360,8 @@ inline void Game::limitFps(FpsControl *fps_timings, f32 *dtime)
void Game::showOverlayMessage(const wchar_t *msg, float dtime,
int percent, bool draw_clouds)
{
- draw_load_screen(msg, device, guienv, dtime, percent, draw_clouds);
+ draw_load_screen(msg, device, guienv, texture_src, dtime, percent,
+ draw_clouds);
delete[] msg;
}