Skip to content

Commit

Permalink
Don't limit texture count + fix loading screen
Browse files Browse the repository at this point in the history
  • Loading branch information
minecraft8997 committed Nov 22, 2023
1 parent a681362 commit 483125c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 1 addition & 0 deletions core/src/ru/mclord/classic/LoadingScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void render(float delta) {

int x = i * TextureManager.getInstance().getTextureSize();
if (x >= width) break;
System.out.println("Drawing at " + x + " " + PROGRESS_BAR_HEIGHT);
batch.draw(blockTexture, x, PROGRESS_BAR_HEIGHT);
}
double percentage = progress / 100.0D;
Expand Down
12 changes: 3 additions & 9 deletions core/src/ru/mclord/classic/TextureManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,11 @@ public void load(String path, boolean allowNet, boolean allowFileSystem) {
int width = image.getWidth();
int height = image.getHeight();

int textureSize;
int textureCount = -1;
if (height == width) {
textureCount = 256;
} else if (height == width * 2) {
textureCount = 512;
} else {
illegalTerrainDimensions();
}
int textureCount;
if (width % 16 != 0) illegalTerrainDimensions();
textureSize = width / 16;
if (height % textureSize != 0) illegalTerrainDimensions();
textureCount = (height / textureSize) * 16;

textures = new Texture[textureCount];

Expand Down

0 comments on commit 483125c

Please sign in to comment.