mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
code review
This commit is contained in:
@@ -246,9 +246,9 @@ std::shared_ptr<ISharedImage> RenderHandler::loadImageFromFileUncached(const Ima
|
|||||||
if(!defFile) // no prescale for this frame
|
if(!defFile) // no prescale for this frame
|
||||||
{
|
{
|
||||||
auto tmpPath = (*locator.defFile).getName();
|
auto tmpPath = (*locator.defFile).getName();
|
||||||
boost::algorithm::replace_all(tmpPath, "2X/", "/");
|
boost::algorithm::replace_all(tmpPath, "SPRITES2X/", "SPRITES/");
|
||||||
boost::algorithm::replace_all(tmpPath, "3X/", "/");
|
boost::algorithm::replace_all(tmpPath, "SPRITES3X/", "SPRITES/");
|
||||||
boost::algorithm::replace_all(tmpPath, "4X/", "/");
|
boost::algorithm::replace_all(tmpPath, "SPRITES4X/", "SPRITES/");
|
||||||
preScaledFactor = 1;
|
preScaledFactor = 1;
|
||||||
defFile = getAnimationFile(AnimationPath::builtin(tmpPath));
|
defFile = getAnimationFile(AnimationPath::builtin(tmpPath));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -279,7 +279,10 @@ std::shared_ptr<ISharedImage> SDLImageShared::scaleInteger(int factor, SDL_Palet
|
|||||||
|
|
||||||
SDL_Surface * scaled = nullptr;
|
SDL_Surface * scaled = nullptr;
|
||||||
if(preScaleFactor == factor)
|
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)
|
else if(preScaleFactor == 1)
|
||||||
scaled = CSDL_Ext::scaleSurfaceIntegerFactor(surf, factor, EScalingAlgorithm::XBRZ);
|
scaled = CSDL_Ext::scaleSurfaceIntegerFactor(surf, factor, EScalingAlgorithm::XBRZ);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user