• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PredatorCZ / RevilLib / 162

17 Jun 2025 03:12PM UTC coverage: 11.187% (-0.06%) from 11.245%
162

push

github

PredatorCZ
smaller bugfixes

2 of 28 new or added lines in 4 files covered. (7.14%)

428 existing lines in 3 files now uncovered.

757 of 6767 relevant lines covered (11.19%)

6698.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/reng/codecs.cpp
1
/*  Revil Format Library
2
    Copyright(C) 2017-2023 Lukas Cone
3

4
    This program is free software : you can redistribute it and / or modify
5
    it under the terms of the GNU General Public License as published by
6
    the Free Software Foundation, either version 3 of the License, or
7
    (at your option) any later version.
8

9
    This program is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
12
    GNU General Public License for more details.
13

14
    You should have received a copy of the GNU General Public License
15
    along with this program.If not, see <https://www.gnu.org/licenses/>.
16
*/
17

18
#include "motion_78.hpp"
19
#include "spike/master_printer.hpp"
20
#include "spike/type/vectors_simd.hpp"
21
#include <unordered_map>
22

23
struct RETrackController_internal : RETrackController {
24
  enum FrameType { FrameType_short = 4, FrameType_char = 2 };
25
  struct {
26
    Vector4A16 min;
27
    Vector4A16 max;
28
  } minMaxBounds;
29
  FrameType frameType;
30
  uint32 componentID;
31
  uint8 *frames;
32
  uint32 numFrames;
33

34
  std::string dataBuffer;
35

36
  template <class C> void Assign_(C *data) {
×
37
    frameType = static_cast<FrameType>((data->flags >> 20) & 0xf);
×
38

39
    if (data->minMaxBounds) {
40
      minMaxBounds.max = Vector4A16(data->minMaxBounds->max);
×
41
      minMaxBounds.min = Vector4A16(data->minMaxBounds->min);
×
42
    }
43

44
    componentID = ((data->flags >> 12) & 0xf) - 1;
×
45
    frames = data->frames.operator->();
×
46
    numFrames = data->numFrames;
×
47
    Assign(data->controlPoints.operator->());
×
48
  }
49

×
50
  virtual void Assign(char *data) = 0;
×
51
  void Assign(RETrackCurve43 *iCurve) override { Assign_(iCurve); }
52
  void Assign(RETrackCurve65 *iCurve) override { Assign_(iCurve); }
53
  void Assign(RETrackCurve78 *iCurve) override { Assign_(iCurve); }
×
54

×
55
  uint16 GetFrame(uint32 id) const override {
56
    if (frameType == FrameType_short) {
57
      return reinterpret_cast<uint16 *>(frames)[id];
×
58
    } else {
×
59
      return frames[id];
×
60
    }
×
61
  }
62

×
63
  KnotSpan GetSpan(int32 frame) const override {
×
64
    KnotSpan retval;
65
    auto findSpan = [&](auto frames) {
66
      auto begin = frames;
×
67
      auto end = begin + numFrames;
×
68
      typename std::remove_pointer<decltype(frames)>::type frame_ = frame;
69
      auto lb = std::lower_bound(begin, end, frame_);
70
      retval.offset = std::distance(begin, lb);
×
71
      retval.second = *lb;
×
72
      retval.first = lb == begin ? *lb : *(lb - 1);
×
73
    };
×
74

75
    if (frameType == FrameType_short) {
×
76
      findSpan(reinterpret_cast<const uint16 *>(frames));
×
77
    } else {
78
      findSpan(frames);
79
    }
×
80

×
81
    return retval;
82
  }
83
};
×
84

×
85
struct LinearVector3Controller : RETrackController_internal {
×
86
  static constexpr uint32 ID = 0xF2;
×
87
  std::span<Vector> dataStorage;
88

89
  void Assign(char *data) override {
90
    Vector *start = reinterpret_cast<Vector *>(data);
×
91
    dataStorage = {start, start + numFrames};
×
92
  }
×
93

94
  void Evaluate(uint32 id, Vector4A16 &out) const override {
×
95
    out = dataStorage[id];
×
96
  }
×
97

NEW
98
  const char *CodecName() const override {
×
99
    return "LinearVector3Controller";
100
  }
101
};
102

