Ejemplo n.º 1
0
 public void displayGuiScreen(GuiScreen guiscreen) {
   if (currentScreen instanceof GuiUnused) {
     return;
   }
   if (currentScreen != null) {
     currentScreen.onGuiClosed();
   }
   if (guiscreen instanceof GuiMainMenu) {
     statFileWriter.func_27175_b();
   }
   statFileWriter.syncStats();
   if (guiscreen == null && theWorld == null) {
     guiscreen = new GuiMainMenu();
   } else if (guiscreen == null && thePlayer.health <= 0) {
     guiscreen = new GuiGameOver();
   }
   if (guiscreen instanceof GuiMainMenu) {
     ingameGUI.clearChatMessages();
   }
   currentScreen = guiscreen;
   if (guiscreen != null) {
     setIngameNotInFocus();
     ScaledResolution scaledresolution =
         new ScaledResolution(gameSettings, displayWidth, displayHeight);
     int i = scaledresolution.getScaledWidth();
     int j = scaledresolution.getScaledHeight();
     guiscreen.setWorldAndResolution(this, i, j);
     skipRenderWorld = false;
   } else {
     setIngameFocus();
   }
 }
Ejemplo n.º 2
0
 private void resize(int i, int j) {
   if (i <= 0) {
     i = 1;
   }
   if (j <= 0) {
     j = 1;
   }
   displayWidth = i;
   displayHeight = j;
   if (currentScreen != null) {
     ScaledResolution scaledresolution = new ScaledResolution(gameSettings, i, j);
     int k = scaledresolution.getScaledWidth();
     int l = scaledresolution.getScaledHeight();
     currentScreen.setWorldAndResolution(this, k, l);
   }
 }
Ejemplo n.º 3
0
 private void loadScreen() throws LWJGLException {
   ScaledResolution scaledresolution =
       new ScaledResolution(gameSettings, displayWidth, displayHeight);
   GL11.glClear(16640);
   GL11.glMatrixMode(5889 /*GL_PROJECTION*/);
   GL11.glLoadIdentity();
   GL11.glOrtho(
       0.0D, scaledresolution.field_25121_a, scaledresolution.field_25120_b, 0.0D, 1000D, 3000D);
   GL11.glMatrixMode(5888 /*GL_MODELVIEW0_ARB*/);
   GL11.glLoadIdentity();
   GL11.glTranslatef(0.0F, 0.0F, -2000F);
   GL11.glViewport(0, 0, displayWidth, displayHeight);
   GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
   Tessellator tessellator = Tessellator.instance;
   GL11.glDisable(2896 /*GL_LIGHTING*/);
   GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
   GL11.glDisable(2912 /*GL_FOG*/);
   GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, renderEngine.getTexture("/title/mojang.png"));
   tessellator.startDrawingQuads();
   tessellator.setColorOpaque_I(0xffffff);
   tessellator.addVertexWithUV(0.0D, displayHeight, 0.0D, 0.0D, 0.0D);
   tessellator.addVertexWithUV(displayWidth, displayHeight, 0.0D, 0.0D, 0.0D);
   tessellator.addVertexWithUV(displayWidth, 0.0D, 0.0D, 0.0D, 0.0D);
   tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
   tessellator.draw();
   char c = '\u0100';
   char c1 = '\u0100';
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   tessellator.setColorOpaque_I(0xffffff);
   func_6274_a(
       (scaledresolution.getScaledWidth() - c) / 2,
       (scaledresolution.getScaledHeight() - c1) / 2,
       0,
       0,
       c,
       c1);
   GL11.glDisable(2896 /*GL_LIGHTING*/);
   GL11.glDisable(2912 /*GL_FOG*/);
   GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
   GL11.glAlphaFunc(516, 0.1F);
   Display.swapBuffers();
 }