From 26e5cfa2d528afed78a981a9a2fa128eb4a93dfc Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 9 Sep 2024 08:31:14 +0200 Subject: [PATCH] Consolidate duplicated `struct obj_sort_item` --- Descent3/render.cpp | 7 ------- Descent3/render.h | 6 ++++++ Descent3/terrainrender.cpp | 7 ------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Descent3/render.cpp b/Descent3/render.cpp index 0bdb96e1..52f4dd69 100644 --- a/Descent3/render.cpp +++ b/Descent3/render.cpp @@ -2986,13 +2986,6 @@ void RenderRoom(room *rp) { } #define MAX_OBJECTS_PER_ROOM 2000 -namespace { -struct obj_sort_item { - int vis_effect; - int objnum; - float dist; -}; -} obj_sort_item obj_sort_list[MAX_OBJECTS_PER_ROOM]; // Compare function for room face sort static int obj_sort_func(const obj_sort_item *a, const obj_sort_item *b) { diff --git a/Descent3/render.h b/Descent3/render.h index f863666f..2e5a4b7e 100644 --- a/Descent3/render.h +++ b/Descent3/render.h @@ -239,6 +239,12 @@ struct state_limited_element { int sort_key; }; +struct obj_sort_item { + int vis_effect; + int objnum; + float dist; +}; + #define MAX_STATE_ELEMENTS 8000 extern state_limited_element State_elements[MAX_STATE_ELEMENTS]; diff --git a/Descent3/terrainrender.cpp b/Descent3/terrainrender.cpp index 3fe57b8e..12c97c7d 100644 --- a/Descent3/terrainrender.cpp +++ b/Descent3/terrainrender.cpp @@ -940,13 +940,6 @@ float GetTerrainDynamicScalar(vector *pos, int seg) { } // Takes a min,max vector and makes a surrounding cube from it void MakePointsFromMinMax(vector *corners, vector *minp, vector *maxp); -namespace { -struct obj_sort_item { - int objnum; - float dist; - int vis_effect; -}; -} // Compare function for room face sort static int obj_sort_func(const obj_sort_item *a, const obj_sort_item *b) { if (a->dist < b->dist)