//------------------------------------------------ //--- 010 Editor v2.0.2 Binary Template // // File: PAL.bt // Authors: SweetScape Software // Version: 1.2 // Purpose: Parses a Microsoft PAL palette file. // Category: Image // File Mask: *.pal // ID Bytes: 52 49 46 46 [+4] 50 41 4C 20 //RIFF????PAL // History: // 1.2 2016-01-29 SweetScape: Updated header for repository submission. // 1.1 2007-10-24 SweetScape: Changed display order in ReadRGBQUAD to match the BMP template. // 1.0 SweetScape: Initial release. //------------------------------------------------ // Declare a structure for holding a color typedef struct { uchar red; uchar green; uchar blue; uchar alpha; } RGBQUAD ; // Custom read functions for color types - this allows the // color to be displayed without having to open up the structure. string ReadRGBQUAD( RGBQUAD &a ) { string s; SPrintf( s, "#%02X%02X%02X%02X", a.alpha, a.red, a.green, a.blue ); return s; } //--------------------------------------------- // Declare the file header char file_signature[4]; int file_length; char tag_type[4]; // Declare the RIFF chunk with color data char chunk_signature[4]; int chunk_size; ushort version ; //should be 300h ushort num_colors; RGBQUAD colors[ num_colors ];