[saco] Implement/match sub_100755C0; the screenshot grab was missing from the TU entirely

This commit is contained in:
ricardoofnl committed 2026-09-03 00:47:38 +07:00
1 parent ab897be9e7
commit 7ae3bdf93d
1 file changed
+38 -1
+38 -1
View File
@@ -51,7 +51,7 @@ void sub_100C3F50(); // .text:100C3F50
void sub_100C41B0(); // .text:100C41B0
int sub_100A4470(); // .text:100A4470
int sub_100C3E20(int a1, int a2); // .text:100C3E20
void sub_100755C0(); // .text:100755C0
int sub_10062270(std::string *pstrFileName); // .text:10062270
void sub_10074480(); // .text:10074480
void sub_10074210(); // .text:10074210
void sub_10075330(); // .text:10075330
@@ -85,6 +85,43 @@ public:
//-------------------------------------------
// screenshot grab: reached from Present when the F8 handler raises dword_1012DE64
void sub_100755C0()
{
dword_1012DE64 = 0;
std::string strFileName;
int iIndex = sub_10062270(&strFileName);
IDirect3DSurface9 *pSurface;
pD3DDevice->CreateOffscreenPlainSurface(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &pSurface, NULL);
if(SUCCEEDED(pD3DDevice->GetFrontBufferData(0, pSurface)))
{
POINT pt;
pt.x = 0;
pt.y = 0;
ClientToScreen(*(HWND *)0xC97C1C, &pt);
RECT rc;
GetClientRect(*(HWND *)0xC97C1C, &rc);
rc.left += pt.x;
rc.right += pt.x;
rc.top += pt.y;
rc.bottom += pt.y;
D3DXSaveSurfaceToFileA(strFileName.c_str(), D3DXIFF_PNG, pSurface, NULL, &rc);
pChatWindow->AddInfoMessage("Screenshot Taken - sa-mp-%03i.png", iIndex);
}
else
{
pChatWindow->AddDebugMessage("Unable to save screenshot.");
}
}
//-------------------------------------------
HRESULT __stdcall IDirect3DDevice9Hook::Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion)
{
if(dword_1012DE64)