ScummVM API documentation
StarTrek::Graphics Class Reference

Public Member Functions

 Graphics (StarTrekEngine *vm)
 
void setBackgroundImage (Common::String imageName)
 
void drawBitmapToBackground (const Common::Rect &origRect, const Common::Rect &drawRect, Bitmap *bitmap)
 
void fillBackgroundRect (const Common::Rect &rect, byte color)
 
byte * getBackgroundPixels ()
 
byte * lockScreenPixels ()
 
void unlockScreenPixels ()
 
void clearScreenAndPriBuffer ()
 
void loadPalette (const String &paletteFile)
 
void copyRectBetweenBitmaps (Bitmap *destBitmap, int destX, int destY, Bitmap *srcBitmap, int srcX, int srcY, int width, int height)
 
void fadeinScreen ()
 
void fadeoutScreen ()
 
void setPaletteFadeLevel (byte *palData, int fadeLevel)
 
void incPaletteFadeLevel ()
 
void decPaletteFadeLevel ()
 
void loadPri (const Common::String &priFile)
 
void clearPri ()
 
void setPri (byte val)
 
byte getPriValue (int x, int y)
 
Common::Point getMousePos ()
 
void setMouseBitmap (Common::String bitmapName)
 
void popMouseBitmap ()
 
void toggleMouse (bool visible)
 
void lockMousePosition (int16 x, int16 y)
 
void unlockMousePosition ()
 
void warpMouse (int16 x, int16 y)
 
void drawSprite (const Sprite &sprite, ::Graphics::Surface *surface)
 
void drawSprite (const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect, int rectLeft=0, int rectTop=0)
 
void drawAllSprites (bool updateScreenFlag=true)
 
void drawAllSpritesInRectToSurface (const Common::Rect &rect, ::Graphics::Surface *surface)
 
void forceDrawAllSprites (bool updateScreenFlag=true)
 
void updateScreen ()
 
SpritegetSpriteAt (int16 x, int16 y)
 
SpritegetSpriteAt (Common::Point p)
 
void addSprite (Sprite *sprite)
 
void delSprite (Sprite *sprite)
 
void pushSprites ()
 
void popSprites ()
 
byte * getFontGfx (char c)
 
void copyBackgroundScreen ()
 
void loadEGAData (const char *egaFile)
 
void drawBackgroundImage (const char *filename)
 

Public Attributes

Font_font
 

Member Function Documentation

◆ drawBitmapToBackground()

void StarTrek::Graphics::drawBitmapToBackground ( const Common::Rect origRect,
const Common::Rect drawRect,
Bitmap bitmap 
)
Parameters
origRectThe rectangle containing the original bitmap (must contain the whole bitmap, even if some is outside the drawable space)
drawRectThe clipped rectangle to draw at (must be within the drawable space)

◆ loadPalette()

void StarTrek::Graphics::loadPalette ( const String paletteFile)

Note: this doesn't flush the palette to the screen (must call "setPaletteFadeLevel")

◆ setPaletteFadeLevel()

void StarTrek::Graphics::setPaletteFadeLevel ( byte *  palData,
int  fadeLevel 
)

This flushes the palette to the screen. fadeLevel ranges from 0-100.

◆ setMouseBitmap()

void StarTrek::Graphics::setMouseBitmap ( Common::String  bitmapName)

Changes the mouse bitmap. The change won't take effect until drawAllSprites is called again.

◆ lockMousePosition()

void StarTrek::Graphics::lockMousePosition ( int16  x,
int16  y 
)

This function is a workaround for when the mouse position needs to be locked in a set position (used in the action menu). This only affects the position it is drawn at; the sprite's "real" position is still updated normally.

This does not call updateScreen.

◆ drawSprite()

void StarTrek::Graphics::drawSprite ( const Sprite sprite,
::Graphics::Surface surface,
const Common::Rect rect,
int  rectLeft = 0,
int  rectTop = 0 
)
Parameters
spriteThe sprite to draw
surfaceThe surface to draw to
rectThe part of the sprite to draw (only draw the part of the sprite that intersects with it) @
rectLeftX-offset to subtract before drawing to surface. @
rectTopY-offset to subtract before drawing to surface.

◆ drawAllSpritesInRectToSurface()

void StarTrek::Graphics::drawAllSpritesInRectToSurface ( const Common::Rect rect,
::Graphics::Surface surface 
)

This function should only be called after "drawAllSprites" (so that sprite rects are updated).

◆ forceDrawAllSprites()

void StarTrek::Graphics::forceDrawAllSprites ( bool  updateScreenFlag = true)

Sets "bitmapChanged" to true on all sprites before calling drawAllSprites.

◆ updateScreen()

void StarTrek::Graphics::updateScreen ( )

Flushes the screen. Usually called by "drawAllSprites".

◆ getSpriteAt()

Sprite* StarTrek::Graphics::getSpriteAt ( int16  x,
int16  y 
)

Returns the sprite at the given position (ignores mouse).


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