Use tie for operator</> of surfflags_t
This commit is contained in:
parent
437459a4dd
commit
9602772450
|
|
@ -386,6 +386,18 @@ struct surfflags_t {
|
|||
minlight_color[1] || minlight_color[2] || phong_angle_concave ||
|
||||
light_alpha;
|
||||
}
|
||||
|
||||
constexpr auto as_tuple() const {
|
||||
return std::tie(native, extended, phong_angle, minlight, minlight_color[0], minlight_color[1], minlight_color[2], phong_angle_concave, light_alpha);
|
||||
}
|
||||
|
||||
constexpr bool operator<(const surfflags_t &other) const {
|
||||
return as_tuple() < other.as_tuple();
|
||||
}
|
||||
|
||||
constexpr bool operator>(const surfflags_t &other) const {
|
||||
return as_tuple() > other.as_tuple();
|
||||
}
|
||||
};
|
||||
|
||||
// header before tightly packed surfflags_t[num_texinfo]
|
||||
|
|
|
|||
|
|
@ -153,10 +153,9 @@ typedef struct mtexinfo_s {
|
|||
if (this->miptex > other.miptex)
|
||||
return false;
|
||||
|
||||
// CHECK: is it worth sorting by all members?
|
||||
if (this->flags.native < other.flags.native)
|
||||
if (this->flags < other.flags)
|
||||
return true;
|
||||
if (this->flags.native > other.flags.native)
|
||||
if (this->flags > other.flags)
|
||||
return false;
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue