#include "pch.h"#include "cube.h"

Defines | |
| #define | TABALIGN(x) ((((x)+PIXELTAB)/PIXELTAB)*PIXELTAB) |
| #define | TEXTGETCOLUMN |
| #define | TEXTSETCOLUMN |
| #define | TEXTSKELETON |
| #define | TEXTWORDSKELETON |
| #define | TEXTINDEX(idx) |
| #define | TEXTTAB(idx) TEXTGETCOLUMN |
| #define | TEXTWHITE(idx) if(y+FONTH > hity && x >= hitx) return idx; |
| #define | TEXTLINE(idx) if(y+FONTH > hity) return idx; |
| #define | TEXTCOLOR(idx) |
| #define | TEXTCHAR(idx) x += curfont->chars[c-curfont->skip].w+1; TEXTWHITE(idx) |
| #define | TEXTWORD TEXTWORDSKELETON |
| #define | TEXTINDEX(idx) if(idx == cursor) { cx = x; cy = y; break; } |
| #define | TEXTTAB(idx) TEXTGETCOLUMN |
| #define | TEXTWHITE(idx) |
| #define | TEXTLINE(idx) |
| #define | TEXTCOLOR(idx) |
| #define | TEXTCHAR(idx) x += curfont->chars[c-curfont->skip].w + 1; |
| #define | TEXTWORD TEXTWORDSKELETON if(i >= cursor) break; |
| #define | TEXTINDEX(idx) |
| #define | TEXTTAB(idx) TEXTSETCOLUMN |
| #define | TEXTWHITE(idx) |
| #define | TEXTLINE(idx) if(x > width) width = x; |
| #define | TEXTCOLOR(idx) |
| #define | TEXTCHAR(idx) x += curfont->chars[c-curfont->skip].w + 1; |
| #define | TEXTWORD x += w + 1; |
| #define | TEXTINDEX(idx) if(idx == cursor) { cx = x; cy = y; cc = str[idx]; } |
| #define | TEXTTAB(idx) TEXTGETCOLUMN |
| #define | TEXTWHITE(idx) |
| #define | TEXTLINE(idx) |
| #define | TEXTCOLOR(idx) text_color(str[idx], colorstack, sizeof(colorstack), colorpos, color, a); |
| #define | TEXTCHAR(idx) x += draw_char(c, left+x, top+y)+1; |
| #define | TEXTWORD TEXTWORDSKELETON |
Functions | |
| void | newfont (char *name, char *tex, char *defaultw, char *defaulth, char *offsetx, char *offsety, char *offsetw, char *offseth) |
| void | fontchar (int x, int y, int w, int h) |
| void | fontskip (int n) |
| COMMANDN (font, newfont, ARG_8STR) | |
| COMMAND (fontchar, ARG_4INT) | |
| COMMAND (fontskip, ARG_1INT) | |
| bool | setfont (const char *name) |
| void | pushfont (const char *name) |
| void | popfont () |
| int | text_width (const char *str) |
| void | draw_textf (const char *fstr, int left, int top,...) |
| static int | draw_char (int c, int x, int y) |
| static void | text_color (char c, char *stack, int size, int &sp, bvec color, int a) |
| void | text_startcolumns () |
| void | text_endcolumns () |
| int | text_visible (const char *str, int hitx, int hity, int maxwidth) |
| void | text_pos (const char *str, int cursor, int &cx, int &cy, int maxwidth) |
| void | text_bounds (const char *str, int &width, int &height, int maxwidth) |
| void | draw_text (const char *str, int left, int top, int r, int g, int b, int a, int cursor, int maxwidth) |
| void | reloadfonts () |
Variables | |
| int | VIRTW |
| static hashtable< const char *, font > | fonts |
| static font * | fontdef = NULL |
| font * | curfont = NULL |
| static vector< font * > | fontstack |
| static vector< int > * | columns = NULL |
| #define TABALIGN | ( | x | ) | ((((x)+PIXELTAB)/PIXELTAB)*PIXELTAB) |
| #define TEXTCHAR | ( | idx | ) | x += draw_char(c, left+x, top+y)+1; |
| #define TEXTCOLOR | ( | idx | ) | text_color(str[idx], colorstack, sizeof(colorstack), colorpos, color, a); |
| #define TEXTCOLOR | ( | idx | ) |
| #define TEXTCOLOR | ( | idx | ) |
| #define TEXTCOLOR | ( | idx | ) |
| #define TEXTGETCOLUMN |
| #define TEXTINDEX | ( | idx | ) |
| #define TEXTINDEX | ( | idx | ) |
| #define TEXTLINE | ( | idx | ) |
| #define TEXTLINE | ( | idx | ) | if(x > width) width = x; |
| #define TEXTLINE | ( | idx | ) |
| #define TEXTLINE | ( | idx | ) | if(y+FONTH > hity) return idx; |
| #define TEXTSETCOLUMN |
| #define TEXTSKELETON |
| #define TEXTTAB | ( | idx | ) | TEXTGETCOLUMN |
| #define TEXTTAB | ( | idx | ) | TEXTSETCOLUMN |
| #define TEXTTAB | ( | idx | ) | TEXTGETCOLUMN |
| #define TEXTTAB | ( | idx | ) | TEXTGETCOLUMN |
| #define TEXTWHITE | ( | idx | ) |
| #define TEXTWHITE | ( | idx | ) |
| #define TEXTWHITE | ( | idx | ) |
| #define TEXTWHITE | ( | idx | ) | if(y+FONTH > hity && x >= hitx) return idx; |
| #define TEXTWORD TEXTWORDSKELETON |
| #define TEXTWORD x += w + 1; |
| #define TEXTWORD TEXTWORDSKELETON if(i >= cursor) break; |
| #define TEXTWORD TEXTWORDSKELETON |
| #define TEXTWORDSKELETON |
| COMMAND | ( | fontskip | , | |
| ARG_1INT | ||||
| ) |
| COMMAND | ( | fontchar | , | |
| ARG_4INT | ||||
| ) |
| COMMANDN | ( | font | , | |
| newfont | , | |||
| ARG_8STR | ||||
| ) |
| static int draw_char | ( | int | c, | |
| int | x, | |||
| int | y | |||
| ) | [static] |
| void draw_text | ( | const char * | str, | |
| int | left, | |||
| int | top, | |||
| int | r, | |||
| int | g, | |||
| int | b, | |||
| int | a, | |||
| int | cursor, | |||
| int | maxwidth | |||
| ) |
| void draw_textf | ( | const char * | fstr, | |
| int | left, | |||
| int | top, | |||
| ... | ||||
| ) |
| void fontchar | ( | int | x, | |
| int | y, | |||
| int | w, | |||
| int | h | |||
| ) |
| void fontskip | ( | int | n | ) |
| void newfont | ( | char * | name, | |
| char * | tex, | |||
| char * | defaultw, | |||
| char * | defaulth, | |||
| char * | offsetx, | |||
| char * | offsety, | |||
| char * | offsetw, | |||
| char * | offseth | |||
| ) |
| void popfont | ( | ) |
| void pushfont | ( | const char * | name | ) |
| void reloadfonts | ( | ) |
| bool setfont | ( | const char * | name | ) |
| void text_bounds | ( | const char * | str, | |
| int & | width, | |||
| int & | height, | |||
| int | maxwidth | |||
| ) |
| static void text_color | ( | char | c, | |
| char * | stack, | |||
| int | size, | |||
| int & | sp, | |||
| bvec | color, | |||
| int | a | |||
| ) | [static] |
| void text_endcolumns | ( | ) |
| void text_pos | ( | const char * | str, | |
| int | cursor, | |||
| int & | cx, | |||
| int & | cy, | |||
| int | maxwidth | |||
| ) |
| void text_startcolumns | ( | ) |
| int text_visible | ( | const char * | str, | |
| int | hitx, | |||
| int | hity, | |||
| int | maxwidth | |||
| ) |
| int text_width | ( | const char * | str | ) |
| int VIRTW |
1.5.7.1