Bugfix Config, setGamePanelWidth(int width);

This commit is contained in:
toksikk
2014-11-03 16:13:23 +01:00
parent 15872210fb
commit 421fca8045
+6
View File
@@ -1,5 +1,7 @@
package de.heatup.cfg; package de.heatup.cfg;
import de.heatup.logging.Logger;
/* /*
* Bitte hier eure Magicnumbers eintragen * Bitte hier eure Magicnumbers eintragen
*/ */
@@ -13,6 +15,10 @@ public class Config {
public static int gamePanelWidth = 800; public static int gamePanelWidth = 800;
public static int singleTilePixels = gamePanelWidth/mapMaxTilesWidth; public static int singleTilePixels = gamePanelWidth/mapMaxTilesWidth;
public static void setGamePanelWidth(int width) { public static void setGamePanelWidth(int width) {
// Wir wollen hier keine Reste!
while (width % mapMaxTilesHeight != 0) {
width--;
}
gamePanelWidth = width; gamePanelWidth = width;
updateSingleTilePixels(); updateSingleTilePixels();
} }