/
hu_stuff.h
110 lines (86 loc) · 2.81 KB
/
hu_stuff.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
// DESCRIPTION: Head up display
//
//-----------------------------------------------------------------------------
#ifndef __COMMON_HU_STUFF_H__
#define __COMMON_HU_STUFF_H__
#include "doomsday.h"
#ifdef __JDOOM__
# include "d_event.h"
# include "r_defs.h"
#elif __JHERETIC__
//# include "jheretic.h"
#elif __JHEXEN__
//#include "jHexen/mn_def.h"
#elif __JSTRIFE__
# include "mn_def.h"
#endif
enum {
ALIGN_LEFT = 0,
ALIGN_CENTER,
ALIGN_RIGHT
};
//
// Globally visible constants.
//
#define HU_FONTSTART '!' // the first font characters
#define HU_FONTEND '_' // the last font characters
// Calculate # of glyphs in font.
#define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1)
//
// HEADS UP TEXT
//
// A combination of patch data and its lump number.
typedef struct dpatch_s {
int width, height;
int leftoffset, topoffset;
int lump;
} dpatch_t;
// The fonts.
extern dpatch_t hu_font[HU_FONTSIZE];
extern dpatch_t hu_font_a[HU_FONTSIZE], hu_font_b[HU_FONTSIZE];
void HU_Init(void);
void HU_Ticker(void);
void R_CachePatch(dpatch_t * dp, char *name);
// Implements patch replacement.
void WI_DrawPatch(int x, int y, float r, float g, float b, float a,
int lump, char *altstring, boolean builtin, int halign);
void WI_DrawParamText(int x, int y, char *string, dpatch_t * defFont,
float defRed, float defGreen, float defBlue,
float defAlpha, boolean defCase, boolean defTypeIn,
int halign);
int M_DrawText(int x, int y, boolean direct, char *string);
int M_StringWidth(char *string, dpatch_t * font);
int M_StringHeight(char *string, dpatch_t * font);
void Draw_BeginZoom(float s, float originX, float originY);
void Draw_EndZoom(void);
#define HU_BROADCAST 5
#define HU_TITLEX 0
#define HU_TITLEY (167 - SHORT(hu_font[0].height))
extern boolean message_noecho;
#ifdef __JDOOM__
// Plutonia and TNT map names.
extern char *mapnamesp[32], *mapnamest[32];
#endif
void HU_Start(void);
void HU_UnloadData(void);
boolean HU_Responder(event_t *ev);
void HU_Drawer(void);
char HU_dequeueChatChar(void);
void HU_Erase(void);
#endif