paldata#
Represents a set of palette colors. 256 rgb
colors divided into 16 csets.
Variables#
Constructors#
Functions#
void |
LoadLevelPalette(int pal) |
void |
LoadSpritePalette(int pal) |
void |
|
void |
LoadCyclePalette(int pal) |
void |
LoadBitmapPalette(int pal) |
void |
WriteLevelPalette(int pal) |
void |
WriteLevelCSet(int pal, int cset) |
void |
WriteSpritePalette(int pal) |
void |
WriteSpriteCSet(int pal, int cset) |
void |
|
void |
WriteMainCSet(int cset) |
void |
WriteCyclePalette(int pal) |
void |
WriteCycleCSet(int pal, int cset) |
bool |
ColorValid(int index) |
void |
ClearColor(int index) |
void |
ClearCSet(int cset) |
void |
Mix(paldata start, paldata end, int percent = |
void |
MixCSet(paldata start, paldata end, int cset, int percent = |
void |
|
void |
|
void |
Free() deprecated |
void |
Own() |
Variable descriptions#
Access colors of the paldata as rgb
. Reading an invalid color
will return INVALID_COLOR (-1
). To write a color as invalid, use
ClearColor() instead.
Access the Red values of the paldata, ranging from 0-255. Reading an invalid color will return -1. To write a color as invalid, use ClearColor() instead.
Access the Green values of the paldata, ranging from 0-255. Reading an invalid color will return -1. To write a color as invalid, use ClearColor() instead.
Access the Blue values of the paldata, ranging from 0-255. Reading an invalid color will return -1. To write a color as invalid, use ClearColor() instead.
Constructor descriptions#
Function descriptions#
void LoadLevelPalette(int pal) π Source
Loads a levelβs palette to the paldata.
CSets will be arranged as they appear on the main palette, so CSet 2 starts at index 0x20, ect.
void LoadSpritePalette(int pal) π Source
Loads a page of sprite palettes to the paldata.
Currently only values of 0 and 1 are valid.
void LoadMainPalette() π Source
Loads the main palette to the paldata.
void LoadCyclePalette(int pal) π Source
Loads the cycle/dark room csets from a level palette to the paldata.
void LoadBitmapPalette(int pal) π Source
Loads the palette from an image. Currently only BMP, PCX, and TGA are supported.
void WriteLevelPalette(int pal) π Source
Writes the paldata to a level palette. Empty color indices will be skipped.
void WriteLevelCSet(int pal, int cset) π Source
Writes a cset of the paldata to a level palette. Empty color indices will be skipped.
void WriteSpritePalette(int pal) π Source
Writes the paldata to a sprite palette page. Empty color indices will be skipped.
void WriteSpriteCSet(int pal, int cset) π Source
Writes a cset of the paldata to a sprite palette page. Empty color indices will be skipped.
void WriteMainPalette() π Source
Writes the paldata to the main palette. Empty color indices will be skipped.
void WriteMainCSet(int cset) π Source
Writes a cset of the paldata to the main palette. Empty color indices will be skipped.
void WriteCyclePalette(int pal) π Source
Writes the paldata to a level paletteβs cycle/dark room csets. Empty color indices will be skipped.
void WriteCycleCSet(int pal, int cset) π Source
Writes a cset of the paldata to a levelβs cycle/dark room palette.
Empty color indices will be skipped.
bool ColorValid(int index) π Source
Returns true if the color at index is valid.
void ClearColor(int index) π Source
Clears the color at index on the paldata. Cleared colors will be skipped when writing to a palette.
void ClearCSet(int cset) π Source
Clears an cset on the paldata. Cleared colors will be skipped when writing to a palette.
void Mix(paldata start, paldata end, int percent = 5000L
, int color_space = 0
) π Source
Interpolates all the colors on a paldata between start and end.
void MixCSet(paldata start, paldata end, int cset, int percent = 5000L
, int color_space = 0
) π Source
Interpolates all the colors on a cset of a paldata between start and end.
void Copy(paldata target) π Source
Copies all the colors from this paldata to the target.
void CopyCSet(paldata target, int src_cset, int dest_cset) π Source
Copies all the colors from one cset on this paldata to another on the target.
De-allocates this paldata
pointer, so that itsβ pointer ID may be
re-used. You may only have a limited number of paldata pointers active at
a time; freeing them when you are done with them helps not reach the
limit.
Warning
Deprecated! Free() no longer does anything as of ZC 3.0. Objects are now freed automatically.
Grants βOwnershipβ of the paldata pointer to the script that calls this function. When the script with βOwnershipβ terminates (at the same time itsβ local arrays are deallocated), this paldata pointer will automatically be βFree()βd.