/* * Icon generation helpers for slide puzzle game * Copyright © 2022 Nick Bowler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef RRACE_ICON_H_ #define RRACE_ICON_H_ /* * Generate one tile of the program icon at various sizes, which is a 3x3 grid * of coloured tiles. * * These functions all operate as follows: * * - icon points to the start of the complete image buffer, in row-major * order. Each byte represents one pixel of the icon, so for example the * 16x16 icon requires a 256-byte buffer. * * - c controls the byte values that are written to the icon for this tile. * The least significant 8 bits of c encode the primary colour, bits 8-15 * encode the dark shade colour, and bits 16-23 encode the light shade * colour. * * - tile_x and tile_y select which tile to render (each may be 0, 1 or 2). * * By calling the function 9 times with all combinations of tile_x/tile_y * values, a complete icon is generated. */ void icon_tile16(unsigned char *icon, unsigned long c, int tile_x, int tile_y); void icon_tile24(unsigned char *icon, unsigned long c, int tile_x, int tile_y); void icon_tile32(unsigned char *icon, unsigned long c, int tile_x, int tile_y); void icon_tile48(unsigned char *icon, unsigned long c, int tile_x, int tile_y); #endif