Skip to content

Commit

Permalink
Implement th06::AnmManager::DrawEndingRect
Browse files Browse the repository at this point in the history
  • Loading branch information
sere committed Nov 8, 2024
1 parent 08ebd8b commit e88f428
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/implemented.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion config/stubbed.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
th06::EclManager::Unload
th06::AnmManager::DrawEndingRect
th06::MidiOutput::OnTimerElapsed
th06::MidiOutput::ParseFile
th06::ResultScreen::OnDraw
Expand Down
40 changes: 40 additions & 0 deletions src/AnmManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e88f428

Please sign in to comment.