MCPcopy Create free account
hub / github.com/beefytech/Beef / TrySkipValue

Function TrySkipValue

BeefySysLib/gfx/glTF.cpp:290–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290static void TrySkipValue(GLTFPropsParser& propsParser)
291{
292 auto nextNode = propsParser.PeekNext();
293
294 if (nextNode.mKind == GLTFPropsParser::NodeKind_LBracket)
295 {
296 propsParser.GetNext();
297 propsParser.GetNext();
298 propsParser.GetNext();
299 nextNode = propsParser.PeekNext();
300 }
301
302 if (nextNode.mKind == GLTFPropsParser::NodeKind_Equals)
303 {
304 propsParser.GetNext();
305
306 int depth = 0;
307 do
308 {
309 auto node = propsParser.GetNext();
310 if (node.mKind == GLTFPropsParser::NodeKind_End)
311 return;
312 if (node.mKind == GLTFPropsParser::NodeKind_LBrace)
313 depth++;
314 else if (node.mKind == GLTFPropsParser::NodeKind_RBrace)
315 depth--;
316 if (node.mKind == GLTFPropsParser::NodeKind_LBracket)
317 depth++;
318 if (node.mKind == GLTFPropsParser::NodeKind_LBracket)
319 depth--;
320 } while (depth > 0);
321 }
322}
323
324static bool ExpectIndex(GLTFPropsParser& propsParser, int& idx)
325{

Callers 2

ParseMaterialDefMethod · 0.85
LoadModelPropsMethod · 0.85

Calls 2

PeekNextMethod · 0.80
GetNextMethod · 0.45

Tested by

no test coverage detected