Actually make the instance of GraphicsSettings private.

This commit is contained in:
Jan Philipp Timme 2014-11-30 11:11:35 +01:00
parent 7023f5322b
commit dba0f6990e
3 changed files with 10 additions and 4 deletions

View File

@ -25,7 +25,7 @@ public class Main {
* @param args Command line arguments.
*/
public static void main(String[] args) {
final GraphicsSettings gs = GraphicsSettings.instance; // Get settings
final GraphicsSettings gs = GraphicsSettings.getInstance(); // Get settings
// Initialize SuperScreen and add to GameFrame, so we can call doPaint()
// on it.

View File

@ -44,7 +44,7 @@ public class GraphicsSettings {
/**
* Instance holder for GraphicsSettings.
*/
public static GraphicsSettings instance;
private static GraphicsSettings instance;
/**
@ -124,4 +124,10 @@ public class GraphicsSettings {
return compatibleImage;
}
/**
* Get the instance of GraphicsSettings
*/
public static GraphicsSettings getInstance() {
return GraphicsSettings.instance;
}
}

View File

@ -185,10 +185,10 @@ public class Loader {
* current ScreenDevice.
*/
private static BufferedImage createCompatibleImage(BufferedImage storedImage) {
if(GraphicsSettings.instance.getColorModel().equals(storedImage.getColorModel())) {
if(GraphicsSettings.getInstance().getColorModel().equals(storedImage.getColorModel())) {
return storedImage;
} else {
return GraphicsSettings.instance.createCompatibleBufferedImage(storedImage);
return GraphicsSettings.getInstance().createCompatibleBufferedImage(storedImage);
}
}