home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / clib / progs / haswinlib / c / palette < prev    next >
Encoding:
Text File  |  1991-02-04  |  1.4 KB  |  50 lines

  1. /* > $.CLIB.C.palette
  2.  *
  3.  *      HASWIN Graphics Library
  4.  *     =========================
  5.  *
  6.  *      Copyright (C) H.A.Shaw 1990.
  7.  *              Howard A. Shaw.
  8.  *              The Unit for Space Sciences,
  9.  *              Room 165,
  10.  *              Physics Building,
  11.  *              University of Kent at Canterbury.
  12.  *              Canterbury.
  13.  *              Kent.  CT2 7NJ
  14.  *      You may use and distribute this code freely, however please leave
  15.  *      it alone.  If you find bugs (and there will be many) please contact
  16.  *      me and the master source can be modified.  If you keep me informed
  17.  *      of who you give copies of this to then I can get release upgrades
  18.  *      to them.
  19.  *
  20.  *     Routines to do things with palettes.  This is short!
  21.  */
  22. #include "includes.h"
  23.  
  24. void haswin_setpalette(palette *pal) {
  25.  
  26.         _kernel_swi_regs        regs;
  27.  
  28.         if (!pal)
  29.                 return;
  30.         regs.r[1] = (int)pal;
  31.         haswin_swi(HASWIN_Set_palette, ®s);
  32.         return;
  33. }
  34.  
  35. palette *haswin_getpalette(palette *pal) {
  36.  
  37.         _kernel_swi_regs        regs;
  38.  
  39.         if (!pal) {
  40.                 pal = haswin_malloc(sizeof(palette), "haswin_getpalette",
  41.                               "new palette");
  42.                 if (!pal)
  43.                         return(0);
  44.         }
  45.         regs.r[1] = (int)pal;
  46.         haswin_swi(HASWIN_Read_palette, ®s);
  47.         return(pal);
  48. }
  49.  
  50.