currently irrelevant sdl call adjustment
authorsheepluva
Fri, 29 Sep 2017 22:06:29 +0200
changeset 12591 7bae1fab444b
parent 12590 b4b5484be651
child 12592 00b539e6115d
currently irrelevant sdl call adjustment as suggested by https://wiki.libsdl.org/MigrationGuide
hedgewars/SDLh.pas
hedgewars/uRenderUtils.pas
hedgewars/uStore.pas
--- a/hedgewars/SDLh.pas	Fri Sep 29 19:31:25 2017 +0200
+++ b/hedgewars/SDLh.pas	Fri Sep 29 22:06:29 2017 +0200
@@ -77,6 +77,9 @@
 /////////////////////  CONSTANT DEFINITIONS /////////////////////
 /////////////////////////////////////////////////////////////////
 
+    SDL_FALSE = 0;
+    SDL_TRUE = 1;
+
     // SDL_Init() flags
     SDL_INIT_TIMER          = $00000001;
     SDL_INIT_AUDIO          = $00000010;
--- a/hedgewars/uRenderUtils.pas	Fri Sep 29 19:31:25 2017 +0200
+++ b/hedgewars/uRenderUtils.pas	Fri Sep 29 22:06:29 2017 +0200
@@ -336,7 +336,7 @@
 
         WriteInRoundRect(finalSurface, 0, 0, Color, font, s, maxLength);
 
-        checkFails(SDL_SetColorKey(finalSurface, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, false);
+        checkFails(SDL_SetColorKey(finalSurface, SDL_TRUE, 0) = 0, errmsgTransparentSet, false);
 
         RenderStringTexLim:= Surface2Tex(finalSurface, false);
 
--- a/hedgewars/uStore.pas	Fri Sep 29 19:31:25 2017 +0200
+++ b/hedgewars/uStore.pas	Fri Sep 29 22:06:29 2017 +0200
@@ -152,7 +152,7 @@
 
     texsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, RMask, GMask, BMask, AMask);
     if not checkFails(texsurf <> nil, errmsgCreateSurface, true) then
-        checkFails(SDL_SetColorKey(texsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
+        checkFails(SDL_SetColorKey(texsurf, SDL_TRUE, 0) = 0, errmsgTransparentSet, true);
 
     if not allOK then exit(nil);
 
@@ -201,7 +201,7 @@
         r.h:= 32;
         texsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, r.w, r.h, 32, RMask, GMask, BMask, AMask);
         if not checkFails(texsurf <> nil, errmsgCreateSurface, true) then
-            checkFails(SDL_SetColorKey(texsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
+            checkFails(SDL_SetColorKey(texsurf, SDL_TRUE, 0) = 0, errmsgTransparentSet, true);
         if not allOK then exit;
 
         r.w:= 26;
@@ -664,7 +664,7 @@
     tmpsurf:= doSurfaceConversion(tmpsurf);
 
     if (imageFlags and ifTransparent) <> 0 then
-        if checkFails(SDL_SetColorKey(tmpsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true) then exit;
+        if checkFails(SDL_SetColorKey(tmpsurf, SDL_TRUE, 0) = 0, errmsgTransparentSet, true) then exit;
 
     WriteLnToConsole(msgOK + ' (' + inttostr(tmpsurf^.w) + 'x' + inttostr(tmpsurf^.h) + ')');