uli / basicengine-firmware

BASIC Engine Firmware
78 stars 16 forks source link

vs23s010: loadSpritePattern sometimes misses #53

Closed konimaru closed 4 years ago

konimaru commented 4 years ago

While playing with (transparent) custom sprites I noticed a strange effect in that what is basically a rectangle (non-transparent frame, transparent fill colour) is marked as opaque during loadSpritePattern.

While the LHS and RHS non-transparent pixels are detected we get solid_block updated to false (lines 854/863). This won't be triggered when the sprite has a solid frame but is otherwise empty. The LINE_BROKEN scan which follows should also set solid_block to false, i.e.

    for (int i = 0; i < p->len; ++i) {
      if (p->pixels[p->off + i] == s->p.key) {
        solid_block = false;
        p->type = LINE_BROKEN;
        break;
      }
    }