• 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/material.cpp
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
#include "material.hpp"
19
#include "../property.hpp"
20
#include <charconv>
21

22
// clang-format off
23
namespace {
UNCOV
24
void ToXML(const MODMaterialX70::VSHData &item, pugi::xml_node node) {
×
UNCOV
25
  NewPrimitive(node, "lightningType", item.Get<MODMaterialX70::LightningType>());
×
UNCOV
26
  NewPrimitive(node, "normalMapType", item.Get<MODMaterialX70::NormalMapType>());
×
UNCOV
27
  NewPrimitive(node, "specularType", item.Get<MODMaterialX70::SpecularType>());
×
UNCOV
28
  NewPrimitive(node, "lightMapType", item.Get<MODMaterialX70::LightMapType>());
×
UNCOV
29
  NewPrimitive(node, "multiTextureType", item.Get<MODMaterialX70::MultiTextureType>());
×
30
}
31

UNCOV
32
void ToXML(const MODMaterialX70::PSHData &item, pugi::xml_node node) {
×
UNCOV
33
  NewPrimitive(node, "enableFOG", bool(item.Get<MODMaterialX70::EnableFOG>()));
×
UNCOV
34
  NewPrimitive(node, "ZWrite", bool(item.Get<MODMaterialX70::ZWrite>()));
×
UNCOV
35
  NewPrimitive(node, "attr", item.Get<MODMaterialX70::Attr>());
×
UNCOV
36
  NewPrimitive(node, "no", item.Get<MODMaterialX70::No>());
×
UNCOV
37
  NewPrimitive(node, "envmapBias", item.Get<MODMaterialX70::EnvmapBias>());
×
UNCOV
38
  NewPrimitive(node, "VType", item.Get<MODMaterialX70::VType>());
×
UNCOV
39
  NewPrimitive(node, "enableUVScroll", bool(item.Get<MODMaterialX70::EnableUVScroll>()));
×
UNCOV
40
  NewPrimitive(node, "ZTest", bool(item.Get<MODMaterialX70::ZTest>()));
×
41
}
42

43
template<class Mat>
UNCOV
44
void ToXML(const Mat &item, pugi::xml_node node) {
×
UNCOV
45
  ToXML(item.vshData, node);
×
UNCOV
46
  ToXML(item.pshData, node);
×
UNCOV
47
  NewPrimitive(node, "technique", item.technique);
×
UNCOV
48
  NewPrimitive(node, "baseTextureIndex", item.baseTextureIndex);
×
UNCOV
49
  NewPrimitive(node, "normalTextureIndex", item.normalTextureIndex);
×
UNCOV
50
  NewPrimitive(node, "maskTextureIndex", item.maskTextureIndex);
×
UNCOV
51
  NewPrimitive(node, "lightTextureIndex", item.lightTextureIndex);
×
UNCOV
52
  NewPrimitive(node, "shadowTextureIndex", item.shadowTextureIndex);
×
UNCOV
53
  NewPrimitive(node, "additionalTextureIndex", item.additionalTextureIndex);
×
UNCOV
54
  NewPrimitive(node, "cubeMapTextureIndex", item.cubeMapTextureIndex);
×
UNCOV
55
  NewPrimitive(node, "heightTextureIndex", item.heightTextureIndex);
×
UNCOV
56
  NewPrimitive(node, "glossTextureIndex", item.glossTextureIndex);
×
UNCOV
57
  NewPrimitive(node, "transparency", item.transparency);
×
UNCOV
58
  NewPrimitive(node, "fresnelFactor", item.fresnelFactor);
×
UNCOV
59
  NewPrimitive(node, "lightMapScale", item.lightMapScale);
×
UNCOV
60
  NewPrimitive(node, "detailFactor", item.detailFactor);
×
UNCOV
61
  NewPrimitive(node, "transmit", item.transmit);
×
UNCOV
62
  NewPrimitive(node, "paralax", item.paralax);
×
UNCOV
63
  NewPrimitive(node, "blendState", item.blendState);
×
UNCOV
64
  NewPrimitive(node, "alphaRef", item.alphaRef);
×
65
}
UNCOV
66
}
×
UNCOV
67
// clang-format on
×
UNCOV
68

×
UNCOV
69
void MODMaterialX70::ToXML(pugi::xml_node node) const { ::ToXML(*this, node); }
×
UNCOV
70

×
UNCOV
71
void MODMaterialX170::ToXML(pugi::xml_node node) const { ::ToXML(*this, node); }
×
UNCOV
72

×
73
void MODMaterialXC5::ToXML(pugi::xml_node node) const { ::ToXML(*this, node); }
×
74

×
75
std::string MODMaterialX70::Name() const {
×
76
  char buffer[0x10]{};
×
UNCOV
77
  std::to_chars(std::begin(buffer), std::end(buffer), blendState, 0x10);
×
UNCOV
78
  return std::string("Material_") + buffer;
×
79
}
×
80

×
81
std::string MODMaterialHash::Name() const {
×
82
  char buffer[0x10]{};
×
UNCOV
83
  std::to_chars(std::begin(buffer), std::end(buffer), hash, 0x10);
×
UNCOV
84
  return std::string("Material_") + buffer;
×
85
}
×
UNCOV
86

×
87
void MODMaterialHash::ToXML(pugi::xml_node node) const {
UNCOV
88
  NewPrimitive(node, "hash", hash);
×
UNCOV
89
}
×
UNCOV
90

×
UNCOV
91
std::string MODMaterialName::Name() const { return name; }
×
UNCOV
92

×
UNCOV
93
void MODMaterialName::ToXML(pugi::xml_node node) const {
×
UNCOV
94
  pugi::xml_node matNode = NewProperty(MtPropertyType::string_, node);
×
UNCOV
95
  matNode.append_attribute("name").set_value("name");
×
UNCOV
96
  matNode.append_attribute("value").set_value(name);
×
UNCOV
97
}
×
UNCOV
98

×
UNCOV
99
void MODMaterialX21::ToXML(pugi::xml_node node) const {
×
UNCOV
100
  pugi::xml_node matNode = NewProperty(MtPropertyType::string_, node);
×
UNCOV
101
  matNode.append_attribute("name").set_value("name");
×
UNCOV
102
  matNode.append_attribute("value").set_value(name.c_str());
×
UNCOV
103
}
×
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