×
103
struct BiLinearVector3_5bitController : RETrackController_internal {
UNCOV
104
  static constexpr uint32 ID = 0x200F2;
×
105
  std::span<uint16> dataStorage;
106

×
UNCOV
107
  static constexpr uint32 componentMask = 0x1f;
×
108
  static constexpr float componentMultiplier =
UNCOV
109
      1.0f / static_cast<float>(componentMask);
×
110

×
111
  void Assign(char *data) override {
×
112
    uint16 *start = reinterpret_cast<uint16 *>(data);
113
    dataStorage = {start, start + numFrames};
×
114

115
    minMaxBounds.max.Z = minMaxBounds.max.Y;
×
UNCOV
116
    minMaxBounds.max.Y = minMaxBounds.max.X;
×
117
    minMaxBounds.max.X = minMaxBounds.min.W;
UNCOV
118
  }
×
119

×
120
  void Evaluate(uint32 id, Vector4A16 &out) const override {
×
121
    const uint16 &retreived = dataStorage[id];
122
    IVector4A16 data(retreived, retreived >> 5, retreived >> 10, 0);
×
123

124
    out = data & componentMask;
×
UNCOV
125
    out = ((out * componentMultiplier) * minMaxBounds.min) + minMaxBounds.max;
×
126
  }
NEW
127
  const char *CodecName() const override {
×
NEW
128
    return "BiLinearVector3_5bitController";
×
NEW
129
  }
×
130
};
131

132
struct BiLinearVector3_10bitController : RETrackController_internal {
×
UNCOV
133
  static constexpr uint32 ID = 0x400F2;
×
134
  std::span<uint32> dataStorage;
135

×
136
  static constexpr uint32 componentMask = 0x3ff;
137
  static constexpr float componentMultiplier =
UNCOV
138
      1.0f / static_cast<float>(componentMask);
×
139

140
  void Assign(char *data) override {
141
    uint32 *start = reinterpret_cast<uint32 *>(data);
142
    dataStorage = {start, start + numFrames};
×
143

144
    minMaxBounds.max.Z = minMaxBounds.max.Y;
145
    minMaxBounds.max.Y = minMaxBounds.max.X;
UNCOV
146
    minMaxBounds.max.X = minMaxBounds.min.W;
×
147
  }
UNCOV
148

×
149
  void Evaluate(uint32 id, Vector4A16 &out) const override {
150
    const uint32 retreived = dataStorage[id];
UNCOV
151
    IVector4A16 data(retreived, retreived >> 10, retreived >> 20, 0);
×
UNCOV
152

×
153
    out = data & componentMask;
154
    out = ((out * componentMultiplier) * minMaxBounds.min) + minMaxBounds.max;
155
  }
×
NEW
156
  const char *CodecName() const override {
×
157
    return "BiLinearVector3_10bitController";
158
  }
159
};
UNCOV
160

×
161
struct BiLinearVector3_21bitController : RETrackController_internal {
162
  static constexpr uint32 ID = 0x800F2;
163
  std::span<uint64> dataStorage;
164

165
  static constexpr uint64 componentMask = (1 << 21) - 1;
166
  static constexpr float componentMultiplier =
167
      1.0f / static_cast<float>(componentMask);
UNCOV
168

×
169
  void Assign(char *data) override {
UNCOV
170
    uint64 *start = reinterpret_cast<uint64 *>(data);
×
171
    dataStorage = {start, start + numFrames};
UNCOV
172

×
UNCOV
173
    minMaxBounds.max.Z = minMaxBounds.max.Y;
×
174
    minMaxBounds.max.Y = minMaxBounds.max.X;
×
175
    minMaxBounds.max.X = minMaxBounds.min.W;
176
  }
UNCOV
177

×
178
  void Evaluate(uint32 id, Vector4A16 &out) const override {
×
179
    const uint64 &retreived = dataStorage[id];
×
180
    IVector4A16 data(retreived, retreived >> 21, retreived >> 42, 0);
181

182
    out = data & componentMask;
183
    out = ((out * componentMultiplier) * minMaxBounds.min) + minMaxBounds.max;
184
  }
×
NEW
185
  const char *CodecName() const override {
×
186
    return "BiLinearVector3_21bitController";
187
  }
188
};
UNCOV
189

×
190
struct BiLinearQuat3_13bitController : RETrackController_internal {
191
  static constexpr uint32 ID = 0x50112;
192
  struct SType {
193
    uint8 data[5];
194
  };
195
  std::span<SType> dataStorage;
196

UNCOV
197
  static constexpr uint64 componentMask = (1 << 13) - 1;
×
198
  static constexpr float componentMultiplier =
UNCOV
199
      1.0f / static_cast<float>(componentMask);
×
200

UNCOV
201
  void Assign(char *data) override {
×
UNCOV
202
    SType *start = reinterpret_cast<SType *>(data);
×
203
    dataStorage = {start, start + numFrames};
×
204
  }
205

UNCOV
206
  void Evaluate(uint32 id, Vector4A16 &out) const override {
×
207
    const uint64 retreived =
×
208
        (static_cast<uint64>(dataStorage[id].data[0]) << 32) |
×
209
        (static_cast<uint64>(dataStorage[id].data[1]) << 24) |
210
        (static_cast<uint64>(dataStorage[id].data[2]) << 16) |
211
        (static_cast<uint64>(dataStorage[id].data[3]) << 8) |
212
        (static_cast<uint64>(dataStorage[id].data[4]) << 0);
213
    IVector4A16 data(retreived, retreived >> 13, retreived >> 26, 0);
×
214
    out = data & componentMask;
×
215
    out = ((out * componentMultiplier) * minMaxBounds.min) + minMaxBounds.max;
216
    out *= Vector4A16(1.f, 1.f, 1.f, 0.0f);
217
    out.QComputeElement();
UNCOV
218
  }
×
219
  const char *CodecName() const override {
220
    return "BiLinearQuat3_13bitController";
221
  }
222
};
223

224
struct BiLinearQuat3_16bitController : RETrackController_internal {
225
  static constexpr uint32 ID = 0x60112;
UNCOV
226
  std::span<USVector> dataStorage;
×
227

UNCOV
228
  static constexpr uint32 componentMask = (1 << 16) - 1;
×
229
  static constexpr float componentMultiplier =
230
      1.0f / static_cast<float>(componentMask);
UNCOV
231

×
232
  void Assign(char *data) override {
×
233
    USVector *start = reinterpret_cast<USVector *>(data);
234
    dataStorage = {start, start + numFrames};
UNCOV
235
  }
×
236

×
237
  void Evaluate(uint32 id, Vector4A16 &out) const override {
×
238
    out = Vector4A16(dataStorage[id].Convert<float>(), 0.0f);
239
    out = ((out * componentMultiplier) * minMaxBounds.min) + minMaxBounds.max;
240
    out *= Vector4A16(1.f, 1.f, 1.f, 0.0f);
241
    out.QComputeElement();
242
  }
×
NEW
243
  const char *CodecName() const override {
×
244
    return "BiLinearQuat3_16bitController";
245
  }
246
};
UNCOV
247

×
248
struct BiLinearQuat3_18bitController : RETrackController_internal {
249
  static constexpr uint32 ID = 0x70112;
250
  struct SType {
251
    uint8 data[7];
252
  };
253
  std::span<SType> dataStorage;
254

255
  static constexpr uint64 componentMask = (1 << 18) - 1;
256
  static constexpr float componentMultiplier =
257
      1.0f / static_cast<float>(componentMask);
UNCOV
258

×
259
  void Assign(char *data) override {
UNCOV
260
    SType *start = reinterpret_cast<SType *>(data);
×
261
    dataStorage = {start, start + numFrames};
262
  }
UNCOV
263

×
264
  void Evaluate(uint32 id, Vector4A16 &out) const override {
UNCOV
265
    const uint64 retreived =
×
266
        (static_cast<uint64>(dataStorage[id].data[0]) << 48) |
×
UNCOV
267
        (static_cast<uint64>(dataStorage[id].data[1]) << 40) |
×
UNCOV
268
        (static_cast<uint64>(dataStorage[id].data[2]) << 32) |
×
269
        (static_cast<uint64>(dataStorage[id].data[3]) << 24) |
×
UNCOV
270
        (static_cast<uint64>(dataStorage[id].data[4]) << 16) |
×
271
        (static_cast<uint64>(dataStorage[id].data[5]) << 8) |
272
        (static_cast<uint64>(dataStorage[id].data[6]) << 0);
273

274
    IVector4A16 data(retreived, retreived >> 18, retreived >> 36, 0);
275

276
    out = data & componentMask;
×
UNCOV
277
    out = ((out * componentMultiplier) * minMaxBounds.min) + minMaxBounds.max;
×
278
    out *= Vector4A16(1.f, 1.f, 1.f, 0.0f);
279
    out.QComputeElement();
280
  }
NEW
281
  const char *CodecName() const override {
×
282
    return "BiLinearQuat3_18bitController";
283
  }
284
};
285

