public bool ProcessChunk(FileContext ctx) { while (ctx.ReadChunk()) { switch (ctx.chunk.id) { case kNamedObject: // (object block ctx.sp = 1; return(false); break; case kMatName: name = ctx.PopString(); break; case kMatAmb: ambient.ProcessChunk(ctx); break; case kMatDiff: diffuse.ProcessChunk(ctx); break; case kMatSpec: specular.ProcessChunk(ctx); break; case kMatTexMap: { TextureMap tex = new TextureMap(); if (tex.ProcessChunk(ctx)) { textures.Add(tex); } break; } default: ctx.SkipChunk(); break; } } return(true); }