From 19635c7bdf2cca269f8457b7c4f10a914f7bd4c9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 14 Aug 2020 21:08:28 +0200 Subject: [PATCH] - render Blood's choking hands in the 3D view. This may not be faithful but it looks a lot less buggy than placing these on top of the entire HUD. --- source/blood/src/choke.cpp | 4 +++- source/blood/src/d_menu.cpp | 4 ++-- source/blood/src/nnexts.cpp | 7 ++++--- source/blood/src/qav.cpp | 10 +++++----- source/blood/src/qav.h | 4 ++-- source/blood/src/weapon.cpp | 2 +- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/source/blood/src/choke.cpp b/source/blood/src/choke.cpp index e0dd37e8f..32c5db928 100644 --- a/source/blood/src/choke.cpp +++ b/source/blood/src/choke.cpp @@ -67,7 +67,9 @@ void CChoke::sub_84110(int x, int y, int basepal) atc = at8->at10; int vdi = at8->at10-atc; at8->Play(vdi-vd, vdi, -1, NULL); - at8->Draw(&twodpsp, vdi, 10, 0, 0, basepal, false); + // This originally overlaid the HUD but that simply doesn't work right with the HUD being a genuine overlay. + // It also never adjusted for a reduced 3D view + at8->Draw(vdi, 10, 0, 0, basepal, true); gFrameClock = v4; } diff --git a/source/blood/src/d_menu.cpp b/source/blood/src/d_menu.cpp index 595e177de..72c07e933 100644 --- a/source/blood/src/d_menu.cpp +++ b/source/blood/src/d_menu.cpp @@ -112,13 +112,13 @@ void CGameMenuItemQAV::Draw(void) int backX = data->x; for (int i = 0; i < nCount; i++) { - data->Draw(twod, data->at10 - at2c, 10 + kQavOrientationLeft, 0, 0, 0, false); + data->Draw(data->at10 - at2c, 10 + kQavOrientationLeft, 0, 0, 0, false); data->x += 320; } data->x = backX; } else - data->Draw(twod, data->at10 - at2c, 10, 0, 0, 0, false); + data->Draw(data->at10 - at2c, 10, 0, 0, 0, false); windowxy1.x = wx1; windowxy1.y = wy1; diff --git a/source/blood/src/nnexts.cpp b/source/blood/src/nnexts.cpp index 022ca1bc4..89e8ef1da 100644 --- a/source/blood/src/nnexts.cpp +++ b/source/blood/src/nnexts.cpp @@ -4813,12 +4813,13 @@ void playerQavSceneDraw(PLAYER* pPlayer, int a2, double a3, double a4, int a5, i if (!(pSprite->flags & kModernTypeFlag1)) { pQAV->x = int(a3); pQAV->y = int(a4); - pQAV->Draw(&twodpsp, a3, a4, v4, flags, a2, a5, basepal, true); + pQAV->Draw(a3, a4, v4, flags, a2, a5, basepal, true); // draw fullscreen (currently 4:3 only) } else { - // What an awful hack... :? - pQAV->Draw(&twodpsp, v4, flags, a2, a5, basepal, false); + // What an awful hack. This throws proper ordering out of the window, but there is no way to reproduce this better with strict layering of elements. + // From the above commit it seems to be incomplete anyway... + pQAV->Draw(v4, flags, a2, a5, basepal, false); } } diff --git a/source/blood/src/qav.cpp b/source/blood/src/qav.cpp index 2bda0eb1b..33bbe6c51 100644 --- a/source/blood/src/qav.cpp +++ b/source/blood/src/qav.cpp @@ -46,7 +46,7 @@ int qavRegisterClient(void(*pClient)(int, void *)) return nClients++; } -void DrawFrame(F2DDrawer *twod, double x, double y, TILE_FRAME *pTile, int stat, int shade, int palnum, int basepal, bool to3dview) +void DrawFrame(double x, double y, TILE_FRAME *pTile, int stat, int shade, int palnum, int basepal, bool to3dview) { stat |= pTile->stat; x += pTile->x; @@ -83,7 +83,7 @@ void DrawFrame(F2DDrawer *twod, double x, double y, TILE_FRAME *pTile, int stat, } } -void QAV::Draw(F2DDrawer* twod, double x, double y, int ticks, int stat, int shade, int palnum, int basepal, bool to3dview) +void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, int basepal, bool to3dview) { dassert(ticksPerFrame > 0); int nFrame = ticks / ticksPerFrame; @@ -92,13 +92,13 @@ void QAV::Draw(F2DDrawer* twod, double x, double y, int ticks, int stat, int sha for (int i = 0; i < 8; i++) { if (pFrame->tiles[i].picnum > 0) - DrawFrame(twod, x, y, &pFrame->tiles[i], stat, shade, palnum, basepal, to3dview); + DrawFrame(x, y, &pFrame->tiles[i], stat, shade, palnum, basepal, to3dview); } } -void QAV::Draw(F2DDrawer* twod, int ticks, int stat, int shade, int palnum, int basepal, bool to3dview) +void QAV::Draw(int ticks, int stat, int shade, int palnum, int basepal, bool to3dview) { - Draw(twod, x, y, ticks, stat, shade, palnum, basepal, to3dview); + Draw(x, y, ticks, stat, shade, palnum, basepal, to3dview); } diff --git a/source/blood/src/qav.h b/source/blood/src/qav.h index cc04985d0..a169f3737 100644 --- a/source/blood/src/qav.h +++ b/source/blood/src/qav.h @@ -81,8 +81,8 @@ struct QAV //SPRITE *pSprite; // 1c char pad3[4]; // 20 FRAMEINFO frames[1]; // 24 - void Draw(F2DDrawer *twod, int ticks, int stat, int shade, int palnum, int basepal, bool inviewport); - void Draw(F2DDrawer* twod, double x, double y, int ticks, int stat, int shade, int palnum, int basepal, bool inviewport); + void Draw(int ticks, int stat, int shade, int palnum, int basepal, bool inviewport); + void Draw(double x, double y, int ticks, int stat, int shade, int palnum, int basepal, bool inviewport); void Play(int, int, int, void *); void Preload(void); void Precache(void); diff --git a/source/blood/src/weapon.cpp b/source/blood/src/weapon.cpp index 2efa8de41..1a8dbe8b3 100644 --- a/source/blood/src/weapon.cpp +++ b/source/blood/src/weapon.cpp @@ -252,7 +252,7 @@ void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5, int basep a2 = -128; flags |= 1; } - pQAV->Draw(&twodpsp, a3, a4, v4, flags, a2, a5, basepal, true); + pQAV->Draw(a3, a4, v4, flags, a2, a5, basepal, true); } void WeaponPlay(PLAYER *pPlayer)