Permalink
Browse files

Adds that the graphics quality is correctly saved and restored using …

…the new config architecture and addresses #184.
  • Loading branch information...
1 parent 668c0a2 commit c59cb75f459a5ba4a980a5b028d04df201f42008 @begla begla committed Mar 4, 2012
@@ -89,9 +89,9 @@ public void init() {
initLogger();
initNativeLibs();
- initOpenAL();
initDisplay();
initOpenGL();
+ initOpenAL();
initControls();
initManagers();
initTimer(); // Dependant on LWJGL
@@ -358,7 +358,7 @@ public IGameState getGameState(GAME_STATE s) {
state.init();
- _gameStates.put(_state, state);
+ _gameStates.put(s, state);
return state;
}
@@ -379,12 +379,6 @@ public double getAverageFps() {
}
public WorldRenderer getActiveWorldRenderer() {
- //TODO: Review architecture of this? Cervator added to fix audio merge with game state system, not expert!
- //t3hk0d3 suggested this fix, problem is that OpenALManager.update does a check of getActivePlayer which triggers this
- //without the state check right here the getGameState would provoke partial game start too early - but a get method shouldn't set?
- if (_state != GAME_STATE.SINGLE_PLAYER) {
- return null;
- }
StateSinglePlayer singlePlayer = (StateSinglePlayer) getGameState(GAME_STATE.SINGLE_PLAYER);
return singlePlayer.getWorldRenderer();
}
@@ -17,7 +17,6 @@
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
-import org.newdawn.slick.openal.SoundStore;
import org.terasology.game.Terasology;
import org.terasology.logic.manager.AudioManager;
import org.terasology.logic.manager.Config;
@@ -148,6 +147,13 @@ else if (Config.getInstance().getActiveViewingDistanceId() == 2)
_configMenu.getViewingDistanceButton().getLabel().setText("Viewing Distance: Far");
else
_configMenu.getViewingDistanceButton().getLabel().setText("Viewing Distance: Near");
+
+ if (Config.getInstance().getGraphicsQuality() == 1)
+ _configMenu.getGraphicsQualityButton().getLabel().setText("Graphics Quality: Nice");
+ else if (Config.getInstance().getGraphicsQuality() == 2)
+ _configMenu.getGraphicsQualityButton().getLabel().setText("Graphics Quality: Epic");
+ else
+ _configMenu.getGraphicsQualityButton().getLabel().setText("Graphics Quality: Ugly");
}
public void deactivate() {
@@ -4,7 +4,6 @@
import org.lwjgl.openal.AL11;
import org.terasology.game.Terasology;
import org.terasology.logic.manager.AudioManager;
-import org.terasology.utilities.FastRandom;
import javax.vecmath.Vector3d;
@@ -344,6 +343,7 @@ private Vector3d getPlayerPosition() {
}
@Override
+ // TODO: This is no guaranteed to be executed at all – move to a safer place
protected void finalize() throws Throwable {
if (this.sourceId != 0) {
AL10.alDeleteSources(this.sourceId);
Oops, something went wrong.

0 comments on commit c59cb75

Please sign in to comment.