Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void func_181560_a(float p_181560_1_, long p_181560_2_) {
- this.frameInit();
- boolean flag = Display.isActive();
- if (!flag && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) {
- if (Minecraft.getSystemTime() - this.prevFrameTime > 500L) {
- this.mc.displayInGameMenu();
- }
- } else {
- this.prevFrameTime = Minecraft.getSystemTime();
- }
- this.mc.mcProfiler.startSection("mouse");
- if (flag && Minecraft.isRunningOnMac && this.mc.inGameHasFocus && !Mouse.isInsideWindow()) {
- Mouse.setGrabbed(false);
- Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2);
- Mouse.setGrabbed(true);
- }
- if (this.mc.inGameHasFocus && flag) {
- this.mc.mouseHelper.mouseXYChange();
- float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
- float f1 = f * f * f * 8.0F;
- float f2 = (float) this.mc.mouseHelper.deltaX * f1;
- float f3 = (float) this.mc.mouseHelper.deltaY * f1;
- byte b0 = 1;
- if (this.mc.gameSettings.invertMouse) {
- b0 = -1;
- }
- if (this.mc.gameSettings.smoothCamera) {
- this.smoothCamYaw += f2;
- this.smoothCamPitch += f3;
- float f4 = p_181560_1_ - this.smoothCamPartialTicks;
- this.smoothCamPartialTicks = p_181560_1_;
- f2 = this.smoothCamFilterX * f4;
- f3 = this.smoothCamFilterY * f4;
- this.mc.thePlayer.setAngles(f2, f3 * (float) b0);
- } else {
- this.smoothCamYaw = 0.0F;
- this.smoothCamPitch = 0.0F;
- this.mc.thePlayer.setAngles(f2, f3 * (float) b0);
- }
- }
- this.mc.mcProfiler.endSection();
- if (!this.mc.skipRenderWorld) {
- anaglyphEnable = this.mc.gameSettings.anaglyph;
- final ScaledResolution scaledresolution = new ScaledResolution(this.mc);
- int l = scaledresolution.getScaledWidth();
- int i1 = scaledresolution.getScaledHeight();
- final int j1 = Mouse.getX() * l / this.mc.displayWidth;
- final int k1 = i1 - Mouse.getY() * i1 / this.mc.displayHeight - 1;
- int l1 = this.mc.gameSettings.limitFramerate;
- if (this.mc.theWorld != null) {
- this.mc.mcProfiler.startSection("level");
- int i = Math.min(Minecraft.getDebugFPS(), l1);
- i = Math.max(i, 60);
- long j = System.nanoTime() - p_181560_2_;
- long k = Math.max((long) (1000000000 / i / 4) - j, 0L);
- this.renderWorld(p_181560_1_, System.nanoTime() + k);
- if (OpenGlHelper.shadersSupported) {
- this.mc.renderGlobal.renderEntityOutlineFramebuffer();
- if (this.theShaderGroup != null && this.useShader) {
- GlStateManager.matrixMode(5890);
- GlStateManager.pushMatrix();
- GlStateManager.loadIdentity();
- this.theShaderGroup.loadShaderGroup(p_181560_1_);
- GlStateManager.popMatrix();
- }
- this.mc.getFramebuffer().bindFramebuffer(true);
- }
- this.renderEndNanoTime = System.nanoTime();
- this.mc.mcProfiler.endStartSection("gui");
- if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) {
- GlStateManager.alphaFunc(516, 0.1F);
- this.mc.ingameGUI.renderGameOverlay(p_181560_1_);
- if (this.mc.gameSettings.ofShowFps && !this.mc.gameSettings.showDebugInfo) {
- Config.drawFps();
- }
- if (this.mc.gameSettings.showDebugInfo) {
- Lagometer.showLagometer(scaledresolution);
- }
- }
- this.mc.mcProfiler.endSection();
- } else {
- GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
- GlStateManager.matrixMode(5889);
- GlStateManager.loadIdentity();
- GlStateManager.matrixMode(5888);
- GlStateManager.loadIdentity();
- this.setupOverlayRendering();
- this.renderEndNanoTime = System.nanoTime();
- TileEntityRendererDispatcher.instance.renderEngine = this.mc.getTextureManager();
- }
- if (this.mc.currentScreen != null) {
- GlStateManager.clear(256);
- try {
- if (Reflector.ForgeHooksClient_drawScreen.exists()) {
- Reflector.callVoid(Reflector.ForgeHooksClient_drawScreen, new Object[]{this.mc.currentScreen, Integer.valueOf(j1), Integer.valueOf(k1), Float.valueOf(p_181560_1_)});
- } else {
- this.mc.currentScreen.drawScreen(j1, k1, p_181560_1_);
- }
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering screen");
- CrashReportCategory crashreportcategory = crashreport.makeCategory("Screen render details");
- crashreportcategory.addCrashSectionCallable("Screen name", new EntityRenderer2(this));
- crashreportcategory.addCrashSectionCallable("Mouse location", new Callable() {
- private static final String __OBFID = "CL_00000950";
- public String call() throws Exception {
- 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())});
- }
- });
- crashreportcategory.addCrashSectionCallable("Screen size", new Callable() {
- private static final String __OBFID = "CL_00000951";
- public String call() throws Exception {
- 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())});
- }
- });
- throw new ReportedException(crashreport);
- }
- }
- }
- this.frameFinish();
- this.waitForServerThread();
- Lagometer.updateLagometer();
- if (this.mc.gameSettings.ofProfiler) {
- this.mc.gameSettings.showDebugProfilerChart = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement