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

PredatorCZ / HavokLib / 89

06 Nov 2025 01:09PM UTC coverage: 63.837% (-3.2%) from 67.014%
89

push

github

PredatorCZ
s

3354 of 5254 relevant lines covered (63.84%)

129082.83 hits per line

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

68.18
/source/packfile/hka_animation_binding.cpp
1
/*  Havok Format Library
2
    Copyright(C) 2016-2022 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 "base.hpp"
19
#include "hklib/hka_animation.hpp"
20
#include "internal/hka_animationbinding.hpp"
21
#include <span>
22

23
#include "hka_animation_binding.inl"
24

25
struct hkaAnimationBindingMidInterface : hkaAnimationBindingInternalInterface {
26
  clgen::hkaAnimationBinding::Interface interface;
27

28
  hkaAnimationBindingMidInterface(clgen::LayoutLookup rules, char *data)
769✔
29
      : interface {
1,538✔
30
    data, rules
31
  } {
769✔
32
  }
769✔
33

34
  void SetDataPointer(void *ptr) override {
769✔
35
    interface.data = static_cast<char *>(ptr);
769✔
36
  }
769✔
37

38
  const void *GetPointer() const override { return interface.data; }
1,224✔
39

40
  void SwapEndian() override {
384✔
41
    clgen::EndianSwap(interface);
384✔
42

43
    for (std::span<int16> indices(interface.TransformTrackToBoneIndices(),
384✔
44
                                  interface.NumTransformTrackToBoneIndices());
384✔
45
         auto &i : indices) {
33,168✔
46
      FByteswapper(i);
32,400✔
47
    }
48

49
    for (std::span<int16> indices(interface.FloatTrackToFloatSlotIndices(),
384✔
50
                                  interface.NumFloatTrackToFloatSlotIndices());
384✔
51
         auto &i : indices) {
768✔
52
      FByteswapper(i);
×
53
    }
54

55
    for (std::span<int16> indices(interface.PartitionIndices(),
384✔
56
                                  interface.NumPartitionIndices());
384✔
57
         auto &i : indices) {
768✔
58
      FByteswapper(i);
×
59
    }
60
  }
384✔
61

62
  std::string_view GetSkeletonName() const override {
×
63
    return interface.SkeletonName();
×
64
  }
65

66
  const hkaAnimation *GetAnimation() const override {
×
67
    return safe_deref_cast<const hkaAnimation>(
×
68
        header->GetClass(interface.Animation()));
×
69
  }
70

71
  BlendHint GetBlendHint() const override { return interface.BlendHint(); }
456✔
72

73
  size_t GetNumTransformTrackToBoneIndices() const override {
456✔
74
    return interface.NumTransformTrackToBoneIndices();
456✔
75
  }
76
  int16 GetTransformTrackToBoneIndex(size_t id) const override {
35,784✔
77
    return interface.TransformTrackToBoneIndices()[id];
35,784✔
78
  }
79
  size_t GetNumFloatTrackToFloatSlotIndices() const override {
456✔
80
    return interface.NumFloatTrackToFloatSlotIndices();
456✔
81
  }
82
  int16 GetFloatTrackToFloatSlotIndex(size_t id) const override {
×
83
    return interface.FloatTrackToFloatSlotIndices()[id];
×
84
  }
85
  size_t GetNumPartitionIndices() const override {
×
86
    return interface.NumPartitionIndices();
×
87
  }
88
  int16 GetPartitionIndex(size_t id) const override {
×
89
    return interface.PartitionIndices()[id];
×
90
  }
91
};
92

93
CREATE_HK_CLASS(hkaAnimationBinding);
2✔
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

© 2026 Coveralls, Inc