From 9a919960c907abcd9dfb2660ce22c0a581798fde Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 3 Apr 2018 01:01:10 +0200 Subject: [PATCH] - fixd bad comparators for std::sort --- src/gl/scene/gl_drawinfo.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gl/scene/gl_drawinfo.cpp b/src/gl/scene/gl_drawinfo.cpp index ecbbac0b7..e36d4a487 100644 --- a/src/gl/scene/gl_drawinfo.cpp +++ b/src/gl/scene/gl_drawinfo.cpp @@ -625,7 +625,7 @@ SortNode * GLDrawList::SortSpriteList(SortNode * head) for(count=0,n=head;n;n=n->next) sortspritelist.Push(n); std::sort(sortspritelist.begin(), sortspritelist.end(), [=](SortNode *a, SortNode *b) { - return CompareSprites(a, b); + return CompareSprites(a, b) < 0; }); for(i=0;i 1) { - std::sort(drawitems.begin(), drawitems.end(), [=](const GLDrawItem &a, const GLDrawItem &b) -> int + std::sort(drawitems.begin(), drawitems.end(), [=](const GLDrawItem &a, const GLDrawItem &b) -> bool { GLWall * w1 = &walls[a.index]; GLWall * w2 = &walls[b.index]; - if (w1->gltexture != w2->gltexture) return w1->gltexture - w2->gltexture; - return ((w1->flags & 3) - (w2->flags & 3)); + if (w1->gltexture != w2->gltexture) return w1->gltexture < w2->gltexture; + return (w1->flags & 3) < (w2->flags & 3); }); } @@ -926,7 +926,7 @@ void GLDrawList::SortFlats() { GLFlat * w1 = &flats[a.index]; GLFlat* w2 = &flats[b.index]; - return w1->gltexture - w2->gltexture; + return w1->gltexture < w2->gltexture; }); } }