ScummVM API documentation
Sci::CelObjPic Class Reference

#include <celobj32.h>

Inheritance diagram for Sci::CelObjPic:
Sci::CelObj

Public Member Functions

 CelObjPic (const GuiResourceId pictureId, const int16 celNo)
 
void draw (Buffer &target, const Common::Rect &targetRect, const Common::Point &scaledPosition, const bool mirrorX) override
 
CelObjPic * duplicate () const override
 
const SciSpan< const byte > getResPointer () const override
 
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)
 
- Public Member Functions inherited from Sci::CelObj
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
 

Public Attributes

uint8 _celCount
 
Common::Point _relativePosition
 
int16 _priority
 
- Public Attributes inherited from Sci::CelObj
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
 

Additional Inherited Members

- Static Public Member Functions inherited from Sci::CelObj
static void init ()
 
static void deinit ()
 
- Static Public Attributes inherited from Sci::CelObj
static CelScaler * _scaler
 
- Protected Member Functions inherited from Sci::CelObj
int searchCache (const CelInfo32 &celInfo, int *nextInsertIndex) const
 
void putCopyInCache (int index) const
 
- Protected Attributes inherited from Sci::CelObj
bool _drawMirrored
 
- Static Protected Attributes inherited from Sci::CelObj
static bool _drawBlackLines
 
static int _nextCacheId
 
static CelCache * _cache
 

Detailed Description

A CelObjPic is the drawing primitive for a Picture type resource. Each CelObjPic corresponds to a single cel within a picture.

Member Function Documentation

◆ draw() [1/4]

void Sci::CelObjPic::draw ( Buffer &  target,
const Common::Rect &  targetRect,
const Common::Point &  scaledPosition,
const bool  mirrorX 
)
overridevirtual

Draws the cel to the target buffer using the positioning and mirroring information from the provided arguments.

Note
In SSCI, this function was a virtual function, but CelObjView, CelObjPic, and CelObjMem all used the same function and the compiler deduplicated the copies; we deduplicate the source by putting the implementation on CelObj instead of copying it to 3/4 of the subclasses.

Reimplemented from Sci::CelObj.

◆ duplicate()

CelObjPic * Sci::CelObjPic::duplicate ( ) const
overridevirtual

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.

Implements Sci::CelObj.

◆ getResPointer()

const SciSpan< const byte > Sci::CelObjPic::getResPointer ( ) const
overridevirtual

Retrieves a pointer to the raw resource data for this cel. This method cannot be used with a CelObjColor.

Implements Sci::CelObj.

◆ draw() [2/4]

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.

◆ draw() [3/4]

virtual void Sci::CelObj::draw ( Buffer &  target,
const ScreenItem &  screenItem,
const Common::Rect &  targetRect,
const bool  mirrorX 
)
virtual

Draws the cel to the target buffer using the priority and positioning information from the given screen item and the given mirror flag.

Note
In SSCI, this function was a virtual function, but CelObjView, CelObjPic, and CelObjMem all used the same function and the compiler deduplicated the copies; we deduplicate the source by putting the implementation on CelObj instead of copying it to 3/4 of the subclasses.

Reimplemented from Sci::CelObj.

◆ draw() [4/4]

virtual void Sci::CelObj::draw ( Buffer &  target,
const Common::Rect &  targetRect,
const Common::Point &  scaledPosition,
const bool  mirrorX 
)
virtual

Draws the cel to the target buffer using the positioning and mirroring information from the provided arguments.

Note
In SSCI, this function was a virtual function, but CelObjView, CelObjPic, and CelObjMem all used the same function and the compiler deduplicated the copies; we deduplicate the source by putting the implementation on CelObj instead of copying it to 3/4 of the subclasses.

Reimplemented from Sci::CelObj.

Member Data Documentation

◆ _celCount

uint8 Sci::CelObjPic::_celCount

The number of cels in the original picture resource.

◆ _relativePosition

Common::Point Sci::CelObjPic::_relativePosition

The position of this cel relative to the top-left corner of the picture.

◆ _priority

int16 Sci::CelObjPic::_priority

The z-buffer priority for this cel. Higher prorities are drawn on top of lower priorities.


The documentation for this class was generated from the following file: