Module: Badline::VIC::GraphicsMode::Multicolor

Included in:
MulticolorBitmap, MulticolorText
Defined in:
lib/badline/vic/graphics_mode.rb

Overview

Decodes 2-bit pixel pairs into double-wide pixels. The colour for each pair is supplied by the block.

Instance Method Summary collapse

Instance Method Details

#paint_pairs(data, seq) ⇒ Object



37
38
39
40
41
42
43
44
45
# File 'lib/badline/vic/graphics_mode.rb', line 37

def paint_pairs(data, seq)
  seq.cur_fg = PAIR_FG[data]
  colors = seq.cur_colors
  i = 0
  while i < 8
    colors[i] = yield((data >> (6 - (i & ~1))) & 0b11)
    i += 1
  end
end