Skip to content

Commit b4071a8

Browse files
authored
Merge pull request #301 from chaoticgd/remove_dead_code
Remove some dead code
2 parents fe90d2c + 62758ec commit b4071a8

File tree

2 files changed

+4
-88
lines changed

2 files changed

+4
-88
lines changed

src/core/util/basic_util.h

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
wrench - A set of modding tools for the Ratchet & Clank PS2 games.
3-
Copyright (C) 2019-2022 chaoticgd
3+
Copyright (C) 2019-2025 chaoticgd
44
55
This program is free software: you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -61,33 +61,6 @@ u32 byte_swap_32(u32 val);
6161

6262
std::size_t parse_number(std::string x);
6363

64-
// Kludge since C++ still doesn't have proper reflection.
65-
#define DEF_FIELD(member) \
66-
{ \
67-
auto temp = std::move(member); \
68-
t.field(#member, temp); \
69-
member = std::move(temp); \
70-
}
71-
#define DEF_PACKED_FIELD(member) \
72-
{ \
73-
auto temp = member; \
74-
t.field(#member, temp); \
75-
member = temp; \
76-
}
77-
#define DEF_HEXDUMP(member) \
78-
{ \
79-
auto temp = std::move(member); \
80-
t.hexdump(#member, temp); \
81-
member = std::move(temp); \
82-
}
83-
84-
template <typename> struct MemberTraits;
85-
template <typename Return, typename Object>
86-
struct MemberTraits<Return (Object::*)>
87-
{
88-
typedef Object instance_type;
89-
};
90-
9164
template <typename T>
9265
using Opt = std::optional<T>;
9366

src/engine/basic_types.h

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
wrench - A set of modding tools for the Ratchet & Clank PS2 games.
3-
Copyright (C) 2019-2021 chaoticgd
3+
Copyright (C) 2019-2025 chaoticgd
44
55
This program is free software: you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -16,8 +16,8 @@
1616
along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*/
1818

19-
#ifndef WAD_BASIC_TYPES_H
20-
#define WAD_BASIC_TYPES_H
19+
#ifndef ENGINE_BASIC_TYPES_H
20+
#define ENGINE_BASIC_TYPES_H
2121

2222
#include <glm/glm.hpp>
2323

@@ -28,14 +28,6 @@ packed_struct(Vec3f,
2828
f32 y;
2929
f32 z;
3030

31-
template <typename T>
32-
void enumerate_fields(T& t)
33-
{
34-
DEF_PACKED_FIELD(x);
35-
DEF_PACKED_FIELD(y);
36-
DEF_PACKED_FIELD(z);
37-
}
38-
3931
glm::vec3 unpack() const
4032
{
4133
return glm::vec3(x, y, z);
@@ -57,15 +49,6 @@ packed_struct(Vec4f,
5749
f32 z;
5850
f32 w;
5951

60-
template <typename T>
61-
void enumerate_fields(T& t)
62-
{
63-
DEF_PACKED_FIELD(x);
64-
DEF_PACKED_FIELD(y);
65-
DEF_PACKED_FIELD(z);
66-
DEF_PACKED_FIELD(w);
67-
}
68-
6952
glm::vec4 unpack() const
7053
{
7154
return glm::vec4(x, y, z, w);
@@ -95,24 +78,6 @@ packed_struct(Mat3,
9578
Vec4f m_1;
9679
Vec4f m_2;
9780

98-
template <typename T>
99-
void enumerate_fields(T& t)
100-
{
101-
Vec4f temp;
102-
103-
temp = m_0;
104-
t.field("0", temp);
105-
m_0 = temp;
106-
107-
temp = m_1;
108-
t.field("1", temp);
109-
m_1 = temp;
110-
111-
temp = m_2;
112-
t.field("2", temp);
113-
m_2 = temp;
114-
}
115-
11681
glm::mat3x4 unpack() const
11782
{
11883
glm::mat3x4 result;
@@ -138,28 +103,6 @@ packed_struct(Mat4,
138103
Vec4f m_2;
139104
Vec4f m_3;
140105

141-
template <typename T>
142-
void enumerate_fields(T& t)
143-
{
144-
Vec4f temp;
145-
146-
temp = m_0;
147-
t.field("0", temp);
148-
m_0 = temp;
149-
150-
temp = m_1;
151-
t.field("1", temp);
152-
m_1 = temp;
153-
154-
temp = m_2;
155-
t.field("2", temp);
156-
m_2 = temp;
157-
158-
temp = m_3;
159-
t.field("3", temp);
160-
m_3 = temp;
161-
}
162-
163106
glm::mat4 unpack() const
164107
{
165108
glm::mat4 result;

0 commit comments

Comments
 (0)