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

ini file write updates by SaiyansKing #127

Merged
merged 5 commits into from
Dec 25, 2022
Merged
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
11 changes: 7 additions & 4 deletions D3D11Engine/D3D11GraphicsEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6260,6 +6260,12 @@ void D3D11GraphicsEngine::UpdateOcclusion() {
void D3D11GraphicsEngine::SaveScreenshot() {
HRESULT hr;

// Create new folder if needed
if ( !Toolbox::FolderExists( "system\\Screenshots" ) ) {
if ( !Toolbox::CreateDirectoryRecursive( "system\\Screenshots" ) )
return;
}

// Buffer for scaling down the image
auto rt = std::make_unique<RenderToTextureBuffer>(
GetDevice().Get(), Resolution.x, Resolution.y, DXGI_FORMAT_R8G8B8A8_UNORM );
Expand Down Expand Up @@ -6295,9 +6301,6 @@ void D3D11GraphicsEngine::SaveScreenshot() {
GetDateFormat( LOCALE_SYSTEM_DEFAULT, 0, nullptr, "yyyy-MM-dd", date, 50 );
GetTimeFormat( LOCALE_SYSTEM_DEFAULT, 0, nullptr, "hh-mm-ss", time, 50 );

// Create new folder if needed
CreateDirectory( "system\\Screenshots", nullptr );

std::string name = "system\\screenshots\\GD3D11_" + std::string( date ) +
"__" + std::string( time ) + ".jpg";

Expand All @@ -6313,7 +6316,7 @@ void D3D11GraphicsEngine::SaveScreenshot() {
varValues[0].vt = VT_R4;
varValues[0].fltVal = 0.95f;

(void)props->Write( 1, options, varValues );
props->Write( 1, options, varValues );
}, false ) );

// Inform the user that a screenshot has been taken
Expand Down
Loading