Add a config switch for antialiasing rendering hints.

This commit is contained in:
Jan Philipp Timme 2014-11-28 20:05:57 +01:00
parent fc66c15cd6
commit 35301b0d27
2 changed files with 9 additions and 2 deletions

View File

@ -159,8 +159,10 @@ public class GameFrame extends JFrame {
* KEY_ANTIALIASING is very expensive and doesn't do much more over KEY_TEXT_ANTIALIASING
*/
private void applyRenderingHints(Graphics2D bufferedGraphics) {
//bufferedGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
bufferedGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
if(GameConfig.antialiasing == true) {
bufferedGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
bufferedGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}
}
/**

View File

@ -25,6 +25,11 @@ public class GameConfig {
*/
public static String windowTitle = "SpaceScooter!";
/**
* Whether or not anti aliasing rendering hints will be used.
*/
public static boolean antialiasing = false;
/**
* Private constructor, this class will never be instantiated.