mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-08 20:07:11 +00:00
TWINE: use Common::sort and remove the dirty cast
This commit is contained in:
parent
e38cc4dc24
commit
ce23193986
@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "twine/holomap.h"
|
||||
#include "common/algorithm.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/memstream.h"
|
||||
#include "common/stream.h"
|
||||
@ -149,10 +150,6 @@ void Holomap::loadHolomapGFX() {
|
||||
_holomapPaletteIndex = 0;
|
||||
}
|
||||
|
||||
static int sortHolomapSurfaceCoordsByDepth(const void *a1, const void *a2) {
|
||||
return (int)*(const int16 *)a1 - (int)*(const int16 *)a2;
|
||||
}
|
||||
|
||||
void Holomap::prepareHolomapSurface(Common::SeekableReadStream *holomapSurfaceStream) {
|
||||
int holomapSurfaceArrayIdx = 0;
|
||||
_engine->_renderer->setBaseRotation(0, 0, 0);
|
||||
@ -225,7 +222,7 @@ void Holomap::prepareHolomapPolygons() {
|
||||
assert(holomapSortArrayIdx == ARRAYSIZE(_holomapSort));
|
||||
assert(holomapSurfaceArrayIdx == ARRAYSIZE(_holomapSurface));
|
||||
assert(_projectedSurfaceIndex == ARRAYSIZE(_projectedSurfacePositions));
|
||||
qsort(_holomapSort, ARRAYSIZE(_holomapSort), sizeof(HolomapSort), sortHolomapSurfaceCoordsByDepth);
|
||||
Common::sort(_holomapSort, _holomapSort + ARRAYSIZE(_holomapSort), [](const HolomapSort &a, const HolomapSort &b) { return a.z < b.z; });
|
||||
}
|
||||
|
||||
bool Holomap::isTriangleVisible(const Vertex *vertices) const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user