19 #ifndef OPENXCOM_PALETTE_H
20 #define OPENXCOM_PALETTE_H
44 void loadDat(
const std::string &filename,
int ncolors,
int offset = 0);
46 SDL_Color *
getColors(
int offset = 0)
const;
48 void savePal(
const std::string &file)
const;
51 static Uint32
getRGBA(SDL_Color* pal, Uint8 color);
59 static inline int palOffset(
int palette) {
return palette*(768+6); }
67 static inline Uint8
blockOffset(Uint8 block) {
return block*16; }
static const int backPos
Position of the background colors block in an X-Com palette (used for background images in screens)...
Definition: Palette.h:69
void loadDat(const std::string &filename, int ncolors, int offset=0)
Loads the colors from an X-Com palette.
Definition: Palette.cpp:50
SDL_Color * getColors(int offset=0) const
Provides access to colors contained in the palette.
Definition: Palette.cpp:88
static Uint8 blockOffset(Uint8 block)
Gets the position of a certain color block in a palette.
Definition: Palette.h:67
~Palette()
Cleans up the palette.
Definition: Palette.cpp:36
Palette()
Creates a blank palette.
Definition: Palette.cpp:29
Container for palettes (sets of 8bpp colors).
Definition: Palette.h:33
static int palOffset(int palette)
Gets the position of a given palette.
Definition: Palette.h:59
static Uint32 getRGBA(SDL_Color *pal, Uint8 color)
Converts a given color into a RGBA color value.
Definition: Palette.cpp:100