diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index c31779d42..4956e35e5 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -1849,6 +1849,16 @@ void Minecraft::run_middle() } } } +#ifdef __linux__ + // On Linux, Iggy Flash UI is not available. If no players were rendered + // (menu / title-screen state), call GameRenderer directly so mc->screen draws. + if (bFirst) + { + localPlayerIdx = 0; + RenderManager.StateSetViewport(C4JRender::VIEWPORT_TYPE_FULLSCREEN); + gameRenderer->render(timer->a, true); + } +#endif // If there's an unoccupied quadrant, then clear that to black if( unoccupiedQuadrant > -1 ) { diff --git a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp b/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp index c2a810eee..a9d58a3b6 100644 --- a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp +++ b/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp @@ -689,6 +689,12 @@ do } while (minecraftThread->isRunning()); delete minecraftThread; +// Re-acquire the GL context in the main thread. +// StartMinecraftThreadProc calls InitialiseContext() which moves the context +// to the init thread for texture loading; we must reclaim it here before +// any further OpenGL calls in the main render loop. +RenderManager.InitialiseContext(); + Minecraft *pMinecraft=Minecraft::GetInstance(); app.InitGameSettings(); @@ -727,9 +733,11 @@ g_NetworkManager.DoWork(); PIXEndNamedEvent(); // Render game graphics. +// On Linux, always call run_middle() so mc->screen (TitleScreen etc.) renders +// even when the game session has not yet started (Iggy Flash UI is unavailable). +pMinecraft->run_middle(); if(app.GetGameStarted()) { - pMinecraft->run_middle(); app.SetAppPaused( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 && ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad()) ); } else diff --git a/Minecraft.Client/UI/Screen.cpp b/Minecraft.Client/UI/Screen.cpp index acb33a3ef..6aa70d4e0 100644 --- a/Minecraft.Client/UI/Screen.cpp +++ b/Minecraft.Client/UI/Screen.cpp @@ -170,22 +170,7 @@ void Screen::renderBackground(int vo) void Screen::renderDirtBackground(int vo) { - // 4J Unused -#if 0 - glDisable(GL_LIGHTING); - glDisable(GL_FOG); - Tesselator *t = Tesselator::getInstance(); - glBindTexture(GL_TEXTURE_2D, minecraft->textures->loadTexture(L"/gui/background.png")); - glColor4f(1, 1, 1, 1); - float s = 32; - t->begin(); - t->color(0x404040); - t->vertexUV((float)(0), (float)( height), (float)( 0), (float)( 0), (float)( height / s + vo)); - t->vertexUV((float)(width), (float)( height), (float)( 0), (float)( width / s), (float)( height / s + vo)); - t->vertexUV((float)(width), (float)( 0), (float)( 0), (float)( width / s), (float)( 0 + vo)); - t->vertexUV((float)(0), (float)( 0), (float)( 0), (float)( 0), (float)( 0 + vo)); - t->end(); -#endif + // 4J Unused - Iggy Flash UI renders the background on consoles } bool Screen::isPauseScreen() diff --git a/Minecraft.Client/UI/Screens/TitleScreen.cpp b/Minecraft.Client/UI/Screens/TitleScreen.cpp index f13e3ca73..a98807442 100644 --- a/Minecraft.Client/UI/Screens/TitleScreen.cpp +++ b/Minecraft.Client/UI/Screens/TitleScreen.cpp @@ -126,35 +126,5 @@ void TitleScreen::buttonClicked(Button *button) void TitleScreen::render(int xm, int ym, float a) { - // 4J Unused -#if 0 - renderBackground(); - Tesselator *t = Tesselator::getInstance(); - - int logoWidth = 155 + 119; - int logoX = width / 2 - logoWidth / 2; - int logoY = 30; - - glBindTexture(GL_TEXTURE_2D, minecraft->textures->loadTexture(L"/title/mclogo.png")); - glColor4f(1, 1, 1, 1); - blit(logoX + 0, logoY + 0, 0, 0, 155, 44); - blit(logoX + 155, logoY + 0, 0, 45, 155, 44); - t->color(0xffffff); - glPushMatrix(); - glTranslatef((float)width / 2 + 90, 70, 0); - - glRotatef(-20, 0, 0, 1); - float sss = 1.8f - Mth::abs(Mth::sin(System::currentTimeMillis() % 1000 / 1000.0f * PI * 2) * 0.1f); - - sss = sss * 100 / (font->width(splash) + 8 * 4); - glScalef(sss, sss, sss); - drawCenteredString(font, splash, 0, -8, 0xffff00); - glPopMatrix(); - - drawString(font, ClientConstants::VERSION_STRING, 2, 2, 0x505050); - wstring msg = L"Copyright Mojang AB. Do not distribute."; - drawString(font, msg, width - font->width(msg) - 2, height - 10, 0xffffff); - - Screen::render(xm, ym, a); -#endif + // 4J Unused - Iggy Flash UI renders the title screen on consoles }