1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

code review

This commit is contained in:
Laserlicht 2024-11-13 23:10:41 +01:00
parent 23709ab217
commit a6c985c4f5
2 changed files with 7 additions and 4 deletions

View File

@ -246,9 +246,9 @@ std::shared_ptr<ISharedImage> RenderHandler::loadImageFromFileUncached(const Ima
if(!defFile) // no prescale for this frame
{
auto tmpPath = (*locator.defFile).getName();
boost::algorithm::replace_all(tmpPath, "2X/", "/");
boost::algorithm::replace_all(tmpPath, "3X/", "/");
boost::algorithm::replace_all(tmpPath, "4X/", "/");
boost::algorithm::replace_all(tmpPath, "SPRITES2X/", "SPRITES/");
boost::algorithm::replace_all(tmpPath, "SPRITES3X/", "SPRITES/");
boost::algorithm::replace_all(tmpPath, "SPRITES4X/", "SPRITES/");
preScaledFactor = 1;
defFile = getAnimationFile(AnimationPath::builtin(tmpPath));
}

View File

@ -279,7 +279,10 @@ std::shared_ptr<ISharedImage> SDLImageShared::scaleInteger(int factor, SDL_Palet
SDL_Surface * scaled = nullptr;
if(preScaleFactor == factor)
scaled = CSDL_Ext::scaleSurfaceIntegerFactor(surf, 1, EScalingAlgorithm::NEAREST); // keep size
{
scaled = CSDL_Ext::newSurface(Point(surf->w, surf->h), surf);
SDL_BlitSurface(surf, nullptr, scaled, nullptr);
}
else if(preScaleFactor == 1)
scaled = CSDL_Ext::scaleSurfaceIntegerFactor(surf, factor, EScalingAlgorithm::XBRZ);
else