Skip to content

Commit

Permalink
Fix transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Aug 5, 2017
1 parent 73879fa commit d9cea6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
7 changes: 0 additions & 7 deletions src/Frame.js

This file was deleted.

8 changes: 4 additions & 4 deletions src/SLP.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,19 @@ SLP.prototype.renderFrame = function (frameIdx, palette, { player, drawOutline }
if (skip === SLP_LINE_EMPTY) {
skip = frame.width
}
fill(255, 0, skip * 4)
fill(0, 0, skip * 4)
idx = skip * 4

frame.commands.forEach(({ command, arg }) => {
let i, color
switch (command) {
case RENDER_SKIP:
fill(255, idx, idx + arg * 4)
fill(0, idx, idx + arg * 4)
idx += arg * 4
break
case RENDER_NEXTLINE:
// fill up the rest of this line
fill(255, idx, idx + outlines[y].right * 4)
fill(0, idx, idx + outlines[y].right * 4)
idx += outlines[y].right * 4
y++
if (y < frame.height) {
Expand All @@ -253,7 +253,7 @@ SLP.prototype.renderFrame = function (frameIdx, palette, { player, drawOutline }
skip = frame.width
}
// fill the start of this line until the first pixel
fill(255, idx, idx + skip * 4)
fill(0, idx, idx + skip * 4)
idx += skip * 4
}
break
Expand Down

0 comments on commit d9cea6b

Please sign in to comment.