home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / WINCPP.ZIP / WCELL.CPP < prev    next >
C/C++ Source or Header  |  1994-01-22  |  437b  |  35 lines

  1. #include "window.h"
  2.  
  3. Cell::Cell()
  4. {
  5.     Character = ' ';
  6.     Attribute = 7;
  7. }
  8.  
  9.  
  10. void Cell::Put(uchar attr, uchar c)
  11. {
  12.     Character = c;
  13.     Attribute = attr;
  14. }
  15.  
  16.  
  17. void Cell::Put(short word)
  18. {
  19.     Character = (uchar)(word & 0xff);
  20.     Attribute = (uchar)(word >> 8);
  21. }
  22.  
  23.  
  24. void Cell::Get(uchar &attr, uchar &c)
  25. {
  26.     c = Character;
  27.     attr = Attribute;
  28. }
  29.  
  30.  
  31. short Cell::Get()
  32. {
  33.     return ((short)((short)Attribute<<8|Character));
  34. }
  35.