mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2026-10-12 00:38:00 +08:00
SDK sync.
This commit is contained in:
1 parent
7cc1bd2f96
commit
e2781a0000
558 files changed
+39082
-1463
No files matched your search
@@ -4246,7 +4246,7 @@ FPExceptionDisabler::FPExceptionDisabler()
|
||||
// Retrieve the current state of the exception flags. This
|
||||
// must be done before changing them. _MCW_EM is a bit
|
||||
// mask representing all available exception masks.
|
||||
_controlfp_s(&mOldValues, _MCW_EM, _MCW_EM);
|
||||
_controlfp_s(&mOldValues, 0, 0);
|
||||
// Set all of the exception flags, which suppresses FP
|
||||
// exceptions on the x87 and SSE units.
|
||||
_controlfp_s(0, _MCW_EM, _MCW_EM);
|
||||
@@ -4271,7 +4271,7 @@ FPExceptionEnabler::FPExceptionEnabler(unsigned int enableBits /*= _EM_OVERFLOW
|
||||
// Retrieve the current state of the exception flags. This
|
||||
// must be done before changing them. _MCW_EM is a bit
|
||||
// mask representing all available exception masks.
|
||||
_controlfp_s(&mOldValues, _MCW_EM, _MCW_EM);
|
||||
_controlfp_s(&mOldValues, 0, 0);
|
||||
|
||||
// Make sure no non-exception flags have been specified,
|
||||
// to avoid accidental changing of rounding modes, etc.
|
||||
|
||||
+4
-2
@@ -259,6 +259,7 @@ float FASTCALL _SSE_VectorNormalize (Vector& vec)
|
||||
"movaps %%xmm4, %1 \n\t"
|
||||
: "=m" (radius), "=m" (result)
|
||||
: "m" (*v)
|
||||
: "xmm1", "xmm2", "xmm3", "xmm4"
|
||||
);
|
||||
#else
|
||||
#error "Not Implemented"
|
||||
@@ -322,8 +323,9 @@ float _SSE_InvRSquared(const float* v)
|
||||
"maxss %%xmm5, %%xmm1 \n\t"
|
||||
"rcpss %%xmm1, %%xmm0 \n\t"
|
||||
"movss %%xmm0, %0 \n\t"
|
||||
: "=m" (inv_r2)
|
||||
: "m" (*v), "0" (inv_r2)
|
||||
: "+m" (inv_r2)
|
||||
: "m" (*v)
|
||||
: "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"
|
||||
);
|
||||
#else
|
||||
#error "Not Implemented"
|
||||
|
||||
+21
-1
@@ -509,7 +509,7 @@ bool VMatrix::IsRotationMatrix() const
|
||||
FloatMakePositive( v2.Dot(v3) ) < 0.01f;
|
||||
}
|
||||
|
||||
void VMatrix::SetupMatrixOrgAngles( const Vector &origin, const QAngle &vAngles )
|
||||
static void SetupMatrixAnglesInternal( vec_t m[4][4], const QAngle & vAngles )
|
||||
{
|
||||
float sr, sp, sy, cr, cp, cy;
|
||||
|
||||
@@ -530,6 +530,11 @@ void VMatrix::SetupMatrixOrgAngles( const Vector &origin, const QAngle &vAngles
|
||||
m[0][3] = 0.f;
|
||||
m[1][3] = 0.f;
|
||||
m[2][3] = 0.f;
|
||||
}
|
||||
|
||||
void VMatrix::SetupMatrixOrgAngles( const Vector &origin, const QAngle &vAngles )
|
||||
{
|
||||
SetupMatrixAnglesInternal( m, vAngles );
|
||||
|
||||
// Add translation
|
||||
m[0][3] = origin.x;
|
||||
@@ -542,6 +547,21 @@ void VMatrix::SetupMatrixOrgAngles( const Vector &origin, const QAngle &vAngles
|
||||
}
|
||||
|
||||
|
||||
void VMatrix::SetupMatrixAngles( const QAngle &vAngles )
|
||||
{
|
||||
SetupMatrixAnglesInternal( m, vAngles );
|
||||
|
||||
// Zero everything else
|
||||
m[0][3] = 0.0f;
|
||||
m[1][3] = 0.0f;
|
||||
m[2][3] = 0.0f;
|
||||
m[3][0] = 0.0f;
|
||||
m[3][1] = 0.0f;
|
||||
m[3][2] = 0.0f;
|
||||
m[3][3] = 1.0f;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Sets matrix to identity
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user