ScummVM API documentation
Ultima::Shared::DungeonSurface Class Reference

#include <dungeon_surface.h>

Inheritance diagram for Ultima::Shared::DungeonSurface:
Ultima::Shared::Gfx::VisualSurface Graphics::ManagedSurface

Public Member Functions

 DungeonSurface (const Graphics::ManagedSurface &src, const Rect &bounds, Game *game, DrawWidgetFn widgetFn)
 
void drawLine (int x0, int y0, int x1, int y1, uint32 color)
 
void drawLineTo (int x, int y, uint32 color)
 
void hLine (int x, int y, int x2, uint32 color)
 
void vLine (int x, int y, int y2, uint32 color)
 
void frameRect (const Common::Rect &r, uint32 color)
 
void drawWall (uint distance)
 
void drawDoorway (uint distance)
 
void drawLeftEdge (uint distance)
 
void drawRightEdge (uint distance)
 
void drawWidget (uint widgetId, uint distance, byte color)
 
void drawLadderDownFaceOn (uint distance)
 
void drawLadderDownSideOn (uint distance)
 
void drawLadderUpFaceOn (uint distance)
 
void drawLadderUpSideOn (uint distance)
 
void drawBeams (uint distance)
 
void drawLeftDoor (uint distance)
 
void drawLeftWall (uint distance)
 
void drawLeftBlank (uint distance)
 
void drawRightDoor (uint distance)
 
void drawRightWall (uint distance)
 
void drawRightBlank (uint distance)
 
- Public Member Functions inherited from Ultima::Shared::Gfx::VisualSurface
 VisualSurface (const Graphics::ManagedSurface &src, const Rect &bounds, GameBase *game=nullptr)
 
void drawPoint (const Point &pt, byte color)
 
void setTextPos (const Point &pt)
 
void writeString (const Common::String &msg, const Point &pt, int color=-1, int bgColor=-1)
 
void writeString (const Common::String &msg, int color=-1, int bgColor=-1)
 
void writeChar (unsigned char c, const Point &pt, int color=-1, int bgColor=-1)
 
void writeChar (unsigned char c, int color=-1, int bgColor=-1)
 
size_t fontHeight ()
 
- 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 ()
 
virtual void clearDirtyRects ()
 
virtual void addDirtyRect (const Common::Rect &r)
 
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)
 

Additional Inherited Members

- Static Public Member Functions inherited from Graphics::ManagedSurface
static bool isBlendBlitPixelFormatSupported (const PixelFormat &src, const PixelFormat &dst)
 
- Public Attributes inherited from Graphics::ManagedSurface
int16 & w
 
int16 & h
 
int32 & pitch
 
PixelFormatformat
 
- 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)
 

Detailed Description

Acts as a handy container for the drawing methods for rendering the dungeon view

Constructor & Destructor Documentation

◆ DungeonSurface()

Ultima::Shared::DungeonSurface::DungeonSurface ( const Graphics::ManagedSurface src,
const Rect bounds,
Game game,
DrawWidgetFn  widgetFn 
)

Constructor

Member Function Documentation

◆ drawLine()

void Ultima::Shared::DungeonSurface::drawLine ( int  x0,
int  y0,
int  x1,
int  y1,
uint32  color 
)
inline

Draw a line

◆ drawLineTo()

void Ultima::Shared::DungeonSurface::drawLineTo ( int  x,
int  y,
uint32  color 
)
inline

Draw a line from a prior line ending point to a new destination pos

◆ hLine()

void Ultima::Shared::DungeonSurface::hLine ( int  x,
int  y,
int  x2,
uint32  color 
)
inline

Draw a horizontal line.

◆ vLine()

void Ultima::Shared::DungeonSurface::vLine ( int  x,
int  y,
int  y2,
uint32  color 
)
inline

Draw a vertical line.

◆ frameRect()

void Ultima::Shared::DungeonSurface::frameRect ( const Common::Rect r,
uint32  color 
)
inline

Draw a frame around a specified rect.

◆ drawWall()

void Ultima::Shared::DungeonSurface::drawWall ( uint  distance)

Draws a wall

◆ drawDoorway()

void Ultima::Shared::DungeonSurface::drawDoorway ( uint  distance)

Draws a doorway directly in front of the player

◆ drawLeftEdge()

void Ultima::Shared::DungeonSurface::drawLeftEdge ( uint  distance)

Draws a vertical line forming the edge of cells to the left of the player

◆ drawRightEdge()

void Ultima::Shared::DungeonSurface::drawRightEdge ( uint  distance)

Draws a vertical line forming the edge of cells to the right of the player

◆ drawWidget()

void Ultima::Shared::DungeonSurface::drawWidget ( uint  widgetId,
uint  distance,
byte  color 
)

Draws a monster or item at a given distance from the player

◆ drawLadderDownFaceOn()

void Ultima::Shared::DungeonSurface::drawLadderDownFaceOn ( uint  distance)

Draw a ladder down face on

◆ drawLadderDownSideOn()

void Ultima::Shared::DungeonSurface::drawLadderDownSideOn ( uint  distance)

Draw a ladder down side on

◆ drawLadderUpFaceOn()

void Ultima::Shared::DungeonSurface::drawLadderUpFaceOn ( uint  distance)

Draw a ladder down face on

◆ drawLadderUpSideOn()

void Ultima::Shared::DungeonSurface::drawLadderUpSideOn ( uint  distance)

Draw a ladder down side on

◆ drawBeams()

void Ultima::Shared::DungeonSurface::drawBeams ( uint  distance)

Draw beams

◆ drawLeftDoor()

void Ultima::Shared::DungeonSurface::drawLeftDoor ( uint  distance)

Draws a door on the left hand side

◆ drawLeftWall()

void Ultima::Shared::DungeonSurface::drawLeftWall ( uint  distance)

Draws a wall on the left-hand side

◆ drawLeftBlank()

void Ultima::Shared::DungeonSurface::drawLeftBlank ( uint  distance)

Draws the partial wall visible at the back of a corridor leading to the left

◆ drawRightDoor()

void Ultima::Shared::DungeonSurface::drawRightDoor ( uint  distance)

Draws a door on the right hand side

◆ drawRightWall()

void Ultima::Shared::DungeonSurface::drawRightWall ( uint  distance)

Draws a wall on the right-hand side

◆ drawRightBlank()

void Ultima::Shared::DungeonSurface::drawRightBlank ( uint  distance)

Draws the partial wall visible at the back of a corridor leading to the right


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