|
coastline 0.0.4
|
The textures of the interface and their drawing as rectangles of the screen. More...
#include <PR/ultratypes.h>

Go to the source code of this file.
Classes | |
| struct | Texture |
| A compressed texture of the cartridge and the memory it is loaded into. More... | |
Typedefs | |
| typedef void *(* | AssetAllocator) (u32 size) |
| An allocator of memory for a loaded asset. | |
Enumerations | |
| enum | { TEXRECT_BLEND_TEXTURE , TEXRECT_BLEND_COLOR_THROUGH_TEXTURE , TEXRECT_BLEND_TEXTURE_2 , TEXRECT_BLEND_SHADED , TEXRECT_BLEND_SHADED_OPAQUE } |
| How DrawTexturedRect() combines the texels with its colors. More... | |
Functions | |
| void | AllocAndDmaLoadAsset (Texture *texture, AssetAllocator alloc) |
| Allocate memory for an uncompressed texture and copy it there from the cartridge. | |
| void | LoadAndDecompressAsset (Texture *texture, AssetAllocator alloc) |
| Allocate memory for a texture and decompress it there from the cartridge. | |
| void | DrawTexturedRect (Texture *texture, s32 x, s32 y, s32 width, s32 height, s32 primRed, s32 primGreen, s32 primBlue, s32 primAlpha, s32 envRed, s32 envGreen, s32 envBlue, s32 envAlpha, s32 blendMode) |
| Draw a texture over a rectangle of the screen, in strips that fit the texture memory, upside down. | |
| void | GetTextureScaleAndMask (u32 size, s32 *scale, s32 *maskBits) |
| Get the texture coordinate scale of a texture side, and the bits of the mask that wraps it. | |
| void | DrawRedIntensityRect (u8 *texture, s32 width, s32 height, s32 x, s32 y, s32 drawWidth, s32 drawHeight) |
| Draw a texture stretched over a rectangle and upside down, shaded from black to red by its intensity. | |
| void | DrawColoredTexturedRect (u8 *texture, s32 width, s32 height, s32 x, s32 y, s32 drawWidth, s32 drawHeight, s32 red, s32 green, s32 blue) |
| Draw a colour through a texture stretched over a rectangle and upside down, with the intensity of the texture as its opacity. | |
The textures of the interface and their drawing as rectangles of the screen.
| typedef void *(* AssetAllocator) (u32 size) |
An allocator of memory for a loaded asset.
| anonymous enum |
How DrawTexturedRect() combines the texels with its colors.
| void AllocAndDmaLoadAsset | ( | Texture * | texture, |
| AssetAllocator | alloc ) |
Allocate memory for an uncompressed texture and copy it there from the cartridge.
| texture | The texture to load. |
| alloc | The allocator of the memory. |
| void LoadAndDecompressAsset | ( | Texture * | texture, |
| AssetAllocator | alloc ) |
Allocate memory for a texture and decompress it there from the cartridge.
| texture | The texture to load. |
| alloc | The allocator of the memory. |
| void DrawTexturedRect | ( | Texture * | texture, |
| s32 | x, | ||
| s32 | y, | ||
| s32 | width, | ||
| s32 | height, | ||
| s32 | primRed, | ||
| s32 | primGreen, | ||
| s32 | primBlue, | ||
| s32 | primAlpha, | ||
| s32 | envRed, | ||
| s32 | envGreen, | ||
| s32 | envBlue, | ||
| s32 | envAlpha, | ||
| s32 | blendMode ) |
Draw a texture over a rectangle of the screen, in strips that fit the texture memory, upside down.
The width counts without its sign. The blend mode picks how the primitive and the environment colors and the texels combine.
| texture | The loaded texture. |
| x | The left edge, in pixels of the low-resolution screen. |
| y | The top edge, in pixels of the low-resolution screen. |
| width | The width, in pixels of the low-resolution screen. |
| height | The height, in pixels of the low-resolution screen. |
| primRed | The red component of the primitive color, from 0 to 255. |
| primGreen | The green component of the primitive color, from 0 to 255. |
| primBlue | The blue component of the primitive color, from 0 to 255. |
| primAlpha | The alpha component of the primitive color, from 0 to 255. |
| envRed | The red component of the environment color, from 0 to 255. |
| envGreen | The green component of the environment color, from 0 to 255. |
| envBlue | The blue component of the environment color, from 0 to 255. |
| envAlpha | The alpha component of the environment color, from 0 to 255. |
| blendMode | One of the TEXRECT_BLEND_ values. |
Get the texture coordinate scale of a texture side, and the bits of the mask that wraps it.
A side of more than 1024 texels is reported on the debug display and leaves the mask unset.
| size | The length of the side, in texels. |
| scale | Receives the texture coordinate scale. |
| maskBits | Receives the number of bits of the mask. |
| void DrawRedIntensityRect | ( | u8 * | texture, |
| s32 | width, | ||
| s32 | height, | ||
| s32 | x, | ||
| s32 | y, | ||
| s32 | drawWidth, | ||
| s32 | drawHeight ) |
Draw a texture stretched over a rectangle and upside down, shaded from black to red by its intensity.
Nothing calls it.
| texture | The texels, 4-bit intensities. |
| width | The width of the texture, in texels. |
| height | The height of the texture, in texels. |
| x | The left edge, in pixels of the low-resolution screen. |
| y | The top edge, in pixels of the low-resolution screen. |
| drawWidth | The width drawn, in pixels of the low-resolution screen, without its sign. |
| drawHeight | The height drawn, in pixels of the low-resolution screen. |
| void DrawColoredTexturedRect | ( | u8 * | texture, |
| s32 | width, | ||
| s32 | height, | ||
| s32 | x, | ||
| s32 | y, | ||
| s32 | drawWidth, | ||
| s32 | drawHeight, | ||
| s32 | red, | ||
| s32 | green, | ||
| s32 | blue ) |
Draw a colour through a texture stretched over a rectangle and upside down, with the intensity of the texture as its opacity.
A negative drawn width also mirrors it. Nothing calls it.
| texture | The texels, 4-bit intensities. |
| width | The width of the texture, in texels. |
| height | The height of the texture, in texels. |
| x | The left edge, in pixels of the low-resolution screen. |
| y | The top edge, in pixels of the low-resolution screen. |
| drawWidth | The width drawn, in pixels of the low-resolution screen, negative to mirror. |
| drawHeight | The height drawn, in pixels of the low-resolution screen. |
| red | The red component of the colour, from 0 to 255. |
| green | The green component of the colour, from 0 to 255. |
| blue | The blue component of the colour, from 0 to 255. |