coastline 0.0.4
Loading...
Searching...
No Matches
coastline::EngineTextures Class Reference

Decoded textures for one active race engine. More...

#include <enginetextures.h>

Public Member Functions

 EngineTextures ()
 Register an empty texture collection for the sole active race engine.
 ~EngineTextures ()
 Unregister the collection and release its decoded texels.
 EngineTextures (const EngineTextures &)=delete
 Copying is disabled because texture hooks address the active collection.
EngineTextures & operator= (const EngineTextures &)=delete
 Assignment is disabled because the active collection has a stable address.
SdlRenderBackendState & Backend ()
SdlVehicleReflections & Reflections ()
unsigned Create (const unsigned char *image, const unsigned char *palette, int width, int height, int lineBytes)
 Create a texture from an 8-bit colour-indexed image of the console, as the hook g_pfnCreateTextureFromN64Image() of the PC release creates one.
void Load (unsigned entry, const unsigned char *colors)
 Load the decoded colours of an image into a texture, as a command 0xdd of a display list loads them.
const EngineTexture * Find (unsigned entry) const
void Clear ()
 Discard decoded textures when the race engine shuts its texture subsystem down.

Static Public Member Functions

static EngineTextures * Active ()

Detailed Description

Decoded textures for one active race engine.

One instance exists at a time.

Constructor & Destructor Documentation

◆ EngineTextures() [1/2]

coastline::EngineTextures::EngineTextures ( )

Register an empty texture collection for the sole active race engine.

◆ ~EngineTextures()

coastline::EngineTextures::~EngineTextures ( )

Unregister the collection and release its decoded texels.

◆ EngineTextures() [2/2]

coastline::EngineTextures::EngineTextures ( const EngineTextures & )
delete

Copying is disabled because texture hooks address the active collection.

Member Function Documentation

◆ operator=()

EngineTextures & coastline::EngineTextures::operator= ( const EngineTextures & )
delete

Assignment is disabled because the active collection has a stable address.

◆ Active()

EngineTextures * coastline::EngineTextures::Active ( )
static
Returns
The active texture collection, or null outside its lifetime.

◆ Backend()

SdlRenderBackendState & coastline::EngineTextures::Backend ( )
inline
Returns
Renderer settings and texture hooks for the race engine.

◆ Reflections()

SdlVehicleReflections & coastline::EngineTextures::Reflections ( )
inline
Returns
Sky images and reflection descriptors for the race engine.

◆ Create()

unsigned coastline::EngineTextures::Create ( const unsigned char * image,
const unsigned char * palette,
int width,
int height,
int lineBytes )

Create a texture from an 8-bit colour-indexed image of the console, as the hook g_pfnCreateTextureFromN64Image() of the PC release creates one.

Parameters
imageThe indices of the texels.
paletteThe 256 colours, each a big-endian RGBA5551 half.
widthThe width in texels.
heightThe height in texels.
lineBytesThe bytes of a row of the image.
Returns
The texture entry, from 1, or zero without an active EngineTextures instance.

◆ Load()

void coastline::EngineTextures::Load ( unsigned entry,
const unsigned char * colors )

Load the decoded colours of an image into a texture, as a command 0xdd of a display list loads them.

Parameters
entryThe texture entry, from 1. Invalid entries are ignored.
colorsThe colours of its texels, each a big-endian RGBA5551 half, row by row.

◆ Find()

const EngineTexture * coastline::EngineTextures::Find ( unsigned entry) const

Parameters
entryThe entry of a texture.
Returns
The texture, or null for an invalid entry or without an active collection. The pointer remains valid until another texture is created or the collection is cleared.

◆ Clear()

void coastline::EngineTextures::Clear ( )

Discard decoded textures when the race engine shuts its texture subsystem down.


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