home *** CD-ROM | disk | FTP | other *** search
- /* This source file is part of the LynxLib miscellaneous library by
- Robert Fischer, and is Copyright 1990 by Robert Fischer. It costs no
- money, and you may not make money off of it, but you may redistribute
- it. It comes with ABSOLUTELY NO WARRANTY. See the file LYNXLIB.DOC
- for more details.
- To contact the author:
- Robert Fischer \\80 Killdeer Rd \\Hamden, CT 06517 USA
- (203) 288-9599 fischer-robert@cs.yale.edu */
-
- /* Takes a low-res picture, switches around its colors, but does not */
- /* change its appearance. */
- /* By Robert Fischer, September 1988 */
-
- #include <tos.h>
- #include <tosmem.h>
- #include "colsw.h"
- /* ----------------------------------------------------------- */
- /* ----------------------------------------------------------- */
- colsw(pic, pal, newpal) /* Does the above operation on a picture */
- BYTE *pic; /* The picture & palette to do this to */
- PALETTE pal;
- PAL_TRANS newpal; /* The palette translation table */
- {
- PALETTE oldpal;
- int h;
- for (h = 0; h < 16; h++) oldpal[h] = pal[h];
- for (h = 0; h < 16; h++) pal[newpal[h]] = oldpal[h];
- switch_colors(pic, newpal);
- }
-