Move font struct definitions to header
This commit is contained in:
parent
77081af42b
commit
0df2b60b86
3 changed files with 20 additions and 19 deletions
20
draw.h
20
draw.h
|
@ -21,7 +21,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// draw.h -- these are the only functions outside the refresh allowed
|
||||
// to touch the vid buffer
|
||||
|
||||
typedef struct drawfont_s drawfont_t ;
|
||||
#include "gl_model.h" // for shader_t
|
||||
|
||||
typedef struct {
|
||||
int ofsx; //x offset into the texture
|
||||
int ofsy; //y offset into the texture
|
||||
int A; //Width of whitespace to the left of the char
|
||||
int B; //Width of the char's pixels
|
||||
int C; //Width of the whiretspace to the right of the char
|
||||
} drawchar_t;
|
||||
|
||||
typedef struct drawfont_s {
|
||||
char name[64];
|
||||
drawchar_t metrics[256];
|
||||
shader_t *shader;
|
||||
int width; //width of the font texture
|
||||
int height; //height of the font texture
|
||||
int charHeight; //height of a single character
|
||||
} drawfont_t;
|
||||
|
||||
|
||||
void Draw_Init (void);
|
||||
void Draw_Character (int x, int y, int num);
|
||||
|
|
17
gl_draw.c
17
gl_draw.c
|
@ -242,23 +242,6 @@ void Draw_String (int x, int y, char *str)
|
|||
}
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
int ofsx; //x offset into the texture
|
||||
int ofsy; //y offset into the texture
|
||||
int A; //Width of whitespace to the left of the char
|
||||
int B; //Width of the char's pixels
|
||||
int C; //Width of the whiretspace to the right of the char
|
||||
} drawchar_t;
|
||||
|
||||
typedef struct drawfont_s {
|
||||
char name[64];
|
||||
drawchar_t metrics[256];
|
||||
shader_t *shader;
|
||||
int width; //width of the font texture
|
||||
int height; //height of the font texture
|
||||
int charHeight; //height of a single character
|
||||
} drawfont_t;
|
||||
|
||||
#define MAX_FONT_CACHE 128
|
||||
static drawfont_t fontCache[MAX_FONT_CACHE];
|
||||
static int numFonts = 0;
|
||||
|
|
|
@ -89,7 +89,7 @@ typedef struct qmelement_s
|
|||
|
||||
|
||||
typedef qwidget_t qmelement_t;
|
||||
typedef struct drawfont_s drawfont_t;
|
||||
|
||||
struct qwidget_s
|
||||
{
|
||||
qmtable_t *mtable;
|
||||
|
|
Loading…
Reference in a new issue