Merge pull request #1644 from mesilliac/nonascii_chars_in_fbxmaterial_cpp

Fix non-ascii encoding in comments in FBXMaterial.cpp.
pull/1645/merge
Kim Kulling 2017-12-18 08:58:49 +01:00 committed by GitHub
commit 5ddc281c4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 26 deletions

View File

@ -291,40 +291,40 @@ Video::Video(uint64_t id, const Element& element, const Document& doc, const std
if(FileName) { if(FileName) {
fileName = ParseTokenAsString(GetRequiredToken(*FileName,0)); fileName = ParseTokenAsString(GetRequiredToken(*FileName,0));
} }
if(RelativeFilename) { if(RelativeFilename) {
relativeFileName = ParseTokenAsString(GetRequiredToken(*RelativeFilename,0)); relativeFileName = ParseTokenAsString(GetRequiredToken(*RelativeFilename,0));
} }
if(Content) { if(Content) {
//this field is ommited when the embedded texture is already loaded, let's ignore if it´s not found //this field is ommited when the embedded texture is already loaded, let's ignore if it's not found
try { try {
const Token& token = GetRequiredToken(*Content, 0); const Token& token = GetRequiredToken(*Content, 0);
const char* data = token.begin(); const char* data = token.begin();
if (!token.IsBinary()) { if (!token.IsBinary()) {
DOMWarning("video content is not binary data, ignoring", &element); DOMWarning("video content is not binary data, ignoring", &element);
} }
else if (static_cast<size_t>(token.end() - data) < 5) { else if (static_cast<size_t>(token.end() - data) < 5) {
DOMError("binary data array is too short, need five (5) bytes for type signature and element count", &element); DOMError("binary data array is too short, need five (5) bytes for type signature and element count", &element);
} }
else if (*data != 'R') { else if (*data != 'R') {
DOMWarning("video content is not raw binary data, ignoring", &element); DOMWarning("video content is not raw binary data, ignoring", &element);
} }
else { else {
// read number of elements // read number of elements
uint32_t len = 0; uint32_t len = 0;
::memcpy(&len, data + 1, sizeof(len)); ::memcpy(&len, data + 1, sizeof(len));
AI_SWAP4(len); AI_SWAP4(len);
contentLength = len; contentLength = len;
content = new uint8_t[len]; content = new uint8_t[len];
::memcpy(content, data + 5, len); ::memcpy(content, data + 5, len);
} }
} catch (runtime_error runtimeError) { } catch (runtime_error runtimeError) {
//we don´t need the content data for contents that has already been loaded //we don't need the content data for contents that has already been loaded
} }
} }
props = GetPropertyTable(doc,"Video.FbxVideo",element,sc); props = GetPropertyTable(doc,"Video.FbxVideo",element,sc);