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

PredatorCZ / RevilLib / 185

21 Apr 2026 07:59PM UTC coverage: 8.612% (-2.1%) from 10.756%
185

push

github

PredatorCZ
update sdl

3 of 459 new or added lines in 1 file covered. (0.65%)

2404 existing lines in 10 files now uncovered.

762 of 8848 relevant lines covered (8.61%)

4773.72 hits per line

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

0.0
/src/mtf_mod/common.hpp
1
/*  Revil Format Library
2
    Copyright(C) 2017-2026 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
#pragma once
19
#include "pugixml.hpp"
20
#include "revil/mod.hpp"
21
#include "spike/reflect/reflector.hpp"
22
#include "spike/type/matrix44.hpp"
23

24
namespace revil {
25
class MODImpl;
26
}
27

28
struct MODMetaDataV2 : revil::MODMetaData {
29
  uint32 numEnvelopes;
30
};
31

32
template <size_t numRemaps> struct MODSkinRemap {
33
  uint32 count;
34
  uint8 bones[numRemaps];
35
};
36

37
template <size_t size> struct MODPath {
38
  char path[size];
39
  void NoSwap();
40
};
41

42
class revil::MODImpl {
43
public:
44
  using ptr = std::unique_ptr<MODImpl>;
45

46
  std::string vertexBuffer;
47
  std::vector<uint16> indexBuffer;
48
  std::vector<es::Matrix44> refPoses;
49
  std::vector<es::Matrix44> transforms;
50
  std::vector<MODEnvelope> envelopes;
51
  std::vector<MODGroup> groups;
52
  Vector4A16 boundingSphere;
53
  MtAABB boundingBox;
54
  MODMetaData simpleMetadata;
55
  std::vector<MODPrimitive> primitives;
56
  std::vector<MODSkinJoints> skins;
57
  std::vector<std::string> paths;
58
  std::vector<MODVertexSpan> vertices;
59
  std::vector<MODIndexSpan> indices;
60
  std::vector<MODMaterial *> materialRefs;
61
  std::vector<MODBone> simpleBones;
62

63
  virtual ~MODImpl() = default;
×
UNCOV
64
  MODImpl(const MODImpl &) = delete;
×
65
  MODImpl() = default;
×
66
  MODImpl(MODImpl &&) = default;
UNCOV
67

×
UNCOV
68
  virtual void Reflect(bool) = 0;
×
69
  virtual const MODMetaData &Metadata() const = 0;
70
};
71

72
template <class T> using use_name = decltype(std::declval<T>().Name());
73
template <class C>
74
constexpr static bool use_name_v = es::is_detected_v<use_name, C>;
75

76
template <class material_type>
77
class MODMaterialProxy : public revil::MODMaterial {
78
public:
UNCOV
79
  material_type main;
×
80

81
  std::string GetName() const override {
82
    if constexpr (use_name_v<std::decay_t<decltype(main)>>) {
UNCOV
83
      return main.Name();
×
84
    }
UNCOV
85

×
86
    return {};
87
  }
UNCOV
88
  void ToXML(pugi::xml_node node) const override { main.ToXML(node); }
×
89
  void Write(BinWritterRef) const;
UNCOV
90
  void Read(BinReaderRef_e);
×
91
};
92

93
template <class traits> struct MODInner : revil::MODImpl {
94
  std::vector<MODMaterialProxy<typename traits::material>> materials;
95
  std::vector<typename traits::bone> bones;
96
  std::vector<MODSkinRemap<traits::numSkinRemaps>> skinRemaps;
97

×
98
  uint8 remaps[traits::numRemaps];
99
  std::vector<typename traits::mesh> meshes;
×
100
  size_t unkBufferSize;
101
  typename traits::metadata metadata;
102

103
  void Reflect(bool) override;
104
  const revil::MODMetaData &Metadata() const override { return metadata; }
×
105
};
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