ScummVM API documentation
Mohawk::MystCard Class Reference

#include <myst_card.h>

Public Member Functions

 MystCard (MohawkEngine_Myst *vm, uint16 id)
 
uint16 getId () const
 
void enter ()
 
void leave ()
 
template<class T >
T * getResource (uint index)
 
void setResourceEnabled (uint16 resourceIndex, bool enable)
 
void updateActiveResource (const Common::Point &mouse)
 
MystAreaforceUpdateClickedResource (const Common::Point &mouse)
 
void resetClickedResource ()
 
int16 getActiveResourceCursor ()
 
void updateResourcesForInput (const Common::Point &mouse, bool mouseClicked, bool mouseMoved)
 
bool isDraggingResource () const
 
uint16 getBackgroundImageId ()
 
void drawBackground ()
 
void drawResourceImages ()
 
void drawResourceRects ()
 
void redrawArea (uint16 var, bool updateScreen=true)
 

Public Attributes

Common::Array< MystArea * > _resources
 

Detailed Description

A game view

The names Card and Stack are legacy from the HyperCard engine used in the original mac version.

Cards contain resources (hotspots), images, sounds, and cursor hints.

Member Function Documentation

◆ getId()

uint16 Mohawk::MystCard::getId ( ) const

Get the id of the card

◆ enter()

void Mohawk::MystCard::enter ( )

Initialization routine used to draw a card for the first time

◆ leave()

void Mohawk::MystCard::leave ( )

Run the card's leave scripts

◆ getResource()

template<class T >
T * Mohawk::MystCard::getResource ( uint  index)

Get a card resource (hotspot) by its index in the resource list

◆ setResourceEnabled()

void Mohawk::MystCard::setResourceEnabled ( uint16  resourceIndex,
bool  enable 
)

Enable or disable a card resource

◆ updateActiveResource()

void Mohawk::MystCard::updateActiveResource ( const Common::Point mouse)

Update the card's active resource according to the mouse position

◆ forceUpdateClickedResource()

MystArea* Mohawk::MystCard::forceUpdateClickedResource ( const Common::Point mouse)

Set the card's currently clicked resource to the currently active resource

◆ resetClickedResource()

void Mohawk::MystCard::resetClickedResource ( )

Clear the card's currently clicked resource

Used to indicate the mouse up event handler should not be called. (Possibly because it was already called by the gameplay logic

◆ getActiveResourceCursor()

int16 Mohawk::MystCard::getActiveResourceCursor ( )

Get the mouse cursor that should be used when hovering the currently active resource

-1 means that no specific cursor is defined for the active resource, or that there is no currently active resource. In that case the default main cursor should be used by the caller.

◆ updateResourcesForInput()

void Mohawk::MystCard::updateResourcesForInput ( const Common::Point mouse,
bool  mouseClicked,
bool  mouseMoved 
)

Call the resource event handlers to account for the new specified input

For example call the mouse down event handler for the currently active resource if the mouse is clicked and there was no clicked resource previously.

◆ isDraggingResource()

bool Mohawk::MystCard::isDraggingResource ( ) const

Is there a currently clicked resource

◆ getBackgroundImageId()

uint16 Mohawk::MystCard::getBackgroundImageId ( )

Retrieve the id of the background image to use when drawing the card

◆ drawBackground()

void Mohawk::MystCard::drawBackground ( )

Draw the card's background image to the backbuffer

◆ drawResourceImages()

void Mohawk::MystCard::drawResourceImages ( )

Draw the card's image resources to the backbuffer

◆ drawResourceRects()

void Mohawk::MystCard::drawResourceRects ( )

Draw debug rectangles around the card's resources

◆ redrawArea()

void Mohawk::MystCard::redrawArea ( uint16  var,
bool  updateScreen = true 
)

Redraw the card's resources that are affected by the specified variable

Member Data Documentation

◆ _resources

Common::Array<MystArea *> Mohawk::MystCard::_resources

The list of resources in the card


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