home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 580a.lha / HDFView_v3.01 / source.LZH / source / src / setPalette.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-22  |  944 b   |  46 lines

  1. #include    <exec/types.h>
  2. #include    <intuition/intuition.h>
  3. #include    <proto/intuition.h>
  4. #include    <proto/graphics.h>
  5. #include    <stdio.h>
  6.  
  7.  
  8. #include    "View_define.h"
  9. #include    "ViewProtos.h"
  10.  
  11. #include    "hame.h"
  12.  
  13. extern   struct ViewPort   *frontViewPort;
  14. extern   struct HamePort   *hamePort;
  15. extern   struct Library    *HameBase;
  16. extern   int   HAME_r[256], HAME_g[256], HAME_b[256];
  17. extern   int   r_32[32], g_32[32], b_32[32];
  18. extern   int   r_16[16], g_16[16], b_16[16];
  19.  
  20. VOID
  21. setColors(int mode)
  22. {
  23.  
  24. int i;   
  25.    
  26.  
  27. if( (mode == COLORS_32) ||  (mode == COLORS_LACE_32) )
  28. {
  29.    for(i=0;i<32;i++)  SetRGB4(frontViewPort, i, r_32[i], g_32[i], b_32[i]);
  30. }
  31.  
  32. if(mode==COLORS_16 || mode==COLORS_LACE_16 )
  33. {
  34.    for(i=0;i<16;i++) SetRGB4(frontViewPort, i, r_16[i], g_16[i], b_16[i]);
  35. }
  36.  
  37. if( (mode==HAME) || (mode==HAME_LACE) )
  38. {
  39.    
  40.    for(i=0;i<256;i++)
  41.       HAME_SetRGB8(hamePort,i,HAME_r[i],HAME_g[i],HAME_b[i]);
  42. }
  43.  
  44.    return;
  45. }  
  46.