hedgewars/uLandGraphics.pas
branchsdl2transition
changeset 9682 aa2431ed87b2
parent 9460 7d7e4ca70f6b
child 9798 f2b18754742f
equal deleted inserted replaced
9679:dfaa39674e1e 9682:aa2431ed87b2
   599 h:= SpritesData[Obj].Height;
   599 h:= SpritesData[Obj].Height;
   600 row:= Frame mod numFramesFirstCol;
   600 row:= Frame mod numFramesFirstCol;
   601 col:= Frame div numFramesFirstCol;
   601 col:= Frame div numFramesFirstCol;
   602 
   602 
   603 if SDL_MustLock(Image) then
   603 if SDL_MustLock(Image) then
   604     SDLTry(SDL_LockSurface(Image) >= 0, true);
   604     SDLTry(SDL_LockSurface(Image) >= 0, 'SDL_LockSurface', true);
   605 
   605 
   606 bpp:= Image^.format^.BytesPerPixel;
   606 bpp:= Image^.format^.BytesPerPixel;
   607 TryDo(bpp = 4, 'It should be 32 bpp sprite', true);
   607 TryDo(bpp = 4, 'It should be 32 bpp sprite', true);
   608 // Check that sprite fits free space
   608 // Check that sprite fits free space
   609 p:= @(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 ]);
   609 p:= @(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 ]);