Skip to content

Instantly share code, notes, and snippets.

@talklittle
Created December 21, 2012 05:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save talklittle/4350948 to your computer and use it in GitHub Desktop.
libgdx MD2Loader modification to fix animation name truncation
// in loadFrame()
int len = 0;
for (int i = 0; i < charBuffer.length; i++) {
// The following line changes to do proper truncation of frame index
// appended to the Marker name by the junaio export script from
// http://www.junaio.com/develop/docs/documenation/general/3dmodels/
if (charBuffer[i] == 0 || Character.isDigit(charBuffer[i])) {
len = i; // was len = i - 1 (off by 1 error)
break;
}
}
frame.name = new String(charBuffer, 0, len);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment