Skip to content

Commit

Permalink
Fix crash when texture atlas rowScale < 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Interrupt committed Dec 12, 2018
1 parent 6f3d4eb commit dfbbde0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dungeoneer/src/com/interrupt/dungeoneer/gfx/TextureAtlas.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ public void loadRepeating() {
Pixmap pixmap = Art.loadPixmap(filename);
spriteSize = pixmap.getWidth() / columns;

// Clamp to a valid size
if(rowScale < 1) {
rowScale = 1;
}

int spriteVerticalSize = spriteSize * rowScale;

final int atlasHeight = pixmap.getHeight() / spriteVerticalSize;
Expand Down

0 comments on commit dfbbde0

Please sign in to comment.