|
coastline 0.0.4
|
The renderer of the PC port: its mode, the routines that start and stop it, and the pool of the data of the models it draws. More...
#include <PR/gbi.h>#include <windows.h>#include "common/combine.h"#include "common/convertedvertex.h"#include "common/damagetexture.h"#include "common/fontdata.h"#include "common/hudassets.h"#include "common/relocation.h"#include "common/render.h"#include "common/renderbackend.h"#include "common/shadowclip.h"#include "common/texturesampling.h"#include "common/textureupload.h"#include "common/track.h"#include "common/trackbackend.h"#include "common/trackskidmarks.h"#include "common/vecmath.h"#include "common/vehicleview.h"
Go to the source code of this file.
Classes | |
| struct | VertexConvCacheEntry |
| A run of vertices of the console converted to floats. More... | |
| struct | TextureMapEntry |
| A texture of the console that a texture of another size replaces, from the texture map. More... | |
Macros | |
| #define | RENDER_BACKEND_MODE_D3D 1 |
| The mode of the renderer of the Direct3D library. | |
| #define | RENDER_BACKEND_MODE_GLIDE 3 |
| The mode of the renderer of the Glide library. | |
| #define | RENDER_BACKEND_MODE RENDER_BACKEND_MODE_GLIDE |
| The mode of the renderer of the library being built. | |
| #define | VERTEX_CONV_CACHE_SIZE 0x800 |
| The number of entries of g_aVertexConvCache. | |
| #define | TEXTURE_MAP_ENTRY_COUNT 256 |
| The number of entries of g_aTextureMapEntries. | |
| #define | TEXTURE_UPLOAD_QUEUE_SIZE 256 |
| The number of entries of g_aTextureUploadQueue. | |
| #define | TEXTURE_RESAMPLE_BUFFER_BYTES 0x80000 |
| The bytes of g_abTextureResampleBuffer. | |
Functions | |
| int | GetRenderBackendMode (void) |
| The renderer the game was set to use. | |
| void | SetRenderBackendMode (int nMode) |
| Record the mode of the renderer. | |
| void | InitializeRenderSubsystems (int nMode) |
| Start the renderer of a mode: reset the device, start the texture subsystem and the renderer, and empty the pool of the data of the models. | |
| void | ResetRenderSubsystems (int nMode, int nWidth, int nHeight, int nBitDepth, int nExtra) |
| Shut the renderer down when one runs, and start the renderer of a mode in a display mode. | |
| int | SetDisplayModeWithFallback (int nWidth, int nHeight, int nBitDepth, int nExtra) |
| Set the size of the frame buffer. | |
| void | SetTextureEntryDamageLevel (int nEntry, int nDamageLevel) |
| Set the level of damage of a texture the game loaded. | |
| int | InitGlideRenderDevice (void) |
| Start the Glide device: set the routines that show a frame and shut the device down, find the hardware and its units of texture and its memory, and open the window of the size of the configuration. | |
| void | InitGbiGlideRenderer (void) |
| Start the renderer of the display lists of the game with Glide. | |
| void | InitializeTextureSubsystem (void) |
| Start the texture subsystem. | |
| int | GetMipLevelFromDimension (int nDimension) |
| Get the exponent of the smallest power of two from 1 to 256 not below a dimension of a texture. | |
| void | CalculateTextureDimensions (int *pWidth, int *pHeight, int nLod, int nAspectRatio) |
| Get the size of a texture from the codes of Glide for its level of detail and its aspect ratio. | |
| void | CopyConfigFramebufferSize (void) |
| Make the size of the frame the size of the framebuffer of the configuration. | |
| void | RefreshScreenDimensions (void) |
| Refresh screen dimensions from the configured framebuffer size. | |
| void | AddVertexConversionCacheEntry (const Vtx *pSource, int nVertexCount, ConvertedModelVertex *pFloatVerts) |
| Add a run of vertices converted to g_aVertexConvCache while it has room. | |
| void | ByteSwapVertexArray (Vtx *pVertices, int nCount) |
| Byte-swap the positions, flags, and texture coordinates of loaded Nintendo 64 vertices. | |
| ConvertedModelVertex * | ConvertVerticesToFloat (const Vtx *pVertices, int nCount) |
| Convert Nintendo 64 vertex positions and texture coordinates to floats in the model data pool. | |
| void | ConvertN64VerticesCached (ModelVertexData *pVertices, int nCount) |
| Reuse converted vertices for a previously seen source array, or convert and cache them. | |
| void | RelocateGbiVertexCommand (GbiCommand *pCommand) |
| Relocate a display-list vertex command's source address and cache its converted vertices. | |
| bool | LookupTextureMapEntry (unsigned dwAddress, int *pnWidth, int *pnHeight) |
| Get the size of the replacement of a texture of the console, searching the texture map from its last entry. | |
| void | InitializeTextureUploadQueue (void) |
| Empty the queue of textures to upload and create its mutex. | |
| void | DestroyTextureUploadQueue (void) |
| Empty the queue of textures to upload and close its mutex. | |
| void | SetTextureLoadCategory (int nCategory) |
| Set the category of the textures loaded next. | |
| int | GetTexelsPerLoadWord (int nSize) |
| Get the texels of a word of 8 bytes of the texture memory of the console for a size of texel. | |
| void | LoadHudOverlayTexture (void) |
| Load the texture of the overlay of the display of the race. | |
| void | LoadHudGlyphTextureSets (void) |
| Load the textures of the sets of glyphs of the display of the race. | |
| void | SelectTextureQualityFromVideoMemory (void) |
| Select texture quality and maximum dimensions from available graphics memory. | |
| unsigned | CreateTextureFromN64ImageAutoLoadSize (const unsigned char *pImage, const unsigned char *pPalette, int nWidth, int nHeight, int nSize, int nFormat, int nOption6, int nOption7, int nOption8, int nOption9, int nOption10, int nOption11, int nOption12, int nOption13) |
Calculate the image load size from nWidth and delegate texture creation to the renderer. | |
| unsigned | DuplicateTextureEntryHalfScale (unsigned nTexture) |
| Duplicate a texture entry with both texture-coordinate scales halved. | |
| void | LoadParticleTexture (void) |
| Create the texture of the particles, 64 by 64 texels. | |
| void | LoadTireTrailTexture (void) |
| Create the texture of the trails of the tyres, 32 by 64 texels. | |
| void | LoadVehicleEnvMapTexture (void) |
| Create the map of the environment of the vehicles, 64 by 64 texels. | |
| void | CreateFallbackEnvironmentTexture (void) |
| Create the texture of the environment used when none is loaded. | |
| void | CreateAlphaRampTextures (void) |
| Create the textures of the ramps of alpha and of precipitation. | |
| void | ProcessTextureUploadQueueEntry (void) |
| Upload the next texture of the queue of textures to upload. | |
| void | EnqueueTextureUploadEntry (int nEntry, TextureUploadData payload) |
| Queue a texture to upload, under the mutex of the queue. | |
| void | CreateWeatherShadeTexture (void) |
| Create a uniform intensity texture for the chosen weather. | |
| unsigned | QueryAvailableTextureMemory (void) |
| Query the free video memory available for textures on the active DirectDraw device. | |
| void | ShutdownTextureSubsystem (void) |
| Stop texture uploads and release texture surfaces and owned paint buffers. | |
| void | UploadTextureEntryToSurface (int nEntry, TextureUploadData payload) |
| Copy a supplied pixel buffer into the device texture of a loaded entry. | |
| void | CreateDeviceTextureFromImageHeader (ModelTexture *pTexture, int nOption13) |
| Replace a static model texture's image with its loaded device texture entry. | |
| int | CalculateTextureLodFromDimensions (int *pLod, int width, int height) |
| Derive a texture level of detail from its larger dimension. | |
| int | ChooseTexturePixelFormat (int nSize, int nFormat, int bColorCombine) |
| Select a device pixel format from N64 texture size, format and combine state. | |
| int | GetTexturePixelSize (int nPixelFormatId) |
| Get the decoded bytes per texture pixel. | |
| int | FindMatchingTextureEntry (const TextureImageData *pImage) |
| Find an entry with the same image, palette and applicable captured colors. | |
| unsigned | RegisterTextureEntry (const TextureImageData *pImage, int nTextureId) |
| Append image metadata and a device texture identifier to the loaded entries. | |
| void | ResizeTextureImage (unsigned char *pDest, int width, int height, const unsigned char *pSource, int sourceWidth, int sourceHeight, int nPixelFormatId) |
| Resize a decoded texture with bilinear sampling at pixel centers. | |
| unsigned char * | GetTextureImagePixels (TextureImageData *pImage) |
| Decode an image descriptor into the texture pixel work buffers. | |
| void | ReloadTextureEntryData (int nEntry) |
| Decode a loaded entry again and upload the resulting pixels. | |
| unsigned | ResizeTextureMipChain (unsigned char *pDest, const unsigned char *pSource, TextureImageData *pImage) |
| Resize consecutive decoded mip levels and record the decoded source dimensions. | |
| void | ModulateTextureWithIntensityPlane (const TextureImageData *pImage, unsigned char *pPixels) |
| Modulate decoded RGB by the half-sized intensity plane following its pixels. | |
| void | DecodeTexturePixels (unsigned char *pDest, int nSize, int nTexelSize, const unsigned char *pImage, const unsigned char *pPalette, int nFormat, int bMirrorS, int bMirrorT, int nTileIndex, int nTileLimit, const TexScanTile *pTiles, unsigned flags, int bColorCombine, unsigned envR, unsigned envG, unsigned envB, unsigned envA, unsigned primR, unsigned primG, unsigned primB, unsigned primA, unsigned nRowSwapMask) |
| Decode captured N64 texture tiles into four-byte pixels. | |
| int | CreateTextureFromImage (TextureImageData *pImage, unsigned char *pPixels) |
| Create a device texture from captured metadata and decoded pixels. | |
| int | CloneTextureEntryWithNewImageData (int nEntry, unsigned char *pImage, const unsigned char *pPalette) |
| Clone texture metadata with replacement image and palette bytes. | |
| int | PreparePaintTexture (int *pWidth, int *pHeight, TextureImageData *pImage) |
| Prepare paint texture metadata and adjust device dimensions. | |
| void | UploadTrackTextureVariants (ModelTexture *pTextures, int nCount) |
| Create device textures for animated track frames and replace their image offsets with entries. | |
| int | DecodeN64TextureToPixelBuffer (void *pDest, const unsigned char *pImage, const unsigned char *pPalette, int nWidth, int nHeight, int nLineBytes, int nSize, int nFormat) |
| Decode an N64 image into the pixel format selected for its texel size and format. | |
| int | CalculateTextureAspectRatio (int *pAspectRatio, int nWidth, int nHeight) |
| Select an aspect ratio code from the truncated ratio of the dimensions. | |
| unsigned | CreateTextureFromN64Image (const unsigned char *pImage, const unsigned char *pPalette, int nWidth, int nHeight, int nLineBytes, int nSize, int nFormat, int nOption7, int nOption8, int nOption9, int nOption10, int nOption11, int nOption12, int nOption13, int nOption14) |
| Create a device texture from an N64 image and its load options. | |
| unsigned char * | GetTextureEntryPixelsWithPaint (int nEntry, unsigned *pSize) |
| Decode texture pixels, applying the selected paint damage image when needed. | |
Variables | |
| void(* | g_pfnRenderBackendSubmitDisplayList )(GbiCommand *pDisplayList) |
| The active backend callback that submits a display list for rendering. | |
| void(* | g_pfnPresentFrame )(void) |
| Show the frame drawn, set by the reset of the render device. | |
| int | g_dwRenderBackendMode |
| The mode of the renderer, 0 before one is set. | |
| int(* | g_pfnRenderDeviceReset )(void) |
| Reset the render device, set by SetRenderBackendMode(). | |
| void(* | g_pfnRenderDeviceShutdown )(void) |
| Release the render device, if one is set. | |
| void(* | g_pfnReloadTextureEntryData )(int nEntry) |
| Load the data of a texture the game loaded again, set by InitializeTextureSubsystem(). | |
| ConvertedModelVertex * | g_pModelDataPoolCursor |
| The next free entry of g_afModelVertexPool. | |
| VertexConvCacheEntry | g_aVertexConvCache [VERTEX_CONV_CACHE_SIZE] |
| The runs of vertices converted. | |
| int | g_dwVertexConvCacheCount |
| The number of entries of g_aVertexConvCache in use. | |
| TextureMapEntry | g_aTextureMapEntries [TEXTURE_MAP_ENTRY_COUNT] |
| The entries the texture map file lists. | |
| int | g_dwTextureMapEntryCount |
| The entries of g_aTextureMapEntries in use. | |
| TextureUploadRequest | g_aTextureUploadQueue [TEXTURE_UPLOAD_QUEUE_SIZE] |
| The textures to upload, a ring from g_dwTextureUploadQueueTail to g_dwTextureUploadQueueHead. | |
| int | g_dwTextureUploadQueueHead |
| The entry of g_aTextureUploadQueue the next texture to queue takes. | |
| int | g_dwTextureUploadQueueTail |
| The entry of g_aTextureUploadQueue of the next texture to upload. | |
| HANDLE | g_hTextureUploadQueueMutex |
| The mutex of the queue of textures to upload. | |
| int | g_dwCopyTextureDataOnRelocate |
| Whether the data of a texture is copied when its pointers are relocated. | |
| int | g_dwTextureLoadCategory |
| The category of the textures loaded next. | |
| unsigned | g_dwHiResTextureMemoryThreshold |
| The available texture-memory threshold for high-resolution textures, in bytes. | |
| int | g_dwMaxTexWidthHighQuality |
| The maximum high-quality texture width, in texels. | |
| int | g_dwMaxTexHeightHighQuality |
| The maximum high-quality texture height, in texels. | |
| int | g_dwMaxTexWidthLowQuality |
| The maximum low-quality texture width, in texels. | |
| int | g_dwMaxTexHeightLowQuality |
| The maximum low-quality texture height, in texels. | |
| unsigned(* | g_pfnCreateTextureFromN64ImageAutoLoadSize )(const unsigned char *, const unsigned char *, int, int, int, int, int, int, int, int, int, int, int, int) |
| The backend callback that creates an N64 image texture after calculating its load size. | |
| unsigned char | g_abAlphaRampRgba [16][4] |
| The 16 white RGBA colours of the alpha ramp, with alpha increasing by 17. | |
| unsigned char | g_abAlphaRampPixelStrip [64] |
| The alpha ramp converted to device pixel format. | |
| unsigned char | g_abWeatherShadeTexture [16] |
| The 4-by-4 intensity pixels of the current weather shade. | |
| unsigned | g_dwWeatherShadeTextureId |
| The device texture identifier of the current weather shade. | |
| unsigned | g_dwTexturePixelByteCount |
| The byte count produced by the last decoded texture operation. | |
| unsigned char | g_abTextureResampleBuffer [TEXTURE_RESAMPLE_BUFFER_BYTES] |
| The pixels of a texture after resizing, or an intensity plane while it is applied. | |
| const char | g_szTidFromTextureAppendAmid [] |
| Allocation label for the device texture table. | |
| decltype(&CreateDeviceTextureFromImageHeader) | g_pfnCreateDeviceTextureFromImageHeader |
| The backend callback that creates a device texture from a model texture header. | |
| decltype(&CloneTextureEntryWithNewImageData) | g_pfnCloneTextureEntryWithNewImageData |
| The backend callback that clones a texture entry with replacement image data. | |
| decltype(&UploadTrackTextureVariants) | g_pfnUploadTrackTextureVariants |
| The backend callback that uploads the texture variants of a track. | |
| int | g_dwCurrentMaxTextureWidth |
| The width limit selected for the current texture category. | |
| int | g_dwCurrentMaxTextureHeight |
| The height limit selected for the current texture category. | |
The renderer of the PC port: its mode, the routines that start and stop it, and the pool of the data of the models it draws.
| #define RENDER_BACKEND_MODE_D3D 1 |
The mode of the renderer of the Direct3D library.
| #define RENDER_BACKEND_MODE_GLIDE 3 |
The mode of the renderer of the Glide library.
| #define RENDER_BACKEND_MODE RENDER_BACKEND_MODE_GLIDE |
The mode of the renderer of the library being built.
| #define VERTEX_CONV_CACHE_SIZE 0x800 |
The number of entries of g_aVertexConvCache.
| #define TEXTURE_MAP_ENTRY_COUNT 256 |
The number of entries of g_aTextureMapEntries.
| #define TEXTURE_UPLOAD_QUEUE_SIZE 256 |
The number of entries of g_aTextureUploadQueue.
| #define TEXTURE_RESAMPLE_BUFFER_BYTES 0x80000 |
The bytes of g_abTextureResampleBuffer.
| int GetRenderBackendMode | ( | void | ) |
The renderer the game was set to use.
| void SetRenderBackendMode | ( | int | nMode | ) |
Record the mode of the renderer.
The mode of the renderer of the library sets the routines that reset its device and start the renderer and the texture subsystem.
| nMode | The mode. |
| void InitializeRenderSubsystems | ( | int | nMode | ) |
Start the renderer of a mode: reset the device, start the texture subsystem and the renderer, and empty the pool of the data of the models.
| nMode | The mode of the renderer. |
| void ResetRenderSubsystems | ( | int | nMode, |
| int | nWidth, | ||
| int | nHeight, | ||
| int | nBitDepth, | ||
| int | nExtra ) |
Shut the renderer down when one runs, and start the renderer of a mode in a display mode.
| nMode | The mode of the renderer. |
| nWidth | The width of the display mode. |
| nHeight | The height of the display mode. |
| nBitDepth | The bits of a pixel of the display mode. |
| nExtra | The fourth value of the display mode. |
| int SetDisplayModeWithFallback | ( | int | nWidth, |
| int | nHeight, | ||
| int | nBitDepth, | ||
| int | nExtra ) |
Set the size of the frame buffer.
A size other than the current one closes the Glide window and opens one of the new size, or of 640 by 480 when that fails.
| nWidth | The width of the display mode. |
| nHeight | The height of the display mode. |
| nBitDepth | The bits of a pixel of the display mode, not read. |
| nExtra | The fourth value of the display mode, not read. |
| void SetTextureEntryDamageLevel | ( | int | nEntry, |
| int | nDamageLevel ) |
Set the level of damage of a texture the game loaded.
| nEntry | The entry of the texture. |
| nDamageLevel | The level of damage. |
| int InitGlideRenderDevice | ( | void | ) |
Start the Glide device: set the routines that show a frame and shut the device down, find the hardware and its units of texture and its memory, and open the window of the size of the configuration.
| void InitGbiGlideRenderer | ( | void | ) |
Start the renderer of the display lists of the game with Glide.
| void InitializeTextureSubsystem | ( | void | ) |
Start the texture subsystem.
| int GetMipLevelFromDimension | ( | int | nDimension | ) |
Get the exponent of the smallest power of two from 1 to 256 not below a dimension of a texture.
| nDimension | The dimension. |
| void CalculateTextureDimensions | ( | int * | pWidth, |
| int * | pHeight, | ||
| int | nLod, | ||
| int | nAspectRatio ) |
Get the size of a texture from the codes of Glide for its level of detail and its aspect ratio.
| pWidth | Receives the width. |
| pHeight | Receives the height. It is not written for an aspect ratio above 6. |
| nLod | The level of detail, from 0 for 256 texels to 8 for 1, and 1 texel above 8. |
| nAspectRatio | The aspect ratio, from 0 for eight times as wide as high to 6 for eight times as high as wide. |
| void CopyConfigFramebufferSize | ( | void | ) |
Make the size of the frame the size of the framebuffer of the configuration.
| void RefreshScreenDimensions | ( | void | ) |
Refresh screen dimensions from the configured framebuffer size.
| void AddVertexConversionCacheEntry | ( | const Vtx * | pSource, |
| int | nVertexCount, | ||
| ConvertedModelVertex * | pFloatVerts ) |
Add a run of vertices converted to g_aVertexConvCache while it has room.
| pSource | The vertices of the console. |
| nVertexCount | The number of vertices. |
| pFloatVerts | The vertices converted. |
| void ByteSwapVertexArray | ( | Vtx * | pVertices, |
| int | nCount ) |
Byte-swap the positions, flags, and texture coordinates of loaded Nintendo 64 vertices.
| ConvertedModelVertex * ConvertVerticesToFloat | ( | const Vtx * | pVertices, |
| int | nCount ) |
Convert Nintendo 64 vertex positions and texture coordinates to floats in the model data pool.
Normal components are divided by 128.
| void ConvertN64VerticesCached | ( | ModelVertexData * | pVertices, |
| int | nCount ) |
Reuse converted vertices for a previously seen source array, or convert and cache them.
| void RelocateGbiVertexCommand | ( | GbiCommand * | pCommand | ) |
Relocate a display-list vertex command's source address and cache its converted vertices.
| bool LookupTextureMapEntry | ( | unsigned | dwAddress, |
| int * | pnWidth, | ||
| int * | pnHeight ) |
Get the size of the replacement of a texture of the console, searching the texture map from its last entry.
| dwAddress | The address of the texture, before g_dwTextureMapAddressBias. |
| pnWidth | Receives the width of the replacement. |
| pnHeight | Receives the height of the replacement. |
| void InitializeTextureUploadQueue | ( | void | ) |
Empty the queue of textures to upload and create its mutex.
| void DestroyTextureUploadQueue | ( | void | ) |
Empty the queue of textures to upload and close its mutex.
| void SetTextureLoadCategory | ( | int | nCategory | ) |
Set the category of the textures loaded next.
| nCategory | The category. |
| int GetTexelsPerLoadWord | ( | int | nSize | ) |
Get the texels of a word of 8 bytes of the texture memory of the console for a size of texel.
| nSize | The size of the texels, from 0 for 4 bits to 3 for 32 bits. |
| void LoadHudOverlayTexture | ( | void | ) |
Load the texture of the overlay of the display of the race.
| void LoadHudGlyphTextureSets | ( | void | ) |
Load the textures of the sets of glyphs of the display of the race.
The Glide renderer loads one texture for each font atlas instead.
| void SelectTextureQualityFromVideoMemory | ( | void | ) |
Select texture quality and maximum dimensions from available graphics memory.
| unsigned CreateTextureFromN64ImageAutoLoadSize | ( | const unsigned char * | pImage, |
| const unsigned char * | pPalette, | ||
| int | nWidth, | ||
| int | nHeight, | ||
| int | nSize, | ||
| int | nFormat, | ||
| int | nOption6, | ||
| int | nOption7, | ||
| int | nOption8, | ||
| int | nOption9, | ||
| int | nOption10, | ||
| int | nOption11, | ||
| int | nOption12, | ||
| int | nOption13 ) |
Calculate the image load size from nWidth and delegate texture creation to the renderer.
| unsigned DuplicateTextureEntryHalfScale | ( | unsigned | nTexture | ) |
Duplicate a texture entry with both texture-coordinate scales halved.
| void LoadParticleTexture | ( | void | ) |
Create the texture of the particles, 64 by 64 texels.
| void LoadTireTrailTexture | ( | void | ) |
Create the texture of the trails of the tyres, 32 by 64 texels.
| void LoadVehicleEnvMapTexture | ( | void | ) |
Create the map of the environment of the vehicles, 64 by 64 texels.
| void CreateFallbackEnvironmentTexture | ( | void | ) |
Create the texture of the environment used when none is loaded.
| void CreateAlphaRampTextures | ( | void | ) |
Create the textures of the ramps of alpha and of precipitation.
| void ProcessTextureUploadQueueEntry | ( | void | ) |
Upload the next texture of the queue of textures to upload.
| void EnqueueTextureUploadEntry | ( | int | nEntry, |
| TextureUploadData | payload ) |
Queue a texture to upload, under the mutex of the queue.
| nEntry | The entry of the texture the game loaded. |
| payload | The second argument of g_pfnUploadTextureEntryToSurface. |
| void CreateWeatherShadeTexture | ( | void | ) |
Create a uniform intensity texture for the chosen weather.
| unsigned QueryAvailableTextureMemory | ( | void | ) |
Query the free video memory available for textures on the active DirectDraw device.
| void ShutdownTextureSubsystem | ( | void | ) |
Stop texture uploads and release texture surfaces and owned paint buffers.
| void UploadTextureEntryToSurface | ( | int | nEntry, |
| TextureUploadData | payload ) |
Copy a supplied pixel buffer into the device texture of a loaded entry.
| nEntry | The loaded texture entry. |
| payload | The pixel buffer. |
| void CreateDeviceTextureFromImageHeader | ( | ModelTexture * | pTexture, |
| int | nOption13 ) |
Replace a static model texture's image with its loaded device texture entry.
| pTexture | The model texture descriptor. |
| nOption13 | The final texture creation option. |
| int CalculateTextureLodFromDimensions | ( | int * | pLod, |
| int | width, | ||
| int | height ) |
Derive a texture level of detail from its larger dimension.
| pLod | Receives the level, clamped to zero for dimensions above 256. |
| width | The width. |
| height | The height. |
| int ChooseTexturePixelFormat | ( | int | nSize, |
| int | nFormat, | ||
| int | bColorCombine ) |
Select a device pixel format from N64 texture size, format and combine state.
| nSize | The N64 texel size. |
| nFormat | The N64 image format. |
| bColorCombine | The scan's color combine state. |
| int GetTexturePixelSize | ( | int | nPixelFormatId | ) |
Get the decoded bytes per texture pixel.
| nPixelFormatId | The device pixel format identifier, ignored. |
| int FindMatchingTextureEntry | ( | const TextureImageData * | pImage | ) |
Find an entry with the same image, palette and applicable captured colors.
| pImage | The image metadata to match. |
| unsigned RegisterTextureEntry | ( | const TextureImageData * | pImage, |
| int | nTextureId ) |
Append image metadata and a device texture identifier to the loaded entries.
| pImage | The image metadata. |
| nTextureId | The device texture identifier. |
| void ResizeTextureImage | ( | unsigned char * | pDest, |
| int | width, | ||
| int | height, | ||
| const unsigned char * | pSource, | ||
| int | sourceWidth, | ||
| int | sourceHeight, | ||
| int | nPixelFormatId ) |
Resize a decoded texture with bilinear sampling at pixel centers.
| pDest | The output pixels. |
| width | The output width. |
| height | The output height. |
| pSource | The source pixels. |
| sourceWidth | The source width. |
| sourceHeight | The source height. |
| nPixelFormatId | The decoded pixel format. |
| unsigned char * GetTextureImagePixels | ( | TextureImageData * | pImage | ) |
Decode an image descriptor into the texture pixel work buffers.
| pImage | The image metadata. |
| void ReloadTextureEntryData | ( | int | nEntry | ) |
Decode a loaded entry again and upload the resulting pixels.
| nEntry | The loaded texture entry. |
| unsigned ResizeTextureMipChain | ( | unsigned char * | pDest, |
| const unsigned char * | pSource, | ||
| TextureImageData * | pImage ) |
Resize consecutive decoded mip levels and record the decoded source dimensions.
| pDest | The output mip pixels. |
| pSource | The source mip pixels. |
| pImage | The image metadata. |
| void ModulateTextureWithIntensityPlane | ( | const TextureImageData * | pImage, |
| unsigned char * | pPixels ) |
Modulate decoded RGB by the half-sized intensity plane following its pixels.
| pImage | The image metadata. |
| pPixels | The decoded pixels and following intensity plane. |
| void DecodeTexturePixels | ( | unsigned char * | pDest, |
| int | nSize, | ||
| int | nTexelSize, | ||
| const unsigned char * | pImage, | ||
| const unsigned char * | pPalette, | ||
| int | nFormat, | ||
| int | bMirrorS, | ||
| int | bMirrorT, | ||
| int | nTileIndex, | ||
| int | nTileLimit, | ||
| const TexScanTile * | pTiles, | ||
| unsigned | flags, | ||
| int | bColorCombine, | ||
| unsigned | envR, | ||
| unsigned | envG, | ||
| unsigned | envB, | ||
| unsigned | envA, | ||
| unsigned | primR, | ||
| unsigned | primG, | ||
| unsigned | primB, | ||
| unsigned | primA, | ||
| unsigned | nRowSwapMask ) |
Decode captured N64 texture tiles into four-byte pixels.
The Glide renderer decodes them into the 16-bit formats of Glide, and an intensity without the combine into bytes.
| pDest | Receives decoded pixels. |
| nSize | The output byte limit. |
| nTexelSize | The N64 texel size. |
| pImage | The captured image bytes. |
| pPalette | The captured palette bytes. |
| nFormat | The N64 image format. |
| bMirrorS | Whether to append reflected columns to each row. |
| bMirrorT | Whether to append reflected rows to each tile. |
| nTileIndex | The first tile. |
| nTileLimit | The exclusive tile limit. |
| pTiles | The captured tile records. |
| flags | The image control flags. |
| bColorCombine | The captured combine state. |
| envR | The environment red byte. |
| envG | The environment green byte. |
| envB | The environment blue byte. |
| envA | The environment alpha byte. |
| primR | The primitive red byte. |
| primG | The primitive green byte. |
| primB | The primitive blue byte. |
| primA | The primitive alpha byte. |
| nRowSwapMask | The row mask for swapped texture words. |
| int CreateTextureFromImage | ( | TextureImageData * | pImage, |
| unsigned char * | pPixels ) |
Create a device texture from captured metadata and decoded pixels.
| pImage | The image metadata. |
| pPixels | The decoded pixels. |
| int CloneTextureEntryWithNewImageData | ( | int | nEntry, |
| unsigned char * | pImage, | ||
| const unsigned char * | pPalette ) |
Clone texture metadata with replacement image and palette bytes.
| nEntry | The source texture entry. |
| pImage | The replacement image bytes. |
| pPalette | The replacement palette bytes. |
| int PreparePaintTexture | ( | int * | pWidth, |
| int * | pHeight, | ||
| TextureImageData * | pImage ) |
Prepare paint texture metadata and adjust device dimensions.
| pWidth | Receives the device width. |
| pHeight | Receives the device height. |
| pImage | The image metadata to prepare. |
| void UploadTrackTextureVariants | ( | ModelTexture * | pTextures, |
| int | nCount ) |
Create device textures for animated track frames and replace their image offsets with entries.
| pTextures | The track texture descriptors. |
| nCount | The descriptor count. |
| int DecodeN64TextureToPixelBuffer | ( | void * | pDest, |
| const unsigned char * | pImage, | ||
| const unsigned char * | pPalette, | ||
| int | nWidth, | ||
| int | nHeight, | ||
| int | nLineBytes, | ||
| int | nSize, | ||
| int | nFormat ) |
Decode an N64 image into the pixel format selected for its texel size and format.
| pDest | Receives device pixels. |
| pImage | The source image bytes. |
| pPalette | The source palette bytes. |
| nWidth | The source width. |
| nHeight | The source height. |
| nLineBytes | The captured tile line size. |
| nSize | The N64 texel size. |
| nFormat | The N64 image format. |
| int CalculateTextureAspectRatio | ( | int * | pAspectRatio, |
| int | nWidth, | ||
| int | nHeight ) |
Select an aspect ratio code from the truncated ratio of the dimensions.
| pAspectRatio | Receives the aspect ratio code. |
| nWidth | The width, nonzero when it is the divisor. |
| nHeight | The height, nonzero when it is the divisor. |
| unsigned CreateTextureFromN64Image | ( | const unsigned char * | pImage, |
| const unsigned char * | pPalette, | ||
| int | nWidth, | ||
| int | nHeight, | ||
| int | nLineBytes, | ||
| int | nSize, | ||
| int | nFormat, | ||
| int | nOption7, | ||
| int | nOption8, | ||
| int | nOption9, | ||
| int | nOption10, | ||
| int | nOption11, | ||
| int | nOption12, | ||
| int | nOption13, | ||
| int | nOption14 ) |
Create a device texture from an N64 image and its load options.
| unsigned char * GetTextureEntryPixelsWithPaint | ( | int | nEntry, |
| unsigned * | pSize ) |
Decode texture pixels, applying the selected paint damage image when needed.
| nEntry | The texture entry. |
| pSize | Receives the decoded byte count. |
|
extern |
The active backend callback that submits a display list for rendering.
|
extern |
Show the frame drawn, set by the reset of the render device.
|
extern |
The mode of the renderer, 0 before one is set.
|
extern |
Reset the render device, set by SetRenderBackendMode().
|
extern |
Release the render device, if one is set.
The Glide library does not call it.
|
extern |
Load the data of a texture the game loaded again, set by InitializeTextureSubsystem().
|
extern |
The next free entry of g_afModelVertexPool.
|
extern |
The runs of vertices converted.
|
extern |
The number of entries of g_aVertexConvCache in use.
|
extern |
The entries the texture map file lists.
|
extern |
The entries of g_aTextureMapEntries in use.
|
extern |
The textures to upload, a ring from g_dwTextureUploadQueueTail to g_dwTextureUploadQueueHead.
|
extern |
The entry of g_aTextureUploadQueue the next texture to queue takes.
|
extern |
The entry of g_aTextureUploadQueue of the next texture to upload.
|
extern |
The mutex of the queue of textures to upload.
|
extern |
Whether the data of a texture is copied when its pointers are relocated.
|
extern |
The category of the textures loaded next.
Its values are not recovered yet.
|
extern |
The available texture-memory threshold for high-resolution textures, in bytes.
|
extern |
The maximum high-quality texture width, in texels.
|
extern |
The maximum high-quality texture height, in texels.
|
extern |
The maximum low-quality texture width, in texels.
|
extern |
The maximum low-quality texture height, in texels.
|
extern |
The backend callback that creates an N64 image texture after calculating its load size.
|
extern |
The 16 white RGBA colours of the alpha ramp, with alpha increasing by 17.
|
extern |
The alpha ramp converted to device pixel format.
|
extern |
The 4-by-4 intensity pixels of the current weather shade.
|
extern |
The device texture identifier of the current weather shade.
|
extern |
The byte count produced by the last decoded texture operation.
|
extern |
The pixels of a texture after resizing, or an intensity plane while it is applied.
|
extern |
Allocation label for the device texture table.
|
extern |
The backend callback that creates a device texture from a model texture header.
|
extern |
The backend callback that clones a texture entry with replacement image data.
|
extern |
The backend callback that uploads the texture variants of a track.
|
extern |
The width limit selected for the current texture category.
|
extern |
The height limit selected for the current texture category.