MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / loadTexture

Method loadTexture

src/main/java/field/graphics/SlowJPEG.java:123–134  ·  view source on GitHub ↗
(int unit, boolean mips, String filename)

Source from the content-addressed store, hash-verified

121 @Override
122 public Texture.TextureSpecification loadTexture(int unit, boolean mips, String filename) {
123
124 int[] d = dimensions(filename);
125 if (d == null) return null;
126
127 ByteBuffer b = ByteBuffer.allocateDirect(3 * d[0] * d[1]);
128 decompress(filename, b, d[0], d[1]);
129 b.rewind();
130
131 return Texture.TextureSpecification.byte3(unit, d[0], d[1], b, mips);
132 }
133
134}

Callers

nothing calls this directly

Calls 3

dimensionsMethod · 0.95
decompressMethod · 0.95
byte3Method · 0.80

Tested by

no test coverage detected