| 216 | |
| 217 | template <typename BlitFn> |
| 218 | void DoRenderBackwards( |
| 219 | const Surface &out, Point position, const uint8_t *src, size_t srcSize, |
| 220 | unsigned srcWidth, unsigned srcHeight, BlitFn &&blitFn) |
| 221 | { |
| 222 | if (position.y < 0 || position.y + 1 >= static_cast<int>(out.h() + srcHeight)) |
| 223 | return; |
| 224 | const ClipX clipX = CalculateClipX(position.x, srcWidth, out); |
| 225 | if (clipX.width <= 0) |
| 226 | return; |
| 227 | const RenderSrc srcForBackwards { src, src + srcSize, static_cast<uint_fast16_t>(srcWidth) }; |
| 228 | if (static_cast<std::size_t>(clipX.width) == srcWidth) { |
| 229 | DoRenderBackwardsClipY( |
| 230 | out, position, srcForBackwards, std::forward<BlitFn>(blitFn)); |
| 231 | } else { |
| 232 | DoRenderBackwardsClipXY( |
| 233 | out, position, srcForBackwards, clipX, std::forward<BlitFn>(blitFn)); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | constexpr size_t MaxOutlinePixels = 4096; |
| 238 | constexpr size_t MaxOutlineSpriteWidth = 253; |
no test coverage detected