286
struct BiLinearQuat3_8bitController : RETrackController_internal {
287
  static constexpr uint32 ID = 0x30112;
288
  std::span<UCVector> dataStorage;
UNCOV
289

×
290
  static constexpr uint32 componentMask = 0xff;
UNCOV
291
  static constexpr float componentMultiplier =
×
292
      1.0f / static_cast<float>(componentMask);
293

UNCOV
294
  void Assign(char *data) override {
×
295
    UCVector *start = reinterpret_cast<UCVector *>(data);
×
296
    dataStorage = {start, start + numFrames};
297
  }
298

299
  void Evaluate(uint32 id, Vector4A16 &out) const override {
300
    out = Vector4A16(dataStorage[id].Convert<float>(), 1.0f);
×
301
    out = ((out * componentMultiplier) * minMaxBounds.min) + minMaxBounds.max;
×
302
    out *= Vector4A16(1.f, 1.f, 1.f, 0.0f);
303
    out.QComputeElement();
304
  }
NEW
305
  const char *CodecName() const override {
×
306
    return "BiLinearQuat3_8bitController";
307
  }
308
};
309

310
struct LinearQuat3Controller : LinearVector3Controller {
311
  static constexpr uint32 ID1 = 0xB0112;
312
  static constexpr uint32 ID2 = 0xC0112;
313

314
  void Evaluate(uint32 id, Vector4A16 &out) const override {
315
    LinearVector3Controller::Evaluate(id, out);
UNCOV
316
    out *= Vector4A16(1.f, 1.f, 1.f, 0.0f);
×
317
    out.QComputeElement();
UNCOV
318
  }
×
319
  const char *CodecName() const override {
320
    return "LinearQuat3Controller";
NEW
321
  }
×
322
};
UNCOV
323

×
UNCOV
324
struct BiLinearQuat3_5bitController : BiLinearVector3_5bitController {
×
325
  static constexpr uint32 ID = 0x20112;
×
UNCOV
326

×
327
  void Assign(char *data) override {
×
UNCOV
328
    uint16 *start = reinterpret_cast<uint16 *>(data);
×
UNCOV
329
    dataStorage = {start, start + numFrames};
×
330
  }
UNCOV
331

×
332
  void Evaluate(uint32 id, Vector4A16 &out) const override {
333
    BiLinearVector3_5bitController::Evaluate(id, out);
334
    out *= Vector4A16(1.f, 1.f, 1.f, 0.0f);
335
    out.QComputeElement();
336
  }
337
  const char *CodecName() const override {
NEW
338
    return "BiLinearQuat3_5bitController";
×
NEW
339
  }
×
340
};
341

342
struct BiLinearQuat3_10bitController : BiLinearVector3_10bitController {
343
  static constexpr uint32 ID1 = 0x30112;
×
344
  static constexpr uint32 ID2 = 0x40112;
345

346
  void Assign(char *data) override {
347
    uint32 *start = reinterpret_cast<uint32 *>(data);
348
    dataStorage = {start, start + numFrames};
349
  }
350

UNCOV
351
  void Evaluate(uint32 id, Vector4A16 &out) const override {
×
352
    BiLinearVector3_10bitController::Evaluate(id, out);
UNCOV
353
    out *= Vector4A16(1.f, 1.f, 1.f, 0.0f);
×
354
    out.QComputeElement();
355
  }
NEW
356
  const char *CodecName() const override {
×
NEW
357
    return "BiLinearQuat3_10bitController";
×
358
  }
359
};
360

361
struct BiLinearQuat3_21bitController : BiLinearVector3_21bitController {
UNCOV
362
  static constexpr uint32 ID1 = 0x70112;
×
363
  static constexpr uint32 ID2 = 0x80112;
×
364

365
  void Assign(char *data) override {
366
    uint64 *start = reinterpret_cast<uint64 *>(data);
UNCOV
367
    dataStorage = {start, start + numFrames};
×
368
  }
369

370
  void Evaluate(uint32 id, Vector4A16 &out) const override {
UNCOV
371
    BiLinearVector3_21bitController::Evaluate(id, out);
×
372
    out *= Vector4A16(1.f, 1.f, 1.f, 0.0f);
373
    out.QComputeElement();
374
  }
375
  const char *CodecName() const override {
NEW
376
    return "BiLinearQuat3_21bitController";
×
NEW
377
  }
×
378
};
379

