From 3fdd9db9dc38f9773748a06e453d0694189f80b9 Mon Sep 17 00:00:00 2001 From: Ilya Shurumov Date: Tue, 16 Feb 2021 22:02:39 +0600 Subject: [PATCH] - fix shadow and map rendering when bilinear filtering is on --- src_rebuild/Game/C/motion_c.c | 8 ++++---- src_rebuild/Game/C/overmap.c | 30 ++++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src_rebuild/Game/C/motion_c.c b/src_rebuild/Game/C/motion_c.c index eeea596e..701c718b 100644 --- a/src_rebuild/Game/C/motion_c.c +++ b/src_rebuild/Game/C/motion_c.c @@ -1759,16 +1759,16 @@ void InitTannerShadow(void) if(GameLevel == 2) // [A] bug fix for vegas offs = 18; - poly->u0 = tannerShadow_texture.coords.u1 / 4; + poly->u0 = tannerShadow_texture.coords.u1 / 4 - 1; poly->v0 = tannerShadow_texture.coords.v1 + offs; - poly->u1 = tannerShadow_texture.coords.u0 / 4; + poly->u1 = tannerShadow_texture.coords.u0 / 4 + 1; poly->v1 = tannerShadow_texture.coords.v0 + offs; - poly->u2 = tannerShadow_texture.coords.u3 / 4; + poly->u2 = tannerShadow_texture.coords.u3 / 4 - 1; poly->v2 = tannerShadow_texture.coords.v3 + offs - 18; - poly->u3 = tannerShadow_texture.coords.u2 / 4; + poly->u3 = tannerShadow_texture.coords.u2 / 4 + 1; poly->v3 = tannerShadow_texture.coords.v2 + offs - 18; poly->tpage = getTPage(2, 0, rectTannerWindow.x, rectTannerWindow.y); diff --git a/src_rebuild/Game/C/overmap.c b/src_rebuild/Game/C/overmap.c index dd8bc8f9..2319abb8 100644 --- a/src_rebuild/Game/C/overmap.c +++ b/src_rebuild/Game/C/overmap.c @@ -1360,8 +1360,16 @@ void DrawOverheadMap(void) { int tile; tile = maptile[j][i]; - width = MapTex[j].w; - height = MapTex[i].h; + width = MapTex[j].w - 1; + height = MapTex[i].h - 1; +#ifndef PSX + // make map fully detailed when filtering is not available + if (!g_bilinearFiltering) + { + width += 1; + height += 1; + } +#endif spt = (POLY_FT4*)current->primptr; @@ -1710,14 +1718,24 @@ void DrawFullscreenMap(void) back->u0 = px; back->v0 = py; - back->u1 = px + 32; + back->u1 = px + 31; back->v1 = py; back->u2 = px; - back->v2 = py + 32; + back->v2 = py + 31; - back->u3 = px + 32; - back->v3 = py + 32; + back->u3 = px + 31; + back->v3 = py + 31; + +#ifndef PSX + // make map fully detailed when filtering is not available + if (!g_bilinearFiltering) + { + back->u1 += 1; + back->v2 += 1; + back->v3 += 1; + } +#endif back->clut = MapClut; back->tpage = MapTPage;