From e88f42838158cdabd94b3bdbb1f3bd7745c6361a Mon Sep 17 00:00:00 2001 From: sere Date: Fri, 8 Nov 2024 05:40:08 +0400 Subject: [PATCH 1/3] Implement th06::AnmManager::DrawEndingRect --- config/implemented.csv | 1 + config/stubbed.csv | 1 - src/AnmManager.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/config/implemented.csv b/config/implemented.csv index a55b6281..e7d434c3 100644 --- a/config/implemented.csv +++ b/config/implemented.csv @@ -52,6 +52,7 @@ th06::AnmManager::TakeScreenshotIfRequested th06::AnmManager::TakeScreenshot th06::AnmManager::TranslateRotation th06::AnmManager::ExecuteAnmIdx +th06::AnmManager::DrawEndingRect th06::BulletManager::RegisterChain th06::BulletManager::CutChain th06::BulletManager::AddedCallback diff --git a/config/stubbed.csv b/config/stubbed.csv index b559c470..f4f77605 100644 --- a/config/stubbed.csv +++ b/config/stubbed.csv @@ -1,5 +1,4 @@ th06::EclManager::Unload -th06::AnmManager::DrawEndingRect th06::MidiOutput::OnTimerElapsed th06::MidiOutput::ParseFile th06::ResultScreen::OnDraw diff --git a/src/AnmManager.cpp b/src/AnmManager.cpp index 8ea47ff2..d2a83106 100644 --- a/src/AnmManager.cpp +++ b/src/AnmManager.cpp @@ -1654,4 +1654,44 @@ void AnmManager::TakeScreenshot(i32 textureId, i32 left, i32 top, i32 width, i32 sourceSurface->Release(); return; } + +void AnmManager::DrawEndingRect(i32 surfaceIdx, i32 rectX, i32 rectY, i32 rectLeft, i32 rectTop, i32 width, i32 height) +{ + IDirect3DSurface8 *D3D_Surface; + + if (surfacesBis[surfaceIdx] == NULL) + { + return; + } + if (g_Supervisor.d3dDevice->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &D3D_Surface) != D3D_OK) + { + return; + } + if (surfaces[surfaceIdx] == NULL) + { + if ((g_Supervisor.d3dDevice->CreateRenderTarget(surfaceSourceInfo[surfaceIdx].Width, + surfaceSourceInfo[surfaceIdx].Height, + g_Supervisor.presentParameters.BackBufferFormat, + D3DMULTISAMPLE_NONE, 1, surfaces + surfaceIdx) != D3D_OK) && + (g_Supervisor.d3dDevice->CreateImageSurface( + surfaceSourceInfo[surfaceIdx].Width, surfaceSourceInfo[surfaceIdx].Height, + g_Supervisor.presentParameters.BackBufferFormat, surfaces + surfaceIdx)) != D3D_OK) + { + D3D_Surface->Release(); + return; + } + if (D3DXLoadSurfaceFromSurface(surfaces[surfaceIdx], NULL, NULL, surfacesBis[surfaceIdx], NULL, NULL, 1, 0) != + D3D_OK) + { + D3D_Surface->Release(); + return; + } + } + + RECT rect = {rectLeft, rectTop, rectLeft + width, rectTop + height}; + POINT point = {rectX, rectY}; + g_Supervisor.d3dDevice->CopyRects(surfaces[surfaceIdx], &rect, 1, D3D_Surface, &point); + D3D_Surface->Release(); + return; +} }; // namespace th06 From 17785f9fe6fa059036dd765df071365b7ea99537 Mon Sep 17 00:00:00 2001 From: sere3925sere <115541716+sere3925sere@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:20:23 +0400 Subject: [PATCH 2/3] 1 to D3DX_FILTER_NONE Co-authored-by: Robin Lambertz --- src/AnmManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AnmManager.cpp b/src/AnmManager.cpp index d2a83106..be6e6f89 100644 --- a/src/AnmManager.cpp +++ b/src/AnmManager.cpp @@ -1680,7 +1680,7 @@ void AnmManager::DrawEndingRect(i32 surfaceIdx, i32 rectX, i32 rectY, i32 rectLe D3D_Surface->Release(); return; } - if (D3DXLoadSurfaceFromSurface(surfaces[surfaceIdx], NULL, NULL, surfacesBis[surfaceIdx], NULL, NULL, 1, 0) != + if (D3DXLoadSurfaceFromSurface(surfaces[surfaceIdx], NULL, NULL, surfacesBis[surfaceIdx], NULL, NULL, D3DX_FILTER_NONE, 0) != D3D_OK) { D3D_Surface->Release(); From 51716f4d6edc89b099f0f6fdc16e64a33f096b24 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:23:56 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/AnmManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AnmManager.cpp b/src/AnmManager.cpp index be6e6f89..a041cf68 100644 --- a/src/AnmManager.cpp +++ b/src/AnmManager.cpp @@ -1680,8 +1680,8 @@ void AnmManager::DrawEndingRect(i32 surfaceIdx, i32 rectX, i32 rectY, i32 rectLe D3D_Surface->Release(); return; } - if (D3DXLoadSurfaceFromSurface(surfaces[surfaceIdx], NULL, NULL, surfacesBis[surfaceIdx], NULL, NULL, D3DX_FILTER_NONE, 0) != - D3D_OK) + if (D3DXLoadSurfaceFromSurface(surfaces[surfaceIdx], NULL, NULL, surfacesBis[surfaceIdx], NULL, NULL, + D3DX_FILTER_NONE, 0) != D3D_OK) { D3D_Surface->Release(); return;