CorsixTH engine (the C++ part)
Open source implementation of Theme Hospital
Loading...
Searching...
No Matches
Public Member Functions | List of all members
raw_bitmap Class Reference

Stored image. More...

#include <th_gfx_sdl.h>

Public Member Functions

 raw_bitmap ()=default
 
 ~raw_bitmap ()
 
void set_palette (const ::palette *pPalette)
 Set the palette of the image.
 
void load_from_th_file (const uint8_t *pPixelData, size_t iPixelDataLength, int iWidth, render_target *pEventualCanvas, uint32_t spriteFlags)
 Load the image from the supplied pixel data.
 
void draw (render_target *pCanvas, int iX, int iY)
 Draw the image at a given position at the given canvas.
 
void draw (render_target *pCanvas, int iX, int iY, int iSrcX, int iSrcY, int iWidth, int iHeight)
 Draw part of the image at a given position at the given canvas.
 

Detailed Description

Stored image.

Constructor & Destructor Documentation

◆ raw_bitmap()

raw_bitmap::raw_bitmap ( )
default

◆ ~raw_bitmap()

raw_bitmap::~raw_bitmap ( )

Member Function Documentation

◆ draw() [1/2]

void raw_bitmap::draw ( render_target pCanvas,
int  iX,
int  iY 
)

Draw the image at a given position at the given canvas.

Parameters
pCanvasCanvas to draw at.
iXDestination x position.
iYDestination y position.

◆ draw() [2/2]

void raw_bitmap::draw ( render_target pCanvas,
int  iX,
int  iY,
int  iSrcX,
int  iSrcY,
int  iWidth,
int  iHeight 
)

Draw part of the image at a given position at the given canvas.

Parameters
pCanvasCanvas to draw at.
iXDestination x position.
iYDestination y position.
iSrcXX position of the part to display.
iSrcYY position of the part to display.
iWidthWidth of the part to display.
iHeightHeight of the part to display.

◆ load_from_th_file()

void raw_bitmap::load_from_th_file ( const uint8_t *  pPixelData,
size_t  iPixelDataLength,
int  iWidth,
render_target pEventualCanvas,
uint32_t  spriteFlags 
)

Load the image from the supplied pixel data.

Loader uses the palette supplied before.

Parameters
pPixelDataImage data loaded from a TH file.
iPixelDataLengthSize of the loaded image data.
iWidthWidth of the image.
pEventualCanvasCanvas to render the image to (eventually).
spriteFlags
Returns
Loading was a success.

◆ set_palette()

void raw_bitmap::set_palette ( const ::palette pPalette)

Set the palette of the image.

Parameters
pPalettePalette to set for this image.

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