Skip to content

Commit

Permalink
Add debug for issue #56
Browse files Browse the repository at this point in the history
  • Loading branch information
AymericBdy committed Jan 21, 2024
1 parent 1276400 commit b97ebcd
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/main/java/fr/dynamx/common/objloader/MTLLoader.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fr.dynamx.common.objloader;

import fr.dynamx.client.renders.model.texture.MaterialTexture;
import fr.dynamx.common.DynamXMain;
import fr.dynamx.common.objloader.data.Material;
import fr.dynamx.utils.RegistryNameSetter;
import lombok.Getter;
Expand Down Expand Up @@ -101,12 +102,17 @@ public void loadTextures() {
* It creates all gl texture ids, so it should be called in gl thread
*/
public void uploadTextures() {
TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
for (Material material : materials) {
material.ambientTexture.forEach((textureName, textures) -> textures.uploadTexture(textureManager));
material.diffuseTexture.forEach((textureName, textures) -> textures.uploadTexture(textureManager));
material.specularTexture.forEach((textureName, textures) -> textures.uploadTexture(textureManager));
material.normalTexture.forEach((textureName, textures) -> textures.uploadTexture(textureManager));
try {
TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
for (Material material : materials) {
material.ambientTexture.forEach((textureName, textures) -> textures.uploadTexture(textureManager));
material.diffuseTexture.forEach((textureName, textures) -> textures.uploadTexture(textureManager));
material.specularTexture.forEach((textureName, textures) -> textures.uploadTexture(textureManager));
material.normalTexture.forEach((textureName, textures) -> textures.uploadTexture(textureManager));
}
} catch (Exception e) {
DynamXMain.log.error("MTLLoader error", e);
throw new RuntimeException("MTLLoader error", e);
}
}
}

0 comments on commit b97ebcd

Please sign in to comment.