1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix spellbook page flip scaling

This commit is contained in:
Ivan Savenko 2024-07-25 13:52:50 +00:00
parent ffba847f40
commit 000af42fcb
2 changed files with 6 additions and 7 deletions

View File

@ -183,8 +183,7 @@ void CVideoInstance::prepareOutput(bool scaleToScreenSize, bool useTextureOutput
}
else
{
dimensions.x = getCodecContext()->width;
dimensions.y = getCodecContext()->height;
dimensions = Point(getCodecContext()->width, getCodecContext()->height) * GH.screenHandler().getScalingFactor();
}
// Allocate a place to put our YUV image on that screen
@ -208,9 +207,9 @@ void CVideoInstance::prepareOutput(bool scaleToScreenSize, bool useTextureOutput
}
else
{
surface = CSDL_Ext::newSurface(dimensions * GH.screenHandler().getScalingFactor());
surface = CSDL_Ext::newSurface(dimensions);
sws = sws_getContext(getCodecContext()->width, getCodecContext()->height, getCodecContext()->pix_fmt,
surface->w, surface->h, AV_PIX_FMT_RGB32,
dimensions.x, dimensions.y, AV_PIX_FMT_RGB32,
SWS_BICUBIC, nullptr, nullptr, nullptr);
}
@ -640,7 +639,7 @@ bool CVideoPlayer::playIntroVideo(const VideoPath & name)
void CVideoPlayer::playSpellbookAnimation(const VideoPath & name, const Point & position)
{
openAndPlayVideoImpl(name, position, false, false, false);
openAndPlayVideoImpl(name, position * GH.screenHandler().getScalingFactor(), false, false, false);
}
std::unique_ptr<IVideoInstance> CVideoPlayer::open(const VideoPath & name, bool scaleToScreen)

View File

@ -535,13 +535,13 @@ void CSpellWindow::setCurrentPage(int value)
void CSpellWindow::turnPageLeft()
{
if(settings["video"]["spellbookAnimation"].Bool() && !isBigSpellbook)
CCS->videoh->playSpellbookAnimation(VideoPath::builtin("PGTRNLFT.SMK"), pos.topLeft() + Point(13, 15));
CCS->videoh->playSpellbookAnimation(VideoPath::builtin("PGTRNLFT.SMK"), pos.topLeft() + Point(13, 14));
}
void CSpellWindow::turnPageRight()
{
if(settings["video"]["spellbookAnimation"].Bool() && !isBigSpellbook)
CCS->videoh->playSpellbookAnimation(VideoPath::builtin("PGTRNRGH.SMK"), pos.topLeft() + Point(13, 15));
CCS->videoh->playSpellbookAnimation(VideoPath::builtin("PGTRNRGH.SMK"), pos.topLeft() + Point(13, 14));
}
void CSpellWindow::keyPressed(EShortcut key)