ScummVM API documentation
Sci::ScreenItem Class Reference

#include <screen_item32.h>

Public Member Functions

 ScreenItem (const reg_t screenItem)
 
 ScreenItem (const reg_t plane, const CelInfo32 &celInfo)
 
 ScreenItem (const reg_t plane, const CelInfo32 &celInfo, const Common::Rect &rect)
 
 ScreenItem (const reg_t plane, const CelInfo32 &celInfo, const Common::Point &position, const ScaleInfo &scaleInfo)
 
 ScreenItem (const ScreenItem &other)
 
void operator= (const ScreenItem &)
 
bool operator< (const ScreenItem &other) const
 
bool operator> (const ScreenItem &other) const
 
bool hasPriorityAbove (const ScreenItem &other) const
 
void calcRects (const Plane &plane)
 
CelObjgetCelObj () const
 
void printDebugInfo (Console *con) const
 
void update (const reg_t object)
 
void update ()
 
Common::Rect getNowSeenRect (const Plane &plane) const
 

Static Public Member Functions

static void init ()
 

Public Attributes

reg_t _plane
 
ScaleInfo _scale
 
uint32 _creationId
 
CelInfo32 _celInfo
 
Common::ScopedPtr< CelObj_celObj
 
bool _fixedPriority
 
int16 _priority
 
Common::Point _position
 
reg_t _object
 
GuiResourceId _pictureId
 
int _created
 
int _updated
 
int _deleted
 
bool _mirrorX
 
Ratio _ratioX
 
Ratio _ratioY
 
Common::Point _scaledPosition
 
Common::Rect _screenRect
 
bool _drawBlackLines
 

Detailed Description

A ScreenItem is the engine-side representation of a game script View.

Member Function Documentation

◆ init()

static void Sci::ScreenItem::init ( )
static

Initialises static Plane members.

◆ calcRects()

void Sci::ScreenItem::calcRects ( const Plane plane)

Calculates the dimensions and scaling parameters for the screen item, using the given plane as the parent plane for screen rect positioning.

Note
This method was called Update in SSCI.

◆ getCelObj()

CelObj& Sci::ScreenItem::getCelObj ( ) const

Retrieves the corresponding cel object for this screen item. If a cel object does not already exist, one will be created and assigned.

◆ update() [1/2]

void Sci::ScreenItem::update ( const reg_t  object)

Updates the properties of the screen item from a VM object.

◆ update() [2/2]

void Sci::ScreenItem::update ( )

Updates the properties of the screen item for one not belonging to a VM object. Originally GraphicsMgr::UpdateScreenItem.

◆ getNowSeenRect()

Common::Rect Sci::ScreenItem::getNowSeenRect ( const Plane plane) const

Gets the "now seen" rect for the screen item, which represents the current size and position of the screen item on the screen in script coordinates.

Member Data Documentation

◆ _plane

reg_t Sci::ScreenItem::_plane

The parent plane of this screen item.

◆ _scale

ScaleInfo Sci::ScreenItem::_scale

Scaling data used to calculate the final screen dimensions of the screen item as well as the scaling ratios used when drawing the item to screen.

◆ _creationId

uint32 Sci::ScreenItem::_creationId

The creation order number, which ensures a stable sort when screen items with identical priorities and z-indexes are added to the screen item list.

◆ _celInfo

CelInfo32 Sci::ScreenItem::_celInfo

A descriptor for the cel object represented by the screen item.

◆ _celObj

Common::ScopedPtr<CelObj> Sci::ScreenItem::_celObj
mutable

The cel object used to actually render the screen item. This member is populated by calling getCelObj.

◆ _fixedPriority

bool Sci::ScreenItem::_fixedPriority

If set, the priority for this screen item is fixed in place. Otherwise, the priority of the screen item is calculated from its y-position + z-index.

◆ _priority

int16 Sci::ScreenItem::_priority

The rendering priority of the screen item, relative only to the other screen items within the same plane. Higher priorities are drawn above lower priorities.

◆ _position

Common::Point Sci::ScreenItem::_position

The top-left corner of the screen item, in game script coordinates, relative to the parent plane.

◆ _object

reg_t Sci::ScreenItem::_object

The associated View script object that was used to create the ScreenItem, or a numeric value in the case of a ScreenItem that was generated by the kernel.

◆ _pictureId

GuiResourceId Sci::ScreenItem::_pictureId

For screen items representing picture resources, the resource ID of the picture.

◆ _created

int Sci::ScreenItem::_created

Flags indicating the state of the screen item.

  • created is set when the screen item is first created, either from a VM object or from within the kernel
  • updated is set when created is not already set and the screen item is updated from a VM object
  • deleted is set by the parent plane, if the parent plane is a pic type and its picture resource ID has changed

◆ _mirrorX

bool Sci::ScreenItem::_mirrorX

For screen items that represent picture cels, this value is set to match the _mirrorX property of the parent plane and indicates that the cel should be drawn horizontally mirrored. For final drawing, it is XORed with the _mirrorX property of the cel object. The cel object's _mirrorX property comes from the resource data.

◆ _ratioX

Ratio Sci::ScreenItem::_ratioX

The scaling ratios to use when drawing this screen item. These values are calculated according to the scale info whenever the screen item is updated.

◆ _scaledPosition

Common::Point Sci::ScreenItem::_scaledPosition

The top-left corner of the screen item, in screen coordinates.

◆ _screenRect

Common::Rect Sci::ScreenItem::_screenRect

The position & dimensions of the screen item in screen coordinates. This rect includes the offset of the parent plane and is clipped to the screen.

◆ _drawBlackLines

bool Sci::ScreenItem::_drawBlackLines

Whether or not the screen item should be drawn with black lines drawn every second line. This is used when pixel doubling videos to improve apparent sharpness at the cost of your eyesight.


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