#include <celobj32.h>
Public Member Functions | |
void | draw (Buffer &target, const ScreenItem &screenItem, const Common::Rect &targetRect) const |
virtual void | draw (Buffer &target, const ScreenItem &screenItem, const Common::Rect &targetRect, const bool mirrorX) |
virtual void | draw (Buffer &target, const Common::Rect &targetRect, const Common::Point &scaledPosition, const bool mirrorX) |
void | drawTo (Buffer &target, const Common::Rect &targetRect, const Common::Point &scaledPosition, const Ratio &scaleX, const Ratio &scaleY) const |
virtual CelObj * | duplicate () const =0 |
virtual const SciSpan< const byte > | getResPointer () const =0 |
virtual uint8 | readPixel (const uint16 x, const uint16 y, const bool mirrorX) const |
void | submitPalette () const |
Static Public Member Functions | |
static void | init () |
static void | deinit () |
Public Attributes | |
CelInfo32 | _info |
uint32 | _celHeaderOffset |
uint32 | _hunkPaletteOffset |
uint16 | _width |
uint16 | _height |
Common::Point | _origin |
uint16 | _xResolution |
uint16 | _yResolution |
uint8 | _skipColor |
bool | _transparent |
CelCompressionType | _compressionType |
bool | _remap |
bool | _mirrorX |
bool | _isMacSource |
Static Public Attributes | |
static CelScaler * | _scaler |
Protected Member Functions | |
int | searchCache (const CelInfo32 &celInfo, int *nextInsertIndex) const |
void | putCopyInCache (int index) const |
Protected Attributes | |
bool | _drawMirrored |
Static Protected Attributes | |
static bool | _drawBlackLines |
static int | _nextCacheId |
static CelCache * | _cache |
A cel object is the lowest-level rendering primitive in the SCI engine and draws itself directly to a target pixel buffer.
|
static |
Initialises static CelObj members.
|
static |
Frees static CelObj members.
void Sci::CelObj::draw | ( | Buffer & | target, |
const ScreenItem & | screenItem, | ||
const Common::Rect & | targetRect | ||
) | const |
Draws the cel to the target buffer using the priority and positioning information from the given screen item. The mirroring of the cel will be unchanged from any previous call to draw.
|
virtual |
Draws the cel to the target buffer using the priority and positioning information from the given screen item and the given mirror flag.
Reimplemented in Sci::CelObjColor.
|
virtual |
Draws the cel to the target buffer using the positioning and mirroring information from the provided arguments.
Reimplemented in Sci::CelObjColor, and Sci::CelObjPic.
void Sci::CelObj::drawTo | ( | Buffer & | target, |
const Common::Rect & | targetRect, | ||
const Common::Point & | scaledPosition, | ||
const Ratio & | scaleX, | ||
const Ratio & | scaleY | ||
) | const |
Draws the cel to the target buffer using the given position and scaling parameters. The mirroring of the cel will be unchanged from any previous call to draw.
|
pure virtual |
Creates a copy of this cel on the free store and returns a pointer to the new object. The new cel will point to a shared copy of bitmap/resource data.
Implemented in Sci::CelObjColor, Sci::CelObjMem, Sci::CelObjPic, and Sci::CelObjView.
|
pure virtual |
Retrieves a pointer to the raw resource data for this cel. This method cannot be used with a CelObjColor.
Implemented in Sci::CelObjColor, Sci::CelObjMem, Sci::CelObjPic, and Sci::CelObjView.
|
virtual |
Reads the pixel at the given coordinates. This method is valid only for CelObjView and CelObjPic.
void Sci::CelObj::submitPalette | ( | ) | const |
Submits the palette from this cel to the palette manager for integration into the master screen palette.
|
protected |
|
protected |
Puts a copy of this CelObj into the cache at the given cache index.
|
staticprotected |
When true, every second line of the cel will be rendered as a black line.
|
protected |
When true, this cel will be horizontally mirrored when it is drawn. This is an internal flag that is set by draw methods based on the combination of the cel's _mirrorX
property and the owner screen item's _mirrorX
property.
CelInfo32 Sci::CelObj::_info |
The basic identifying information for this cel. This information effectively acts as a composite key for a cel object, and any cel object can be recreated from this data alone.
uint32 Sci::CelObj::_celHeaderOffset |
The offset to the cel header for this cel within the raw resource data.
uint32 Sci::CelObj::_hunkPaletteOffset |
The offset to the embedded palette for this cel within the raw resource data.
uint16 Sci::CelObj::_width |
The natural dimensions of the cel.
Common::Point Sci::CelObj::_origin |
The origin of the cel, relative to the top-left corner, in cel coordinates.
uint16 Sci::CelObj::_xResolution |
The dimensions of the original coordinate system for the cel. Used to scale cels from their native size to the correct size on screen.
uint8 Sci::CelObj::_skipColor |
The skip (transparent) color for the cel. When compositing, any pixels matching this color will not be copied to the buffer.
bool Sci::CelObj::_transparent |
Whether or not this cel has any transparent regions. This is used for optimised drawing of non-transparent cels.
CelCompressionType Sci::CelObj::_compressionType |
The compression type for the pixel data for this cel.
bool Sci::CelObj::_remap |
Whether or not this cel contains remap pixels.
bool Sci::CelObj::_mirrorX |
If true, the cel contains pre-mirrored picture data. This value comes directly from the resource data and is XORed with the _mirrorX
property of the owner screen item when rendering.
bool Sci::CelObj::_isMacSource |
If true, the source for this cel is a Mac pic or view or color whose pixels for entries 0 and 255 must be swapped when drawing since we use the PC palette.
|
staticprotected |
A monotonically increasing cache ID used to identify the least recently used item in the cache for replacement.
|
staticprotected |
A cache of cel objects used to avoid reinitialisation overhead for cels with the same CelInfo32.