Skip to content

Commit 80bfd73

Browse files
committed
Refactor: Keep old behavior changed by previous commit
The following usages across the code base were changed `flt_min` -> `flt_lowest` `flt_zero` -> `flt_min` `dbl_zero` -> `dbl_min`
1 parent 2ff2326 commit 80bfd73

25 files changed

+34
-34
lines changed

src/Layers/xrRenderPC_R1/LightProjector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ void CLightProjector::calculate()
243243
v.sub(v_Cs, v_C);
244244
;
245245
#ifdef DEBUG
246-
if ((v.x * v.x + v.y * v.y + v.z * v.z) <= flt_zero)
246+
if ((v.x * v.x + v.y * v.y + v.z * v.z) <= flt_min)
247247
{
248248
IGameObject* OO = dynamic_cast<IGameObject*>(R.O);
249249
Msg("Object[%s] Visual[%s] has invalid position. ", *OO->cName(), *OO->cNameVisual());
@@ -274,7 +274,7 @@ void CLightProjector::calculate()
274274
}
275275
#endif
276276
// handle invalid object-bug
277-
if ((v.x * v.x + v.y * v.y + v.z * v.z) <= flt_zero)
277+
if ((v.x * v.x + v.y * v.y + v.z * v.z) <= flt_min)
278278
{
279279
// invalidate record, so that object will be unshadowed, but doesn't crash
280280
R.dwTimeValid = Device.dwTimeGlobal;

src/utils/xrAI/space_restrictor_wrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void CSpaceRestrictorWrapper::fill_shape(const CShapeData::shape_def& shape)
147147
Fvector().set(-.5f, +.5f, -.5f), Fvector().set(-.5f, +.5f, +.5f), Fvector().set(+.5f, -.5f, -.5f),
148148
Fvector().set(+.5f, -.5f, +.5f), Fvector().set(+.5f, +.5f, -.5f), Fvector().set(+.5f, +.5f, +.5f)};
149149
start = Fvector().set(flt_max, flt_max, flt_max);
150-
dest = Fvector().set(flt_min, flt_min, flt_min);
150+
dest = Fvector().set(flt_lowest, flt_lowest, flt_lowest);
151151
Fmatrix Q;
152152
Q.mul_43(m_xform, shape.data.box);
153153
Fvector temp;

src/utils/xrLC/OGF_Face.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void OGF::Optimize()
210210
// 1. Calc bounds
211211
Fvector2 Tmin,Tmax;
212212
Tmin.set(flt_max,flt_max);
213-
Tmax.set(flt_min,flt_min);
213+
Tmax.set(flt_lowest,flt_lowest);
214214
for (size_t j=0; j<x_vertices.size(); j++) {
215215
x_vertex& V = x_vertices[j];
216216
//Tmin.min (V.UV);
@@ -291,7 +291,7 @@ void OGF::Optimize()
291291
{
292292
Fvector2 Tmin, Tmax;
293293
Tmin.set(flt_max, flt_max);
294-
Tmax.set(flt_min, flt_min);
294+
Tmax.set(flt_lowest, flt_lowest);
295295
for (size_t j = 0; j < selection.size(); j++)
296296
{
297297
OGF_Vertex& V = data.vertices[selection[j]];

src/utils/xrLC_Light/MeshStructure.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ struct MESHSTRUCTURE_API Tface : public DataVertexType::DataFaceType, public vec
198198
t2.sub(v2, v1);
199199
dN.crossproduct(t1, t2);
200200
double mag = dN.magnitude();
201-
if (mag < dbl_zero)
201+
if (mag < dbl_min)
202202
{
203203
Failure();
204204
Dvector Nabs;

src/utils/xrMiscMath/matrix.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ _matrix<T>& _matrix<T>::invert(const _matrix<T>& a) // important: this is 4x3
155155
a._12 * (a._21 * a._33 - a._23 * a._31) +
156156
a._13 * (a._21 * a._32 - a._22 * a._31));
157157

158-
VERIFY(_abs(fDetInv) > flt_zero);
158+
VERIFY(_abs(fDetInv) > flt_min);
159159
fDetInv = 1.0f / fDetInv;
160160

161161
_11 = fDetInv * (a._22 * a._33 - a._23 * a._32);
@@ -188,7 +188,7 @@ bool _matrix<T>::invert_b(const _matrix<T>& a) // important: this is 4x3 inver
188188
a._12 * (a._21 * a._33 - a._23 * a._31) +
189189
a._13 * (a._21 * a._32 - a._22 * a._31));
190190

191-
if (_abs(fDetInv) <= flt_zero) return false;
191+
if (_abs(fDetInv) <= flt_min) return false;
192192
fDetInv = 1.0f / fDetInv;
193193

194194
_11 = fDetInv * (a._22 * a._33 - a._23 * a._32);
@@ -234,7 +234,7 @@ _matrix<T>& _matrix<T>::invert_44(const _matrix<T>& a)
234234
T A14 = -(a21 * mn3 - a22 * mn5 + a23 * mn6);
235235

236236
T detInv = a11 * A11 + a12 * A12 + a13 * A13 + a14 * A14;
237-
VERIFY(_abs(detInv) > flt_zero);
237+
VERIFY(_abs(detInv) > flt_min);
238238

239239
detInv = 1.f / detInv;
240240

src/utils/xrMiscMath/vector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ _vector3<T>& _vector3<T>::normalize_safe()
315315
template <typename T>
316316
_vector3<T>& _vector3<T>::normalize(const _vector3<T>& v)
317317
{
318-
VERIFY((v.x*v.x + v.y*v.y + v.z*v.z) > flt_zero);
318+
VERIFY((v.x*v.x + v.y*v.y + v.z*v.z) > flt_min);
319319
T mag = _sqrt(1 / (v.x*v.x + v.y*v.y + v.z*v.z));
320320
x = v.x*mag;
321321
y = v.y*mag;

src/xrCDB/Frustum.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ void CFrustum::SimplifyPoly_AABB(sPoly* poly, Fplane& plane)
295295
// Project and find extents
296296
Fvector2 min, max;
297297
min.set(flt_max, flt_max);
298-
max.set(flt_min, flt_min);
298+
max.set(flt_lowest, flt_lowest);
299299
for (auto& v : *poly)
300300
{
301301
Fvector2 tmp;

src/xrCore/_fbox.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ struct Fbox3
6767
auto& invalidate()
6868
{
6969
vMin.set(type_max<float>, type_max<float>, type_max<float>);
70-
vMax.set(type_min<float>, type_min<float>, type_min<float>);
70+
vMax.set(type_lowest<float>, type_lowest<float>, type_lowest<float>);
7171
return *this;
7272
}
7373

src/xrCore/_fbox2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct Fbox2
5757
auto& invalidate()
5858
{
5959
min.set(type_max<float>, type_max<float>);
60-
max.set(type_min<float>, type_min<float>);
60+
max.set(type_lowest<float>, type_lowest<float>);
6161
return *this;
6262
}
6363

src/xrCore/_rect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ struct _rect
7070
{
7171
lt.x = type_max<T>;
7272
lt.y = type_max<T>;
73-
rb.x = type_min<T>;
74-
rb.y = type_min<T>;
73+
rb.x = type_lowest<T>;
74+
rb.y = type_lowest<T>;
7575
return *this;
7676
};
7777
IC bool valide() { return lt.x1 < rb.x && lt.y < rb.y; }

0 commit comments

Comments
 (0)