(screen: Screen, index: number)
| 415 | } |
| 416 | |
| 417 | function isEmptyCellByIndex(screen: Screen, index: number): boolean { |
| 418 | // An empty/unwritten cell has both words === 0: |
| 419 | // word0 = EMPTY_CHAR_INDEX (0), word1 = packWord1(emptyStyleId=0, 0, 0) = 0. |
| 420 | const ci = index << 1 |
| 421 | return screen.cells[ci] === 0 && screen.cells[ci | 1] === 0 |
| 422 | } |
| 423 | |
| 424 | export function isEmptyCellAt(screen: Screen, x: number, y: number): boolean { |
| 425 | if (x < 0 || y < 0 || x >= screen.width || y >= screen.height) return true |