1 /** @file st_stuff.h Doom specific HUD. 2 * 3 * @authors Copyright © 2003-2017 Jaakko Keränen <jaakko.keranen@iki.fi> 4 * @authors Copyright © 2005-2015 Daniel Swanson <danij@dengine.net> 5 * @authors Copyright © 1993-1996 by id Software, Inc. 6 * 7 * @par License 8 * GPL: http://www.gnu.org/licenses/gpl.html 9 * 10 * <small>This program is free software; you can redistribute it and/or modify 11 * it under the terms of the GNU General Public License as published by the 12 * Free Software Foundation; either version 2 of the License, or (at your 13 * option) any later version. This program is distributed in the hope that it 14 * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 * Public License for more details. You should have received a copy of the GNU 17 * General Public License along with this program; if not, write to the Free 18 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 19 * 02110-1301 USA</small> 20 */ 21 22 #ifndef LIBDOOM_STUFF_H 23 #define LIBDOOM_STUFF_H 24 25 #ifndef __JDOOM__ 26 # error "Using jDoom headers without __JDOOM__" 27 #endif 28 29 #include "d_config.h" 30 31 // Size of statusbar, now sensitive for scaling. 32 #define ST_HEIGHT (32 * SCREEN_MUL) 33 #define ST_WIDTH (SCREENWIDTH) 34 #define ST_Y (SCREENHEIGHT - ST_HEIGHT) 35 36 #define ST_AUTOMAP_OBSCURE_TOLERANCE (.9999f) 37 38 #ifdef __cplusplus 39 # include "hu_lib.h" 40 41 class AutomapWidget; 42 class ChatWidget; 43 class PlayerLogWidget; 44 45 AutomapWidget *ST_TryFindAutomapWidget(int localPlayer); 46 ChatWidget *ST_TryFindChatWidget(int localPlayer); 47 PlayerLogWidget *ST_TryFindPlayerLogWidget(int localPlayer); 48 49 extern "C" { 50 #endif 51 52 /// Register the console commands, variables, etc..., of this module. 53 void ST_Register(void); 54 55 void ST_Init(void); 56 void ST_Shutdown(void); 57 58 int ST_Responder(event_t *ev); 59 void ST_Ticker(timespan_t ticLength); 60 void ST_Drawer(int localPlayer); 61 62 /** 63 * Returns the unique identifier of the active HUD configuration. 64 * 65 * (Each independent HUD configuration is attributed a unique identifier. The 66 * statusbar and fullscreen-HUD are examples of HUD configurations). 67 * 68 * @param localPlayer Player to lookup the active HUD for. 69 */ 70 int ST_ActiveHud(int localPlayer); 71 72 /// Call when the console player is spawned on each map. 73 void ST_Start(int localPlayer); 74 void ST_Stop(int localPlayer); 75 void HU_WakeWidgets(int localPlayer); 76 77 void ST_CloseAll(int localPlayer, dd_bool fast); 78 79 dd_bool ST_ChatIsActive(int localPlayer); 80 dd_bool ST_StatusBarIsActive(int localPlayer); 81 float ST_StatusBarShown(int localPlayer); 82 83 /** 84 * Post a message to the specified player's log. 85 * 86 * @param localPlayer Player number whose log to post to. 87 * @param flags @ref logMessageFlags 88 * @param text Message Text to be posted. Messages may use the same 89 * parameter control blocks as with the engine's Text rendering API. 90 */ 91 void ST_LogPost(int localPlayer, byte flags, char const *text); 92 93 /** 94 * Rewind the message log of the specified player, making the last few messages 95 * visible once again. 96 * 97 * @param localPlayer Player number whose message log to refresh. 98 */ 99 void ST_LogRefresh(int localPlayer); 100 101 /** 102 * Empty the message log of the specified player. 103 * 104 * @param localPlayer Player number whose message log to empty. 105 */ 106 void ST_LogEmpty(int localPlayer); 107 108 void ST_LogUpdateAlignment(void); 109 110 /** 111 * Start the automap. 112 */ 113 void ST_AutomapOpen(int localPlayer, dd_bool yes, dd_bool fast); 114 115 dd_bool ST_AutomapIsOpen(int localPlayer); 116 117 void ST_AutomapFollowMode(int localPlayer); 118 void ST_AutomapZoomMode(int localPlayer); 119 120 float ST_AutomapOpacity(int localPlayer); 121 122 /** 123 * Does the player's automap obscure this region completely? 124 * @pre Window dimensions use the fixed coordinate space {x} 0 - 320, {y} 0 - 200. 125 * 126 * @param localPlayer Player number whose automap to check. 127 * @param region Window region. 128 * 129 * @return @true= there is no point even partially visible. 130 */ 131 dd_bool ST_AutomapObscures2(int localPlayer, RectRaw const *region); 132 dd_bool ST_AutomapObscures(int localPlayer, int x, int y, int width, int height); 133 134 int ST_AutomapAddPoint(int localPlayer, coord_t x, coord_t y, coord_t z); 135 void ST_AutomapClearPoints(int localPlayer); 136 137 void ST_SetAutomapCameraRotation(int localPlayer, dd_bool on); 138 139 int ST_AutomapCheatLevel(int localPlayer); 140 void ST_SetAutomapCheatLevel(int localPlayer, int level); 141 void ST_CycleAutomapCheatLevel(int localPlayer); 142 143 void ST_RevealAutomap(int localPlayer, dd_bool on); 144 dd_bool ST_AutomapIsRevealed(int localPlayer); 145 146 /** 147 * Unhides the current HUD display if hidden. 148 * 149 * @param localPlayer Player whoose HUD to (maybe) unhide. 150 * @param event Event type trigger. 151 */ 152 void ST_HUDUnHide(int localPlayer, hueevent_t event); 153 154 #ifdef __cplusplus 155 } // extern "C" 156 #endif 157 158 #endif // LIBDOOM_STUFF_H 159