-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
st_stuff.h
147 lines (117 loc) · 4.25 KB
/
st_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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/**\file st_stuff.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2010 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2011 Daniel Swanson <danij@dengine.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
/**
* Statusbar code jHeretic - specific.
*
* Does the face/direction indicator animatin.
* Does palette indicators as well (red pain/berserk, bright pickup)
*/
#ifndef LIBHERETIC_STUFF_H
#define LIBHERETIC_STUFF_H
#ifndef __JHERETIC__
# error "Using jHeretic headers without __JHERETIC__"
#endif
#include "hu_lib.h"
#include "h_config.h"
// Size of statusbar, now sensitive for scaling.
#define ST_HEIGHT (42 * SCREEN_MUL)
#define ST_WIDTH (SCREENWIDTH)
#define ST_Y (SCREENHEIGHT - ST_HEIGHT)
#define ST_AUTOMAP_OBSCURE_TOLERANCE (.9999f)
// Called by startup code.
void ST_Register(void);
void ST_Init(void);
void ST_Shutdown(void);
int ST_Responder(event_t* ev);
void ST_Ticker(timespan_t ticLength);
void ST_Drawer(int player);
void ST_Start(int player);
void ST_Stop(int player);
void ST_doPaletteStuff(int player);
uiwidget_t* ST_UIChatForPlayer(int player);
uiwidget_t* ST_UILogForPlayer(int player);
uiwidget_t* ST_UIAutomapForPlayer(int player);
boolean ST_ChatIsActive(int player);
/**
* Post a message to the specified player's log.
*
* @param player Player (local) number whose log to post to.
* @param flags @see logMessageFlags
* @param text Message Text to be posted. Messages may use the same
* paramater control blocks as with the engine's Text rendering API.
*/
void ST_LogPost(int player, byte flags, const char* text);
/**
* Rewind the message log of the specified player, making the last few messages
* visible once again.
*
* @param player Local player number whose message log to refresh.
*/
void ST_LogRefresh(int player);
/**
* Empty the message log of the specified player.
*
* @param player Local player number whose message log to empty.
*/
void ST_LogEmpty(int player);
void ST_LogUpdateAlignment(void);
void ST_LogPostVisibilityChangeNotification(void);
/**
* Start the automap.
*/
void ST_AutomapOpen(int player, boolean yes, boolean fast);
boolean ST_AutomapIsActive(int player);
void ST_ToggleAutomapPanMode(int player);
void ST_ToggleAutomapMaxZoom(int player);
float ST_AutomapOpacity(int player);
/**
* Does the player's automap obscure this region completely?
* \assume: Window dimensions are in a fixed coordinate space {x} 0 - 320, {y} 0 - 200.
*
* @param playerid Index of the player whose map to check.
* @param x Top left X coordinate.
* @param y Top left Y coordinate.
* @param w Width.
* @param h Height.
*
* @return @true= there is no point even partially visible.
*/
boolean ST_AutomapWindowObscures(int player, int x, int y, int w, int h);
int ST_AutomapAddPoint(int player, float x, float y, float z);
void ST_AutomapClearPoints(int player);
boolean ST_AutomapPointOrigin(int player, int point, float* x, float* y, float* z);
void ST_SetAutomapCameraRotation(int player, boolean on);
int ST_AutomapCheatLevel(int player);
void ST_SetAutomapCheatLevel(int player, int level);
void ST_CycleAutomapCheatLevel(int player);
void ST_RevealAutomap(int player, boolean on);
boolean ST_AutomapHasReveal(int player);
void ST_RebuildAutomap(int player);
/// Call when it might be neccessary for the hud to unhide.
void ST_HUDUnHide(int player, hueevent_t ev);
void ST_FlashCurrentItem(int player);
D_CMD(ChatOpen);
D_CMD(ChatAction);
D_CMD(ChatSendMacro);
#endif /* LIBHERETIC_STUFF_H */