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

PredatorCZ / HavokLib / 90

07 Nov 2025 09:36AM UTC coverage: 62.461% (-1.4%) from 63.837%
90

push

github

PredatorCZ
add support for scene data

556 of 1153 new or added lines in 22 files covered. (48.22%)

205 existing lines in 35 files now uncovered.

2777 of 4446 relevant lines covered (62.46%)

124997.44 hits per line

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

46.88
/source/packfile/hka_mesh_binding.cpp
1
/*  Havok Format Library
2
    Copyright(C) 2016-2025 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 "internal/hka_meshbinding.hpp"
20
#include "internal/hkx_mesh.hpp"
21

22
#include "hka_mesh_binding.inl"
23

24
struct hkaMeshBindingMidInterface : hkaMeshBindingInternalInterface {
25
  clgen::hkaMeshBinding::Interface interface;
26

27
  hkaMeshBindingMidInterface(clgen::LayoutLookup rules, char *data)
64✔
28
      : interface{data, rules} {}
64✔
29

30
  void SetDataPointer(void *ptr) override {
64✔
31
    interface.data = static_cast<char *>(ptr);
64✔
32
  }
64✔
33

34
  const void *GetPointer() const override { return interface.data; }
48✔
35

36
  void SwapEndian() override {
32✔
37
    clgen::EndianSwap(interface);
32✔
38
    auto mappings = interface.Mappings();
32✔
39
    const uint32 numMappings = interface.NumMappings();
40

41
    for (uint32 i = 0; i < numMappings; i++, mappings.Next()) {
32✔
NEW
42
      clgen::EndianSwap(mappings);
×
43
      auto mapping = mappings.Mapping();
44
      const uint32 numIndices = mappings.NumMapping();
45

NEW
46
      for (uint32 j = 0; j < numIndices; j++) {
×
NEW
47
        FByteswapper(mapping[j]);
×
48
      }
49
    }
50

51
    es::Matrix44 *boneTms = interface.BoneFromSkinMeshTransforms();
52
    const uint32 numBoneTMs = interface.NumBoneFromSkinMeshTransforms();
53

54
    for (uint32 i = 0; i < numBoneTMs; i++) {
256✔
55
      FByteswapper(boneTms[i]);
224✔
56
    }
57
  }
32✔
58

NEW
59
  uni::Element<hkxMesh> Mesh() const override {
×
NEW
60
    auto mesh = interface.Mesh();
×
NEW
61
    return {hkxMeshInternalInterface::Create(&mesh), true};
×
62
  }
63

NEW
64
  std::string_view SkeletonName() const override {
×
NEW
65
    return safe_sw(interface.SkeletonName());
×
66
  }
67

NEW
68
  std::string_view Name() const override { return safe_sw(interface.Name()); }
×
69

NEW
70
  uni::Element<hkaSkeleton> Skeleton() const override { return {}; }
×
71

NEW
72
  size_t NumMappings() const override { return interface.NumMappings(); }
×
73

NEW
74
  std::span<const int16> Mappings(size_t at) const override {
×
NEW
75
    return {interface.Mappings().Next(at).Mapping(),
×
NEW
76
            interface.Mappings().Next(at).NumMapping()};
×
77
  }
78

NEW
79
  std::span<const es::Matrix44> BoneFromSkinMeshTransforms() const override {
×
80
    return {interface.BoneFromSkinMeshTransforms(),
NEW
81
            interface.NumBoneFromSkinMeshTransforms()};
×
82
  }
83
};
84

85
CREATE_HK_CLASS(hkaMeshBinding);
4✔
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