42 void loadDat(
const std::string &filename,
int ncolors,
int offset = 0);
44 SDL_Color *
getColors(
int offset = 0)
const;
46 void savePal(
const std::string &file)
const;
47 void setColors(SDL_Color* pal,
int ncolors);
49 static Uint32
getRGBA(SDL_Color* pal, Uint8 color);
57 static inline int palOffset(
int palette) {
return palette*(768+6); }
65 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:67
void loadDat(const std::string &filename, int ncolors, int offset=0)
Loads the colors from an X-Com palette.
Definition: Palette.cpp:50
static Uint8 blockOffset(Uint8 block)
Gets the position of a certain color block in a palette.
Definition: Palette.h:65
~Palette()
Cleans up the palette.
Definition: Palette.cpp:36
SDL_Color * getColors(int offset=0) const
Provides access to colors contained in the palette.
Definition: Palette.cpp:88
Palette()
Creates a blank palette.
Definition: Palette.cpp:29
Container for palettes (sets of 8bpp colors).
Definition: Palette.h:31
static int palOffset(int palette)
Gets the position of a given palette.
Definition: Palette.h:57
static Uint32 getRGBA(SDL_Color *pal, Uint8 color)
Converts a given color into a RGBA color value.
Definition: Palette.cpp:100
Definition: BaseInfoState.cpp:40