diff --git a/src/game.cpp b/src/game.cpp index 3fb146b..16da51f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1008,8 +1008,12 @@ void update_skybox(video::IVideoDriver* driver, Draws a screen with logo and text on it. Text will be removed when the screen is drawn the next time. */ -void drawLoadingScreen(video::IVideoDriver* driver, const std::wstring msg) +void drawLoadingScreen(irr::IrrlichtDevice* device, const std::wstring msg) { + if (device == NULL) + return; + device->run(); + video::IVideoDriver* driver = device->getVideoDriver(); if (driver == NULL) return; core::dimension2d screensize = driver->getScreenSize(); @@ -1105,7 +1109,7 @@ void the_game( Draw "Loading" screen */ //draw_load_screen(L"Loading...", driver, font); - drawLoadingScreen(driver,wgettext("Loading...")); + drawLoadingScreen(device,wgettext("Loading...")); /* Create server. @@ -1114,7 +1118,7 @@ void the_game( SharedPtr server; if(address == ""){ //draw_load_screen(L"Creating server...", driver, font); - drawLoadingScreen(driver,wgettext("Creating server...")); + drawLoadingScreen(device,wgettext("Creating server...")); infostream<<"Creating server"<start(port); @@ -1125,12 +1129,12 @@ void the_game( */ //draw_load_screen(L"Creating client...", driver, font); - drawLoadingScreen(driver,wgettext("Creating client...")); + drawLoadingScreen(device,wgettext("Creating client...")); infostream<<"Creating client"< { diff --git a/src/main.cpp b/src/main.cpp index a245232..dd61344 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1088,7 +1088,7 @@ int main(int argc, char *argv[]) // Create texture source g_texturesource = new TextureSource(device); - drawLoadingScreen(driver,L""); + drawLoadingScreen(device,L""); /* Speed tests (done after irrlicht is loaded to get timer) @@ -1128,7 +1128,7 @@ int main(int argc, char *argv[]) // If font was not found, this will get us one font = skin->getFont(); assert(font); - drawLoadingScreen(driver,wgettext("Setting Up UI")); + drawLoadingScreen(device,wgettext("Setting Up UI")); u32 text_height = font->getDimension(L"Hello, world!").Height; infostream<<"text_height="<