You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Revert floor sorting optimizations (#639)
They cause some weird collision bugs, and are thus not worth keeping until properly investigated.
This commit is contained in:
@@ -120,6 +120,7 @@ static void clear_static_surfaces(void) {
|
||||
*/
|
||||
static void add_surface_to_cell(s32 dynamic, s32 cellX, s32 cellZ, struct Surface *surface) {
|
||||
struct SurfaceNode *list;
|
||||
s32 priority;
|
||||
s32 sortDir = 1; // highest to lowest, then insertion order (water and floors)
|
||||
s32 listIndex;
|
||||
|
||||
@@ -135,6 +136,7 @@ static void add_surface_to_cell(s32 dynamic, s32 cellX, s32 cellZ, struct Surfac
|
||||
sortDir = 0; // insertion order
|
||||
}
|
||||
|
||||
s32 surfacePriority = surface->upperY * sortDir;
|
||||
|
||||
struct SurfaceNode *newNode = alloc_surface_node(dynamic);
|
||||
newNode->surface = surface;
|
||||
@@ -156,18 +158,14 @@ static void add_surface_to_cell(s32 dynamic, s32 cellX, s32 cellZ, struct Surfac
|
||||
}
|
||||
|
||||
// Loop until we find the appropriate place for the surface in the list.
|
||||
if (listIndex == SPATIAL_PARTITION_WATER) {
|
||||
s32 surfacePriority = surface->upperY * sortDir;
|
||||
s32 priority;
|
||||
while (list->next != NULL) {
|
||||
priority = list->next->surface->upperY * sortDir;
|
||||
while (list->next != NULL) {
|
||||
priority = list->next->surface->upperY * sortDir;
|
||||
|
||||
if (surfacePriority > priority) {
|
||||
break;
|
||||
}
|
||||
|
||||
list = list->next;
|
||||
if (surfacePriority > priority) {
|
||||
break;
|
||||
}
|
||||
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
newNode->next = list->next;
|
||||
|
||||
Reference in New Issue
Block a user