Merge branch 'master' into title_screen

Conflicts:
	AndorsTrail/src/com/gpl/rpg/AndorsTrail/resource/tiles/TileManager.java
This commit is contained in:
Zukero
2018-02-28 17:09:23 +01:00
2 changed files with 12 additions and 9 deletions

View File

@@ -85,7 +85,7 @@ public final class TileManager {
public final TileCache tileCache = new TileCache();
public final TileCollection preloadedTiles = new TileCollection(116);
public TileCollection preloadedTiles;// = new TileCollection(116);
public TileCollection currentMapTiles;
public TileCollection adjacentMapTiles;
private final HashSet<Integer> preloadedTileIDs = new HashSet<Integer>();
@@ -336,12 +336,13 @@ public final class TileManager {
public void loadPreloadedTiles(Resources r) {
int maxTileID = tileCache.getMaxTileID();
if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) {
if (maxTileID > preloadedTiles.maxTileID) {
L.log("ERROR: TileManager.preloadedTiles needs to be initialized with at least " + maxTileID + " slots. Application will crash now.");
throw new IndexOutOfBoundsException("ERROR: TileManager.preloadedTiles needs to be initialized with at least " + maxTileID + " slots. Application will crash now.");
}
}
// if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) {
// if (maxTileID > preloadedTiles.maxTileID) {
// L.log("ERROR: TileManager.preloadedTiles needs to be initialized with at least " + maxTileID + " slots. Application will crash now.");
// throw new IndexOutOfBoundsException("ERROR: TileManager.preloadedTiles needs to be initialized with at least " + maxTileID + " slots. Application will crash now.");
// }
// }
preloadedTiles = new TileCollection(maxTileID);
for(int i = TileManager.BEGIN_ID; i <= maxTileID; ++i) {
preloadedTileIDs.add(i);
}

View File

@@ -221,8 +221,10 @@ public final class MainView extends SurfaceView
}
private void redrawAll(RedrawAllDebugReason why) {
if (scrolling && why != RedrawAllDebugReason.MapScrolling) return;
if (!scrolling && movingSprites > 0 && why != RedrawAllDebugReason.SpriteMoved) return;
if (preferences.enableUiAnimations) {
if (scrolling && why != RedrawAllDebugReason.MapScrolling) return;
if (!scrolling && movingSprites > 0 && why != RedrawAllDebugReason.SpriteMoved) return;
}
redrawArea_(mapViewArea, null, 0, 0);
}
private void redrawTile(final Coord p, RedrawTileDebugReason why) {