mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-01-23 03:39:10 +01:00
Fixed rendering when animations are disabled. Backported automatic
sizing of TileCollection from stoutford_tests.
This commit is contained in:
@@ -70,7 +70,7 @@ public final class TileManager {
|
||||
|
||||
|
||||
public final TileCache tileCache = new TileCache();
|
||||
public final TileCollection preloadedTiles = new TileCollection(114);
|
||||
public TileCollection preloadedTiles;// = new TileCollection(118);
|
||||
public TileCollection currentMapTiles;
|
||||
public TileCollection adjacentMapTiles;
|
||||
private final HashSet<Integer> preloadedTileIDs = new HashSet<Integer>();
|
||||
@@ -310,12 +310,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.CHAR_HERO; i <= maxTileID; ++i) {
|
||||
preloadedTileIDs.add(i);
|
||||
}
|
||||
|
||||
@@ -222,8 +222,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) {
|
||||
|
||||
Reference in New Issue
Block a user