Browse Source

Fix build with older SDL

Ivan Savenko 1 year ago
parent
commit
5409936509
1 changed files with 6 additions and 0 deletions
  1. 6 0
      client/renderSDL/SDL_Extensions.cpp

+ 6 - 0
client/renderSDL/SDL_Extensions.cpp

@@ -19,6 +19,8 @@
 #include "../../lib/GameConstants.h"
 
 #include <SDL_render.h>
+#include <SDL_surface.h>
+#include <SDL_version.h>
 
 Rect CSDL_Ext::fromSDL(const SDL_Rect & rect)
 {
@@ -630,7 +632,11 @@ SDL_Surface * CSDL_Ext::scaleSurface(SDL_Surface * surf, int width, int height)
 	SDL_Surface * intermediate = SDL_ConvertSurface(surf, screen->format, 0);
 	SDL_Surface * ret = newSurface(width, height, intermediate);
 
+#if SDL_VERSION_ATLEAST(2,0,16)
 	SDL_SoftStretchLinear(intermediate, nullptr, ret, nullptr);
+#else
+	SDL_SoftStretch(intermediate, nullptr, ret, nullptr);
+#endif
 	SDL_FreeSurface(intermediate);
 
 	return ret;