| 153 | |
| 154 | // update sub-rectangle of the current tile |
| 155 | _subTile(x, y, w, h, color) { |
| 156 | const red = color[0]; |
| 157 | const green = color[1]; |
| 158 | const blue = color[2]; |
| 159 | const xend = x + w; |
| 160 | const yend = y + h; |
| 161 | |
| 162 | const data = this._tileBuffer; |
| 163 | const width = this._tileW; |
| 164 | for (let j = y; j < yend; j++) { |
| 165 | for (let i = x; i < xend; i++) { |
| 166 | const p = (i + (j * width)) * 4; |
| 167 | data[p] = red; |
| 168 | data[p + 1] = green; |
| 169 | data[p + 2] = blue; |
| 170 | data[p + 3] = 255; |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | // draw the current tile to the screen |
| 176 | _finishTile(display) { |