From 35df6a39826009e8dd7ec9d2724afcdca5789e10 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 28 Oct 2013 21:06:38 +0000 Subject: Test if we're dithering already before turning it on. (No functional change atm, but when bitmap tiling is moved into nsfb, error diffusion will be able to cross tile boundaries.) --- include/palette.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/palette.h') diff --git a/include/palette.h b/include/palette.h index a4b9f77..04bdd4f 100644 --- a/include/palette.h +++ b/include/palette.h @@ -28,7 +28,7 @@ struct nsfb_palette_s { uint8_t last; /**< Last used palette index */ nsfb_colour_t data[256]; /**< Palette for index modes */ - bool dither; /**< Whether to use error diffusion */ + bool dither; /**< Whether error diffusion was requested */ struct { int width; /**< Length of error value buffer ring*/ int current; /**< Current pos in ring buffer*/ @@ -53,6 +53,11 @@ void nsfb_palette_dither_fini(struct nsfb_palette_s *palette); /** Generate libnsfb 8bpp default palette. */ void nsfb_palette_generate_nsfb_8bpp(struct nsfb_palette_s *palette); +static inline bool nsfb_palette_dithering_on(struct nsfb_palette_s *palette) +{ + return palette->dither; +} + /** Find best palette match for given colour. */ static inline uint8_t nsfb_palette_best_match(struct nsfb_palette_s *palette, nsfb_colour_t c, int *r_error, int *g_error, int *b_error) -- cgit v1.2.3