| 46 | } |
| 47 | |
| 48 | void XYRasterU8Sparse::rasterize_internal(const Tile2x2_u8 &tile, |
| 49 | const rect<u16> *optional_bounds) { |
| 50 | const vec2<u16> &origin = tile.origin(); |
| 51 | for (int x = 0; x < 2; ++x) { |
| 52 | for (int y = 0; y < 2; ++y) { |
| 53 | u8 value = tile.at(x, y); |
| 54 | if (!value) { |
| 55 | continue; |
| 56 | } |
| 57 | int xx = origin.x + x; |
| 58 | int yy = origin.y + y; |
| 59 | if (optional_bounds && !optional_bounds->contains(xx, yy)) { |
| 60 | continue; |
| 61 | } |
| 62 | write(vec2<u16>(xx, yy), value); |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | } // namespace fl |
| 68 |