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

#include <th_gfx.h>

Public Member Functions

 chunk_renderer (int width, int height, std::vector< uint8_t >::iterator start)
 Initialise a renderer for a specific size result.
 
void decode_chunks (const uint8_t *pData, int iDataLen, bool bComplex)
 Convert a stream of chunks into a raw bitmap.
 
void chunk_copy (int npixels, const uint8_t *in_data)
 Perform a "copy" chunk (normally called by decodeChunks)
 
void chunk_fill (int npixels, uint8_t value)
 Perform a "fill" chunk (normally called by decodeChunks)
 
void chunk_fill_to_end_of_line (uint8_t value)
 Perform a "fill to end of line" chunk (normally called by decodeChunks)
 
void chunk_finish (uint8_t value)
 Perform a "fill to end of file" chunk (normally called by decodeChunks)
 

Detailed Description

Utility class for decoding Theme Hospital "chunked" graphics files. Generally used internally by sprite_sheet.

Constructor & Destructor Documentation

◆ chunk_renderer()

chunk_renderer::chunk_renderer ( int  width,
int  height,
std::vector< uint8_t >::iterator  start 
)

Initialise a renderer for a specific size result.

Parameters
widthPixel width of the resulting image
heightPixel height of the resulting image
startAn iterator to the start writing the resulting image to. Must point to a container of at least width * height.

Member Function Documentation

◆ chunk_copy()

void chunk_renderer::chunk_copy ( int  npixels,
const uint8_t *  in_data 
)

Perform a "copy" chunk (normally called by decodeChunks)

◆ chunk_fill()

void chunk_renderer::chunk_fill ( int  npixels,
uint8_t  value 
)

Perform a "fill" chunk (normally called by decodeChunks)

◆ chunk_fill_to_end_of_line()

void chunk_renderer::chunk_fill_to_end_of_line ( uint8_t  value)

Perform a "fill to end of line" chunk (normally called by decodeChunks)

◆ chunk_finish()

void chunk_renderer::chunk_finish ( uint8_t  value)

Perform a "fill to end of file" chunk (normally called by decodeChunks)

◆ decode_chunks()

void chunk_renderer::decode_chunks ( const uint8_t *  pData,
int  iDataLen,
bool  bComplex 
)

Convert a stream of chunks into a raw bitmap.

Parameters
pDataStream data.
iDataLenLength of pData.
bComplextrue if pData is a stream of "complex" chunks, false if pData is a stream of "simple" chunks. Passing the wrong value will usually result in a very visible wrong result.

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