From 1b2719174faa515d978393f43d0c879142c763f7 Mon Sep 17 00:00:00 2001 From: codereader Date: Sat, 7 May 2022 18:43:16 +0200 Subject: [PATCH] #5955: Fix player start not being rendered (in a new map) after a large map has been loaded. The code to determine whether a 4-component colour is "less" than another (as used in the shader pass sorting) was prone to collisions. --- include/version.h | 2 +- radiantcore/rendersystem/backend/OpenGLStateLess.h | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/version.h b/include/version.h index bcd9952db9..8ba98857b8 100644 --- a/include/version.h +++ b/include/version.h @@ -4,7 +4,7 @@ #include #define RADIANT_VERSION PACKAGE_VERSION #else -#define RADIANT_VERSION "3.0.0pre5" +#define RADIANT_VERSION "3.0.0pre6" #endif #define RADIANT_APPNAME "DarkRadiant" diff --git a/radiantcore/rendersystem/backend/OpenGLStateLess.h b/radiantcore/rendersystem/backend/OpenGLStateLess.h index 7bb040d10a..7856afe966 100644 --- a/radiantcore/rendersystem/backend/OpenGLStateLess.h +++ b/radiantcore/rendersystem/backend/OpenGLStateLess.h @@ -8,8 +8,12 @@ namespace render // Compare two Colour4 values inline bool Colour4_less(const Colour4& a, const Colour4& b) { - return a.x() * a.x() + a.y() * a.y() + a.z() * a.z() + a.w() * a.w() < - b.x() * b.x() + b.y() * b.y() + b.z() * b.z() + b.w() * b.w(); + if (a.x() != b.x()) return a.x() < b.x(); + if (a.y() != b.y()) return a.y() < b.y(); + if (a.z() != b.z()) return a.z() < b.z(); + if (a.w() != b.w()) return a.w() < b.w(); + + return false; } /**