ScummVM API documentation
MADS::UserInterface Class Reference
Inheritance diagram for MADS::UserInterface:
MADS::MSurface MADS::BaseSurface Graphics::Screen Graphics::ManagedSurface

Public Member Functions

 UserInterface (MADSEngine *vm)
 
void load (const Common::Path &resName) override
 
void setup (InputMode inputMode)
 
void drawTextElements ()
 
void mergeFrom (BaseSurface *src, const Common::Rect &srcBounds, const Common::Point &destPos, int transparencyIndex=-1)
 
void loadInventoryAnim (int objectId)
 
void noInventoryAnim ()
 
void doBackgroundAnimation ()
 
void inventoryAnim ()
 
void categoryChanged ()
 
void selectObject (int invIndex)
 
void updateSelection (ScrCategory category, int newIndex, int *idx)
 
void changeScrollBar ()
 
void scrollerChanged ()
 
void scrollInventory ()
 
void updateInventoryScroller ()
 
void emptyConversationList ()
 
void addConversationMessage (int vocabId, const Common::String &msg)
 
void synchronize (Common::Serializer &s)
 
void refresh ()
 
- Public Member Functions inherited from MADS::MSurface
 MSurface (int width, int height)
 
- Public Member Functions inherited from MADS::BaseSurface
 BaseSurface ()
 
 BaseSurface (int width, int height)
 
 ~BaseSurface () override
 
Common::Rect getBounds ()
 
byte * getPixels ()
 
const void * getPixels () const
 
byte * getBasePtr (int x, int y)
 
const byte * getBasePtr (int x, int y) const
 
void drawSprite (const Common::Point &pt, SpriteInfo &info, const Common::Rect &clipRect)
 
void scrollX (int xAmount)
 
void scrollY (int yAmount)
 
void translate (Common::Array< RGB6 > &palette)
 
void translate (byte map[PALETTE_COUNT])
 
BaseSurfaceflipHorizontal () const
 
void copyRectTranslate (BaseSurface &srcSurface, const byte *paletteMap, const Common::Point &destPos, const Common::Rect &srcRect)
 
void copyFrom (BaseSurface &src, const Common::Point &destPos, int depth, DepthSurface *depthSurface, int scale, bool flipped, int transparentColor=-1)
 
- Public Member Functions inherited from Graphics::Screen
 Screen (int width, int height)
 
 Screen (int width, int height, PixelFormat pixelFormat)
 
bool isDirty () const
 
void makeAllDirty ()
 
virtual void clearDirtyRects ()
 
virtual void update ()
 
virtual void updateScreen ()
 
void getPalette (byte palette[PALETTE_SIZE])
 
void getPalette (byte *palette, uint start, uint num)
 
Graphics::Palette getPalette (uint start=0, uint num=PALETTE_COUNT)
 
void setPalette (const byte palette[PALETTE_SIZE])
 
void setPalette (const byte *palette, uint start, uint num)
 
void setPalette (const Graphics::Palette &pal, uint start=0)
 
void clearPalette ()
 
- Public Member Functions inherited from Graphics::ManagedSurface
bool clip (Common::Rect &srcBounds, Common::Rect &destBounds) const
 
 ManagedSurface ()
 
 ManagedSurface (const ManagedSurface &surf)
 
 ManagedSurface (ManagedSurface &&surf)
 
 ManagedSurface (int width, int height)
 
 ManagedSurface (int width, int height, const Graphics::PixelFormat &pixelFormat)
 
 ManagedSurface (ManagedSurface &surf, const Common::Rect &bounds)
 
 ManagedSurface (Surface *surf, DisposeAfterUse::Flag disposeAfterUse=DisposeAfterUse::YES)
 
 ManagedSurface (const Surface *surf)
 
virtual ~ManagedSurface ()
 
 operator const Surface & () const
 
const SurfacerawSurface () const
 
SurfacesurfacePtr ()
 
ManagedSurfaceoperator= (const ManagedSurface &surf)
 
ManagedSurfaceoperator= (ManagedSurface &&surf)
 
bool empty () const
 
DisposeAfterUse::Flag disposeAfterUse () const
 
uint32 getPixel (int x, int y) const
 
void setPixel (int x, int y, uint32 pixel)
 
const void * getBasePtr (int x, int y) const
 
void * getBasePtr (int x, int y)
 
void * getPixels ()
 
const void * getPixels () const
 
virtual void setPixels (void *newPixels)
 
virtual void create (int16 width, int16 height)
 
virtual void create (int16 width, int16 height, const PixelFormat &pixelFormat)
 
virtual void create (ManagedSurface &surf, const Common::Rect &bounds)
 
virtual void free ()
 
const Common::Point getOffsetFromOwner () const
 
const Common::Rect getBounds () const
 
