changeset 3881 | e570268a9d52 |
parent 3875 | 7d7c16ed5056 |
child 3895 | e7c202c08ac1 |
3880:24810907e853 | 3881:e570268a9d52 |
---|---|
393 with SpritesData[ii] do |
393 with SpritesData[ii] do |
394 // FIXME - add a sprite attribute |
394 // FIXME - add a sprite attribute |
395 if ((cReducedQuality and rqNoBackground) = 0) or (not (ii in [sprSky, sprSkyL, sprSkyR, sprHorizont, sprHorizontL, sprHorizontR, sprFlake, sprSplash, sprDroplet])) then // FIXME: hack |
395 if ((cReducedQuality and rqNoBackground) = 0) or (not (ii in [sprSky, sprSkyL, sprSkyR, sprHorizont, sprHorizontL, sprHorizontR, sprFlake, sprSplash, sprDroplet])) then // FIXME: hack |
396 begin |
396 begin |
397 if AltPath = ptNone then |
397 if AltPath = ptNone then |
398 if ii in [sprHorizontL, sprHorizontR, sprSkyL, sprSkyR, sprFlake] then // FIXME: hack |
398 if ii in [sprHorizontL, sprHorizontR, sprSkyL, sprSkyR] then // FIXME: hack |
399 tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, ifAlpha or ifTransparent) |
399 tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, ifAlpha or ifTransparent) |
400 else |
400 else |
401 tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, ifAlpha or ifTransparent or ifCritical) |
401 tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, ifAlpha or ifTransparent or ifCritical) |
402 else begin |
402 else begin |
403 tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, ifAlpha or ifTransparent); |
403 tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, ifAlpha or ifTransparent); |
487 procedure DrawFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture); |
487 procedure DrawFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture); |
488 var rr: TSDL_Rect; |
488 var rr: TSDL_Rect; |
489 _l, _r, _t, _b: real; |
489 _l, _r, _t, _b: real; |
490 VertexBuffer, TextureBuffer: array [0..3] of TVertex2f; |
490 VertexBuffer, TextureBuffer: array [0..3] of TVertex2f; |
491 begin |
491 begin |
492 if (SourceTexture = nil) or (SourceTexture^.h = 0) or (SourceTexture^.w = 0) then exit; |
492 if (SourceTexture^.h = 0) or (SourceTexture^.w = 0) then exit; |
493 |
493 |
494 // don't draw anything outside the visible screen space (first check fixes some sprite drawing, e.g. hedgehogs) |
494 // don't draw anything outside the visible screen space (first check fixes some sprite drawing, e.g. hedgehogs) |
495 if (abs(X) > W) and ((abs(X + W / 2) - W / 2) > cScreenWidth / cScaleFactor) then |
495 if (abs(X) > W) and ((abs(X + W / 2) - W / 2) > cScreenWidth / cScaleFactor) then |
496 exit; |
496 exit; |
497 if (abs(Y) > H) and ((abs(Y + H / 2 - (0.5 * cScreenHeight)) - H / 2) > cScreenHeight / cScaleFactor) then |
497 if (abs(Y) > H) and ((abs(Y + H / 2 - (0.5 * cScreenHeight)) - H / 2) > cScreenHeight / cScaleFactor) then |