diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-26 18:10:04 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-28 13:41:37 +0000 |
| commit | dd0570f4c7babf825c255d4a70eb65cdfbef98c3 (patch) | |
| tree | 027aa27a142933c134681a216da816612f8b51b9 /gfx | |
| parent | Support for the BillboardPainter (diff) | |
| download | ilt-dd0570f4c7babf825c255d4a70eb65cdfbef98c3.tar.bz2 ilt-dd0570f4c7babf825c255d4a70eb65cdfbef98c3.tar.xz ilt-dd0570f4c7babf825c255d4a70eb65cdfbef98c3.zip | |
Allow specifying all three partition functions independently
Two predicate version behaviour is unchanged, the second predicate is
just the inverse of the third.
Diffstat (limited to 'gfx')
| -rw-r--r-- | gfx/gl/instanceVertices.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gfx/gl/instanceVertices.h b/gfx/gl/instanceVertices.h index 2417a91..ecadf8f 100644 --- a/gfx/gl/instanceVertices.h +++ b/gfx/gl/instanceVertices.h @@ -144,9 +144,16 @@ public: PartitionResult partition(Pred1 pred1, Pred2 pred2) { + return partition(pred1, std::not_fn(pred2), pred2); + } + + template<typename Pred1, typename Pred2, typename Pred3> + PartitionResult + partition(Pred1 pred1, Pred2 pred2, Pred3 pred3) + { auto boundary1 = partition(base::begin(), base::end(), pred1); - auto begin2 = partition(base::begin(), boundary1, std::not_fn(pred2)); - auto end2 = partition(boundary1, base::end(), pred2); + auto begin2 = partition(base::begin(), boundary1, pred2); + auto end2 = partition(boundary1, base::end(), pred3); return {indexOf(boundary1), {indexOf(begin2), indexOf(end2)}}; } |
