Switch box overlay transform type to 'matrix3x4_t'

Actual type turned out to be 'matrix3x4_t' after further reverse engineering.
This commit is contained in:
Kawe Mazidjatari 2023-01-23 02:20:21 +01:00
parent 6f02e3ae13
commit 502a1d2324
4 changed files with 7 additions and 7 deletions

View File

@ -135,7 +135,7 @@ void DrawOverlay(OverlayBase_t* pOverlay)
}
}
v_RenderBox(pBox->transforms, pBox->mins, pBox->maxs, Color(pBox->r, pBox->g, pBox->b, pBox->a), r_debug_overlay_zbuffer->GetBool());
v_RenderBox(pBox->transforms.mat, pBox->mins, pBox->maxs, Color(pBox->r, pBox->g, pBox->b, pBox->a), r_debug_overlay_zbuffer->GetBool());
break;
}
case OverlayType_t::OVERLAY_SPHERE:

View File

@ -71,7 +71,7 @@ struct OverlayBox_t : public OverlayBase_t
union
{
__m128 xmm[3];
Vector4D vec[3];
matrix3x4_t mat;
};
};
@ -170,7 +170,7 @@ inline CMemory p_RenderLine;
inline auto v_RenderLine = p_RenderLine.RCast<void* (*)(const Vector3D& vOrigin, const Vector3D& vDest, Color color, bool bZBuffer)>();
inline CMemory p_RenderBox;
inline auto v_RenderBox = p_RenderBox.RCast<void* (*)(const OverlayBox_t::Transforms& vTransforms, const Vector3D& vMins, const Vector3D& vMaxs, Color color, bool bZBuffer)>();
inline auto v_RenderBox = p_RenderBox.RCast<void* (*)(const matrix3x4_t& vTransforms, const Vector3D& vMins, const Vector3D& vMaxs, Color color, bool bZBuffer)>();
inline CMemory p_RenderWireframeSphere;
inline auto v_RenderWireframeSphere = p_RenderWireframeSphere.RCast<void* (*)(const Vector3D& vCenter, float flRadius, int nTheta, int nPhi, Color color, bool bZBuffer)>();
@ -212,7 +212,7 @@ class VDebugOverlay : public IDetour
v_DrawAllOverlays = p_DrawAllOverlays.RCast<void (*)(bool)>(); /*40 55 48 83 EC 30 48 8B 05 ?? ?? ?? ?? 0F B6 E9*/
v_DestroyOverlay = p_DestroyOverlay.RCast<void (*)(OverlayBase_t*)>(); /*40 53 48 83 EC 20 48 8B D9 48 8D 0D ?? ?? ?? ?? FF 15 ?? ?? ?? ?? 48 63 03 */
v_RenderBox = p_RenderBox.RCast<void* (*)(const OverlayBox_t::Transforms&, const Vector3D&, const Vector3D&, Color, bool)>(); /*48 89 5C 24 ?? 48 89 6C 24 ?? 44 89 4C 24 ??*/
v_RenderBox = p_RenderBox.RCast<void* (*)(const matrix3x4_t&, const Vector3D&, const Vector3D&, Color, bool)>(); /*48 89 5C 24 ?? 48 89 6C 24 ?? 44 89 4C 24 ??*/
v_RenderWireframeSphere = p_RenderWireframeSphere.RCast<void* (*)(const Vector3D&, float, int, int, Color, bool)>(); /*40 56 41 54 41 55 48 81 EC ?? ?? ?? ??*/
v_RenderLine = p_RenderLine.RCast<void* (*)(const Vector3D&, const Vector3D&, Color, bool)>(); /*48 89 74 24 ?? 44 89 44 24 ?? 57 41 56*/
}

View File

@ -76,7 +76,7 @@ void CAI_Utility::DrawAIScriptNetwork(const CAI_Network* pNetwork) const
vTransforms.xmm[1] = _mm_set_ps(xOrigin.m128_f32[1], 0.0f, 1.0f, 0.0f);
vTransforms.xmm[2] = _mm_set_ps(xOrigin.m128_f32[2], 1.0f, 0.0f, 0.0f);
v_RenderBox(vTransforms, *reinterpret_cast<const Vector3D*>(&xMins),
v_RenderBox(vTransforms.mat, *reinterpret_cast<const Vector3D*>(&xMins),
*reinterpret_cast<const Vector3D*>(&xMaxs), m_BoxColor, bUseDepthBuffer);
if (bDrawNearest) // Render links to the nearest node.
@ -154,7 +154,7 @@ void CAI_Utility::DrawNavMeshBVTree(dtNavMesh* pMesh) const
const __m128 xMaxs = _mm_add_ps(xTileAABB, _mm_mul_ps( // Formula: tile->header->bmax[axis]+node->bmax[axis]*cs;
_mm_setr_ps(pNode->bmax[0], pNode->bmax[1], pNode->bmax[2], 0.0f), xCellSize));
v_RenderBox(vTransforms, *reinterpret_cast<const Vector3D*>(&xMins), *reinterpret_cast<const Vector3D*>(&xMaxs),
v_RenderBox(vTransforms.mat, *reinterpret_cast<const Vector3D*>(&xMins), *reinterpret_cast<const Vector3D*>(&xMaxs),
Color(188, 188, 188, 255), bDepthBuffer);
}
}

View File

@ -17,7 +17,7 @@ class IVDebugOverlay
class CIVDebugOverlay : public IVDebugOverlay
{
public:
void AddBoxOverlay(__m128i& vTransforms, const Vector3D& vMins, const Vector3D& vMaxs, int r, int g, int b, int a, bool bZBuffer, float flDuration)
void AddBoxOverlay(matrix3x4_t& vTransforms, const Vector3D& vMins, const Vector3D& vMaxs, int r, int g, int b, int a, bool bZBuffer, float flDuration)
{
const static int index = 1;
CallVFunc<void>(index, this, vTransforms, vMins, vMaxs, r, g, b, a, bZBuffer, flDuration);