380
struct LinearSCVector3Controller : RETrackController_internal {
UNCOV
381
  static constexpr uint32 ID1 = 0x310F2;
×
382
  static constexpr uint32 ID2 = 0x320F2;
383
  static constexpr uint32 ID3 = 0x330F2;
UNCOV
384
  static constexpr uint32 ID4 = 0x340F2;
×
385
  static constexpr uint32 ID5 = 0x410F2;
UNCOV
386
  static constexpr uint32 ID6 = 0x420F2;
×
387
  static constexpr uint32 ID7 = 0x430F2;
388
  static constexpr uint32 ID8 = 0x440F2;
UNCOV
389

×
390
  std::span<float> dataStorage;
391

392
  void Assign(char *data) override {
393
    float *start = reinterpret_cast<float *>(data);
UNCOV
394
    dataStorage = {start, start + numFrames};
×
395
  }
×
396

397
  void Evaluate(uint32 id, Vector4A16 &out) const override {
398
    const float &retreived = dataStorage[id];
UNCOV
399
    if (componentID == 3) {
×
400
      out = Vector4A16(retreived);
401
    } else {
402
      out = minMaxBounds.min;
UNCOV
403
      out[componentID] = retreived;
×
404
    }
405
  }
×
406
  const char *CodecName() const override {
407
    return "LinearSCVector3Controller";
NEW
408
  }
×
409
};
410

411
struct BiLinearSCVector3_16bitController : RETrackController_internal {
412
  static constexpr uint32 ID1 = 0x210F2;
UNCOV
413
  static constexpr uint32 ID2 = 0x220F2;
×
414
  static constexpr uint32 ID3 = 0x230F2;
×
415
  static constexpr uint32 ID4 = 0x240F2;
416

417
  std::span<uint16> dataStorage;
UNCOV
418

×
419
  static constexpr uint32 componentMask = (1 << 16) - 1;
420
  static constexpr float componentMultiplier =
421
      1.0f / static_cast<float>(componentMask);
UNCOV
422

×
423
  void Assign(char *data) override {
424
    uint16 *start = reinterpret_cast<uint16 *>(data);
×
425
    dataStorage = {start, start + numFrames};
426
  }
UNCOV
427

×
428
  void Evaluate(uint32 id, Vector4A16 &out) const override {
429
    const uint16 &retreived = dataStorage[id];
430
    float decompVal = minMaxBounds.min[(componentID % 3) + 1] +
431
                      (minMaxBounds.min[0] *
UNCOV
432
                       (static_cast<float>(retreived) * componentMultiplier));
×
433
    if (componentID == 3) {
×
434
      out = Vector4A16(decompVal);
435
    } else {
436
      out.X = minMaxBounds.min.Y;
UNCOV
437
      out.Y = minMaxBounds.min.Z;
×
438
      out.Z = minMaxBounds.min.W;
439
      out[componentID] = decompVal;
440
    }
441
  }
442
  const char *CodecName() const override {
443
    return "BiLinearSCVector3_16bitController";
444
  }
445
};
446

447
struct BiLinearSCQuat3Controller : LinearSCVector3Controller {
448
  static constexpr uint32 ID1 = 0x31112;
UNCOV
449
  static constexpr uint32 ID2 = 0x32112;
×
450
  static constexpr uint32 ID3 = 0x33112;
UNCOV
451
  static constexpr uint32 ID4 = 0x41112;
×
452
  static constexpr uint32 ID5 = 0x42112;
453
  static constexpr uint32 ID6 = 0x43112;
UNCOV
454

×
NEW
455
  void Evaluate(uint32 id, Vector4A16 &out) const override {
×
UNCOV
456
    out[componentID] = dataStorage[id];
×
457
    out.QComputeElement();
×
458
  }
NEW
459
  const char *CodecName() const override {
×
NEW
460
    return "BiLinearSCQuat3Controller";
×
461
  }
462
};
463

