Only register changes in ReplayFileAppender if something changed - this applies to GuiKeyframeRepository, GuiObjectManager, GuiPlayerOverview, GuiAssetManager

Added equals method to ReplayImageAsset which is based on the BufferedImage's hash code (which is calculated only once)
This commit is contained in:
CrushedPixel
2015-07-16 13:26:12 +02:00
parent e6fcf4f094
commit d45fcb8a34
9 changed files with 69 additions and 3 deletions

View File

@@ -0,0 +1,13 @@
package eu.crushedpixel.replaymod.utils;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferByte;
import java.util.Arrays;
public class BufferedImageUtils {
public static int hashCode(BufferedImage bi) {
byte[] data = ((DataBufferByte) bi.getData().getDataBuffer()).getData();
return Arrays.hashCode(data);
}
}