From 688af268469c9019e6221f48b74aedea5bebedc9 Mon Sep 17 00:00:00 2001 From: Ian Curtis Date: Sat, 2 Apr 2016 22:13:59 +0000 Subject: [PATCH] Possible work around for slightly incorrect viewport positions in ECA and harley --- Src/Graphics/New3D/New3D.cpp | 8 ++++++++ Src/Graphics/New3D/PolyHeader.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Src/Graphics/New3D/New3D.cpp b/Src/Graphics/New3D/New3D.cpp index c704ada..83d3087 100644 --- a/Src/Graphics/New3D/New3D.cpp +++ b/Src/Graphics/New3D/New3D.cpp @@ -647,6 +647,14 @@ void CNew3D::RenderViewport(UINT32 addr, int pri) vpHeight = (int)(((vpnode[0x14] >> 16) / 4.0f) + 0.5f); // height (14.2) matrixBase = vpnode[0x16] & 0xFFFFFF; // matrix base address + if (vpX) { + vpX += 2; + } + + if (vpY) { + vpY += 2; + } + LODBlendTable* tableTest = (LODBlendTable*)TranslateCullingAddress(vpnode[0x17]); float angle_left = -atan2(*(float *)&vpnode[12], *(float *)&vpnode[13]); diff --git a/Src/Graphics/New3D/PolyHeader.h b/Src/Graphics/New3D/PolyHeader.h index 8617115..784007b 100644 --- a/Src/Graphics/New3D/PolyHeader.h +++ b/Src/Graphics/New3D/PolyHeader.h @@ -35,7 +35,7 @@ xxxxxxxx xxxxxxxx xxxxxxxx -------- Polygon normal Y coordinate(2.22 fixed poin 0x03: xxxxxxxx xxxxxxxx xxxxxxxx -------- Polygon normal Z coordinate(2.22 fixed point) -------- -------- -------- --xxx--- Texture width(in 8 - pixel tiles) --------- -------- -------- ---- - xxx Texture height(in 8 - pixel tiles) +-------- -------- -------- -----xxx Texture height(in 8 - pixel tiles) 0x04: xxxxxxxx xxxxxxxx xxxxxxxx -------- Color(RGB888)