×
464
struct BiLinearSCQuat3_16bitController : BiLinearSCVector3_16bitController {
×
465
  static constexpr uint32 ID1 = 0x21112;
466
  static constexpr uint32 ID2 = 0x22112;
467
  static constexpr uint32 ID3 = 0x23112;
468

×
469
  void Evaluate(uint32 id, Vector4A16 &out) const override {
470
    const uint16 &retreived = dataStorage[id];
471
    out[componentID] = minMaxBounds.min[1] +
472
                       (minMaxBounds.min[0] *
473
                        (static_cast<float>(retreived) * componentMultiplier));
474
    out.QComputeElement();
475
  }
476
  const char *CodecName() const override {
477
    return "BiLinearSCQuat3_16bitController";
478
  }
479
};
UNCOV
480

×
481
struct BiLinearSCQuat3_16bitController_old : BiLinearSCQuat3_16bitController {
UNCOV
482
  static constexpr uint32 ID1 = 0x21112;
×
483
  static constexpr uint32 ID2 = 0x22112;
484
  static constexpr uint32 ID3 = 0x23112;
UNCOV
485

×
NEW
486
  void Evaluate(uint32 id, Vector4A16 &out) const override {
×
UNCOV
487
    const uint16 &retreived = dataStorage[id];
×
UNCOV
488
    out[componentID] = minMaxBounds.max[componentID] +
×
489
                       (minMaxBounds.min[componentID] *
×
UNCOV
490
                        (static_cast<float>(retreived) * componentMultiplier));
×
491
    out.QComputeElement();
×
492
  }
NEW
493
  const char *CodecName() const override {
×
NEW
494
    return "BiLinearSCQuat3_16bitController_old";
×
NEW
495
  }
×
496
};
×
497

498
using ptr_type_ = std::unique_ptr<RETrackController_internal>;
499

×
500
template <class C> ptr_type_ controlDummy() { return std::make_unique<C>(); }
×
501

502
template <class C, size_t id> struct id_ {
503
  constexpr static auto get() { return C::ID; }
UNCOV
504
};
×
505

506
template <class C> struct id_<C, 1> {
507
  constexpr static auto get() { return C::ID1; }
508
};
509

510
template <class C> struct id_<C, 2> {
511
  constexpr static auto get() { return C::ID2; }
UNCOV
512
};
×
513

×
514
template <class C> struct id_<C, 3> {
515
  constexpr static auto get() { return C::ID3; }
UNCOV
516
};
×
UNCOV
517

×
518
template <class C> struct id_<C, 4> {
519
  constexpr static auto get() { return C::ID4; }
520
};
521

×
522
template <class C> struct id_<C, 5> {
523
  constexpr static auto get() { return C::ID5; }
524
};
525

UNCOV
526
template <class C> struct id_<C, 6> {
×
527
  constexpr static auto get() { return C::ID6; }
×
UNCOV
528
};
×
UNCOV
529

×
UNCOV
530
template <class C> struct id_<C, 7> {
×
531
  constexpr static auto get() { return C::ID7; }
532
};
533

×
534
template <class C> struct id_<C, 8> {
×
535
  constexpr static auto get() { return C::ID8; }
536
};
537

UNCOV
538
template <class C, size_t id = 0> auto make() {
×
539
  return std::make_pair(id_<C, id>::get(), controlDummy<C>);
540
}
541

542
static const std::unordered_map<uint32, ptr_type_ (*)()> curveControllers = {
UNCOV
543
    make<LinearVector3Controller>(),
×
UNCOV
544
    make<LinearQuat3Controller, 1>(),
×
UNCOV
545
    make<BiLinearSCQuat3Controller, 1>(),
×
546
    make<BiLinearSCQuat3Controller, 2>(),
×
547
    make<BiLinearSCQuat3Controller, 3>(),
×
548
    make<BiLinearSCQuat3_16bitController, 1>(),
549
    make<BiLinearSCQuat3_16bitController, 2>(),
550
    make<BiLinearSCQuat3_16bitController, 3>(),
×
UNCOV
551
    make<LinearSCVector3Controller, 1>(),
×
552
    make<LinearSCVector3Controller, 2>(),
553
    make<LinearSCVector3Controller, 3>(),
554
    make<LinearSCVector3Controller, 4>(),
555
    make<BiLinearSCVector3_16bitController, 1>(),
556
    make<BiLinearSCVector3_16bitController, 2>(),
557
    make<BiLinearSCVector3_16bitController, 3>(),
×
558
    make<BiLinearSCVector3_16bitController, 4>(),
×
559
    make<BiLinearQuat3_10bitController, 1>(),
×
560
    make<BiLinearQuat3_21bitController, 1>(),
×
561
};
×
562

