1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Lazy `.anim` loading — the client's own scheme, in this parser's shape.
//
// A `.m2` keeps only some of its sequences' keys; the rest live in `.anim`
// siblings, one file per (animation id, variation). A character model can have
// a hundred of them and several megabytes of keys, and a viewer that plays one
// sequence has no use for the other ninety-nine.
//
// The client never reads them at load. CM2Model::LoadSequence is called when
// something asks a model to *play* a sequence; it walks the variation chain and
// hands each entry that is not already resident to
// CM2Shared::LoadLowPrioritySequence, which reads `%s%04d-%02d.anim`
// asynchronously and, on arrival, re-runs the model's fixup pass with
// `s_loadingSequence` set — resolving that one sequence's slice of every track
// against the file that just landed, and nothing else.
//
// Parser::setLazyAnimations(true) puts this parser on the same footing. The
// parse reads the keys the model carries itself and stops there, keeping each
// deferred sequence's KeySpanRef per track; loadSequence() below reads the
// sibling and fills in that one sequence's sub-arrays. The difference from the
// client is that the read here is synchronous and the keys are copied out of
// the buffer rather than pointed into it, so the `.anim` is dropped again once
// its keys are in the model.
//
// Off by default: an eagerly parsed model needs no follow-up call, and every
// existing caller keeps that behaviour.
namespace whiteout // namespace whiteout