From 9bac17556df0e45600076658f1a38bc4cdb8baf7 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 15 May 2016 15:26:30 -0500 Subject: [PATCH] Another itch scratched I suppose --- src/photo.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/photo.c b/src/photo.c index 7ce5e45..827f09c 100644 --- a/src/photo.c +++ b/src/photo.c @@ -103,15 +103,12 @@ static inline uint8_t tile_read(cammy_photo *photo, size_t x, size_t y) { } static inline void tile_write(cammy_photo *photo, - size_t x, size_t y, - uint8_t r, uint8_t g, uint8_t b) { + size_t x, size_t y, uint8_t value) { cammy_tile *tile = &photo->tiles[y>>3][x>>3]; int tile_x = x & 7, tile_y = y & 7; - uint8_t value = rgb_to_tile_2bpp(r, g, b, x, y); - tile->data[ tile_y<<1] |= (value & 0x01) << (tile_x ^ 7); tile->data[(tile_y<<1)|1] |= ((value & 0x02) >> 1) << (tile_x ^ 7); } @@ -158,7 +155,7 @@ void cammy_photo_import(cammy_photo *dest, uint8_t *src, int stride) { buf_read(src, x, y, CAMMY_PHOTO_WIDTH, &r, &g, &b, stride); - tile_write(dest, x, y, r, g, b); + tile_write(dest, x, y, rgb_to_tile_2bpp(r, g, b, x, y)); } } }