예제 #1
0
void HackerContext::DumpRenderTargets()
{
	UINT i;
	NvAPI_Status nvret;
	wchar_t filename[MAX_PATH];
	HRESULT hr;

	if (analyse_options & FrameAnalysisOptions::STEREO) {
		// Enable reverse stereo blit for all resources we are about to dump:
		nvret = NvAPI_Stereo_ReverseStereoBlitControl(mHackerDevice->mStereoHandle, true);
		if (nvret != NVAPI_OK) {
			LogInfo("DumpStereoResource failed to enable reverse stereo blit\n");
			// Continue anyway, we should still be able to dump in 2D...
		}
	}

	for (i = 0; i < mCurrentRenderTargets.size(); ++i) {
		hr = FrameAnalysisFilename(filename, MAX_PATH, false, false, false, i);
		if (FAILED(hr))
			goto out;
		DumpResource((ID3D11Resource*)mCurrentRenderTargets[i], filename);
	}
	if (mCurrentDepthTarget) {
		hr = FrameAnalysisFilename(filename, MAX_PATH, false, false, true, 0);
		if (FAILED(hr))
			goto out;
		DumpResource((ID3D11Resource*)mCurrentDepthTarget, filename);
	}

out:
	if (analyse_options & FrameAnalysisOptions::STEREO)
		NvAPI_Stereo_ReverseStereoBlitControl(mHackerDevice->mStereoHandle, false);
}
예제 #2
0
static int DumpDir( WResDir dir, WResFileID handle )
/**************************************************/
{
    int             retcode;
    bool            error;
    WResDirWindow   wind;
    uint_16         os;

    retcode = 0;

    if( WResIsEmpty( dir ) ) {
        printf( "Directory in file %s is empty\n", CmdLineParms.FileName );
    } else {
        os = WResGetTargetOS( dir );
        wind = WResFirstResource( dir );
        while( !WResIsLastResource( wind, dir ) ) {
            error = DumpResource( wind, handle, os );
            if( error ) {
                retcode = 2;
            }
            wind = WResNextResource( wind, dir );
        }
        error = DumpResource( wind, handle, os );
        if( error ) {
            retcode = 2;
        }
    }

    return( retcode );
}
예제 #3
0
bool DumpCursor(int Id, const TCHAR* Caption)
{
    //    NEWHEADER
    //    RES_CURSOR

    HGLOBAL hGlobal;
    int Size;
    const BYTE* Data;
    if (!LoadResource(Id, RT_GROUP_CURSOR, hGlobal, Data, Size))
        return false;

    const NEWHEADER* Header = (const NEWHEADER*)Data;
    if (Header->ResType != RES_CURSOR || Header->ResCount < 1)
        return false;

    const RESDIR* Resdir = (const RESDIR*)(Header + 1);
    int IconId = Resdir->IconCursorId;

    UnlockAndFreeResource(hGlobal);

    DumpResource(IconId, Caption, RT_CURSOR);

    //    const int FormatVersion = 0x00030000;
    //    static HCURSOR hCursor =
    //        CreateIconFromResource(FilterBits, FilterBitsCount, FALSE/*!fIcon*/, FormatVersion);
    //    SetCursor(hCursor);

    return true;
}
예제 #4
0
파일: restd.cpp 프로젝트: ryanttb/restd
INT _tmain(INT argc, _TCHAR* argv[])
{
#ifdef _DEBUG
  DumpResource(L"empty.restd");
#endif

	return 0;
}
예제 #5
0
void HackerContext::DumpUAVs(bool compute)
{
	UINT i;
	NvAPI_Status nvret;
	ID3D11UnorderedAccessView *uavs[D3D11_PS_CS_UAV_REGISTER_COUNT];
	ID3D11Resource *resource;
	wchar_t filename[MAX_PATH];
	HRESULT hr;

	if (analyse_options & FrameAnalysisOptions::STEREO) {
		// Enable reverse stereo blit for all resources we are about to dump:
		nvret = NvAPI_Stereo_ReverseStereoBlitControl(mHackerDevice->mStereoHandle, true);
		if (nvret != NVAPI_OK) {
			LogInfo("DumpStereoResource failed to enable reverse stereo blit\n");
			// Continue anyway, we should still be able to dump in 2D...
		}
	}

	mOrigContext->CSGetUnorderedAccessViews(0, D3D11_PS_CS_UAV_REGISTER_COUNT, uavs);

	for (i = 0; i < D3D11_PS_CS_UAV_REGISTER_COUNT; ++i) {
		if (!uavs[i])
			continue;

		uavs[i]->GetResource(&resource);
		if (!resource) {
			uavs[i]->Release();
			continue;
		}

		hr = FrameAnalysisFilename(filename, MAX_PATH, compute, true, false, i);
		if (SUCCEEDED(hr))
			DumpResource(resource, filename);

		resource->Release();
		uavs[i]->Release();
	}

	if (analyse_options & FrameAnalysisOptions::STEREO)
		NvAPI_Stereo_ReverseStereoBlitControl(mHackerDevice->mStereoHandle, false);
}
예제 #6
0
bool DumpDialog(int Id, const TCHAR* Caption)
{
    return DumpResource(Id, Caption, RT_DIALOG);
}
예제 #7
0
bool DumpBitmap(int Id, const TCHAR* Caption)
{
    return DumpResource(Id, Caption, RT_BITMAP);
}