Browse Source

Convert C-style casts to the more verbose C++ style

Alexander Wilms 1 year ago
parent
commit
781328f282
2 changed files with 4 additions and 4 deletions
  1. 2 2
      client/renderSDL/SDL_Extensions.cpp
  2. 2 2
      mapeditor/mainwindow.cpp

+ 2 - 2
client/renderSDL/SDL_Extensions.cpp

@@ -664,8 +664,8 @@ void CSDL_Ext::convertToGrayscale( SDL_Surface * surf, const Rect & rect )
 template<int bpp>
 void scaleSurfaceFastInternal(SDL_Surface *surf, SDL_Surface *ret)
 {
-	const float factorX = float(surf->w) / float(ret->w);
-	const float factorY = float(surf->h) / float(ret->h);
+	const float factorX = static_cast<float>(surf->w) / static_cast<float>(ret->w);
+	const float factorY = static_cast<float>(surf->h) / static_cast<float>(ret->h);
 
 	for(int y = 0; y < ret->h; y++)
 	{

+ 2 - 2
mapeditor/mainwindow.cpp

@@ -538,8 +538,8 @@ void MainWindow::addGroupIntoCatalog(const std::string & groupName, bool useCust
 			auto picture = animation.getImage(0);
 			if(picture && picture->width() && picture->height())
 			{
-				qreal xscale = qreal(128) / qreal(picture->width());
-				qreal yscale = qreal(128) / qreal(picture->height());
+				qreal xscale = static_cast<qreal>(128) / static_cast<qreal>(picture->width());
+				qreal yscale = static_cast<qreal>(128) / static_cast<qreal>(picture->height());
 				qreal scale = std::min(xscale, yscale);
 				painter.scale(scale, scale);
 				painter.drawImage(QPoint(0, 0), *picture);