split classes into files for better understanding

- also for excluding some things in the build, as I may not need
 to support PCBoard at revision. Actually, I don't. Later I can
 add that support, but for now, I need the Revision bits working.
This commit is contained in:
Howland Owl 2014-04-05 13:30:28 +03:00
parent 10e8940807
commit 49d411a3d1
15 changed files with 2454 additions and 746 deletions

25
16col/bin.coffee Normal file
View file

@ -0,0 +1,25 @@
class @ImageTextModeBin extends @ImageTextMode
constructor: ( options ) ->
super
@linewrap = 160
this[k] = v for own k, v of options
parse: ( content ) ->
x = 0
y = 0
@screen[ y ] = []
for i in [ 0 .. content.length - 2 ] by 2
ch = content.substr( i, 1 )
break if ch == "\x1a"
attr = @getByteAt( content, i + 1 )
@screen[ y ][ x ] = { 'ch': ch, 'attr': attr }
x++
if x == @linewrap
x = 0
y++
@screen[ y ] = []
@screen.pop() if @screen[ y ].length == 0