Isle
|
[AI] Encapsulates a DirectDraw 8-bit (256 color) palette for use with DirectX rendering. More...
#include <mxpalette.h>
Public Member Functions | |
MxBool | operator== (MxPalette &p_other) |
[AI] Compares two palettes for equality by checking all 256 color entries (RGB only, not flags). More... | |
void | Detach () |
[AI] Detaches the internal DirectDraw palette object, releasing ownership. More... | |
MxPalette () | |
[AI] Constructs a new palette, initializing to the system or default palette entries. More... | |
MxPalette (const RGBQUAD *) | |
[AI] Constructs a palette using an array of RGBQUADs for indices 10..245, with system entries at borders. More... | |
~MxPalette () override | |
[AI] Destructor. More... | |
void | ApplySystemEntriesToPalette (LPPALETTEENTRY p_entries) |
[AI] Copies system palette entries (first and last 10) to the specified buffer. More... | |
MxPalette * | Clone () |
[AI] Creates a duplicate of this palette object with the same palette data and override flag. More... | |
void | GetDefaultPalette (LPPALETTEENTRY p_entries) |
[AI] Retrieves the default palette for the current system/graphics environment. More... | |
MxResult | GetEntries (LPPALETTEENTRY p_entries) |
[AI] Copies all palette entries to external buffer. More... | |
MxResult | SetEntries (LPPALETTEENTRY p_palette) |
[AI] Sets the palette's RGB entries from an external array and updates the DirectDraw palette if attached. More... | |
MxResult | SetSkyColor (LPPALETTEENTRY p_skyColor) |
[AI] Sets the "sky color" palette entry (typically index 141, reserved for sky background), and updates attached DirectDraw palette. More... | |
void | Reset (MxBool p_ignoreSkyColor) |
[AI] Resets palette entries to default system values, optionally preserving the current sky color, then uploads to DirectDraw. More... | |
LPDIRECTDRAWPALETTE | CreateNativePalette () |
[AI] Creates the internal DirectDraw palette object and populates it with the current palette entries. More... | |
void | SetPalette (LPDIRECTDRAWPALETTE p_palette) |
[AI] Sets the internal DirectDraw palette pointer, releasing any previously held instance. More... | |
void | SetOverrideSkyColor (MxBool p_value) |
[AI] Sets whether the sky color is overridden, preventing calls to SetSkyColor from effecting palette entries. More... | |
![]() | |
MxCore () | |
[AI] Constructs a new MxCore object and assigns it a unique id. More... | |
virtual | ~MxCore () |
[AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More... | |
virtual MxLong | Notify (MxParam &p_param) |
[AI] Virtual callback notification mechanism. More... | |
virtual MxResult | Tickle () |
[AI] Called by tickle managers to allow the object to update itself. More... | |
virtual const char * | ClassName () const |
[AI] Returns the runtime class name of this object. More... | |
virtual MxBool | IsA (const char *p_name) const |
[AI] Checks whether this object's class type or parents match the given name. More... | |
MxU32 | GetId () |
[AI] Gets the unique (per-process) id assigned to this object instance. More... | |
[AI] Encapsulates a DirectDraw 8-bit (256 color) palette for use with DirectX rendering.
Handles palette entry management, overrides for special colors (e.g., sky), cloning, and platform/system palette integration. [AI]
The palette provides facilities to set, retrieve, and modify palette entries, set the palette for rendering, and override specific entries for custom rendering effects such as sky gradients. Internal members allow for efficient updates and synchronization with DirectDraw API objects. [AI]
Definition at line 17 of file mxpalette.h.
MxPalette::MxPalette | ( | ) |
[AI] Constructs a new palette, initializing to the system or default palette entries.
[AI]
Definition at line 77 of file mxpalette.cpp.
MxPalette::MxPalette | ( | const RGBQUAD * | p_colors | ) |
[AI] Constructs a palette using an array of RGBQUADs for indices 10..245, with system entries at borders.
[AI]
p_colors | Pointer to RGBQUAD array (minimum 256 entries recommended). [AI] |
Definition at line 87 of file mxpalette.cpp.
|
override |
[AI] Destructor.
Releases any allocated DirectDraw palette. [AI]
Definition at line 105 of file mxpalette.cpp.
void MxPalette::ApplySystemEntriesToPalette | ( | LPPALETTEENTRY | p_entries | ) |
[AI] Copies system palette entries (first and last 10) to the specified buffer.
[AI]
p_entries | Pointer to a PALETTEENTRY array to receive system entries. [AI] |
Used to synchronize palette with system colors for correct display. [AI]
Definition at line 293 of file mxpalette.cpp.
MxPalette * MxPalette::Clone | ( | ) |
[AI] Creates a duplicate of this palette object with the same palette data and override flag.
[AI]
Definition at line 160 of file mxpalette.cpp.
LPDIRECTDRAWPALETTE MxPalette::CreateNativePalette | ( | ) |
[AI] Creates the internal DirectDraw palette object and populates it with the current palette entries.
[AI]
On first call, creates palette. No-op on subsequent calls. [AI]
Definition at line 114 of file mxpalette.cpp.
void MxPalette::Detach | ( | ) |
[AI] Detaches the internal DirectDraw palette object, releasing ownership.
Does not release the underlying DirectDraw resource. [AI]
Definition at line 266 of file mxpalette.cpp.
void MxPalette::GetDefaultPalette | ( | LPPALETTEENTRY | p_entries | ) |
[AI] Retrieves the default palette for the current system/graphics environment.
[AI]
p_entries | Pointer to a PALETTEENTRY array to receive all default entries. [AI] |
Uses system palette if supported, otherwise uses static default. [AI]
Definition at line 311 of file mxpalette.cpp.
MxResult MxPalette::GetEntries | ( | LPPALETTEENTRY | p_entries | ) |
[AI] Copies all palette entries to external buffer.
[AI]
p_entries | Output buffer for 256 palette entries. [AI] |
Definition at line 170 of file mxpalette.cpp.
[AI] Compares two palettes for equality by checking all 256 color entries (RGB only, not flags).
[AI]
p_other | The palette to compare with. [AI] |
Definition at line 273 of file mxpalette.cpp.
void MxPalette::Reset | ( | MxBool | p_ignoreSkyColor | ) |
[AI] Resets palette entries to default system values, optionally preserving the current sky color, then uploads to DirectDraw.
[AI]
p_ignoreSkyColor | If FALSE, the sky color entry will be forcibly set. [AI] |
Definition at line 329 of file mxpalette.cpp.
MxResult MxPalette::SetEntries | ( | LPPALETTEENTRY | p_palette | ) |
[AI] Sets the palette's RGB entries from an external array and updates the DirectDraw palette if attached.
[AI]
p_palette | Input buffer of 256 palette entries. [AI] |
Definition at line 178 of file mxpalette.cpp.
|
inline |
[AI] Sets whether the sky color is overridden, preventing calls to SetSkyColor from effecting palette entries.
[AI]
p_value | TRUE to override, FALSE to use palette. [AI] |
Definition at line 112 of file mxpalette.h.
void MxPalette::SetPalette | ( | LPDIRECTDRAWPALETTE | p_palette | ) |
[AI] Sets the internal DirectDraw palette pointer, releasing any previously held instance.
No copy is made. [AI]
p_palette | Pointer to DirectDraw palette instance. [AI] |
Definition at line 255 of file mxpalette.cpp.
MxResult MxPalette::SetSkyColor | ( | LPPALETTEENTRY | p_skyColor | ) |
[AI] Sets the "sky color" palette entry (typically index 141, reserved for sky background), and updates attached DirectDraw palette.
[AI]
p_skyColor | Pointer to sky color entry (only one entry used). [AI] |
If override for sky color is enabled, this call has no effect. [AI]
Definition at line 239 of file mxpalette.cpp.