pass DAR to the display; preserve aspect ratio in screenshots
This commit is contained in:
@@ -669,10 +669,15 @@ bool RageDisplay::SaveScreenshot( CString sPath, GraphicsFileFormat format )
|
|||||||
RageSurface* surface = this->CreateScreenshot();
|
RageSurface* surface = this->CreateScreenshot();
|
||||||
|
|
||||||
/* Unless we're in lossless, resize the image to 640x480. If we're saving lossy,
|
/* Unless we're in lossless, resize the image to 640x480. If we're saving lossy,
|
||||||
* there's no sense in saving 1280x960 screenshots, and if we're in a custom
|
* there's no sense in saving 1280x960 screenshots, and we don't want to output
|
||||||
* resolution (eg. 640x240), we don't want to output in that resolution. */
|
* screenshots in a strange (non-1) sample aspect ratio. */
|
||||||
if( format != SAVE_LOSSLESS && (surface->h != 640 || surface->w != 480) )
|
if( format != SAVE_LOSSLESS && (surface->h != 640 || surface->w != 480) )
|
||||||
RageSurfaceUtils::Zoom( surface, 640, 480 );
|
{
|
||||||
|
/* Maintain the DAR. */
|
||||||
|
int iWidth = lrintf( 640 / GetVideoModeParams().fDisplayAspectRatio );
|
||||||
|
LOG->Trace( "%ix%i -> %ix%i (%.3f)", surface->w, surface->h, 640, iWidth, GetVideoModeParams().fDisplayAspectRatio );
|
||||||
|
RageSurfaceUtils::Zoom( surface, 640, iWidth );
|
||||||
|
}
|
||||||
|
|
||||||
RageFile out;
|
RageFile out;
|
||||||
if( !out.Open( sPath, RageFile::WRITE ) )
|
if( !out.Open( sPath, RageFile::WRITE ) )
|
||||||
|
|||||||
@@ -117,7 +117,8 @@ public:
|
|||||||
bool bAnisotropicFiltering_,
|
bool bAnisotropicFiltering_,
|
||||||
CString sWindowTitle_,
|
CString sWindowTitle_,
|
||||||
CString sIconFile_,
|
CString sIconFile_,
|
||||||
bool PAL_
|
bool PAL_,
|
||||||
|
float fDisplayAspectRatio_
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
windowed = windowed_;
|
windowed = windowed_;
|
||||||
@@ -133,6 +134,7 @@ public:
|
|||||||
sWindowTitle = sWindowTitle_;
|
sWindowTitle = sWindowTitle_;
|
||||||
sIconFile = sIconFile_;
|
sIconFile = sIconFile_;
|
||||||
PAL = PAL_;
|
PAL = PAL_;
|
||||||
|
fDisplayAspectRatio = fDisplayAspectRatio_;
|
||||||
}
|
}
|
||||||
VideoModeParams() {}
|
VideoModeParams() {}
|
||||||
|
|
||||||
@@ -147,6 +149,7 @@ public:
|
|||||||
bool bAnisotropicFiltering;
|
bool bAnisotropicFiltering;
|
||||||
bool interlaced;
|
bool interlaced;
|
||||||
bool PAL;
|
bool PAL;
|
||||||
|
float fDisplayAspectRatio;
|
||||||
CString sWindowTitle;
|
CString sWindowTitle;
|
||||||
CString sIconFile;
|
CString sIconFile;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ static RageDisplay::VideoModeParams GetCurVideoModeParams()
|
|||||||
PREFSMAN->m_bAnisotropicFiltering,
|
PREFSMAN->m_bAnisotropicFiltering,
|
||||||
WINDOW_TITLE,
|
WINDOW_TITLE,
|
||||||
THEME->GetPathToG("Common window icon"),
|
THEME->GetPathToG("Common window icon"),
|
||||||
PREFSMAN->m_bPAL
|
PREFSMAN->m_bPAL,
|
||||||
|
PREFSMAN->m_fAspectRatio
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user