Add high performance rendering mode which does not render the GUI every frame
This commit is contained in:
@@ -516,6 +516,10 @@ public class GuiRenderSettings extends GuiScreen {
|
|||||||
|
|
||||||
options.setIgnoreCameraRotation(ignoreCamDir.isChecked());
|
options.setIgnoreCameraRotation(ignoreCamDir.isChecked());
|
||||||
|
|
||||||
|
if (isCtrlKeyDown()) {
|
||||||
|
options.setHighPerformance(true);
|
||||||
|
}
|
||||||
|
|
||||||
if(commandInput.getText().trim().length() > 0) {
|
if(commandInput.getText().trim().length() > 0) {
|
||||||
options.setExportCommand(commandInput.getText().trim());
|
options.setExportCommand(commandInput.getText().trim());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public final class RenderOptions {
|
|||||||
private int height = Minecraft.getMinecraft().displayHeight;
|
private int height = Minecraft.getMinecraft().displayHeight;
|
||||||
|
|
||||||
// Highly advanced
|
// Highly advanced
|
||||||
|
private boolean highPerformance;
|
||||||
private String exportCommand = "ffmpeg";
|
private String exportCommand = "ffmpeg";
|
||||||
private String exportCommandArgs = "";
|
private String exportCommandArgs = "";
|
||||||
|
|
||||||
@@ -55,6 +56,7 @@ public final class RenderOptions {
|
|||||||
copy.skyColor = this.skyColor;
|
copy.skyColor = this.skyColor;
|
||||||
copy.width = this.width;
|
copy.width = this.width;
|
||||||
copy.height = this.height;
|
copy.height = this.height;
|
||||||
|
copy.highPerformance = this.highPerformance;
|
||||||
copy.exportCommand = this.exportCommand;
|
copy.exportCommand = this.exportCommand;
|
||||||
copy.exportCommandArgs = this.exportCommandArgs;
|
copy.exportCommandArgs = this.exportCommandArgs;
|
||||||
return copy;
|
return copy;
|
||||||
|
|||||||
@@ -115,7 +115,9 @@ public class VideoRenderer implements RenderInfo {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float updateForNextFrame() {
|
public float updateForNextFrame() {
|
||||||
|
if (!options.isHighPerformance() || framesDone % fps == 0) {
|
||||||
drawGui();
|
drawGui();
|
||||||
|
}
|
||||||
|
|
||||||
updateTime(mc.timer, framesDone);
|
updateTime(mc.timer, framesDone);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user