mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
code review
This commit is contained in:
parent
23709ab217
commit
a6c985c4f5
@ -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));
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user