UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
wrapCache_s 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...

Data Fields

char text [MAX_CACHE_STRING]
 
const font_tfont
 
struct wrapCache_snext
 
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

bool wrapCache_s::aborted

true if we can't finish the chunk generation

Definition at line 78 of file r_font.cpp.

Referenced by R_FontWrapText().

int wrapCache_s::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().

const font_t* wrapCache_s::font

font used for wrapping/rendering this text

Definition at line 71 of file r_font.cpp.

Referenced by R_FontWrapText().

int wrapCache_s::maxWidth

width to which this text was wrapped

Definition at line 73 of file r_font.cpp.

Referenced by R_FontWrapText().

longlines_t wrapCache_s::method

were long lines wrapped or truncated?

Definition at line 74 of file r_font.cpp.

Referenced by R_FontWrapText().

struct wrapCache_s* wrapCache_s::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().

int wrapCache_s::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().

int wrapCache_s::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().

char wrapCache_s::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: