mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Added temporary hack to test if the image cache affects the heap size significantly.
This commit is contained in:
@@ -2,8 +2,13 @@
|
|||||||
package forge;
|
package forge;
|
||||||
|
|
||||||
|
|
||||||
import static java.lang.Double.parseDouble;
|
import arcane.ui.util.ImageUtil;
|
||||||
import static java.lang.Math.min;
|
import com.google.common.base.Function;
|
||||||
|
import com.google.common.collect.ComputationException;
|
||||||
|
import com.google.common.collect.MapMaker;
|
||||||
|
import com.mortennobel.imagescaling.ResampleOp;
|
||||||
|
import forge.properties.ForgeProps;
|
||||||
|
import forge.properties.NewConstants;
|
||||||
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.geom.AffineTransform;
|
import java.awt.geom.AffineTransform;
|
||||||
@@ -13,15 +18,8 @@ import java.util.Map;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import arcane.ui.util.ImageUtil;
|
import static java.lang.Double.parseDouble;
|
||||||
|
import static java.lang.Math.min;
|
||||||
import com.google.common.base.Function;
|
|
||||||
import com.google.common.collect.ComputationException;
|
|
||||||
import com.google.common.collect.MapMaker;
|
|
||||||
import com.mortennobel.imagescaling.ResampleOp;
|
|
||||||
|
|
||||||
import forge.properties.ForgeProps;
|
|
||||||
import forge.properties.NewConstants;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -322,4 +320,9 @@ public class ImageCache implements NewConstants {
|
|||||||
BufferedImage image = resampleOp.filter(original, null);
|
BufferedImage image = resampleOp.filter(original, null);
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void clear(){
|
||||||
|
imageCache.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -501,6 +501,10 @@ public class QuestMainPanel extends QuestAbstractPanel {
|
|||||||
}//card shop button
|
}//card shop button
|
||||||
|
|
||||||
private void launchGame() {
|
private void launchGame() {
|
||||||
|
|
||||||
|
//TODO: This is a temporary hack to see if the image cache affects the heap usage significantly.
|
||||||
|
ImageCache.clear();
|
||||||
|
|
||||||
String humanDeckName = (String) deckComboBox.getSelectedItem();
|
String humanDeckName = (String) deckComboBox.getSelectedItem();
|
||||||
Deck humanDeck = questData.getDeck(humanDeckName);
|
Deck humanDeck = questData.getDeck(humanDeckName);
|
||||||
Constant.Runtime.HumanDeck[0] = humanDeck;
|
Constant.Runtime.HumanDeck[0] = humanDeck;
|
||||||
|
|||||||
Reference in New Issue
Block a user