+ inputStream.read(reinterpret_cast<byte*>(skinnameRelative), MD2_MAX_SKINNAME);
+ // relative texture path - allows moving of models in game dir structure without changing the skinpath
+ // e.g. used in ufo:ai
+ if (skinnameRelative[0] == '.')
+ {
+ strncpy(path, file.getName(), MD2_MAX_SKINNAME);
+ for (; i--;)
+ {
+ // skip filename
+ if (path[i] == '/' || path[i] == '\\')
+ break;
+ path[i] = '\0';
+ }
+// globalErrorStream() << "modified skinname: " << path << " (path) and " << skinnameRelative << " (texture)" << "\n";
+ snprintf(skinname, MD2_MAX_SKINNAME, "%s%s", path, &skinnameRelative[1]);
+// globalErrorStream() << skinname << "\n";
+ }
+ else
+ {
+ strcpy(skinname, skinnameRelative);
+ }