Skip to content

Commit 8fc4079

Browse files
committed
Remove unnecessary byte and call the variable c as in the formulas
1 parent 556b57c commit 8fc4079

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfUtils.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -382,21 +382,20 @@ public static float readAsFloat(LittleEndien stream, VertexBuffer.Format format)
382382
// 5121 (UNSIGNED_BYTE) f = c / 255.0 c = round(f * 255.0)
383383
// 5122 (SHORT) f = max(c / 32767.0, -1.0) c = round(f * 32767.0)
384384
// 5123 (UNSIGNED_SHORT) f = c / 65535.0 c = round(f * 65535.0)
385-
byte b;
386-
int s;
385+
int c;
387386
switch (format) {
388387
case Byte:
389-
b = stream.readByte();
390-
return Math.max(b / 127f, -1f);
388+
c = stream.readByte();
389+
return Math.max(c / 127f, -1f);
391390
case UnsignedByte:
392-
s = stream.readUnsignedByte();
393-
return s / 255f;
391+
c = stream.readUnsignedByte();
392+
return c / 255f;
394393
case Short:
395-
s = stream.readShort();
396-
return Math.max(s / 32767f, -1f);
394+
c = stream.readShort();
395+
return Math.max(c / 32767f, -1f);
397396
case UnsignedShort:
398-
s = stream.readUnsignedShort();
399-
return s / 65535f;
397+
c = stream.readUnsignedShort();
398+
return c / 65535f;
400399
default:
401400
//we have a regular float
402401
return stream.readFloat();

0 commit comments

Comments
 (0)