--- a/hedgewars/uLandGraphics.pas Wed Jan 13 16:19:50 2016 +0100
+++ b/hedgewars/uLandGraphics.pas Sun Jan 10 00:45:13 2016 +0300
@@ -716,7 +716,7 @@
col:= Frame div numFramesFirstCol;
if SDL_MustLock(Image) then
- SDLTry(SDL_LockSurface(Image) >= 0, 'TryPlaceOnLand', true);
+ if SDLCheck(SDL_LockSurface(Image) >= 0, 'TryPlaceOnLand', true) then exit;
bpp:= Image^.format^.BytesPerPixel;
TryDo(bpp = 4, 'It should be 32 bpp sprite', true);
@@ -835,7 +835,7 @@
col:= Frame div numFramesFirstCol;
if SDL_MustLock(Image) then
- SDLTry(SDL_LockSurface(Image) >= 0, 'EraseLand', true);
+ if SDLCheck(SDL_LockSurface(Image) >= 0, 'EraseLand', true) then exit;
bpp:= Image^.format^.BytesPerPixel;
TryDo(bpp = 4, 'It should be 32 bpp sprite', true);
@@ -918,7 +918,8 @@
col:= Frame div numFramesFirstCol;
if SDL_MustLock(Image) then
- SDLTry(SDL_LockSurface(Image) >= 0, 'SDL_LockSurface', true);
+ if SDLCheck(SDL_LockSurface(Image) >= 0, 'SDL_LockSurface', true) then
+ exit;
bpp:= Image^.format^.BytesPerPixel;
TryDo(bpp = 4, 'It should be 32 bpp sprite', true);
@@ -930,7 +931,8 @@
TryDo(finalSurface <> nil, 'GetPlaceCollisionTex: fail to create surface', true);
if SDL_MustLock(finalSurface) then
- SDLTry(SDL_LockSurface(finalSurface) >= 0, 'GetPlaceCollisionTex', true);
+ if SDLCheck(SDL_LockSurface(finalSurface) >= 0, 'GetPlaceCollisionTex', true) then
+ exit;
p:= PLongWordArray(@(PLongWordArray(Image^.pixels)^[ (Image^.pitch div 4) * row * h + col * w ]));
pt:= PLongWordArray(finalSurface^.pixels);