home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / Examples / p1-109 < prev    next >
Encoding:
Text File  |  1994-05-16  |  515 b   |  24 lines

  1. #include "os.h"
  2.  
  3. os_error *read_palette (os_gcol entry_no, int entry_type,
  4.       os_colour *on, os_colour *off)
  5.  
  6. {  os_error *error = NULL;
  7.    bool incomplete;
  8.  
  9.    if ((error = xpalettev_read_entry (entry_no, entry_type,
  10.          on, off, &incomplete)) != NULL)
  11.       goto finish;
  12.  
  13.    if (incomplete)
  14.    {  if ((error = xos_read_palette (entry_no, entry_type, on, off)) != NULL)
  15.          goto finish;
  16.  
  17.       *on  |= (*on  & 0xF0F0F000) >> 4;
  18.       *off |= (*off & 0xF0F0F000) >> 4;
  19.    }
  20.  
  21. finish:
  22.    return error;
  23. }
  24.