void simpleBlitFrom (const Surface &src, const Palette *srcPalette=nullptr)
 
void simpleBlitFrom (const Surface &src, const Common::Point &destPos, const Palette *srcPalette=nullptr)
 
void simpleBlitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos, const Palette *srcPalette=nullptr)
 
void simpleBlitFrom (const ManagedSurface &src)
 
void simpleBlitFrom (const ManagedSurface &src, const Common::Point &destPos)
 
void simpleBlitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos)
 
void blitFrom (const Surface &src, const Palette *srcPalette=nullptr)
 
void blitFrom (const Surface &src, const Common::Point &destPos, const Palette *srcPalette=nullptr)
 
void blitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos, const Palette *srcPalette=nullptr)
 
void blitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const Palette *srcPalette=nullptr)
 
void blitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Rect &destRect)
 
void blitFrom (const ManagedSurface &src)
 
void blitFrom (const ManagedSurface &src, const Common::Point &destPos)
 
void blitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos)
 
void transBlitFrom (const Surface &src, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const Surface &src, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const Surface &src, const Common::Point &destPos, const ManagedSurface &mask, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const Surface &src, const Common::Point &destPos, const Surface &mask, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const Palette *srcPalette)
 
void transBlitFrom (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Surface *mask=nullptr, bool maskOnly=false, const Palette *srcPalette=nullptr)
 
void transBlitFrom (const ManagedSurface &src, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff)
 
void transBlitFrom (const ManagedSurface &src, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff)
 
void transBlitFrom (const ManagedSurface &src, const Common::Point &destPos, const ManagedSurface &mask)
 
void transBlitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff)
 
void transBlitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Rect &destRect, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Surface *mask=nullptr, bool maskOnly=false)
 
void rawBlitFrom (const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos)
 
Common::Rect blendBlitTo (ManagedSurface &target, const int posX=0, const int posY=0, const int flipping=FLIP_NONE, const Common::Rect *srcRect=nullptr, const uint colorMod=(uint32)(((255)<< 24)|((255)<< 16)|((255)<< 8)|(255)), const int width=-1, const int height=-1, const TSpriteBlendMode blend=BLEND_NORMAL, const AlphaType alphaType=ALPHA_FULL)
 Renders this surface onto target. More...
 
Common::Rect blendBlitTo (Surface &target, const int posX=0, const int posY=0, const int flipping=FLIP_NONE, const Common::Rect *srcRect=nullptr, const uint colorMod=(uint32)(((255)<< 24)|((255)<< 16)|((255)<< 8)|(255)), const int width=-1, const int height=-1, const TSpriteBlendMode blend=BLEND_NORMAL, const AlphaType alphaType=ALPHA_FULL)
 
void clear (uint32 color=0)
 
void markAllDirty ()
 
void copyRectToSurface (const void *buffer, int srcPitch, int destX, int destY, int width, int height)
 
void copyRectToSurface (const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect subRect)
 
void copyRectToSurfaceWithKey (const void *buffer, int srcPitch, int destX, int destY, int width, int height, uint32 key)
 
void copyRectToSurfaceWithKey (const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect subRect, uint32 key)
 
void copyFrom (const ManagedSurface &surf)
 
void copyFrom (const Surface &surf)
 
void convertFrom (const ManagedSurface &surf, const PixelFormat &fmt)
 
void convertFrom (const Surface &surf, const PixelFormat &fmt)
 
ManagedSurfacescale (int16 newWidth, int16 newHeight, bool filtering=false) const
 
ManagedSurfacerotoscale (const TransformStruct &transform, bool filtering=false) const
 Rotoscale function; this returns a transformed version of this surface after rotation and scaling. Please do not use this if angle == 0, use plain old scaling function. More...
 
void drawLine (int x0, int y0, int x1, int y1, uint32 color)
 
void drawThickLine (int x0, int y0, int x1, int y1, int penX, int penY, uint32 color)
 
void hLine (int x, int y, int x2, uint32 color)
 
void vLine (int x, int y, int y2, uint32 color)
 
void fillRect (Common::Rect r, uint32 color)
 
void frameRect (const Common::Rect &r, uint32 color)
 
AlphaType detectAlpha () const
 
Surface getSubArea (const Common::Rect &area)
 
void convertToInPlace (const PixelFormat &dstFormat)
 
void convertToInPlace (const PixelFormat &dstFormat, const byte *palette, uint16 paletteCount)
 
uint getTransparentColor () const
 
void setTransparentColor (uint32 color)
 
void clearTransparentColor ()
 
bool hasTransparentColor () const
 
void clearPalette ()
 
bool hasPalette () const
 
void grabPalette (byte *colors, uint start, uint num) const
 
void setPalette (const byte *colors, uint start, uint num)
 

Public Attributes

MSurface _surface
 
