more texture creation logging
Some checks reported errors
studiorailgun/Renderer/pipeline/head Something is wrong with the build of this commit
Some checks reported errors
studiorailgun/Renderer/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
parent
831df3d6af
commit
88135c4fbe
@ -167,6 +167,7 @@ public class Texture {
|
||||
height = 1;
|
||||
try {
|
||||
BufferedImage image_data = ImageIO.read(FileUtils.getAssetFile(path));
|
||||
LoggerInterface.loggerRenderer.DEBUG("Read image");
|
||||
|
||||
//
|
||||
//transparency check
|
||||
@ -204,21 +205,16 @@ public class Texture {
|
||||
for(int x = 0; x < width; x++){
|
||||
Color temp = new Color(image_data.getRGB(x, y), hasTransparency);
|
||||
|
||||
if(data.position() + 3 > data.limit() + 1){
|
||||
throw new IllegalStateException("Hit buffer limit!");
|
||||
}
|
||||
data.put((byte)temp.getRed());
|
||||
data.put((byte)temp.getGreen());
|
||||
data.put((byte)temp.getBlue());
|
||||
if(hasTransparency){
|
||||
if(data.position() + 1 > data.limit() + 1){
|
||||
throw new IllegalStateException("Hit buffer limit!");
|
||||
}
|
||||
data.put((byte)temp.getAlpha());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
LoggerInterface.loggerRenderer.DEBUG("Failed to read image");
|
||||
ex.printStackTrace();
|
||||
hasTransparency = false;
|
||||
data = BufferUtils.createByteBuffer(3);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user