Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement th06::AnmManager::DrawEndingRect #311

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,4 +1,3 @@
th06::AnmManager::DrawEndingRect
th06::MidiOutput::OnTimerElapsed
th06::MidiOutput::ParseFile
th06::MusicRoom::RegisterChain
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,
D3DX_FILTER_NONE, 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
Loading