UISlots _uiSlots
 
DirtyAreas _dirtyAreas
 
ScrCategory _category
 
Common::Rect_rectP
 
int _inventoryTopIndex
 
int _selectedInvIndex
 
int _selectedActionIndex
 
int _selectedItemVocabIdx
 
ScrollbarActive _scrollbarActive
 
ScrollbarActive _scrollbarOldActive
 
int _highlightedCommandIndex
 
int _highlightedInvIndex
 
int _highlightedItemVocabIndex
 
bool _inventoryChanged
 
int _categoryIndexes [8]
 
Common::StringArray _talkStrings
 
Common::Array< int > _talkIds
 
bool _scrollbarQuickly
 
uint32 _scrollbarMilliTime
 
int _scrollbarElevator
 
int _scrollbarOldElevator
 
ScrollbarActive _scrollbarStrokeType
 
- Public Attributes inherited from Graphics::ManagedSurface
int16 & w
 
int16 & h
 
int32 & pitch
 
PixelFormatformat
 

Additional Inherited Members

- Static Public Member Functions inherited from MADS::BaseSurface
static void setVm (MADSEngine *vm)
 
- Static Public Member Functions inherited from Graphics::ManagedSurface
static bool isBlendBlitPixelFormatSupported (const PixelFormat &src, const PixelFormat &dst)
 
- Protected Member Functions inherited from MADS::MSurface
void addDirtyRect (const Common::Rect &r) override
 
- Protected Member Functions inherited from Graphics::Screen
void mergeDirtyRects ()
 
bool unionRectangle (Common::Rect &destRect, const Common::Rect &src1, const Common::Rect &src2)
 
- Protected Member Functions inherited from Graphics::ManagedSurface
void simpleBlitFromInner (const Surface &src, const Common::Rect &srcRect, const Common::Point &destPos, const Palette *srcPalette, bool transparentColorSet, uint transparentColor)
 
void blitFromInner (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, const Palette *srcPalette)
 
void transBlitFromInner (const Surface &src, const Common::Rect &srcRect, const Common::Rect &destRect, uint32 transColor, bool flipped, uint32 overrideColor, uint32 srcAlpha, const Palette *srcPalette, const Palette *dstPalette, const Surface *mask, bool maskOnly)
 
- Protected Attributes inherited from Graphics::Screen
Common::List< Common::Rect_dirtyRects
 
- Static Protected Attributes inherited from MADS::BaseSurface
static MADSEngine_vm
 

Constructor & Destructor Documentation

◆ UserInterface()

MADS::UserInterface::UserInterface ( MADSEngine vm)

Constructor

Member Function Documentation

◆ load()

void MADS::UserInterface::load ( const Common::Path resName)
overridevirtual

Loads an interface from a specified resource

Reimplemented from MADS::BaseSurface.

◆ setup()

void MADS::UserInterface::setup ( InputMode  inputMode)

Set up the interface

◆ mergeFrom()

void MADS::UserInterface::mergeFrom ( BaseSurface src,
const Common::Rect srcBounds,
const Common::Point destPos,
int  transparencyIndex = -1 
)

Merges a sub-section of another surface into the user interface without destroying any on-screen text

Parameters
srcSource surface
srcBoundsArea to copy/merge from
destPosDestination position to draw in current surface
transparencyIndexTransparency color

◆ loadInventoryAnim()

void MADS::UserInterface::loadInventoryAnim ( int  objectId)

Loads the animation sprite data for a given inventory object

◆ noInventoryAnim()

void MADS::UserInterface::noInventoryAnim ( )

Resets the inventory animation when no inventory item is selected

◆ doBackgroundAnimation()

void MADS::UserInterface::doBackgroundAnimation ( )

Handles any animation that occurs in the background of the user interface

◆ inventoryAnim()

void MADS::UserInterface::inventoryAnim ( )

Handles queuing a new frame of an inventory animation for drawing

◆ selectObject()

void MADS::UserInterface::selectObject ( int  invIndex)

Select an item from the inventory list

Parameters
invIndexIndex in the inventory list of the item to select

◆ changeScrollBar()

void MADS::UserInterface::changeScrollBar ( )

Updates the current top visible item of the scrollbar

◆ updateInventoryScroller()

void MADS::UserInterface::updateInventoryScroller ( )

Checks for the mouse being on the user interface inventory scroller, and update the scroller highlight and selected inventory object as necessary

◆ emptyConversationList()

void MADS::UserInterface::emptyConversationList ( )

Empties the current conversation talk list

◆ addConversationMessage()

void MADS::UserInterface::addConversationMessage ( int  vocabId,
const Common::String msg 
)

Add a msesage to the list of conversation items to select from

◆ synchronize()

void MADS::UserInterface::synchronize ( Common::Serializer s)

Synchronize the data


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