Change characters used for Sprites examples

This commit is contained in:
Scott Allen 2017-12-10 09:13:11 -05:00
parent 5e58d9b6a8
commit 93c33f6ad6
1 changed files with 60 additions and 55 deletions

View File

@ -49,6 +49,11 @@
* *
* Data for each frame after the first one immediately follows the previous * Data for each frame after the first one immediately follows the previous
* frame. Frame numbers start at 0. * frame. Frame numbers start at 0.
* \note
* In the example patterns given in each Sprites function description,
* a # character represents a bit set to 1 and
* a - character represents a bit set to 0.
*/ */
class Sprites class Sprites
{ {
@ -71,21 +76,21 @@ class Sprites
* value of the corresponding image bit. Bits set to 0 in the mask will be * value of the corresponding image bit. Bits set to 0 in the mask will be
* left unchanged. * left unchanged.
* *
* image mask before after * image mask before after (# = 1, - = 0)
* *
* ..... .OOO. ..... ..... * ----- -###- ----- -----
* ..O.. OOOOO ..... ..O.. * --#-- ##### ----- --#--
* OO.OO OO.OO ..... OO.OO * ##-## ##-## ----- ##-##
* ..O.. OOOOO ..... ..O.. * --#-- ##### ----- --#--
* ..... .OOO. ..... ..... * ----- -###- ----- -----
* *
* image mask before after * image mask before after
* *
* ..... .OOO. OOOOO O...O * ----- -###- ##### #---#
* ..O.. OOOOO OOOOO ..O.. * --#-- ##### ##### --#--
* OO.OO OOOOO OOOOO OO.OO * ##-## ##### ##### ##-##
* ..O.. OOOOO OOOOO ..O.. * --#-- ##### ##### --#--
* ..... .OOO. OOOOO O...O * ----- -###- ##### #---#
*/ */
static void drawExternalMask(int16_t x, int16_t y, const uint8_t *bitmap, static void drawExternalMask(int16_t x, int16_t y, const uint8_t *bitmap,
const uint8_t *mask, uint8_t frame, uint8_t mask_frame); const uint8_t *mask, uint8_t frame, uint8_t mask_frame);
@ -108,21 +113,21 @@ class Sprites
* value of the corresponding image bit. Bits set to 0 in the mask will be * value of the corresponding image bit. Bits set to 0 in the mask will be
* left unchanged. * left unchanged.
* *
* image mask before after * image mask before after (# = 1, - = 0)
* *
* ..... .OOO. ..... ..... * ----- -###- ----- -----
* ..O.. OOOOO ..... ..O.. * --#-- ##### ----- --#--
* OO.OO OO.OO ..... OO.OO * ##-## ##-## ----- ##-##
* ..O.. OOOOO ..... ..O.. * --#-- ##### ----- --#--
* ..... .OOO. ..... ..... * ----- -###- ----- -----
* *
* image mask before after * image mask before after
* *
* ..... .OOO. OOOOO O...O * ----- -###- ##### #---#
* ..O.. OOOOO OOOOO ..O.. * --#-- ##### ##### --#--
* OO.OO OOOOO OOOOO OO.OO * ##-## ##### ##### ##-##
* ..O.. OOOOO OOOOO ..O.. * --#-- ##### ##### --#--
* ..... .OOO. OOOOO O...O * ----- -###- ##### #---#
*/ */
static void drawPlusMask(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame); static void drawPlusMask(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
@ -139,21 +144,21 @@ class Sprites
* to 1 in the frame will set the pixel to 1 in the buffer, and a 0 in the * to 1 in the frame will set the pixel to 1 in the buffer, and a 0 in the
* array will set a 0 in the buffer. * array will set a 0 in the buffer.
* *
* image before after * image before after (# = 1, - = 0)
* *
* ..... ..... ..... * ----- ----- -----
* ..O.. ..... ..O.. * --#-- ----- --#--
* OO.OO ..... OO.OO * ##-## ----- ##-##
* ..O.. ..... ..O.. * --#-- ----- --#--
* ..... ..... ..... * ----- ----- -----
* *
* image before after * image before after
* *
* ..... OOOOO ..... * ----- ##### -----
* ..O.. OOOOO ..O.. * --#-- ##### --#--
* OO.OO OOOOO OO.OO * ##-## ##### ##-##
* ..O.. OOOOO ..O.. * --#-- ##### --#--
* ..... OOOOO ..... * ----- ##### -----
*/ */
static void drawOverwrite(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame); static void drawOverwrite(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
@ -170,21 +175,21 @@ class Sprites
* corresponding pixel in the buffer to 0. Frame bits set to 0 will remain * corresponding pixel in the buffer to 0. Frame bits set to 0 will remain
* unchanged in the buffer. * unchanged in the buffer.
* *
* image before after * image before after (# = 1, - = 0)
* *
* ..... ..... ..... * ----- ----- -----
* ..O.. ..... ..... * --#-- ----- -----
* OO.OO ..... ..... * ##-## ----- -----
* ..O.. ..... ..... * --#-- ----- -----
* ..... ..... ..... * ----- ----- -----
* *
* image before after * image before after
* *
* ..... OOOOO OOOOO * ----- ##### #####
* ..O.. OOOOO OO.OO * --#-- ##### ##-##
* OO.OO OOOOO ..O.. * ##-## ##### --#--
* ..O.. OOOOO OO.OO * --#-- ##### ##-##
* ..... OOOOO OOOOO * ----- ##### #####
*/ */
static void drawErase(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame); static void drawErase(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
@ -200,21 +205,21 @@ class Sprites
* the corresponding pixel in the buffer to 1. Bits set to 0 in the frame * the corresponding pixel in the buffer to 1. Bits set to 0 in the frame
* will remain unchanged in the buffer. * will remain unchanged in the buffer.
* *
* image before after * image before after (# = 1, - = 0)
* *
* ..... ..... ..... * ----- ----- -----
* ..O.. ..... ..O.. * --#-- ----- --#--
* OO.OO ..... OO.OO * ##-## ----- ##-##
* ..O.. ..... ..O.. * --#-- ----- --#--
* ..... ..... ..... * ----- ----- -----
* *
* image before after * image before after
* *
* ..... OOOOO OOOOO (no change because all pixels were * ----- ##### ##### (no change because all pixels were
* ..O.. OOOOO OOOOO already white) * --#-- ##### ##### already white)
* OO.OO OOOOO OOOOO * ##-## ##### #####
* ..O.. OOOOO OOOOO * --#-- ##### #####
* ..... OOOOO OOOOO * ----- ##### #####
*/ */
static void drawSelfMasked(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame); static void drawSelfMasked(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);