coastline 0.0.4
Loading...
Searching...
No Matches
texture.h File Reference

The sizes, the formats, and the colours of the textures of the Glide renderer. More...

Go to the source code of this file.

Functions

int CalculateMipMapLevel (int *level, int width, int height)
 Select the Glide mip level for the larger dimension, clamping dimensions above 256.
int CalculateAspectRatioLevel (int *level, int width, int height)
 Select the Glide aspect level from the truncated ratio of eight times the larger dimension.
int GetGlideTexFormatBytesPerPixel (int format)
 Get one byte for texture formats 2, 3, and 4, and two bytes for other formats.
unsigned ConvertN64Rgba5551ToArgb1555 (unsigned color)
 Swap the bytes of an N64 RGBA5551 colour and move its alpha bit to the high bit.

Detailed Description

The sizes, the formats, and the colours of the textures of the Glide renderer.

Function Documentation

◆ CalculateMipMapLevel()

int CalculateMipMapLevel ( int * level,
int width,
int height )

Select the Glide mip level for the larger dimension, clamping dimensions above 256.

Returns
Whether the larger dimension is at most 256.
Ghidra address:
BRGlide: 0x100242e0

◆ CalculateAspectRatioLevel()

int CalculateAspectRatioLevel ( int * level,
int width,
int height )

Select the Glide aspect level from the truncated ratio of eight times the larger dimension.

Returns
Whether the ratio exactly matches a supported aspect.
Ghidra address:
BRGlide: 0x100275c0

◆ GetGlideTexFormatBytesPerPixel()

int GetGlideTexFormatBytesPerPixel ( int format)

Get one byte for texture formats 2, 3, and 4, and two bytes for other formats.

Ghidra address:
BRGlide: 0x10024df0

◆ ConvertN64Rgba5551ToArgb1555()

unsigned ConvertN64Rgba5551ToArgb1555 ( unsigned color)

Swap the bytes of an N64 RGBA5551 colour and move its alpha bit to the high bit.

Ghidra address:
BRGlide: 0x100271f0