Actually make the instance of GraphicsSettings private.
This commit is contained in:
parent
7023f5322b
commit
dba0f6990e
|
@ -25,7 +25,7 @@ public class Main {
|
||||||
* @param args Command line arguments.
|
* @param args Command line arguments.
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) {
|
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()
|
// Initialize SuperScreen and add to GameFrame, so we can call doPaint()
|
||||||
// on it.
|
// on it.
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class GraphicsSettings {
|
||||||
/**
|
/**
|
||||||
* Instance holder for GraphicsSettings.
|
* Instance holder for GraphicsSettings.
|
||||||
*/
|
*/
|
||||||
public static GraphicsSettings instance;
|
private static GraphicsSettings instance;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -124,4 +124,10 @@ public class GraphicsSettings {
|
||||||
return compatibleImage;
|
return compatibleImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the instance of GraphicsSettings
|
||||||
|
*/
|
||||||
|
public static GraphicsSettings getInstance() {
|
||||||
|
return GraphicsSettings.instance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,10 +185,10 @@ public class Loader {
|
||||||
* current ScreenDevice.
|
* current ScreenDevice.
|
||||||
*/
|
*/
|
||||||
private static BufferedImage createCompatibleImage(BufferedImage storedImage) {
|
private static BufferedImage createCompatibleImage(BufferedImage storedImage) {
|
||||||
if(GraphicsSettings.instance.getColorModel().equals(storedImage.getColorModel())) {
|
if(GraphicsSettings.getInstance().getColorModel().equals(storedImage.getColorModel())) {
|
||||||
return storedImage;
|
return storedImage;
|
||||||
} else {
|
} else {
|
||||||
return GraphicsSettings.instance.createCompatibleBufferedImage(storedImage);
|
return GraphicsSettings.getInstance().createCompatibleBufferedImage(storedImage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue