Fix crash on exit of replay (no longer processing clicks mid-rendering) and OpenGL error warnings

Remove MCTimerHandler, instead always install the ReplayTimer
This commit is contained in:
johni0702
2015-06-16 19:33:34 +02:00
parent 8d61bfbfa8
commit b0f253538c
10 changed files with 71 additions and 131 deletions

View File

@@ -11,7 +11,7 @@ import eu.crushedpixel.replaymod.interpolation.LinearTimestamp;
import eu.crushedpixel.replaymod.interpolation.SplinePoint;
import eu.crushedpixel.replaymod.settings.RenderOptions;
import eu.crushedpixel.replaymod.timer.EnchantmentTimer;
import eu.crushedpixel.replaymod.timer.MCTimerHandler;
import eu.crushedpixel.replaymod.timer.ReplayTimer;
import eu.crushedpixel.replaymod.video.VideoRenderer;
import net.minecraft.client.Minecraft;
@@ -109,7 +109,7 @@ public class ReplayProcess {
}
ReplayMod.chatMessageHandler.addLocalizedChatMessage("replaymod.chat.pathstarted", ChatMessageType.INFORMATION);
MCTimerHandler.setTimerSpeed(1f);
mc.timer.timerSpeed = 1;
} else {
try {
isVideoRecording = true;
@@ -136,7 +136,7 @@ public class ReplayProcess {
ReplayMod.replaySender.stopHurrying();
MCTimerHandler.setActiveTimer();
ReplayTimer.get(mc).passive = false;
ReplayMod.replaySender.setReplaySpeed(previousReplaySpeed);
ReplayMod.replaySender.setReplaySpeed(0);
}
@@ -165,9 +165,9 @@ public class ReplayProcess {
lastPartialTicks = 100;
lastRenderPartialTicks = 100;
lastTicks = 100;
MCTimerHandler.setRenderPartialTicks(100);
MCTimerHandler.setPartialTicks(100);
MCTimerHandler.setTicks(100);
mc.timer.renderPartialTicks = 100;
mc.timer.elapsedPartialTicks = 100;
mc.timer.elapsedTicks = 100;
}
if(justCheck) return;
@@ -336,9 +336,9 @@ public class ReplayProcess {
//if(curSpeed > 0)
lastSpeed = curSpeed;
lastPartialTicks = MCTimerHandler.getPartialTicks();
lastRenderPartialTicks = MCTimerHandler.getRenderTicks();
lastTicks = MCTimerHandler.getTicks();
lastPartialTicks = mc.timer.elapsedPartialTicks;
lastRenderPartialTicks = mc.timer.renderPartialTicks;
lastTicks = mc.timer.elapsedTicks;
if(curTimestamp != null)
ReplayMod.replaySender.sendPacketsTill(curTimestamp);

View File

@@ -8,7 +8,6 @@ import eu.crushedpixel.replaymod.entities.CameraEntity;
import eu.crushedpixel.replaymod.events.handlers.RecordingHandler;
import eu.crushedpixel.replaymod.holders.PacketData;
import eu.crushedpixel.replaymod.holders.Position;
import eu.crushedpixel.replaymod.timer.MCTimerHandler;
import eu.crushedpixel.replaymod.utils.ReplayFile;
import eu.crushedpixel.replaymod.utils.ReplayFileIO;
import io.netty.channel.ChannelHandler.Sharable;
@@ -422,7 +421,7 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
* @return {@code true} if it is paused, {@code false} otherwise
*/
public boolean paused() {
return MCTimerHandler.getTimerSpeed() == 0;
return mc.timer.timerSpeed == 0;
}
/**
@@ -442,7 +441,7 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
*/
public void setReplaySpeed(final double d) {
if(d != 0) this.replaySpeed = d;
MCTimerHandler.setTimerSpeed((float) d);
mc.timer.timerSpeed = (float) d;
}
/////////////////////////////////////////////////////////