Skip to content

Commit

Permalink
#5955: Fix player start not being rendered (in a new map) after a lar…
Browse files Browse the repository at this point in the history
…ge 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.
  • Loading branch information
codereader committed May 7, 2022
1 parent 2b94826 commit 1b27191
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/version.h
Expand Up @@ -4,7 +4,7 @@
#include <config.h>
#define RADIANT_VERSION PACKAGE_VERSION
#else
#define RADIANT_VERSION "3.0.0pre5"
#define RADIANT_VERSION "3.0.0pre6"
#endif

#define RADIANT_APPNAME "DarkRadiant"
Expand Down
8 changes: 6 additions & 2 deletions radiantcore/rendersystem/backend/OpenGLStateLess.h
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 1b27191

Please sign in to comment.