UFO: Alien Invasion
Loading...
Searching...
No Matches
wrapCache_t Struct Reference

This structure caches information about rendering a text in one font wrapped to a specific width. It points to structures in the chunkCache that cache detailed information and the textures used. More...

Collaboration diagram for wrapCache_t:
Collaboration graph

Data Fields

char text [MAX_CACHE_STRING]
const font_tfont
struct wrapCache_s * next
int maxWidth
longlines_t method
int numChunks
int numLines
int chunkIdx
bool aborted

Detailed Description

This structure caches information about rendering a text in one font wrapped to a specific width. It points to structures in the chunkCache that cache detailed information and the textures used.

Note
Caching text-wrapping information is particularly important for Cyrillic and possibly other non-ascii text, where TTF_SizeUTF8() is almost as slow as rendering. Intro sequence went from 4 fps to 50 after introducing the wrapCache.

Definition at line 69 of file r_font.cpp.

Field Documentation

◆ aborted

bool wrapCache_t::aborted

true if we can't finish the chunk generation

Definition at line 78 of file r_font.cpp.

Referenced by R_FontWrapText().

◆ chunkIdx

int wrapCache_t::chunkIdx

first chunk in chunkCache for this text

Definition at line 77 of file r_font.cpp.

Referenced by R_FontDrawString(), R_FontTextSize(), and R_FontWrapText().

◆ font

const font_t* wrapCache_t::font

font used for wrapping/rendering this text

Definition at line 71 of file r_font.cpp.

Referenced by R_FontWrapText().

◆ maxWidth

int wrapCache_t::maxWidth

width to which this text was wrapped

Definition at line 73 of file r_font.cpp.

Referenced by R_FontWrapText().

◆ method

longlines_t wrapCache_t::method

were long lines wrapped or truncated?

Definition at line 74 of file r_font.cpp.

Referenced by R_FontWrapText().

◆ next

struct wrapCache_s* wrapCache_t::next

next hash entry in case of collision

Definition at line 72 of file r_font.cpp.

Referenced by R_FontListCache_f(), and R_FontWrapText().

◆ numChunks

int wrapCache_t::numChunks

number of (contiguous) chunks in chunkCache used

Definition at line 75 of file r_font.cpp.

Referenced by R_FontDrawString(), R_FontTextSize(), and R_FontWrapText().

◆ numLines

int wrapCache_t::numLines

total line count of wrapped text

Definition at line 76 of file r_font.cpp.

Referenced by R_FontDrawString(), R_FontTextSize(), and R_FontWrapText().

◆ text

char wrapCache_t::text[MAX_CACHE_STRING]

hash id

Definition at line 70 of file r_font.cpp.

Referenced by R_FontListCache_f(), and R_FontWrapText().


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