Skip to content

Instantly share code, notes, and snippets.

@joshgoebel
Created February 7, 2016 20:22
Show Gist options
  • Save joshgoebel/56e6f289117e76f5d608 to your computer and use it in GitHub Desktop.
Save joshgoebel/56e6f289117e76f5d608 to your computer and use it in GitHub Desktop.
// MASKED
void drawExternalMask(int16_t x, int16_t y, const uint8_t *bitmap,
const uint8_t *mask, uint8_t frame, uint8_t mask_frame);
// = sprite UNMASKED
void drawOverwrite(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
// AND (~sprite) SPRITE_IS_MASK_ERASE
void drawErase(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
// OR (sprite) SPRITE_IS_MASK
void drawSelfMasked(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
// internal masking SPRITE_PLUS_MASK
void drawPlusMask(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
Copy link

ghost commented Feb 7, 2016

drawExternMask = use a bitmap as a sprite with masking, but masking is done by an other bitmap(both are separate arrays, and can have different amount of frames)

drawOverwrite = use a bitmap as a sprite, nothing is masked

drawErase = use a bitmap for negative sprite (this means you will see black on white)

drawSelfMasked = use a bitmap as a sprite, the same bitmap is being used as sprite

drawPlusMask = use a bitmap as a sprite with masking, but masking has been included in the same bitmap

@joshgoebel
Copy link
Author

    // drawOverwrite() replaces the existing content completely
    //
    // image  before  after
    //
    // .....  .....   ..... 
    // ..O..  .....   ..O..
    // OO.OO  .....   OO.OO
    // ..O..  .....   ..O..
    // .....  .....   .....
    //
    // image  before  after
    //
    // .....  OOOOO   ..... 
    // ..O..  OOOOO   ..O..
    // OO.OO  OOOOO   OO.OO
    // ..O..  OOOOO   ..O..
    // .....  OOOOO   .....
    //

Copy link

ghost commented Feb 8, 2016

// drawExternMask() replaces the existing content completely
//
//  image      Mask       before    after
//
// ........  ........    ........  ........
// ........  .------.    ........  ........
// ..OOOO..  .------.    ........  ..OOOO..
// ..O..O..  .------.    ........  ..O..O..
// ...OO...  .------.    ........  ...OO...
// ........  .------.    ........  ........
// ........  ........    ........  ........
//
//  image      Mask       before    after
//
// ........  ........    OOOOOOOO  OOOOOOOO
// ........  .------.    OOOOOOOO  O......O
// ..OOOO..  .------.    OOOOOOOO  O.OOOO.O
// ..O..O..  .------.    OOOOOOOO  O.O..O.O
// ...OO...  .------.    OOOOOOOO  O..OO..O
// ........  .------.    OOOOOOOO  O......O
// ........  ........    OOOOOOOO  OOOOOOOO
//

Copy link

ghost commented Feb 8, 2016

// drawPlusMask() replaces the existing content completely
//
//  image       before    after
//
// ........    ........  ........
// .------.    ........  ........
// .-OOOO-.    ........  ..OOOO..
// .-O--O-.    ........  ..O..O..
// .--OO--.    ........  ...OO...
// .------.    ........  ........
// ........    ........  ........
//
//  image       before    after
//
// ........    OOOOOOOO  OOOOOOOO
// .------.    OOOOOOOO  O......O
// .-OOOO-.    OOOOOOOO  O.OOOO.O
// .-O--O-.    OOOOOOOO  O.O..O.O
// .--OO--.    OOOOOOOO  O..OO..O
// .------.    OOOOOOOO  O......O
// ........    OOOOOOOO  OOOOOOOO
//

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment