SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Toggle main menu visibility
Loading...
Searching...
No Matches
HOT.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <filesystem>
4
#include <cstddef>
5
#include <span>
6
#include <vector>
7
8
#include <
sourcepp/Macros.h
>
9
#include <
sourcepp/Math.h
>
10
11
namespace
vtfpp
{
12
13
class
HOT
{
14
public
:
15
struct
Rect
{
16
enum
Flags
: uint8_t {
17
FLAG_NONE
= 0,
18
FLAG_RANDOM_ROTATION
= 1 << 0,
19
FLAG_RANDOM_REFLECTION
= 1 << 1,
20
FLAG_IS_ALTERNATE
= 1 << 2,
21
}
flags
;
22
uint16_t
x1
;
23
uint16_t
y1
;
24
uint16_t
x2
;
25
uint16_t
y2
;
26
};
27
28
HOT
();
29
30
explicit
HOT
(std::span<const std::byte> hotData);
31
32
explicit
HOT
(
const
std::filesystem::path& hotPath);
33
34
[[nodiscard]]
explicit
operator
bool()
const
;
35
36
[[nodiscard]] uint8_t
getVersion
()
const
;
37
38
void
setVersion
(uint8_t v);
39
40
[[nodiscard]] uint8_t
getFlags
()
const
;
41
42
void
setFlags
(uint8_t f);
43
44
[[nodiscard]]
const
std::vector<Rect>&
getRects
()
const
;
45
46
[[nodiscard]] std::vector<Rect>&
getRects
();
47
48
[[nodiscard]] std::vector<std::byte>
bake
()
const
;
49
50
bool
bake
(
const
std::filesystem::path& hotPath)
const
;
// NOLINT(*-use-nodiscard)
51
52
protected
:
53
bool
opened
;
54
55
uint8_t
version
= 1;
56
uint8_t
flags
= 0;
57
std::vector<Rect>
rects
;
58
};
59
SOURCEPP_BITFLAGS_ENUM
(
HOT::Rect::Flags
)
60
61
}
// namespace vtfpp
Macros.h
SOURCEPP_BITFLAGS_ENUM
#define SOURCEPP_BITFLAGS_ENUM(Enum)
Defines bitwise operators for an enum or enum class.
Definition
Macros.h:29
Math.h
vtfpp::HOT::bake
std::vector< std::byte > bake() const
Definition
HOT.cpp:61
vtfpp::HOT::setVersion
void setVersion(uint8_t v)
Definition
HOT.cpp:38
vtfpp::HOT::HOT
HOT()
Definition
HOT.cpp:8
vtfpp::HOT::rects
std::vector< Rect > rects
Definition
HOT.h:57
vtfpp::HOT::getRects
const std::vector< Rect > & getRects() const
Definition
HOT.cpp:53
vtfpp::HOT::getFlags
uint8_t getFlags() const
Definition
HOT.cpp:45
vtfpp::HOT::setFlags
void setFlags(uint8_t f)
Definition
HOT.cpp:49
vtfpp::HOT::opened
bool opened
Definition
HOT.h:53
vtfpp::HOT::flags
uint8_t flags
Definition
HOT.h:56
vtfpp::HOT::version
uint8_t version
Definition
HOT.h:55
vtfpp::HOT::getVersion
uint8_t getVersion() const
Definition
HOT.cpp:34
vtfpp
Definition
DistanceMapping.h:8
vtfpp::HOT::Rect
Definition
HOT.h:15
vtfpp::HOT::Rect::y2
uint16_t y2
Definition
HOT.h:25
vtfpp::HOT::Rect::x1
uint16_t x1
Definition
HOT.h:22
vtfpp::HOT::Rect::x2
uint16_t x2
Definition
HOT.h:24
vtfpp::HOT::Rect::Flags
Flags
Definition
HOT.h:16
vtfpp::HOT::Rect::FLAG_IS_ALTERNATE
@ FLAG_IS_ALTERNATE
Definition
HOT.h:20
vtfpp::HOT::Rect::FLAG_RANDOM_REFLECTION
@ FLAG_RANDOM_REFLECTION
Definition
HOT.h:19
vtfpp::HOT::Rect::FLAG_NONE
@ FLAG_NONE
Definition
HOT.h:17
vtfpp::HOT::Rect::FLAG_RANDOM_ROTATION
@ FLAG_RANDOM_ROTATION
Definition
HOT.h:18
vtfpp::HOT::Rect::y1
uint16_t y1
Definition
HOT.h:23
include
vtfpp
HOT.h
Generated on
for SourcePP by
1.17.0