Added static reference to current VideoRenderer instance to allow CustomObjectRenderer to correctly interpolate Object Transformations while rendering
This commit is contained in:
@@ -5,6 +5,7 @@ import eu.crushedpixel.replaymod.gui.GuiObjectManager;
|
|||||||
import eu.crushedpixel.replaymod.holders.Position;
|
import eu.crushedpixel.replaymod.holders.Position;
|
||||||
import eu.crushedpixel.replaymod.holders.Transformation;
|
import eu.crushedpixel.replaymod.holders.Transformation;
|
||||||
import eu.crushedpixel.replaymod.replay.ReplayHandler;
|
import eu.crushedpixel.replaymod.replay.ReplayHandler;
|
||||||
|
import eu.crushedpixel.replaymod.replay.ReplayProcess;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
@@ -71,7 +72,9 @@ public class CustomObjectRenderer {
|
|||||||
|
|
||||||
int renderTimestamp;
|
int renderTimestamp;
|
||||||
if(mc.currentScreen instanceof GuiObjectManager) {
|
if(mc.currentScreen instanceof GuiObjectManager) {
|
||||||
renderTimestamp = ((GuiObjectManager)mc.currentScreen).getObjectKeyframeTimeline().cursorPosition;
|
renderTimestamp = ((GuiObjectManager) mc.currentScreen).getObjectKeyframeTimeline().cursorPosition;
|
||||||
|
} else if(ReplayProcess.isVideoRecording()) {
|
||||||
|
renderTimestamp = ReplayProcess.getVideoRenderer().getVideoTime();
|
||||||
} else {
|
} else {
|
||||||
renderTimestamp = ReplayHandler.getRealTimelineCursor();
|
renderTimestamp = ReplayHandler.getRealTimelineCursor();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import eu.crushedpixel.replaymod.settings.RenderOptions;
|
|||||||
import eu.crushedpixel.replaymod.timer.EnchantmentTimer;
|
import eu.crushedpixel.replaymod.timer.EnchantmentTimer;
|
||||||
import eu.crushedpixel.replaymod.timer.ReplayTimer;
|
import eu.crushedpixel.replaymod.timer.ReplayTimer;
|
||||||
import eu.crushedpixel.replaymod.video.VideoRenderer;
|
import eu.crushedpixel.replaymod.video.VideoRenderer;
|
||||||
|
import lombok.Getter;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiErrorScreen;
|
import net.minecraft.client.gui.GuiErrorScreen;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
@@ -34,6 +35,9 @@ public class ReplayProcess {
|
|||||||
|
|
||||||
private static boolean calculated = false;
|
private static boolean calculated = false;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private static VideoRenderer videoRenderer = null;
|
||||||
|
|
||||||
private static boolean isVideoRecording = false;
|
private static boolean isVideoRecording = false;
|
||||||
private static boolean blocked = false;
|
private static boolean blocked = false;
|
||||||
private static boolean deepBlock = false;
|
private static boolean deepBlock = false;
|
||||||
@@ -100,7 +104,7 @@ public class ReplayProcess {
|
|||||||
boolean success = false;
|
boolean success = false;
|
||||||
try {
|
try {
|
||||||
isVideoRecording = true;
|
isVideoRecording = true;
|
||||||
VideoRenderer videoRenderer = new VideoRenderer(renderOptions);
|
videoRenderer = new VideoRenderer(renderOptions);
|
||||||
success = videoRenderer.renderVideo();
|
success = videoRenderer.renderVideo();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -422,6 +422,8 @@ public class VideoRenderer {
|
|||||||
return totalFrames;
|
return totalFrames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getVideoTime() { return framesDone * 1000 / fps; }
|
||||||
|
|
||||||
public FrameRenderer getFrameRenderer() {
|
public FrameRenderer getFrameRenderer() {
|
||||||
return frameRenderer;
|
return frameRenderer;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user