mirror of https://github.com/x64dbg/btparser
45 lines
1.2 KiB
Plaintext
45 lines
1.2 KiB
Plaintext
|
//--------------------------------------
|
||
|
//--- 010 Editor v2.0.2 Template File
|
||
|
//
|
||
|
// File: PALTemplate.bt
|
||
|
// Author: SweetScape Software
|
||
|
// Revision: 1.1
|
||
|
// Purpose: Parses a Microsoft PAL
|
||
|
// palette file.
|
||
|
// SweetScape: Changed display order
|
||
|
// in ReadRGBQUAD to match the BMP
|
||
|
// template (Oct 24th, 2007).
|
||
|
//--------------------------------------
|
||
|
|
||
|
// Declare a structure for holding a color
|
||
|
typedef struct
|
||
|
{
|
||
|
uchar red;
|
||
|
uchar green;
|
||
|
uchar blue;
|
||
|
uchar alpha;
|
||
|
} RGBQUAD <read=ReadRGBQUAD>;
|
||
|
|
||
|
// 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 <format=hex>; //should be 300h
|
||
|
ushort num_colors;
|
||
|
RGBQUAD colors[ num_colors ];
|