×
563
RETrackController::Ptr RETrackCurve65::GetController() {
×
564
  const uint32 type = flags & 0xff0fffff;
×
565

×
566
  if (curveControllers.count(type)) {
×
567
    auto iCon = curveControllers.at(type)();
×
568
    iCon->Assign(this);
×
569
    return iCon;
×
570
  } else {
×
571
    printerror("[RETrackController]: Unhandled curve compression: " << std::hex
×
572
                                                                    << type);
×
573
  }
×
574

×
575
  return {};
576
}
577

578
static const std::unordered_map<uint32, ptr_type_ (*)()> curveControllers78 = {
579
    make<LinearVector3Controller>(),
580
    make<LinearQuat3Controller, 2>(),
581

582
    make<BiLinearSCQuat3Controller, 4>(),
583
    make<BiLinearSCQuat3Controller, 5>(),
584
    make<BiLinearSCQuat3Controller, 6>(),
585

586
    make<BiLinearSCQuat3_16bitController, 1>(),
587
    make<BiLinearSCQuat3_16bitController, 2>(),
588
    make<BiLinearSCQuat3_16bitController, 3>(),
589

590
    make<LinearSCVector3Controller, 5>(),
591
    make<LinearSCVector3Controller, 6>(),
592
    make<LinearSCVector3Controller, 7>(),
593
    make<LinearSCVector3Controller, 8>(),
594

595
    make<BiLinearSCVector3_16bitController, 1>(),
596
    make<BiLinearSCVector3_16bitController, 2>(),
597
    make<BiLinearSCVector3_16bitController, 3>(),
598
    make<BiLinearSCVector3_16bitController, 4>(),
599

600
    make<BiLinearVector3_5bitController>(),
601
    make<BiLinearVector3_10bitController>(),
602
    make<BiLinearVector3_21bitController>(),
603

604
    make<BiLinearQuat3_5bitController>(),
605
    make<BiLinearQuat3_8bitController>(),
606
    make<BiLinearQuat3_10bitController, 2>(),
607
    make<BiLinearQuat3_13bitController>(),
608
    make<BiLinearQuat3_16bitController>(),
609
    make<BiLinearQuat3_18bitController>(),
610
    make<BiLinearQuat3_21bitController, 2>(),
611
};
612

613
RETrackController::Ptr RETrackCurve78::GetController() {
614
  const uint32 type = flags & 0xff0fffff;
615

616
  if (curveControllers78.count(type)) {
617
    auto iCon = curveControllers78.at(type)();
618
    iCon->Assign(this);
619
    return iCon;
620
  } else {
621
    printerror("[RETrackController]: Unhandled curve compression: " << std::hex
622
                                                                    << type);
623
  }
624

625
  return {};
626
}
627

628
static const std::unordered_map<uint32, ptr_type_ (*)()> curveControllers43 = {
629
    make<LinearVector3Controller>(),
630
    make<LinearQuat3Controller, 1>(),
631

632
    make<BiLinearSCQuat3Controller, 1>(),
633
    make<BiLinearSCQuat3Controller, 2>(),
634
    make<BiLinearSCQuat3Controller, 3>(),
635

636
    make<BiLinearSCQuat3_16bitController_old, 1>(),
637
    make<BiLinearSCQuat3_16bitController_old, 2>(),
×
638
    make<BiLinearSCQuat3_16bitController_old, 3>(),
×
639

640
    make<BiLinearQuat3_10bitController, 1>(),
641
    make<BiLinearQuat3_21bitController, 1>(),
×
642
};
×
643

644
RETrackController::Ptr RETrackCurve43::GetController() {
645
  const uint32 type = flags & 0xff0fffff;
×
646

647
  if (curveControllers43.count(type)) {
648
    auto iCon = curveControllers43.at(type)();
649
    iCon->Assign(this);
650
    return iCon;
651
  } else {
652
    printerror("[RETrackController]: Unhandled curve compression: " << std::hex
653
                                                                    << type);
654
  }
655

656
  return {};
657
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc