1 /* NetHack 3.7 tile.h $NHDT-Date: 1596498339 2020/08/03 23:45:39 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.14 $ */ 2 /* Copyright (c) 2016 by Michael Allison */ 3 /* NetHack may be freely redistributed. See license for details. */ 4 5 typedef unsigned char pixval; 6 7 typedef struct pixel_s { 8 pixval r, g, b; 9 } pixel; 10 11 #define MAXCOLORMAPSIZE 256 12 13 #define CM_RED 0 14 #define CM_GREEN 1 15 #define CM_BLUE 2 16 17 /* shared between reader and writer */ 18 extern pixval ColorMap[3][MAXCOLORMAPSIZE]; 19 extern int colorsinmap; 20 /* writer's accumulated colormap */ 21 extern pixval MainColorMap[3][MAXCOLORMAPSIZE]; 22 extern int colorsinmainmap; 23 24 #include "dlb.h" /* for MODEs */ 25 26 /* size of tiles */ 27 #ifndef TILE_X 28 #define TILE_X 16 29 #endif 30 #ifndef TILE_Y 31 #define TILE_Y 16 32 #endif 33 34 #define Fprintf (void) fprintf 35 36 extern boolean fopen_text_file(const char *, const char *); 37 extern boolean read_text_tile(pixel(*) [TILE_X]); 38 extern boolean write_text_tile(pixel(*) [TILE_X]); 39 extern int fclose_text_file(void); 40 41 extern void set_grayscale(int); 42 extern void init_colormap(void); 43 extern void merge_colormap(void); 44 45 #if defined(MICRO) || defined(WIN32) 46 #undef exit 47 #if !defined(MSDOS) && !defined(WIN32) 48 extern void exit(int); 49 #endif 50 #endif 51