diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-06-08 08:01:02 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-06-08 08:01:02 +0100 |
commit | f90846d5a7a82573f85a58306c7b866baef95703 (patch) | |
tree | 59e5f2c56f7d6afcac7fb69e5998da97c635817b /src/vga.c | |
parent | 1cd96edcd529599b2d1a0de584bee50252cc23be (diff) | |
download | gold-mine-run-f90846d5a7a82573f85a58306c7b866baef95703.tar.gz gold-mine-run-f90846d5a7a82573f85a58306c7b866baef95703.zip |
Use a rectangle struct
Diffstat (limited to 'src/vga.c')
-rw-r--r-- | src/vga.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -44,12 +44,12 @@ void set_palette(const uint8_t *palette) outportb(0x3c9, palette[i] >> 2); } -void blit(const uint8_t *src, uint16_t x, uint16_t y, uint16_t w, uint16_t h) +void blit(const uint8_t *sprite, const Rect *dst) { - for (int32_t j = y * 320; j < (y + h) * 320; j += 320) - for (int16_t i = x; i < x + w; i++) + for (int32_t j = dst->y * 320; j < (dst->y + dst->h) * 320; j += 320) + for (int16_t i = dst->x; i < dst->x + dst->w; i++) { - uint8_t b = *src++; + uint8_t b = *sprite++; /* transparent */ if (b == TRANSPARENT) |