Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.05 KB | None | 0 0
  1. public void func_181560_a(float p_181560_1_, long p_181560_2_) {
  2. this.frameInit();
  3. boolean flag = Display.isActive();
  4.  
  5. if (!flag && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) {
  6. if (Minecraft.getSystemTime() - this.prevFrameTime > 500L) {
  7. this.mc.displayInGameMenu();
  8. }
  9. } else {
  10. this.prevFrameTime = Minecraft.getSystemTime();
  11. }
  12.  
  13. this.mc.mcProfiler.startSection("mouse");
  14.  
  15. if (flag && Minecraft.isRunningOnMac && this.mc.inGameHasFocus && !Mouse.isInsideWindow()) {
  16. Mouse.setGrabbed(false);
  17. Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2);
  18. Mouse.setGrabbed(true);
  19. }
  20.  
  21. if (this.mc.inGameHasFocus && flag) {
  22. this.mc.mouseHelper.mouseXYChange();
  23. float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
  24. float f1 = f * f * f * 8.0F;
  25. float f2 = (float) this.mc.mouseHelper.deltaX * f1;
  26. float f3 = (float) this.mc.mouseHelper.deltaY * f1;
  27. byte b0 = 1;
  28.  
  29. if (this.mc.gameSettings.invertMouse) {
  30. b0 = -1;
  31. }
  32.  
  33. if (this.mc.gameSettings.smoothCamera) {
  34. this.smoothCamYaw += f2;
  35. this.smoothCamPitch += f3;
  36. float f4 = p_181560_1_ - this.smoothCamPartialTicks;
  37. this.smoothCamPartialTicks = p_181560_1_;
  38. f2 = this.smoothCamFilterX * f4;
  39. f3 = this.smoothCamFilterY * f4;
  40. this.mc.thePlayer.setAngles(f2, f3 * (float) b0);
  41. } else {
  42. this.smoothCamYaw = 0.0F;
  43. this.smoothCamPitch = 0.0F;
  44. this.mc.thePlayer.setAngles(f2, f3 * (float) b0);
  45. }
  46. }
  47.  
  48. this.mc.mcProfiler.endSection();
  49.  
  50. if (!this.mc.skipRenderWorld) {
  51. anaglyphEnable = this.mc.gameSettings.anaglyph;
  52. final ScaledResolution scaledresolution = new ScaledResolution(this.mc);
  53. int l = scaledresolution.getScaledWidth();
  54. int i1 = scaledresolution.getScaledHeight();
  55. final int j1 = Mouse.getX() * l / this.mc.displayWidth;
  56. final int k1 = i1 - Mouse.getY() * i1 / this.mc.displayHeight - 1;
  57. int l1 = this.mc.gameSettings.limitFramerate;
  58.  
  59. if (this.mc.theWorld != null) {
  60. this.mc.mcProfiler.startSection("level");
  61. int i = Math.min(Minecraft.getDebugFPS(), l1);
  62. i = Math.max(i, 60);
  63. long j = System.nanoTime() - p_181560_2_;
  64. long k = Math.max((long) (1000000000 / i / 4) - j, 0L);
  65. this.renderWorld(p_181560_1_, System.nanoTime() + k);
  66.  
  67. if (OpenGlHelper.shadersSupported) {
  68. this.mc.renderGlobal.renderEntityOutlineFramebuffer();
  69.  
  70. if (this.theShaderGroup != null && this.useShader) {
  71. GlStateManager.matrixMode(5890);
  72. GlStateManager.pushMatrix();
  73. GlStateManager.loadIdentity();
  74. this.theShaderGroup.loadShaderGroup(p_181560_1_);
  75. GlStateManager.popMatrix();
  76. }
  77.  
  78. this.mc.getFramebuffer().bindFramebuffer(true);
  79. }
  80.  
  81. this.renderEndNanoTime = System.nanoTime();
  82. this.mc.mcProfiler.endStartSection("gui");
  83.  
  84. if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) {
  85. GlStateManager.alphaFunc(516, 0.1F);
  86. this.mc.ingameGUI.renderGameOverlay(p_181560_1_);
  87.  
  88. if (this.mc.gameSettings.ofShowFps && !this.mc.gameSettings.showDebugInfo) {
  89. Config.drawFps();
  90. }
  91.  
  92. if (this.mc.gameSettings.showDebugInfo) {
  93. Lagometer.showLagometer(scaledresolution);
  94. }
  95. }
  96.  
  97. this.mc.mcProfiler.endSection();
  98. } else {
  99. GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
  100. GlStateManager.matrixMode(5889);
  101. GlStateManager.loadIdentity();
  102. GlStateManager.matrixMode(5888);
  103. GlStateManager.loadIdentity();
  104. this.setupOverlayRendering();
  105. this.renderEndNanoTime = System.nanoTime();
  106. TileEntityRendererDispatcher.instance.renderEngine = this.mc.getTextureManager();
  107. }
  108.  
  109. if (this.mc.currentScreen != null) {
  110. GlStateManager.clear(256);
  111.  
  112. try {
  113. if (Reflector.ForgeHooksClient_drawScreen.exists()) {
  114. Reflector.callVoid(Reflector.ForgeHooksClient_drawScreen, new Object[]{this.mc.currentScreen, Integer.valueOf(j1), Integer.valueOf(k1), Float.valueOf(p_181560_1_)});
  115. } else {
  116. this.mc.currentScreen.drawScreen(j1, k1, p_181560_1_);
  117. }
  118. } catch (Throwable throwable) {
  119. CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering screen");
  120. CrashReportCategory crashreportcategory = crashreport.makeCategory("Screen render details");
  121. crashreportcategory.addCrashSectionCallable("Screen name", new EntityRenderer2(this));
  122. crashreportcategory.addCrashSectionCallable("Mouse location", new Callable() {
  123. private static final String __OBFID = "CL_00000950";
  124.  
  125. public String call() throws Exception {
  126. return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[]{Integer.valueOf(j1), Integer.valueOf(k1), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())});
  127. }
  128. });
  129. crashreportcategory.addCrashSectionCallable("Screen size", new Callable() {
  130. private static final String __OBFID = "CL_00000951";
  131.  
  132. public String call() throws Exception {
  133. return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[]{Integer.valueOf(scaledresolution.getScaledWidth()), Integer.valueOf(scaledresolution.getScaledHeight()), Integer.valueOf(EntityRenderer.this.mc.displayWidth), Integer.valueOf(EntityRenderer.this.mc.displayHeight), Integer.valueOf(scaledresolution.getScaleFactor())});
  134. }
  135. });
  136. throw new ReportedException(crashreport);
  137. }
  138. }
  139. }
  140.  
  141. this.frameFinish();
  142. this.waitForServerThread();
  143. Lagometer.updateLagometer();
  144.  
  145. if (this.mc.gameSettings.ofProfiler) {
  146. this.mc.gameSettings.showDebugProfilerChart = true;
  147. }
  148. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement