|
@@ -112,13 +112,13 @@ void Render::drawLoadScreen()
|
112
|
112
|
}
|
113
|
113
|
|
114
|
114
|
|
115
|
|
-int compareEntites(const void *voidA, const void *voidB)
|
|
115
|
+bool compareEntites(const void *voidA, const void *voidB)
|
116
|
116
|
{
|
117
|
117
|
entity_t *a = (entity_t *)voidA, *b = (entity_t *)voidB;
|
118
|
118
|
vec_t distA, distB;
|
119
|
119
|
|
120
|
120
|
if (!a || !b)
|
121
|
|
- return -1; // error really
|
|
121
|
+ return false; // error really
|
122
|
122
|
|
123
|
123
|
distA = gViewVolume.getDistToSphereFromNear(a->pos[0],
|
124
|
124
|
a->pos[1],
|
|
@@ -129,22 +129,17 @@ int compareEntites(const void *voidA, const void *voidB)
|
129
|
129
|
b->pos[2],
|
130
|
130
|
1.0f);
|
131
|
131
|
|
132
|
|
- // less than
|
133
|
|
- if (distA < distB)
|
134
|
|
- return -1;
|
135
|
|
-
|
136
|
|
- // greater than ( no need for equal )
|
137
|
|
- return 1;
|
|
132
|
+ return (distA < distB);
|
138
|
133
|
}
|
139
|
134
|
|
140
|
135
|
|
141
|
|
-int compareStaticModels(const void *voidA, const void *voidB)
|
|
136
|
+bool compareStaticModels(const void *voidA, const void *voidB)
|
142
|
137
|
{
|
143
|
138
|
static_model_t *a = (static_model_t *)voidA, *b = (static_model_t *)voidB;
|
144
|
139
|
vec_t distA, distB;
|
145
|
140
|
|
146
|
141
|
if (!a || !b)
|
147
|
|
- return -1; // error really
|
|
142
|
+ return false; // error really
|
148
|
143
|
|
149
|
144
|
distA = gViewVolume.getDistToSphereFromNear(a->pos[0],
|
150
|
145
|
a->pos[1],
|
|
@@ -155,30 +150,20 @@ int compareStaticModels(const void *voidA, const void *voidB)
|
155
|
150
|
b->pos[2],
|
156
|
151
|
128.0f);
|
157
|
152
|
|
158
|
|
- // less than
|
159
|
|
- if (distA < distB)
|
160
|
|
- return -1;
|
161
|
|
-
|
162
|
|
- // greater than ( no need for equal )
|
163
|
|
- return 1;
|
|
153
|
+ return (distA < distB);
|
164
|
154
|
}
|
165
|
155
|
|
166
|
156
|
|
167
|
|
-int compareRoomDist(const void *voidA, const void *voidB)
|
|
157
|
+bool compareRoomDist(const void *voidA, const void *voidB)
|
168
|
158
|
{
|
169
|
159
|
const RenderRoom *a = static_cast<const RenderRoom *>(voidA);
|
170
|
160
|
const RenderRoom *b = static_cast<const RenderRoom *>(voidB);
|
171
|
161
|
|
172
|
162
|
|
173
|
163
|
if (!a || !b || !a->room || !b->room)
|
174
|
|
- return -1; // error really
|
175
|
|
-
|
176
|
|
- // less than
|
177
|
|
- if (a->dist < b->dist)
|
178
|
|
- return -1;
|
|
164
|
+ return false; // error really
|
179
|
165
|
|
180
|
|
- // greater than ( no need for equal )
|
181
|
|
- return 1;
|
|
166
|
+ return (a->dist < b->dist);
|
182
|
167
|
}
|
183
|
168
|
|
184
|
169
|
|