1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

refactor backgrounds (allow resolution change)

This commit is contained in:
Laserlicht
2025-02-08 20:53:32 +01:00
parent 0424f71cb2
commit de06de06b5
4 changed files with 23 additions and 12 deletions

View File

@@ -45,8 +45,6 @@ CHighScoreScreen::CHighScoreScreen(HighScorePage highscorepage, int highlighted)
OBJECT_CONSTRUCTION;
pos = center(Rect(0, 0, 800, 600));
backgroundAroundMenu = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), Rect(-pos.x, -pos.y, GH.screenDimensions().x, GH.screenDimensions().y));
addHighScores();
addButtons();
}
@@ -174,6 +172,12 @@ void CHighScoreScreen::buttonExitClick()
CMM->playMusic();
}
void CHighScoreScreen::showAll(Canvas & to)
{
to.fillTexture(GH.renderHandler().loadImage(ImagePath::builtin("DiBoxBck"), EImageBlitMode::OPAQUE));
CWindowObject::showAll(to);
}
CHighScoreInputScreen::CHighScoreInputScreen(bool won, HighScoreCalculation calc, const StatisticDataSet & statistic)
: CWindowObject(BORDERED), won(won), calc(calc), stat(statistic)
{
@@ -182,7 +186,6 @@ CHighScoreInputScreen::CHighScoreInputScreen(bool won, HighScoreCalculation calc
OBJECT_CONSTRUCTION;
pos = center(Rect(0, 0, 800, 600));
backgroundAroundMenu = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), Rect(-pos.x, -pos.y, GH.screenDimensions().x, GH.screenDimensions().y));
background = std::make_shared<TransparentFilledRectangle>(Rect(0, 0, pos.w, pos.h), Colors::BLACK);
if(won)
@@ -272,6 +275,12 @@ void CHighScoreInputScreen::show(Canvas & to)
CWindowObject::showAll(to);
}
void CHighScoreInputScreen::showAll(Canvas & to)
{
to.fillTexture(GH.renderHandler().loadImage(ImagePath::builtin("DiBoxBck"), EImageBlitMode::OPAQUE));
CWindowObject::showAll(to);
}
void CHighScoreInputScreen::clickPressed(const Point & cursorPosition)
{
if(statisticButton && statisticButton->pos.isInside(cursorPosition))