home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d4xx / d430 / smartfields.lha / SmartFields / Functions / con_graphic_rend.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-11  |  1.0 KB  |  40 lines

  1. /***************************************
  2. *  CONsole GRAPHIC RENDition v1.12
  3. *  © Copyright Timm Martin
  4. *  All Rights Reserved
  5. ****************************************/
  6.  
  7. #include <exec/io.h>
  8. #include <exec/types.h>
  9. #include <console/console.h>
  10. #include <console/functions.h>
  11.  
  12. UBYTE gr__escdata[] = { CSI, '0', ';', '3', '1', ';', '4', '0', 'm' };
  13. UBYTE gr__escstyl[] = { CSI, '1', 'm' };
  14.  
  15. void con_graphic_rend( wreq, style, foreground, background )
  16.   struct IOStdReq *wreq;
  17.   USHORT style, foreground, background;
  18. {
  19.   gr__escdata[4] = foreground % 10 + '0';
  20.   gr__escdata[7] = background % 10 + '0';
  21.   con_write( wreq, &gr__escdata[0], 9 );
  22.  
  23.   if (style & CON_BOLD) {
  24.     gr__escstyl[1] = '1';
  25.     con_write( wreq, &gr__escstyl[0], 3 );
  26.   }
  27.   if (style & CON_ITALIC) {
  28.     gr__escstyl[1] = '3';
  29.     con_write( wreq, &gr__escstyl[0], 3 );
  30.   }
  31.   if (style & CON_UNDERSCORE) {
  32.     gr__escstyl[1] = '4';
  33.     con_write( wreq, &gr__escstyl[0], 3 );
  34.   }
  35.   if (style & CON_INVERSE) {
  36.     gr__escstyl[1] = '7';
  37.     con_write( wreq, &gr__escstyl[0], 3 );
  38.   }
  39. }
  40.