MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / readHeader

Function readHeader

physx/samples/samplebase/AcclaimLoader.cpp:288–317  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

286
287///////////////////////////////////////////////////////////////////////////////
288static bool readHeader(SampleFileBuffer& buffer, Acclaim::ASFData& data)
289{
290 using namespace Acclaim;
291
292 char token[MAX_TOKEN_LENGTH], value[MAX_TOKEN_LENGTH];
293
294 while (buffer.getNextTokenButMarker(token) == true)
295 {
296
297 if (strcmp(token, "mass") == 0)
298 {
299 if (buffer.getNextFloat(data.mHeader.mMass) == false)
300 return false;
301 }
302 else if (strcmp(token, "length") == 0)
303 {
304 if (buffer.getNextFloat(data.mHeader.mLengthUnit) == false)
305 return false;
306 }
307 else if (strcmp(token, "angle") == 0)
308 {
309 if (buffer.getNextToken(value, true) == false)
310 return false;
311
312 data.mHeader.mAngleInDegree = (strcmp(value, "deg") == 0);
313 }
314 }
315
316 return true;
317}
318
319///////////////////////////////////////////////////////////////////////////////
320static bool readRoot(SampleFileBuffer& buffer, Acclaim::ASFData& data)

Callers 1

readASFDataMethod · 0.70

Calls 4

strcmpFunction · 0.85
getNextTokenButMarkerMethod · 0.80
getNextFloatMethod · 0.80
getNextTokenMethod · 0.80

Tested by

no test coverage detected