ScummVM API documentation
Ultima::Ultima3::Gfx::PicDecoder Class Reference

#include <pic_decoder.h>

Inheritance diagram for Ultima::Ultima3::Gfx::PicDecoder:
Image::ImageDecoder

Public Member Functions

bool loadStream (Common::SeekableReadStream &stream) override
 
void destroy () override
 
const Graphics::Surface * getSurface () const override
 
const Graphics::Palette & getPalette () const override
 
- Public Member Functions inherited from Image::ImageDecoder
virtual bool loadStream (Common::SeekableReadStream &stream)=0
 
virtual void destroy ()=0
 
virtual const Graphics::Surface * getSurface () const =0
 
virtual const Graphics::Palette & getPalette () const =0
 
virtual bool hasPalette () const
 
virtual bool hasTransparentColor () const
 
virtual uint32 getTransparentColor () const
 
virtual const Graphics::Surface * getMask () const
 
virtual bool hasMask () const
 

Detailed Description

Decodes Ultima III's raw full-screen title art. The original "*.IBM" files are a literal 16384-byte dump of the CGA mode 4 (320x200, 4-color, palette 1) framebuffer segment – two interleaved 8192-byte banks (even scanlines in the first, odd in the second), 2 bits/pixel, 4 pixels per byte, MSB-first. The upgrade's "*.EGA" and "*.VGA" files are the 320x200 pixels in order, at 4 and 8 bits per pixel. Which is read depends on the renderer in use.

Member Function Documentation

◆ loadStream()

bool Ultima::Ultima3::Gfx::PicDecoder::loadStream ( Common::SeekableReadStream &  stream)
overridevirtual

Load an image from the specified stream.

loadStream() should implicitly call destroy() to free the memory of the last loadStream() call.

Parameters
streamInput stream.
Returns
Whether loading the file succeeded.
See also
getSurface
getPalette

Implements Image::ImageDecoder.

◆ destroy()

void Ultima::Ultima3::Gfx::PicDecoder::destroy ( )
inlineoverridevirtual

Destroy this decoder's surface and palette.

This should be called by a loadStream() implementation as well as by the destructor.

Implements Image::ImageDecoder.

◆ getSurface()

const Graphics::Surface * Ultima::Ultima3::Gfx::PicDecoder::getSurface ( ) const
inlineoverridevirtual

Get the decoded surface.

This surface is owned by this ImageDecoder and remains valid until destroy() or loadStream() is called, or until the destructor of this ImageDecoder is called.

Returns
The decoded surface, or 0 if no surface is present.

Implements Image::ImageDecoder.

◆ getPalette()

const Graphics::Palette & Ultima::Ultima3::Gfx::PicDecoder::getPalette ( ) const
inlineoverridevirtual

Get the decoded palette.

This palette is owned by this ImageDecoder and remains valid until destroy() or loadStream() is called, or until the destructor of this ImageDecoder is called.

Returns
The decoded palette, or empty if no palette is present.

Implements Image::ImageDecoder.


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