| 151 | } |
| 152 | |
| 153 | void PiuViewDrawTexture(PiuView* self, PiuTexture* texture, PiuCoordinate x, PiuCoordinate y, PiuCoordinate sx, PiuCoordinate sy, PiuDimension sw, PiuDimension sh) |
| 154 | { |
| 155 | PiuDimension tw = (*texture)->width; |
| 156 | PiuDimension th = (*texture)->height; |
| 157 | if (sx < 0) { |
| 158 | x -= sx; |
| 159 | sw += sx; |
| 160 | sx = 0; |
| 161 | } |
| 162 | if (sx + sw > tw) |
| 163 | sw = tw - sx; |
| 164 | if (sy < 0) { |
| 165 | y -= sy; |
| 166 | sh += sy; |
| 167 | sy = 0; |
| 168 | } |
| 169 | if (sy + sh > th) |
| 170 | sh = th - sy; |
| 171 | if ((sw <= 0) || (sh <= 0)) return; |
| 172 | PiuViewDrawTextureAux(self, texture, x, y, sx, sy, sw, sh); |
| 173 | } |
| 174 | |
| 175 | void PiuViewDrawTextureAux(PiuView* self, PiuTexture* texture, PiuCoordinate x, PiuCoordinate y, PiuCoordinate sx, PiuCoordinate sy, PiuDimension sw, PiuDimension sh) |
| 176 | { |
nothing calls this directly
no test coverage detected