MCPcopy Create free account
hub / github.com/assimp/assimp / TAcCheckedLoadFloatArray

Function TAcCheckedLoadFloatArray

code/AssetLib/AC/ACLoader.cpp:117–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115// read 1 to n floats prefixed with an optional predefined identifier
116template <class T>
117inline const char *TAcCheckedLoadFloatArray(const char *buffer, const char *end, const char *name, size_t name_length, size_t num, T *out) {
118 buffer = AcSkipToNextToken(buffer, end);
119 if (0 != name_length) {
120 if (0 != strncmp(buffer, name, name_length) || !IsSpace(buffer[name_length])) {
121 ASSIMP_LOG_ERROR("AC3D: Unexpected token. ", name, " was expected.");
122 return buffer;
123 }
124 buffer += name_length + 1;
125 }
126 for (unsigned int _i = 0; _i < num; ++_i) {
127 buffer = AcSkipToNextToken(buffer, end);
128 buffer = fast_atoreal_move(buffer, ((float *)out)[_i]);
129 }
130
131 return buffer;
132}
133
134// ------------------------------------------------------------------------------------------------
135// Reverses vertex indices in a face.

Callers 2

LoadObjectSectionMethod · 0.85
InternReadFileMethod · 0.85

Calls 3

AcSkipToNextTokenFunction · 0.85
fast_atoreal_moveFunction · 0.85
IsSpaceFunction · 0.50

Tested by

no test coverage detected