CImageLoaderSVG: don't rescale on server

This commit is contained in:
Mary Strodl 2022-04-07 14:21:00 -04:00
parent 4c4daf9698
commit 878f064ecf
No known key found for this signature in database
GPG Key ID: 23B7FC1590D8E30E

View File

@ -13,7 +13,9 @@
#include "os.h"
#include "irrString.h"
#include "CNullDriver.h"
#ifndef SERVER_ONLY
#include "ge_main.hpp"
#endif
namespace irr
{
@ -103,10 +105,12 @@ IImage* CImageLoaderSVG::loadImage(io::IReadFile* file, bool skip_checking) cons
// only rescale the icons
if ( strstr(file->getFileName().c_str(),"gui/icons/") )
{
#ifndef SERVER_ONLY
// determine scaling based on screen size
float screen_height = (float)GE::getDriver()->getCurrentRenderTargetSize().Height;
float desired_icon_size = 0.21*screen_height + 30.0f; // phenomenological
scale = desired_icon_size/img->height;
#endif
}
// create surface