| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | --- HISTORICAL COMMENTS FOLLOW --- |
| 19 | |
| 20 | * $Logfile: /DescentIII/Main/hudmessage.cpp $ |
| 21 | * $Revision: 89 $ |
| 22 | * $Date: 9/22/01 7:14p $ |
| 23 | * $Author: Kevin $ |
| 24 | * |
| 25 | * <file to correctly render hud messages> |
| 26 | * |
| 27 | * $Log: /DescentIII/Main/hudmessage.cpp $ |
| 28 | * |
| 29 | * 89 9/22/01 7:14p Kevin |
| 30 | * Print confirmation messages when sending a private message |
| 31 | * |
| 32 | * 88 4/19/00 5:31p Matt |
| 33 | * From Duane for 1.4 |
| 34 | * Set m_limit class member variable if it had not been properly |
| 35 | * initialized |
| 36 | * |
| 37 | * 87 7/16/99 11:17a Samir |
| 38 | * dirty rects for multi line persistent hud messages. |
| 39 | * |
| 40 | * 86 7/13/99 12:22a Jeff |
| 41 | * correctly externed HudInputMessage, increased size for new tokenized |
| 42 | * text macros |
| 43 | * |
| 44 | * 85 7/09/99 3:49p Jason |
| 45 | * fixed bugs/issues for patch |
| 46 | * |
| 47 | * 84 7/07/99 12:50a Jeff |
| 48 | * if a hud message gets broken up while typing, the state is saved and |
| 49 | * continued on the next line |
| 50 | * |
| 51 | * 83 5/20/99 5:48p Matt |
| 52 | * Added a HUD item flag, for use by Dallas-created items, that makes a |
| 53 | * HUD item persisitent for the duration of one level, but get cleared |
| 54 | * between levels. |
| 55 | * |
| 56 | * 82 5/17/99 6:29p Jeff |
| 57 | * only filter hud messages in multiplayer |
| 58 | * |
| 59 | * 81 5/17/99 6:22p Jeff |
| 60 | * added filtered HUD messages |
| 61 | * |
| 62 | * 80 5/17/99 5:48p Samir |
| 63 | * base scrolling off of time key is down. |
| 64 | * |
| 65 | * 79 5/10/99 10:22p Ardussi |
| 66 | * changes to compile on Mac |
| 67 | * |
| 68 | * 78 5/08/99 12:54p Matt |
| 69 | * When a HUD message is split over multiple lines, copy the color |
| 70 | * information to subsequent lines. |
| 71 | * |
| 72 | * 77 5/08/99 1:06a Samir |
| 73 | * create dirty rect when clearing persistent hud messages. |
| 74 | * |
| 75 | * 76 5/07/99 10:48p Matt |
| 76 | * Made add-HUD functions return true if the message was added, and false |
| 77 | * if it wasn't (because the previous message was the same). |
| 78 | * |
| 79 | * 75 5/05/99 6:36p Matt |
| 80 | * Added queue system for persistent HUD messages. |
| 81 | * |
| 82 | * 74 5/01/99 5:52p Samir |
| 83 | * removed RenderHudMessages, and redid RenderHUDMessages so it did what |
| 84 | * RenderHudMessages did, resets on screen hud messages. The HUD message |
| 85 | * console is resetted in ResetGameMessages. |
| 86 | * |
| 87 | * 73 4/28/99 2:14a Samir |
| 88 | * save and load Game messages in savegame. |
| 89 | * |
| 90 | * 72 4/27/99 12:32p Samir |
| 91 | * maybe fixed crash when resetting message lists. |
| 92 | * |
| 93 | * 71 4/24/99 10:38p Samir |
| 94 | * cleaned up hud text problems in 'small mode' |
| 95 | * |
| 96 | * 70 4/24/99 8:43p Samir |
| 97 | * when shrinking screen hud messages get rendered in black region. |
| 98 | * |
| 99 | * 69 4/17/99 6:15p Samir |
| 100 | * replaced gr.h with grdefs.h and fixed resulting compile bugs. |
| 101 | * |
| 102 | * 68 4/14/99 12:35p Samir |
| 103 | * localization issues. |
| 104 | * |
| 105 | * 67 4/14/99 2:50a Jeff |
| 106 | * fixed some case mismatched #includes |
| 107 | * |
| 108 | * 66 4/09/99 3:04p Kevin |
| 109 | * Set hud message length back to 40 -- I think I meant to change |
| 110 | * something else when I changed this. |
| 111 | * |
| 112 | * 65 3/10/99 2:25p Kevin |
| 113 | * Save/Load and Demo file fixes |
| 114 | * |
| 115 | * 64 3/05/99 3:01p Jeff |
| 116 | * fixed crash when a persistant message is displayed during a IGC |
| 117 | * |
| 118 | * 63 3/05/99 12:46p Matt |
| 119 | * Set text flags & alpha before drawing scrolling text and input message. |
| 120 | * |
| 121 | * 62 3/04/99 8:09p Samir |
| 122 | * when inputting text, don't use formatted print function to output it to |
| 123 | * screen. There's still a problem on the end though when printing out the |
| 124 | * message. |
| 125 | * |
| 126 | * 61 3/04/99 7:39p Matt |
| 127 | * Added sound effects to FreeSpace-style persistent HUD messages. |
| 128 | * |
| 129 | * 60 3/04/99 6:15p Matt |
| 130 | * Added groovy FreeSpace briefing-style text effect to the persistent HUD |
| 131 | * message. |
| 132 | * |
| 133 | * 59 3/03/99 5:34p Matt |
| 134 | * Added fade-out for goal complete messages |
| 135 | * |
| 136 | * 58 3/02/99 11:41p Kevin |
| 137 | * Fixed dedicated server |
| 138 | * |
| 139 | * 57 3/02/99 3:30p Samir |
| 140 | * took out ddio_KeyFlush which caused shift characters to be silenced |
| 141 | * when inputting message. This did not affect other key things as far as |
| 142 | * I know. |
| 143 | * |
| 144 | * 56 2/19/99 2:18p Samir |
| 145 | * AddGameMessage implicitly figures out time and level of message. |
| 146 | * |
| 147 | * 55 2/18/99 5:27p Matt |
| 148 | * Added color parm to AddPersistentHUDMessage() and fixed the timeout. |
| 149 | * |
| 150 | * 54 2/16/99 6:16p Jeff |
| 151 | * pause hud messages when in cinematics |
| 152 | * |
| 153 | * 53 2/16/99 3:52p Kevin |
| 154 | * Hud messages wrap on 70% of the screen width instead of 100% |
| 155 | * |
| 156 | * 52 2/09/99 6:52p Jeff |
| 157 | * implemented 'typing inidcator' in multiplayer...players that are typing |
| 158 | * messages have an icon on them |
| 159 | * |
| 160 | * 51 2/04/99 7:17p Jeff |
| 161 | * put in sounds for hud messages |
| 162 | * |
| 163 | * 50 1/31/99 7:26p Matt |
| 164 | * Renamed a bunch of functions to have HUD capitalized |
| 165 | * |
| 166 | * 49 1/29/99 6:34p Samir |
| 167 | * fixed booboo. |
| 168 | * |
| 169 | * 48 1/29/99 6:32p Samir |
| 170 | * implemented hud scrollback for hud messages. |
| 171 | * |
| 172 | * 47 1/29/99 2:08p Jeff |
| 173 | * localization |
| 174 | * |
| 175 | * 46 1/28/99 6:17p Jason |
| 176 | * added markers |
| 177 | * |
| 178 | * 45 1/27/99 6:05p Samir |
| 179 | * added scrollback for game messages on HUD. |
| 180 | * |
| 181 | * 44 1/23/99 2:33p Kevin |
| 182 | * Increased hud message length, because we clip to the real width of the |
| 183 | * hud. Also fixed up the multiline code a bit |
| 184 | * |
| 185 | * 43 1/22/99 4:19p Kevin |
| 186 | * Fixed some multiline hud stuff |
| 187 | * |
| 188 | * 42 1/22/99 4:06p Jeff |
| 189 | * added hud messages that can be sent to just teammates or individual |
| 190 | * people |
| 191 | * |
| 192 | * 41 1/21/99 11:43p Kevin |
| 193 | * Hud messages will now span multiple lines if needed (except for |
| 194 | * blinking) |
| 195 | * |
| 196 | * 40 1/08/99 2:55p Samir |
| 197 | * Ripped out OSIRIS1. |
| 198 | * |
| 199 | * 39 12/14/98 11:06a Jason |
| 200 | * changes for 1.1 |
| 201 | * |
| 202 | * 38 12/10/98 4:58p Jason |
| 203 | * fixed off-by-one hudmessage problem |
| 204 | * |
| 205 | * 37 11/01/98 1:57a Jeff |
| 206 | * converted the vsprintf calls to use the Pvsprintf, which is a safe |
| 207 | * vsprintf, no buffer overflows allowed |
| 208 | * |
| 209 | * 36 10/29/98 11:59a Jason |
| 210 | * fixed hud message issues |
| 211 | * |
| 212 | * 35 10/21/98 5:02p Jeff |
| 213 | * removed player from HUD if in observer nide |
| 214 | * |
| 215 | * 34 10/19/98 11:22p Samir |
| 216 | * made AddPersistentMessage screen res friendly. |
| 217 | * |
| 218 | * 33 10/17/98 2:46p Jason |
| 219 | * automatically start new line when eol is reaching in DoInputMessage |
| 220 | * |
| 221 | * 32 10/14/98 4:26p Samir |
| 222 | * added persistent hud messages. |
| 223 | * |
| 224 | * 31 10/13/98 8:44p Samir |
| 225 | * move outgoing message prompt down. |
| 226 | * |
| 227 | * 30 10/07/98 6:55p Jason |
| 228 | * made message rollback work |
| 229 | * |
| 230 | * 29 10/07/98 10:58a Jason |
| 231 | * flushed the key buffer when pressing escape while entering hud message |
| 232 | * |
| 233 | * 28 10/06/98 5:45p Kevin |
| 234 | * Added new configuration for demo |
| 235 | * |
| 236 | * 27 10/05/98 11:08a Jason |
| 237 | * implemented player message log |
| 238 | * |
| 239 | * 26 9/30/98 4:50p Jeff |
| 240 | * fixed mprintf if a hud message is too long |
| 241 | * |
| 242 | * 25 9/15/98 4:31p Jason |
| 243 | * added more functionality for the dedicated server |
| 244 | * |
| 245 | * 24 9/14/98 6:28p Jason |
| 246 | * first pass at getting dedicated server working |
| 247 | * |
| 248 | * 23 9/08/98 10:28a Samir |
| 249 | * added function to reset hud messages. |
| 250 | * |
| 251 | * 22 8/17/98 10:39a Jeff |
| 252 | * fixed bug with buffer length for hud messages |
| 253 | * |
| 254 | * 21 8/15/98 10:50p Matt |
| 255 | * Changed comment |
| 256 | * |
| 257 | * 20 8/13/98 3:10p Jeff |
| 258 | * key flush when done typing a hud message |
| 259 | * |
| 260 | * 19 7/28/98 3:17p Jason |
| 261 | * fixed buffer overrun problem |
| 262 | * |
| 263 | * 18 6/16/98 10:53a Jeff |
| 264 | * |
| 265 | * 17 5/05/98 5:35p Jason |
| 266 | * took off stupid drop shadow |
| 267 | * |
| 268 | * 16 4/23/98 4:13a Samir |
| 269 | * new hud system. |
| 270 | * |
| 271 | * 15 4/06/98 2:54p Jason |
| 272 | * yet more multiplayer changes |
| 273 | * |
| 274 | * 14 3/23/98 7:37p Jason |
| 275 | * added colored hud messages |
| 276 | * |
| 277 | * 13 3/23/98 4:51p Jason |
| 278 | * incremental checkin for multiplay |
| 279 | * |
| 280 | * 12 3/16/98 6:41p Jason |
| 281 | * added user definable messages to multiplayer |
| 282 | * |
| 283 | * 11 3/16/98 3:53p Jason |
| 284 | * added hud input message stuff |
| 285 | * |
| 286 | * 10 2/06/98 5:45p Samir |
| 287 | * Use hud font now. |
| 288 | * |
| 289 | * 9 1/19/98 4:37p Jason |
| 290 | * made hud message time longer |
| 291 | * |
| 292 | * 8 1/12/98 7:07p Samir |
| 293 | * Hud messages are in the briefing font for now. |
| 294 | * |
| 295 | * 7 1/12/98 5:23p Samir |
| 296 | * New hud font for messages. |
| 297 | * |
| 298 | * 6 12/29/97 5:47p Samir |
| 299 | * New text system and took out refs to Game_viewport. |
| 300 | * |
| 301 | * 5 12/16/97 4:27p Jason |
| 302 | * fixed time wrapping problem |
| 303 | * |
| 304 | * 4 8/29/97 5:42p Jason |
| 305 | * fixed hud rendering problems |
| 306 | * |
| 307 | * 6 4/25/97 10:49a Jason |
| 308 | * made timer stuff work with Gametime instead of timer_GetTime |
| 309 | * |
| 310 | * 5 3/05/97 3:03p Jason |
| 311 | * added blinking messages |
| 312 | * |
| 313 | * 4 3/04/97 12:58p Jason |
| 314 | * made hud messages scroll and fade |
| 315 | * |
| 316 | * 3 3/04/97 11:58a Jason |
| 317 | * checked in for Samir to debug |
| 318 | * |
| 319 | * 2 2/13/97 4:12p Jason |
| 320 | * added hud message test |
| 321 | * |
| 322 | * $NoKeywords: $ |
| 323 | */ |
| 324 | |
| 325 | #include <cstdarg> |
| 326 | #include <cstdio> |
| 327 | |
| 328 | #include <stdlib.h> |
| 329 | #include <string.h> |
| 330 | #include <ctype.h> |
| 331 | #include "grdefs.h"cxx . . $ `<file>/lib/grdefs.h`/ |
| 332 | #include "hud.h"cxx . . $ `<file>/Descent3/hud.h`/ |
| 333 | #include "game.h"cxx . . $ `<file>/Descent3/game.h`/ |
| 334 | #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/ |
| 335 | #include "gamefont.h"cxx . . $ `<file>/Descent3/gamefont.h`/ |
| 336 | #include "newui.h"cxx . . $ `<file>/Descent3/newui.h`/ |
| 337 | #include "multi.h"cxx . . $ `<file>/Descent3/multi.h`/ |
| 338 | #include "player.h"cxx . . $ `<file>/Descent3/player.h`/ |
| 339 | #include "game2dll.h"cxx . . $ `<file>/lib/game2dll.h`/ |
| 340 | #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/ |
| 341 | #include "dedicated_server.h"cxx . . $ `<file>/lib/dedicated_server.h`/ |
| 342 | #include "AppConsole.h"cxx . . $ `<file>/lib/AppConsole.h`/ |
| 343 | #include "demofile.h"cxx . . $ `<file>/lib/demofile.h`/ |
| 344 | #include "mem.h"cxx . . $ `<file>/mem/mem.h`/ |
| 345 | #include "textaux.h"cxx . . $ `<file>/lib/textaux.h`/ |
| 346 | #include "3d.h"cxx . . $ `<file>/lib/3d.h`/ |
| 347 | #include "marker.h"cxx . . $ `<file>/Descent3/marker.h`/ |
| 348 | #include "controls.h"cxx . . $ `<file>/Descent3/controls.h`/ |
| 349 | #include "Mission.h"cxx . . $ `<file>/Descent3/Mission.h`/ |
| 350 | #include "sounds.h"cxx . . $ `<file>/Descent3/sounds.h`/ |
| 351 | #include "hlsoundlib.h"cxx . . $ `<file>/sndlib/hlsoundlib.h`/ |
| 352 | #include "args.h"cxx . . $ `<file>/Descent3/args.h`/ |
| 353 | |
| 354 | #define HUD_MESSAGE_NORMALcxx . . $ `Descent3/hudmessage.cpp:354:9`! 0 |
| 355 | #define HUD_MESSAGE_BLINKINGcxx . . $ `Descent3/hudmessage.cpp:355:9`! 1 |
| 356 | |
| 357 | #define HUD_MESSAGE_NONEcxx . . $ `Descent3/hudmessage.cpp:357:9`! 0 |
| 358 | #define HUD_MESSAGE_GENERALcxx . . $ `Descent3/hudmessage.cpp:358:9`! 1 |
| 359 | #define HUD_MESSAGE_TEAMcxx . . $ `Descent3/hudmessage.cpp:359:9`! 2 |
| 360 | |
| 361 | // How long the message stays up for (in seconds) |
| 362 | #define HUD_MESSAGE_TIMEcxx . . $ `Descent3/hudmessage.cpp:362:9`! 5 |
| 363 | // How long the message scrolls for (in seconds) |
| 364 | #define HUD_SCROLL_TIMEcxx . . $ `Descent3/hudmessage.cpp:364:9`! .5 |
| 365 | |
| 366 | char HudInputMessagecxx . . $ HudInputMessage.[MAX_HUD_INPUT_LENcxx . . $ `Descent3/hud.h:317:9`!]; |
| 367 | int Doing_input_messagecxx . . $ Doing_input_message. = HUD_MESSAGE_NONEcxx . . $ `Descent3/hudmessage.cpp:357:9`!; |
| 368 | int HudInputMessageLencxx . . $ HudInputMessageLen. = 0; |
| 369 | static t_dirty_rectcxx . . $ t_dirty_rect# HUD_inmsg_dirty_rectcxx . . $ HUD_inmsg_dirty_rect.; |
| 370 | |
| 371 | static char HUD_messagescxx . . $ HUD_messages.[MAX_HUD_MESSAGEScxx . . $ `Descent3/hud.h:258:9`!][HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`!]; |
| 372 | static int HUD_message_typecxx . . $ HUD_message_type.[MAX_HUD_MESSAGEScxx . . $ `Descent3/hud.h:258:9`!]; |
| 373 | static ddgr_colorcxx . . $ ddgr_color# HUD_message_colorcxx . . $ HUD_message_color.[MAX_HUD_MESSAGEScxx . . $ `Descent3/hud.h:258:9`!]; |
| 374 | int Num_hud_messagescxx . . $ Num_hud_messages. = 0; |
| 375 | static int Hud_scroll_offsetcxx . . $ Hud_scroll_offset. = 0; |
| 376 | static t_dirty_rectcxx . . $ t_dirty_rect# HUD_msg_dirty_rectcxx . . $ HUD_msg_dirty_rect.; |
| 377 | |
| 378 | static float Hud_timercxx . . $ Hud_timer. = 0.0f; |
| 379 | |
| 380 | static uint8_tcxx . . $ uint8_t# Hud_persistent_msg_idcxx . . $ Hud_persistent_msg_id. = HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!; |
| 381 | static float Hud_persistent_msg_timercxx . . $ Hud_persistent_msg_timer. = 0.0f; |
| 382 | static int Hud_persistent_msg_flagscxx . . $ Hud_persistent_msg_flags. = 0; |
| 383 | static int Hud_persistent_msg_current_lencxx . . $ Hud_persistent_msg_current_len.; |
| 384 | static float Hud_persistent_msg_char_timercxx . . $ Hud_persistent_msg_char_timer.; |
| 385 | static float Hud_persistent_msg_id2cxx . . $ Hud_persistent_msg_id2. = HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!; |
| 386 | static int Hud_persistent_msg_sound_handlecxx . . $ Hud_persistent_msg_sound_handle. = SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!; |
| 387 | static t_dirty_rectcxx . . $ t_dirty_rect# HUD_persist_dirty_rectcxx . . $ HUD_persist_dirty_rect.[2]; |
| 388 | |
| 389 | tHUDItemcxx . . $ tHUDItem# *GetHUDItemcxx . . $ GetHUDItem(59e21a775e1fa362).(int id); |
| 390 | |
| 391 | // game message console |
| 392 | MsgListConsolecxx . . $ MsgListConsole# Game_msg_concxx . . $ Game_msg_con.; |
| 393 | static tMsgListcxx . . $ tMsgList# Game_msg_listcxx . . $ Game_msg_list.; |
| 394 | static bool Game_msg_con_viscxx . . $ Game_msg_con_vis. = false; |
| 395 | |
| 396 | // hud message console |
| 397 | MsgListConsolecxx . . $ MsgListConsole# HUD_msg_concxx . . $ HUD_msg_con.; |
| 398 | static tMsgListcxx . . $ tMsgList# HUD_msg_listcxx . . $ HUD_msg_list.; |
| 399 | static bool HUD_msg_con_viscxx . . $ HUD_msg_con_vis. = false; |
| 400 | static bool Hud_messages_pausedcxx . . $ Hud_messages_paused. = false; |
| 401 | |
| 402 | #define GAME_MSGCON_Wcxx . . $ `Descent3/hudmessage.cpp:402:9`! 416 |
| 403 | #define GAME_MSGCON_Hcxx . . $ `Descent3/hudmessage.cpp:403:9`! 256 |
| 404 | #define GAME_MSGCON_Xcxx . . $ `Descent3/hudmessage.cpp:404:9`! ((Max_window_w - GAME_MSGCON_Wcxx . . $ `Descent3/hudmessage.cpp:402:9`!) / 2) |
| 405 | #define GAME_MSGCON_Ycxx . . $ `Descent3/hudmessage.cpp:405:9`! ((Max_window_h - GAME_MSGCON_Hcxx . . $ `Descent3/hudmessage.cpp:403:9`!) / 2) |
| 406 | |
| 407 | // This function takes a HUD messages, ensures it isn't too long, and if it is, it correctly fixes it |
| 408 | static void CorrectHudMessagecxx . . $ CorrectHudMessage(fda57c8427c60377).(char *str); |
| 409 | |
| 410 | /////////////////////////////////////////////////////////////////////////////// |
| 411 | // Functions |
| 412 | |
| 413 | // prints a string onto the debug consle |
| 414 | static void AddMessageToRollbackcxx . . $ AddMessageToRollback(fda57c8427c60377).(char *msg) { HUD_msg_listcxx . . $ HUD_msg_list..addcxx . . $ tMsgList#add(8b3ed2aaeef03f3f).(msg); } |
| 415 | |
| 416 | // Adds a single line to the hud message list |
| 417 | // Returns true if message added, or false if message not (because the previous message was the same) |
| 418 | static bool AddLineToHUDMessagescxx . . $ AddLineToHUDMessages(952e37fc5ba10d29).(char *temp_message, ddgr_colorcxx . . $ ddgr_color# color = -1); |
| 419 | bool AddLineToHUDMessagescxx . . $ AddLineToHUDMessages(952e37fc5ba10d29).(char *temp_message, ddgr_colorcxx . . $ ddgr_color# color) { |
| 420 | if (Num_hud_messagescxx . . $ Num_hud_messages. > 0 && !strcmp(temp_message, HUD_messagescxx . . $ HUD_messages.[Num_hud_messagescxx . . $ Num_hud_messages. - 1])) |
| 421 | return 0; // this is the same message as before, don't print it twice! |
| 422 | |
| 423 | if (Dedicated_servercxx . . $ Dedicated_server.) { |
| 424 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("*%s\n", temp_message); |
| 425 | return 1; |
| 426 | } |
| 427 | |
| 428 | AddMessageToRollbackcxx . . $ AddMessageToRollback(fda57c8427c60377).(temp_message); |
| 429 | |
| 430 | if (color == -1) |
| 431 | color = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 255, 0); |
| 432 | |
| 433 | if (Num_hud_messagescxx . . $ Num_hud_messages. == MAX_HUD_MESSAGEScxx . . $ `Descent3/hud.h:258:9`!) { |
| 434 | // Get rid of top message |
| 435 | |
| 436 | for (int i = 1; i < MAX_HUD_MESSAGEScxx . . $ `Descent3/hud.h:258:9`!; i++) { |
| 437 | strcpy(HUD_messagescxx . . $ HUD_messages.[i - 1], HUD_messagescxx . . $ HUD_messages.[i]); |
| 438 | HUD_message_typecxx . . $ HUD_message_type.[i - 1] = HUD_message_typecxx . . $ HUD_message_type.[i]; |
| 439 | HUD_message_colorcxx . . $ HUD_message_color.[i - 1] = HUD_message_colorcxx . . $ HUD_message_color.[i]; |
| 440 | } |
| 441 | |
| 442 | Num_hud_messagescxx . . $ Num_hud_messages.--; |
| 443 | |
| 444 | Hud_scroll_offsetcxx . . $ Hud_scroll_offset. = 0; |
| 445 | |
| 446 | if (!Hud_messages_pausedcxx . . $ Hud_messages_paused.) |
| 447 | Hud_timercxx . . $ Hud_timer. = Gametimecxx . . $ Gametime.; |
| 448 | } |
| 449 | |
| 450 | if (Num_hud_messagescxx . . $ Num_hud_messages. == 0 && !Hud_messages_pausedcxx . . $ Hud_messages_paused.) |
| 451 | Hud_timercxx . . $ Hud_timer. = Gametimecxx . . $ Gametime.; |
| 452 | |
| 453 | CorrectHudMessagecxx . . $ CorrectHudMessage(fda57c8427c60377).(temp_message); |
| 454 | |
| 455 | strcpy(HUD_messagescxx . . $ HUD_messages.[Num_hud_messagescxx . . $ Num_hud_messages.], temp_message); |
| 456 | HUD_message_typecxx . . $ HUD_message_type.[Num_hud_messagescxx . . $ Num_hud_messages.] = HUD_MESSAGE_NORMALcxx . . $ `Descent3/hudmessage.cpp:354:9`!; |
| 457 | |
| 458 | HUD_message_colorcxx . . $ HUD_message_color.[Num_hud_messagescxx . . $ Num_hud_messages.] = color; |
| 459 | |
| 460 | Num_hud_messagescxx . . $ Num_hud_messages.++; |
| 461 | |
| 462 | return 1; |
| 463 | } |
| 464 | |
| 465 | // Adds line, splitting if too long |
| 466 | // Returns true if line added |
| 467 | static bool AddMultipleLinesToHUDMessagescxx . . $ AddMultipleLinesToHUDMessages(952e37fc5ba10d29).(char *temp_message, ddgr_colorcxx . . $ ddgr_color# color = -1); |
| 468 | bool AddMultipleLinesToHUDMessagescxx . . $ AddMultipleLinesToHUDMessages(952e37fc5ba10d29).(char *temp_message, ddgr_colorcxx . . $ ddgr_color# color) { |
| 469 | char ourstr[HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2]; |
| 470 | char *p; |
| 471 | // char word[HUD_MESSAGE_LENGTH*2]; |
| 472 | char nextword[HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2]; |
| 473 | static char thisline[HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2] = ""; |
| 474 | thisline[0] = '\0'; |
| 475 | strcpy(ourstr, temp_message); |
| 476 | p = strtok(ourstr, " "); |
| 477 | bool added = 0; |
| 478 | while (p) { |
| 479 | strcat(thisline, p); |
| 480 | strcat(thisline, " "); |
| 481 | // strcpy(word,p); |
| 482 | |
| 483 | p = strtok(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, " "); |
| 484 | if (p) { |
| 485 | strcpy(nextword, p); |
| 486 | if ((grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(thisline) + grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(nextword)) > (Game_window_wcxx . . $ Game_window_w. * .7)) { |
| 487 | if (thisline[strlen(thisline) - 1] == ' ') |
| 488 | thisline[strlen(thisline) - 1] = '\0'; |
| 489 | added |= AddLineToHUDMessagescxx . . $ AddLineToHUDMessages(952e37fc5ba10d29).(thisline, color); |
| 490 | |
| 491 | // Scan for color information in the string we just added |
| 492 | char *c = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, *c2; |
| 493 | c2 = strchr(thisline, '\1'); |
| 494 | while (c2) { |
| 495 | c = c2; |
| 496 | c2 = strchr(c2 + 4, '\1'); |
| 497 | } |
| 498 | if (c) { // found one |
| 499 | for (int i = 0; i < 4; i++) |
| 500 | thisline[i] = c[i]; |
| 501 | thisline[4] = 0; |
| 502 | } else |
| 503 | thisline[0] = '\0'; |
| 504 | } |
| 505 | p = nextword; |
| 506 | } |
| 507 | } |
| 508 | if (thisline[strlen(thisline) - 1] == ' ') |
| 509 | thisline[strlen(thisline) - 1] = '\0'; |
| 510 | if (thisline[0]) |
| 511 | added |= AddLineToHUDMessagescxx . . $ AddLineToHUDMessages(952e37fc5ba10d29).(thisline, color); |
| 512 | |
| 513 | return added; |
| 514 | } |
| 515 | |
| 516 | // adds a colored hud message to the list |
| 517 | // Returns true if message added, or false if message not (because the previous message was the same) |
| 518 | bool AddColoredHUDMessagecxx . . $ AddColoredHUDMessage(7778decf30f5fc42).(ddgr_colorcxx . . $ ddgr_color# color, const char *format, ...) { |
| 519 | std::va_listcxx . . $ std/va_list# args; |
| 520 | char *message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 521 | char *last_message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 522 | char temp_message[HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2]; |
| 523 | |
| 524 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(args, format); |
| 525 | std::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(temp_message, HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2, format, args); |
| 526 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(args); |
| 527 | |
| 528 | if (Demo_flagscxx . . $ Demo_flags. == DF_RECORDINGcxx . . $ `lib/demofile.h:122:9`!) { |
| 529 | DemoWriteHudMessagecxx . . $ DemoWriteHudMessage(40674f1824b31f9).(color, false, temp_message); |
| 530 | } |
| 531 | |
| 532 | if (Dedicated_servercxx . . $ Dedicated_server.) { |
| 533 | return AddLineToHUDMessagescxx . . $ AddLineToHUDMessages(952e37fc5ba10d29).(temp_message, color); |
| 534 | } |
| 535 | |
| 536 | return AddMultipleLinesToHUDMessagescxx . . $ AddMultipleLinesToHUDMessages(952e37fc5ba10d29).(temp_message, color); |
| 537 | } |
| 538 | |
| 539 | // Adds a HUD message (similar to AddColoredHUDMessage), however can be filtered out by |
| 540 | // a "-playermessages" command line. |
| 541 | bool AddFilteredColoredHUDMessagecxx . . $ AddFilteredColoredHUDMessage(7778decf30f5fc42).(ddgr_colorcxx . . $ ddgr_color# color, const char *format, ...) { |
| 542 | static int8_t checked_command_line = -1; |
| 543 | |
| 544 | if (checked_command_line == -1) { |
| 545 | if (FindArgcxx . . $ FindArg(5c4306d8553b3696).("-playermessages") != 0) { |
| 546 | checked_command_line = 1; |
| 547 | } else { |
| 548 | checked_command_line = 0; |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`! && checked_command_line) |
| 553 | return false; // filter this message |
| 554 | |
| 555 | std::va_listcxx . . $ std/va_list# args; |
| 556 | char *message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 557 | char *last_message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 558 | char temp_message[HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2]; |
| 559 | |
| 560 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(args, format); |
| 561 | std::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(temp_message, HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2, format, args); |
| 562 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(args); |
| 563 | |
| 564 | if (Demo_flagscxx . . $ Demo_flags. == DF_RECORDINGcxx . . $ `lib/demofile.h:122:9`!) { |
| 565 | DemoWriteHudMessagecxx . . $ DemoWriteHudMessage(40674f1824b31f9).(color, false, temp_message); |
| 566 | } |
| 567 | |
| 568 | if (Dedicated_servercxx . . $ Dedicated_server.) { |
| 569 | return AddLineToHUDMessagescxx . . $ AddLineToHUDMessages(952e37fc5ba10d29).(temp_message, color); |
| 570 | } |
| 571 | |
| 572 | return AddMultipleLinesToHUDMessagescxx . . $ AddMultipleLinesToHUDMessages(952e37fc5ba10d29).(temp_message, color); |
| 573 | } |
| 574 | |
| 575 | // Adds a HUD message (similar to AddHUDMessage), however can be filtered out by |
| 576 | // a "-playermessages" command line. |
| 577 | bool AddFilteredHUDMessagecxx . . $ AddFilteredHUDMessage(f90d95ab21fd6d97).(const char *format, ...) { |
| 578 | static int8_t checked_command_line = -1; |
| 579 | |
| 580 | if (checked_command_line == -1) { |
| 581 | if (FindArgcxx . . $ FindArg(5c4306d8553b3696).("-playermessages") != 0) { |
| 582 | checked_command_line = 1; |
| 583 | } else { |
| 584 | checked_command_line = 0; |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`! && checked_command_line) |
| 589 | return false; // filter this message |
| 590 | |
| 591 | std::va_listcxx . . $ std/va_list# args; |
| 592 | char *message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 593 | char *last_message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 594 | char temp_message[HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2]; |
| 595 | |
| 596 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(args, format); |
| 597 | std::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(temp_message, HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2, format, args); |
| 598 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(args); |
| 599 | |
| 600 | if (Demo_flagscxx . . $ Demo_flags. == DF_RECORDINGcxx . . $ `lib/demofile.h:122:9`!) { |
| 601 | DemoWriteHudMessagecxx . . $ DemoWriteHudMessage(40674f1824b31f9).(0, false, temp_message); |
| 602 | } |
| 603 | |
| 604 | if (Dedicated_servercxx . . $ Dedicated_server.) { |
| 605 | return AddLineToHUDMessagescxx . . $ AddLineToHUDMessages(952e37fc5ba10d29).(temp_message); |
| 606 | } |
| 607 | |
| 608 | return AddMultipleLinesToHUDMessagescxx . . $ AddMultipleLinesToHUDMessages(952e37fc5ba10d29).(temp_message); |
| 609 | } |
| 610 | |
| 611 | // Adds a message to the HUD message list. If the list is already full, punt the |
| 612 | // top one and move the others up |
| 613 | // Returns true if message added, or false if message not (because the previous message was the same) |
| 614 | bool AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(const char *format, ...) { |
| 615 | std::va_listcxx . . $ std/va_list# args; |
| 616 | char *message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 617 | char *last_message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 618 | char temp_message[HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2]; |
| 619 | |
| 620 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(args, format); |
| 621 | std::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(temp_message, HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2, format, args); |
| 622 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(args); |
| 623 | |
| 624 | if (Demo_flagscxx . . $ Demo_flags. == DF_RECORDINGcxx . . $ `lib/demofile.h:122:9`!) { |
| 625 | DemoWriteHudMessagecxx . . $ DemoWriteHudMessage(40674f1824b31f9).(0, false, temp_message); |
| 626 | } |
| 627 | |
| 628 | if (Dedicated_servercxx . . $ Dedicated_server.) { |
| 629 | return AddLineToHUDMessagescxx . . $ AddLineToHUDMessages(952e37fc5ba10d29).(temp_message); |
| 630 | } |
| 631 | |
| 632 | return AddMultipleLinesToHUDMessagescxx . . $ AddMultipleLinesToHUDMessages(952e37fc5ba10d29).(temp_message); |
| 633 | } |
| 634 | |
| 635 | // Adds a blinking message to the HUD message list. If the list is already full, punt the |
| 636 | // top one and move the others up |
| 637 | // Returns true if message added, or false if message not (because the previous message was the same) |
| 638 | bool AddBlinkingHUDMessagecxx . . $ AddBlinkingHUDMessage(f90d95ab21fd6d97).(const char *format, ...) { |
| 639 | std::va_listcxx . . $ std/va_list# args; |
| 640 | char *message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 641 | char *last_message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 642 | char temp_message[HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2]; |
| 643 | |
| 644 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(args, format); |
| 645 | std::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(temp_message, HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2, format, args); |
| 646 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(args); |
| 647 | |
| 648 | if (Demo_flagscxx . . $ Demo_flags. == DF_RECORDINGcxx . . $ `lib/demofile.h:122:9`!) { |
| 649 | DemoWriteHudMessagecxx . . $ DemoWriteHudMessage(40674f1824b31f9).(0, true, temp_message); |
| 650 | } |
| 651 | |
| 652 | CorrectHudMessagecxx . . $ CorrectHudMessage(fda57c8427c60377).(temp_message); |
| 653 | |
| 654 | if (Num_hud_messagescxx . . $ Num_hud_messages. > 0 && !strcmp(temp_message, HUD_messagescxx . . $ HUD_messages.[Num_hud_messagescxx . . $ Num_hud_messages. - 1])) |
| 655 | return 0; // this is the same message as before, don't print it twice! |
| 656 | |
| 657 | if (Num_hud_messagescxx . . $ Num_hud_messages. == MAX_HUD_MESSAGEScxx . . $ `Descent3/hud.h:258:9`!) { |
| 658 | // Get rid of top message |
| 659 | |
| 660 | for (int i = 1; i < MAX_HUD_MESSAGEScxx . . $ `Descent3/hud.h:258:9`!; i++) { |
| 661 | strcpy(HUD_messagescxx . . $ HUD_messages.[i - 1], HUD_messagescxx . . $ HUD_messages.[i]); |
| 662 | HUD_message_typecxx . . $ HUD_message_type.[i - 1] = HUD_message_typecxx . . $ HUD_message_type.[i]; |
| 663 | } |
| 664 | |
| 665 | Num_hud_messagescxx . . $ Num_hud_messages.--; |
| 666 | |
| 667 | Hud_scroll_offsetcxx . . $ Hud_scroll_offset. = 0; |
| 668 | |
| 669 | if (!Hud_messages_pausedcxx . . $ Hud_messages_paused.) |
| 670 | Hud_timercxx . . $ Hud_timer. = Gametimecxx . . $ Gametime.; |
| 671 | } |
| 672 | |
| 673 | if (Num_hud_messagescxx . . $ Num_hud_messages. == 0 && !Hud_messages_pausedcxx . . $ Hud_messages_paused.) |
| 674 | Hud_timercxx . . $ Hud_timer. = Gametimecxx . . $ Gametime.; |
| 675 | |
| 676 | strcpy(HUD_messagescxx . . $ HUD_messages.[Num_hud_messagescxx . . $ Num_hud_messages.], temp_message); |
| 677 | HUD_message_typecxx . . $ HUD_message_type.[Num_hud_messagescxx . . $ Num_hud_messages.] = HUD_MESSAGE_BLINKINGcxx . . $ `Descent3/hudmessage.cpp:355:9`!; |
| 678 | |
| 679 | Num_hud_messagescxx . . $ Num_hud_messages.++; |
| 680 | |
| 681 | return 1; |
| 682 | } |
| 683 | |
| 684 | // This function takes a HUD messages, ensures it isn't too long, and if it is, it correctly fixes it |
| 685 | void CorrectHudMessagecxx . . $ CorrectHudMessage(fda57c8427c60377).(char *str) { |
| 686 | // if (strlen(str)<=(HUD_MESSAGE_LENGTH-1)) |
| 687 | if (grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(str) <= Game_window_wcxx . . $ Game_window_w.) |
| 688 | return; |
| 689 | |
| 690 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Message '%s' is too long!\n", str); |
| 691 | // the line is too long, we need to shorten it, but when we do, we need to make sure that it isn't in the middle |
| 692 | // of a color (0x01 0xFF 0xFF 0xFF) |
| 693 | str[HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! - 1] = '\0'; |
| 694 | |
| 695 | // go back the last 3 characters and look for an 0x01, if we find one, than make it an '\0' to cut the string |
| 696 | for (int i = (HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! - 2); i >= (HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! - 4); i--) { |
| 697 | if (str[i] == 0x01) { |
| 698 | // we found a color start |
| 699 | str[i] = '\0'; |
| 700 | } |
| 701 | } |
| 702 | } |
| 703 | |
| 704 | // Called when the player hit the Multiplayer message key. |
| 705 | // Puts the player in input mode, or if already inputting resets the hud input message. |
| 706 | void StartHUDInputMessagecxx . . $ StartHUDInputMessage(49f6e7a06ebc5aa8).() { |
| 707 | HudInputMessagecxx . . $ HudInputMessage.[0] = 0; |
| 708 | Doing_input_messagecxx . . $ Doing_input_message. = HUD_MESSAGE_GENERALcxx . . $ `Descent3/hudmessage.cpp:358:9`!; |
| 709 | HudInputMessageLencxx . . $ HudInputMessageLen. = 0; |
| 710 | SuspendControlscxx . . $ SuspendControls(49f6e7a06ebc5aa8).(); |
| 711 | MultiSendRequestTypeIconcxx . . $ MultiSendRequestTypeIcon(b45ddcbc8423892c).(true); |
| 712 | } |
| 713 | |
| 714 | // Called when the player hits the Multiplayer team-message key. |
| 715 | // Puts the player in input mode, or if already inputting resets the hud input message. |
| 716 | void StartTeamHUDInputMessagecxx . . $ StartTeamHUDInputMessage(49f6e7a06ebc5aa8).() { |
| 717 | // make sure that HUD_MESSAGE_TEAM is only set for team games |
| 718 | if (!Team_gamecxx . . $ Team_game.) { |
| 719 | StartHUDInputMessagecxx . . $ StartHUDInputMessage(49f6e7a06ebc5aa8).(); |
| 720 | return; |
| 721 | } |
| 722 | |
| 723 | HudInputMessagecxx . . $ HudInputMessage.[0] = 0; |
| 724 | Doing_input_messagecxx . . $ Doing_input_message. = HUD_MESSAGE_TEAMcxx . . $ `Descent3/hudmessage.cpp:359:9`!; |
| 725 | HudInputMessageLencxx . . $ HudInputMessageLen. = 0; |
| 726 | SuspendControlscxx . . $ SuspendControls(49f6e7a06ebc5aa8).(); |
| 727 | } |
| 728 | |
| 729 | // Given a hud message, it will determine who should get this message. |
| 730 | // "name: message" = the player with the callsign name should get the message |
| 731 | // "team: message" = the Player_num's team should get the message |
| 732 | // "0-32: message" = the player with player num of 0-32 should get the message |
| 733 | // all other messages are for everyone else |
| 734 | // |
| 735 | // returns the starting position of the real message (past the :) |
| 736 | // destination will receive one of the following values: |
| 737 | // MULTI_SEND_MESSAGE_ALL = everyone should get this message |
| 738 | // MULTI_SEND_MESSAGE_RED_TEAM = only red team (0) should get this message |
| 739 | // MULTI_SEND_MESSAGE_BLUE_TEAM = only blue team (1) should get this message |
| 740 | // MULTI_SEND_MESSAGE_GREEN_TEAM = only green team (2) should get this message |
| 741 | // MULTI_SEND_MESSAGE_YELLOW_TEAM = only yellow team (3) should get this message |
| 742 | // 0-32 = player num of the player to get the message |
| 743 | const char *GetMessageDestinationcxx . . $ GetMessageDestination(6a735779416056db).(const char *message, int *destination) { |
| 744 | int to_who = MULTI_SEND_MESSAGE_ALLcxx . . $ `Descent3/multi.h:717:9`!; |
| 745 | const char *ret = message; |
| 746 | |
| 747 | // see if there is a colon in the string, and match that up with a name |
| 748 | const char *colon_pos = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 749 | colon_pos = strchr(message, ':'); |
| 750 | if (colon_pos > message) { |
| 751 | // this message might be for one person in particular |
| 752 | char buffer[256]; |
| 753 | memcpy(buffer, message, (colon_pos - message)); |
| 754 | buffer[colon_pos - message] = '\0'; |
| 755 | |
| 756 | // see if buffer is a number, in which case just send to that pnum |
| 757 | char *p = buffer; |
| 758 | bool is_num = true; |
| 759 | while (*p) { |
| 760 | if (!isdigit(*p)) { |
| 761 | is_num = false; |
| 762 | break; |
| 763 | } |
| 764 | p++; |
| 765 | } |
| 766 | |
| 767 | if (is_num) { |
| 768 | to_who = atoicxx . . $ atoi(f5ecf3191ed0cd93).(buffer); |
| 769 | if (to_who < 0 || to_who >= MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!) |
| 770 | to_who = MULTI_SEND_MESSAGE_ALLcxx . . $ `Descent3/multi.h:717:9`!; |
| 771 | } else { |
| 772 | int possible_match = -1; |
| 773 | int name_len = strlen(buffer); |
| 774 | int call_len; |
| 775 | |
| 776 | // it's not a number, see if it matches any of the player names |
| 777 | for (int pn = 0; pn < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!; pn++) { |
| 778 | if (NetPlayerscxx . . $ NetPlayers.[pn].flagscxx . . $ netplayer#flags. & NPF_CONNECTEDcxx . . $ `Descent3/multi_external.h:165:9`! && NetPlayerscxx . . $ NetPlayers.[pn].sequencecxx . . $ netplayer#sequence. == NETSEQ_PLAYINGcxx . . $ `Descent3/multi_external.h:161:9`!) { |
| 779 | |
| 780 | call_len = strlen(Playerscxx . . $ Players.[pn].callsigncxx . . $ player#callsign.); |
| 781 | |
| 782 | if (call_len > name_len) { |
| 783 | // try to match a partial name |
| 784 | if (!strnicmpcxx . . $ `linux/linux_fix.h:44:9`!(Players[pn].callsign, buffer, name_len)) { |
| 785 | // possible match |
| 786 | possible_match = pn; |
| 787 | } |
| 788 | } else if (call_len == name_len) { |
| 789 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(Players[pn].callsign, buffer)) { |
| 790 | // match! |
| 791 | to_who = pn; |
| 792 | break; |
| 793 | } |
| 794 | } |
| 795 | } // end if |
| 796 | } // end for |
| 797 | |
| 798 | if (to_who < 0 && possible_match != -1) { |
| 799 | to_who = possible_match; |
| 800 | } |
| 801 | } |
| 802 | |
| 803 | if (to_who == MULTI_SEND_MESSAGE_ALLcxx . . $ `Descent3/multi.h:717:9`!) { |
| 804 | // see if it is for the team |
| 805 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(buffer, "team")) { |
| 806 | switch (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].teamcxx . . $ player#team.) { |
| 807 | case 0: |
| 808 | to_who = MULTI_SEND_MESSAGE_RED_TEAMcxx . . $ `Descent3/multi.h:718:9`!; |
| 809 | break; |
| 810 | case 1: |
| 811 | to_who = MULTI_SEND_MESSAGE_BLUE_TEAMcxx . . $ `Descent3/multi.h:719:9`!; |
| 812 | break; |
| 813 | case 2: |
| 814 | to_who = MULTI_SEND_MESSAGE_GREEN_TEAMcxx . . $ `Descent3/multi.h:720:9`!; |
| 815 | break; |
| 816 | case 3: |
| 817 | to_who = MULTI_SEND_MESSAGE_YELLOW_TEAMcxx . . $ `Descent3/multi.h:721:9`!; |
| 818 | break; |
| 819 | } |
| 820 | } |
| 821 | } |
| 822 | |
| 823 | ret = colon_pos + 1; |
| 824 | } |
| 825 | |
| 826 | *destination = to_who; |
| 827 | return ret; |
| 828 | } |
| 829 | |
| 830 | // Sends off the input message the player was typing |
| 831 | void SendOffHUDInputMessagecxx . . $ SendOffHUDInputMessage(49f6e7a06ebc5aa8).() { |
| 832 | if (Doing_input_messagecxx . . $ Doing_input_message. == HUD_MESSAGE_NONEcxx . . $ `Descent3/hudmessage.cpp:357:9`!) |
| 833 | return; |
| 834 | |
| 835 | if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) { |
| 836 | if (HudInputMessagecxx . . $ HudInputMessage.[0] == '$') // special command |
| 837 | { |
| 838 | DLLInfocxx . . $ DLLInfo..input_stringcxx . . $ dllinfo#input_string. = HudInputMessagecxx . . $ HudInputMessage.; |
| 839 | CallGameDLLcxx . . $ CallGameDLL(32ca0c0c7dbc2fcf).(EVT_CLIENT_INPUT_STRINGcxx . . $ `lib/d3events.h:106:9`!, &DLLInfocxx . . $ DLLInfo.); |
| 840 | } else { |
| 841 | char str[255]; |
| 842 | snprintf(str, sizeof(str), TXT_HUDSAYcxx . . $ `Descent3/stringtable.h:148:9`!, Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].callsigncxx . . $ player#callsign., HudInputMessagecxx . . $ HudInputMessage.); |
| 843 | |
| 844 | switch (Doing_input_messagecxx . . $ Doing_input_message.) { |
| 845 | case HUD_MESSAGE_GENERALcxx . . $ `Descent3/hudmessage.cpp:358:9`!: { |
| 846 | int to_who; |
| 847 | |
| 848 | const char *colon_pos = GetMessageDestinationcxx . . $ GetMessageDestination(6a735779416056db).(HudInputMessagecxx . . $ HudInputMessage., &to_who); |
| 849 | |
| 850 | if (to_who != MULTI_SEND_MESSAGE_ALLcxx . . $ `Descent3/multi.h:717:9`!) { |
| 851 | if (to_who < 0) { |
| 852 | // to a team |
| 853 | snprintf(str, sizeof(str), "[%s]: %s", Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].callsigncxx . . $ player#callsign., colon_pos); |
| 854 | } else { |
| 855 | // to a player |
| 856 | // cut out what's after the colon |
| 857 | snprintf(str, sizeof(str), "<%s>:%s", Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].callsigncxx . . $ player#callsign., colon_pos); |
| 858 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Sent private message to %s", Playerscxx . . $ Players.[to_who].callsigncxx . . $ player#callsign.); |
| 859 | } |
| 860 | } |
| 861 | |
| 862 | if (Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) |
| 863 | MultiSendMessageFromServercxx . . $ MultiSendMessageFromServer(99469d7ff9a1485a).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 128, 255), str, to_who); |
| 864 | else |
| 865 | MultiSendMessageToServercxx . . $ MultiSendMessageToServer(99469d7ff9a1485a).(0, str, to_who); |
| 866 | } break; |
| 867 | case HUD_MESSAGE_TEAMcxx . . $ `Descent3/hudmessage.cpp:359:9`!: { |
| 868 | int team = MULTI_SEND_MESSAGE_ALLcxx . . $ `Descent3/multi.h:717:9`!; |
| 869 | switch (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].teamcxx . . $ player#team.) { |
| 870 | case 0: |
| 871 | team = MULTI_SEND_MESSAGE_RED_TEAMcxx . . $ `Descent3/multi.h:718:9`!; |
| 872 | break; |
| 873 | case 1: |
| 874 | team = MULTI_SEND_MESSAGE_BLUE_TEAMcxx . . $ `Descent3/multi.h:719:9`!; |
| 875 | break; |
| 876 | case 2: |
| 877 | team = MULTI_SEND_MESSAGE_GREEN_TEAMcxx . . $ `Descent3/multi.h:720:9`!; |
| 878 | break; |
| 879 | case 3: |
| 880 | team = MULTI_SEND_MESSAGE_YELLOW_TEAMcxx . . $ `Descent3/multi.h:721:9`!; |
| 881 | break; |
| 882 | } |
| 883 | |
| 884 | if (team != MULTI_SEND_MESSAGE_ALLcxx . . $ `Descent3/multi.h:717:9`!) { |
| 885 | snprintf(str, sizeof(str), "[%s]: %s", Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].callsigncxx . . $ player#callsign., HudInputMessagecxx . . $ HudInputMessage.); |
| 886 | } |
| 887 | |
| 888 | if (Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) |
| 889 | MultiSendMessageFromServercxx . . $ MultiSendMessageFromServer(99469d7ff9a1485a).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 128, 255), str, team); |
| 890 | else |
| 891 | MultiSendMessageToServercxx . . $ MultiSendMessageToServer(99469d7ff9a1485a).(0, str, team); |
| 892 | } break; |
| 893 | } |
| 894 | } |
| 895 | } |
| 896 | HudInputMessagecxx . . $ HudInputMessage.[0] = 0; |
| 897 | HudInputMessageLencxx . . $ HudInputMessageLen. = 0; |
| 898 | |
| 899 | ddio_KeyFlushcxx . . $ ddio_KeyFlush(49f6e7a06ebc5aa8).(); |
| 900 | ResumeControlscxx . . $ ResumeControls(49f6e7a06ebc5aa8).(); |
| 901 | Doing_input_messagecxx . . $ Doing_input_message. = HUD_MESSAGE_NONEcxx . . $ `Descent3/hudmessage.cpp:357:9`!; |
| 902 | MultiSendRequestTypeIconcxx . . $ MultiSendRequestTypeIcon(b45ddcbc8423892c).(false); |
| 903 | } |
| 904 | |
| 905 | // Breaks up the input message so that if we overflow it starts on the next line nicely |
| 906 | // Returns the number of characters in the next line |
| 907 | int BreakupHUDInputMessagecxx . . $ BreakupHUDInputMessage(1ef8e6ec083aabb9).(char *str) { |
| 908 | int cur = 0; |
| 909 | int last_space = -1; |
| 910 | int len = strlen(HudInputMessagecxx . . $ HudInputMessage.); |
| 911 | |
| 912 | for (int i = 0; i < len; i++) { |
| 913 | if (HudInputMessagecxx . . $ HudInputMessage.[i] == ' ') |
| 914 | last_space = i; |
| 915 | } |
| 916 | |
| 917 | if (last_space == -1) { |
| 918 | return 0; |
| 919 | } |
| 920 | |
| 921 | int leftover_len = len - last_space; |
| 922 | int leftover_size = leftover_len - 1; |
| 923 | if (leftover_len > 0) { |
| 924 | int to_who; |
| 925 | const char *colon_pos = GetMessageDestinationcxx . . $ GetMessageDestination(6a735779416056db).(HudInputMessagecxx . . $ HudInputMessage., &to_who); |
| 926 | |
| 927 | if (to_who != MULTI_SEND_MESSAGE_ALLcxx . . $ `Descent3/multi.h:717:9`!) { |
| 928 | char to_who_text[64]; |
| 929 | int to_who_size; |
| 930 | |
| 931 | to_who_size = colon_pos - HudInputMessagecxx . . $ HudInputMessage. - 1; |
| 932 | strncpy(to_who_text, HudInputMessagecxx . . $ HudInputMessage., to_who_size); |
| 933 | to_who_text[to_who_size] = '\0'; |
| 934 | |
| 935 | sprintf(str, "%s:%s", to_who_text, &HudInputMessagecxx . . $ HudInputMessage.[last_space + 1]); |
| 936 | leftover_size = strlen(str); |
| 937 | } else { |
| 938 | strcpy(str, &HudInputMessagecxx . . $ HudInputMessage.[last_space + 1]); |
| 939 | } |
| 940 | } |
| 941 | |
| 942 | HudInputMessagecxx . . $ HudInputMessage.[last_space] = 0; |
| 943 | |
| 944 | return leftover_size; |
| 945 | } |
| 946 | |
| 947 | // Handles all incoming keys for an inputted hud message |
| 948 | void DoHUDInputMessageKeycxx . . $ DoHUDInputMessageKey(d4f767463ce0a6b3).(int key) { |
| 949 | if (key == KEY_F8cxx . . $ `ddio/ddio_common.h:289:9`!) { |
| 950 | StartHUDInputMessagecxx . . $ StartHUDInputMessage(49f6e7a06ebc5aa8).(); |
| 951 | return; |
| 952 | } |
| 953 | |
| 954 | if (Doing_input_messagecxx . . $ Doing_input_message. == HUD_MESSAGE_NONEcxx . . $ `Descent3/hudmessage.cpp:357:9`!) |
| 955 | return; |
| 956 | |
| 957 | // ddio_KeyFlush(); // took this out. screwed up shift-keys. don't need it anyway. |
| 958 | |
| 959 | if (key == KEY_ESCcxx . . $ `ddio/ddio_common.h:267:9`!) { |
| 960 | Doing_input_messagecxx . . $ Doing_input_message. = HUD_MESSAGE_NONEcxx . . $ `Descent3/hudmessage.cpp:357:9`!; |
| 961 | MultiSendRequestTypeIconcxx . . $ MultiSendRequestTypeIcon(b45ddcbc8423892c).(false); |
| 962 | Marker_messagecxx . . $ Marker_message. = 0; |
| 963 | HudInputMessagecxx . . $ HudInputMessage.[0] = 0; |
| 964 | HudInputMessageLencxx . . $ HudInputMessageLen. = 0; |
| 965 | ResumeControlscxx . . $ ResumeControls(49f6e7a06ebc5aa8).(); |
| 966 | } else if (key == KEY_BACKSPcxx . . $ `ddio/ddio_common.h:269:9`! || key == KEY_DELETEcxx . . $ `ddio/ddio_common.h:315:9`!) { |
| 967 | if (HudInputMessageLencxx . . $ HudInputMessageLen. > 0) |
| 968 | HudInputMessageLencxx . . $ HudInputMessageLen.--; |
| 969 | |
| 970 | HudInputMessagecxx . . $ HudInputMessage.[HudInputMessageLencxx . . $ HudInputMessageLen.] = 0; |
| 971 | } else if (key == KEY_ENTERcxx . . $ `ddio/ddio_common.h:268:9`!) { |
| 972 | if (Marker_messagecxx . . $ Marker_message.) { |
| 973 | DropMarkercxx . . $ DropMarker(fda57c8427c60377).(HudInputMessagecxx . . $ HudInputMessage.); |
| 974 | Doing_input_messagecxx . . $ Doing_input_message. = HUD_MESSAGE_NONEcxx . . $ `Descent3/hudmessage.cpp:357:9`!; |
| 975 | MultiSendRequestTypeIconcxx . . $ MultiSendRequestTypeIcon(b45ddcbc8423892c).(false); |
| 976 | Marker_messagecxx . . $ Marker_message. = 0; |
| 977 | HudInputMessagecxx . . $ HudInputMessage.[0] = 0; |
| 978 | HudInputMessageLencxx . . $ HudInputMessageLen. = 0; |
| 979 | ResumeControlscxx . . $ ResumeControls(49f6e7a06ebc5aa8).(); |
| 980 | } else |
| 981 | SendOffHUDInputMessagecxx . . $ SendOffHUDInputMessage(49f6e7a06ebc5aa8).(); |
| 982 | } else { |
| 983 | int ascii = ddio_KeyToAsciicxx . . $ ddio_KeyToAscii(7864480464b09eea).(key); |
| 984 | if (isdigit(ascii) || isalpha(ascii) || ispunct(ascii) || isspace(ascii)) { |
| 985 | if (Marker_messagecxx . . $ Marker_message.) { |
| 986 | if (HudInputMessageLencxx . . $ HudInputMessageLen. >= (MAX_MARKER_MESSAGE_LENGTHcxx . . $ `Descent3/marker.h:24:9`! - 2)) |
| 987 | return; |
| 988 | } |
| 989 | |
| 990 | HudInputMessagecxx . . $ HudInputMessage.[HudInputMessageLencxx . . $ HudInputMessageLen.++] = ascii; |
| 991 | HudInputMessagecxx . . $ HudInputMessage.[HudInputMessageLencxx . . $ HudInputMessageLen.] = 0; |
| 992 | |
| 993 | if (!Marker_messagecxx . . $ Marker_message. && HudInputMessageLencxx . . $ HudInputMessageLen. >= (MAX_HUD_INPUT_LENcxx . . $ `Descent3/hud.h:317:9`! - 1)) { |
| 994 | // Break up our outgoing message onto the next line if need be |
| 995 | char str[MAX_HUD_INPUT_LENcxx . . $ `Descent3/hud.h:317:9`!]; |
| 996 | int str_len; |
| 997 | int old_style = Doing_input_messagecxx . . $ Doing_input_message.; |
| 998 | |
| 999 | str_len = BreakupHUDInputMessagecxx . . $ BreakupHUDInputMessage(1ef8e6ec083aabb9).(str); |
| 1000 | SendOffHUDInputMessagecxx . . $ SendOffHUDInputMessage(49f6e7a06ebc5aa8).(); |
| 1001 | |
| 1002 | switch (old_style) { |
| 1003 | case HUD_MESSAGE_TEAMcxx . . $ `Descent3/hudmessage.cpp:359:9`!: |
| 1004 | StartTeamHUDInputMessagecxx . . $ StartTeamHUDInputMessage(49f6e7a06ebc5aa8).(); |
| 1005 | break; |
| 1006 | case HUD_MESSAGE_GENERALcxx . . $ `Descent3/hudmessage.cpp:358:9`!: |
| 1007 | StartHUDInputMessagecxx . . $ StartHUDInputMessage(49f6e7a06ebc5aa8).(); |
| 1008 | break; |
| 1009 | } |
| 1010 | |
| 1011 | if (str_len > 0) { |
| 1012 | strcpy(HudInputMessagecxx . . $ HudInputMessage., str); |
| 1013 | HudInputMessageLencxx . . $ HudInputMessageLen. = str_len; |
| 1014 | } |
| 1015 | } |
| 1016 | } |
| 1017 | } |
| 1018 | } |
| 1019 | |
| 1020 | // Simply renders the hud input message if there is one |
| 1021 | void RenderHUDInputMessagecxx . . $ RenderHUDInputMessage(49f6e7a06ebc5aa8).() { |
| 1022 | char message[255]; |
| 1023 | int y, x, lw; |
| 1024 | |
| 1025 | ddgr_colorcxx . . $ ddgr_color# text_color = HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!; |
| 1026 | grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(text_color); |
| 1027 | |
| 1028 | if (Doing_input_messagecxx . . $ Doing_input_message. == HUD_MESSAGE_TEAMcxx . . $ `Descent3/hudmessage.cpp:359:9`!) { |
| 1029 | snprintf(message, sizeof(message), TXT_HUD_TEAMSAYcxx . . $ `Descent3/stringtable.h:586:9`!, HudInputMessagecxx . . $ HudInputMessage.); |
| 1030 | } else { |
| 1031 | if (Marker_messagecxx . . $ Marker_message.) |
| 1032 | snprintf(message, sizeof(message), TXT_HUD_MARKERcxx . . $ `Descent3/stringtable.h:587:9`!, HudInputMessagecxx . . $ HudInputMessage.); |
| 1033 | else |
| 1034 | snprintf(message, sizeof(message), TXT_MESSAGEcxx . . $ `Descent3/stringtable.h:149:9`!, HudInputMessagecxx . . $ HudInputMessage.); |
| 1035 | } |
| 1036 | |
| 1037 | grtext_SetAlphacxx . . $ grtext_SetAlpha(ac50b47256ae7414).(HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!); |
| 1038 | grtext_SetFlagscxx . . $ grtext_SetFlags(d4f767463ce0a6b3).(0); |
| 1039 | |
| 1040 | // RenderHUDTextNoFormatFlags(HUDTEXT_CENTERED, HUD_COLOR, HUD_ALPHA, 1, 0, y, message); |
| 1041 | lw = grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(message); |
| 1042 | x = (Game_window_wcxx . . $ Game_window_w. - lw) / 2; |
| 1043 | if (Small_hud_flagcxx . . $ Small_hud_flag.) { |
| 1044 | y = Max_window_hcxx . . $ Max_window_h. - (int)(40 * ((float)Max_window_hcxx . . $ Max_window_h. / (float)DEFAULT_HUD_HEIGHTcxx . . $ `Descent3/hud.h:262:9`!)); |
| 1045 | HUD_inmsg_dirty_rectcxx . . $ HUD_inmsg_dirty_rect..setcxx . . $ t_dirty_rect#set(6f3a90be462c391b).(x, y, x + lw, y + grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!)); |
| 1046 | } else { |
| 1047 | y = (Game_window_hcxx . . $ Game_window_h. * 3 / 5) + Game_window_ycxx . . $ Game_window_y.; |
| 1048 | } |
| 1049 | grtext_Putscxx . . $ grtext_Puts(3139f19a0dbb8edf).(x, y, message); |
| 1050 | } |
| 1051 | |
| 1052 | int testcolorcxx . . $ testcolor. = 200; |
| 1053 | |
| 1054 | float Hud_messages_paused_saved_Gametimecxx . . $ Hud_messages_paused_saved_Gametime.; |
| 1055 | |
| 1056 | void HUDPauseMessagescxx . . $ HUDPauseMessages(49f6e7a06ebc5aa8).(void) { |
| 1057 | if (Hud_messages_pausedcxx . . $ Hud_messages_paused.) |
| 1058 | return; |
| 1059 | |
| 1060 | Hud_messages_pausedcxx . . $ Hud_messages_paused. = true; |
| 1061 | Hud_messages_paused_saved_Gametimecxx . . $ Hud_messages_paused_saved_Gametime. = Gametimecxx . . $ Gametime.; |
| 1062 | } |
| 1063 | |
| 1064 | void HUDUnpauseMessagescxx . . $ HUDUnpauseMessages(49f6e7a06ebc5aa8).(void) { |
| 1065 | if (!Hud_messages_pausedcxx . . $ Hud_messages_paused.) |
| 1066 | return; |
| 1067 | |
| 1068 | Hud_messages_pausedcxx . . $ Hud_messages_paused. = false; |
| 1069 | float time_paused = Gametimecxx . . $ Gametime. - Hud_messages_paused_saved_Gametimecxx . . $ Hud_messages_paused_saved_Gametime.; |
| 1070 | |
| 1071 | Hud_timercxx . . $ Hud_timer. += time_paused; |
| 1072 | } |
| 1073 | |
| 1074 | // Renders all the messages we have in the message list. If HUD_MESSAGE_TIME has |
| 1075 | // elapsed, then punt the oldest message and move the others up one |
| 1076 | void RenderScrollingHUDMessagescxx . . $ RenderScrollingHUDMessages(49f6e7a06ebc5aa8).() { |
| 1077 | if (Hud_messages_pausedcxx . . $ Hud_messages_paused.) |
| 1078 | return; |
| 1079 | |
| 1080 | int shade; |
| 1081 | int text_height; |
| 1082 | int16_t l, t, r, b; |
| 1083 | int i; |
| 1084 | |
| 1085 | // Check for wraps |
| 1086 | if (Gametimecxx . . $ Gametime. < Hud_timercxx . . $ Hud_timer.) |
| 1087 | Hud_timercxx . . $ Hud_timer. = Gametimecxx . . $ Gametime.; |
| 1088 | |
| 1089 | grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!); |
| 1090 | text_height = grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!); |
| 1091 | |
| 1092 | text_height += (3 * Hud_aspect_ycxx . . $ Hud_aspect_y.); // add this for a spacer |
| 1093 | |
| 1094 | if (Doing_input_messagecxx . . $ Doing_input_message. > HUD_MESSAGE_NONEcxx . . $ `Descent3/hudmessage.cpp:357:9`!) |
| 1095 | RenderHUDInputMessagecxx . . $ RenderHUDInputMessage(49f6e7a06ebc5aa8).(); |
| 1096 | |
| 1097 | if (Num_hud_messagescxx . . $ Num_hud_messages. == 0) |
| 1098 | return; |
| 1099 | |
| 1100 | l = (Small_hud_flagcxx . . $ Small_hud_flag.) ? (Max_window_wcxx . . $ Max_window_w. / 2) : (Game_window_wcxx . . $ Game_window_w. / 2); |
| 1101 | r = l; |
| 1102 | t = 0; |
| 1103 | b = 0; |
| 1104 | for (i = 0; i < Num_hud_messagescxx . . $ Num_hud_messages.; i++) { |
| 1105 | int x; |
| 1106 | |
| 1107 | if (HUD_message_typecxx . . $ HUD_message_type.[i] == HUD_MESSAGE_BLINKINGcxx . . $ `Descent3/hudmessage.cpp:355:9`!) { |
| 1108 | float blink_time = Gametimecxx . . $ Gametime.; |
| 1109 | int iblink = blink_time; |
| 1110 | float frac_blink = blink_time - iblink; |
| 1111 | |
| 1112 | float answer = frac_blink / .5; |
| 1113 | |
| 1114 | iblink = answer; |
| 1115 | |
| 1116 | if (iblink == 1 || iblink == 3) |
| 1117 | continue; |
| 1118 | } |
| 1119 | |
| 1120 | if (i == 0 && Hud_scroll_offsetcxx . . $ Hud_scroll_offset. != 0) { |
| 1121 | int scolor = text_height + Hud_scroll_offsetcxx . . $ Hud_scroll_offset.; |
| 1122 | shade = (255 * scolor) / text_height; |
| 1123 | } else |
| 1124 | shade = 255; |
| 1125 | |
| 1126 | char *message = HUD_messagescxx . . $ HUD_messages.[i]; |
| 1127 | int text_width = grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(message); |
| 1128 | int vp_width = Game_window_wcxx . . $ Game_window_w.; |
| 1129 | int y = (i * text_height) + Hud_scroll_offsetcxx . . $ Hud_scroll_offset.; |
| 1130 | |
| 1131 | if (HUD_message_typecxx . . $ HUD_message_type.[i] == HUD_MESSAGE_BLINKINGcxx . . $ `Descent3/hudmessage.cpp:355:9`!) { |
| 1132 | ddgr_colorcxx . . $ ddgr_color# text_color; |
| 1133 | text_color = (GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(shade, 0, 0)); |
| 1134 | grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(text_color); |
| 1135 | } else { |
| 1136 | ddgr_colorcxx . . $ ddgr_color# text_color; |
| 1137 | text_color = HUD_message_colorcxx . . $ HUD_message_color.[i]; |
| 1138 | grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(text_color); |
| 1139 | } |
| 1140 | |
| 1141 | grtext_SetAlphacxx . . $ grtext_SetAlpha(ac50b47256ae7414).(HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!); |
| 1142 | grtext_SetFlagscxx . . $ grtext_SetFlags(d4f767463ce0a6b3).(0); |
| 1143 | |
| 1144 | if (Small_hud_flagcxx . . $ Small_hud_flag.) { |
| 1145 | x = (Max_window_wcxx . . $ Max_window_w. - text_width) / 2; |
| 1146 | if (x < l) |
| 1147 | l = x; |
| 1148 | if ((x + text_width) > r) |
| 1149 | r = x + text_width; |
| 1150 | b += text_height; |
| 1151 | } else { |
| 1152 | x = (Game_window_wcxx . . $ Game_window_w. - text_width) / 2; |
| 1153 | } |
| 1154 | grtext_Putscxx . . $ grtext_Puts(3139f19a0dbb8edf).(x, y, message); |
| 1155 | } |
| 1156 | if (Small_hud_flagcxx . . $ Small_hud_flag. && (i > 0)) { |
| 1157 | HUD_msg_dirty_rectcxx . . $ HUD_msg_dirty_rect..setcxx . . $ t_dirty_rect#set(6f3a90be462c391b).(l, t, r, b); |
| 1158 | } |
| 1159 | |
| 1160 | // Now see if the topmost message is old |
| 1161 | |
| 1162 | float new_time = Gametimecxx . . $ Gametime.; |
| 1163 | |
| 1164 | if ((new_time - Hud_timercxx . . $ Hud_timer.) > HUD_MESSAGE_TIMEcxx . . $ `Descent3/hudmessage.cpp:362:9`!) { |
| 1165 | for (int i = 1; i < MAX_HUD_MESSAGEScxx . . $ `Descent3/hud.h:258:9`!; i++) { |
| 1166 | strcpy(HUD_messagescxx . . $ HUD_messages.[i - 1], HUD_messagescxx . . $ HUD_messages.[i]); |
| 1167 | HUD_message_typecxx . . $ HUD_message_type.[i - 1] = HUD_message_typecxx . . $ HUD_message_type.[i]; |
| 1168 | HUD_message_colorcxx . . $ HUD_message_color.[i - 1] = HUD_message_colorcxx . . $ HUD_message_color.[i]; |
| 1169 | } |
| 1170 | |
| 1171 | Num_hud_messagescxx . . $ Num_hud_messages.--; |
| 1172 | Hud_scroll_offsetcxx . . $ Hud_scroll_offset. = 0; |
| 1173 | Hud_timercxx . . $ Hud_timer. = new_time; |
| 1174 | |
| 1175 | } else if ((new_time - Hud_timercxx . . $ Hud_timer.) > (HUD_MESSAGE_TIMEcxx . . $ `Descent3/hudmessage.cpp:362:9`! - HUD_SCROLL_TIMEcxx . . $ `Descent3/hudmessage.cpp:364:9`!)) { |
| 1176 | // scroll |
| 1177 | |
| 1178 | float cur_scroll_time = HUD_MESSAGE_TIMEcxx . . $ `Descent3/hudmessage.cpp:362:9`! - HUD_SCROLL_TIMEcxx . . $ `Descent3/hudmessage.cpp:364:9`!; |
| 1179 | float cur_hud_time = (new_time - Hud_timercxx . . $ Hud_timer.) - cur_scroll_time; |
| 1180 | float fscroll; |
| 1181 | |
| 1182 | cur_hud_time /= HUD_SCROLL_TIMEcxx . . $ `Descent3/hudmessage.cpp:364:9`!; |
| 1183 | // cur_hud_time is now normalized from 0 to 1 |
| 1184 | // 0 represents not scrolled, 1 represents a total scroll |
| 1185 | |
| 1186 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(cur_hud_time >= 0 && cur_hud_time <= 1); |
| 1187 | |
| 1188 | fscroll = text_height * cur_hud_time; |
| 1189 | |
| 1190 | Hud_scroll_offsetcxx . . $ Hud_scroll_offset. = -fscroll; |
| 1191 | } |
| 1192 | } |
| 1193 | |
| 1194 | #define FADEOUT_TIMEcxx . . $ `Descent3/hudmessage.cpp:1194:9`! 0.5f // fades out over this amount of time |
| 1195 | #define CHAR_DELAYcxx . . $ `Descent3/hudmessage.cpp:1195:9`! 0.03f // delay between character |
| 1196 | |
| 1197 | // Renders all the messages we have in the message list. If HUD_MESSAGE_TIME has |
| 1198 | // elapsed, then punt the oldest message and move the others up one |
| 1199 | void RenderHUDMessagescxx . . $ RenderHUDMessages(49f6e7a06ebc5aa8).() { |
| 1200 | if (Hud_messages_pausedcxx . . $ Hud_messages_paused.) |
| 1201 | return; |
| 1202 | |
| 1203 | // Render & update the scrolling message list |
| 1204 | RenderScrollingHUDMessagescxx . . $ RenderScrollingHUDMessages(49f6e7a06ebc5aa8).(); |
| 1205 | |
| 1206 | // do persistent hud message system |
| 1207 | if (Hud_persistent_msg_idcxx . . $ Hud_persistent_msg_id. != HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!) { |
| 1208 | if (Hud_persistent_msg_timercxx . . $ Hud_persistent_msg_timer. != HUD_MSG_PERSISTENT_INFINITEcxx . . $ `Descent3/hud.h:311:9`!) { |
| 1209 | tHUDItemcxx . . $ tHUDItem# *item = GetHUDItemcxx . . $ GetHUDItem(59e21a775e1fa362).(Hud_persistent_msg_idcxx . . $ Hud_persistent_msg_id.); |
| 1210 | |
| 1211 | // Update time |
| 1212 | Hud_persistent_msg_timercxx . . $ Hud_persistent_msg_timer. -= Frametimecxx . . $ Frametime.; |
| 1213 | |
| 1214 | // Do fadeout |
| 1215 | if (Hud_persistent_msg_flagscxx . . $ Hud_persistent_msg_flags. & HPF_FADEOUTcxx . . $ `Descent3/hud.h:401:9`!) { |
| 1216 | if (Hud_persistent_msg_timercxx . . $ Hud_persistent_msg_timer. < FADEOUT_TIMEcxx . . $ `Descent3/hudmessage.cpp:1194:9`!) { |
| 1217 | item->alphacxx . . $ tHUDItem#alpha. = HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`! * Hud_persistent_msg_timercxx . . $ Hud_persistent_msg_timer. / FADEOUT_TIMEcxx . . $ `Descent3/hudmessage.cpp:1194:9`!; |
| 1218 | } |
| 1219 | } |
| 1220 | |
| 1221 | if (item && Small_hud_flagcxx . . $ Small_hud_flag.) { |
| 1222 | grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!); |
| 1223 | int16_t l = item->xcxx . . $ tHUDItem#x. * Max_window_wcxx . . $ Max_window_w. / DEFAULT_HUD_WIDTHcxx . . $ `Descent3/hud.h:261:9`!; |
| 1224 | int16_t t = item->ycxx . . $ tHUDItem#y. * Max_window_hcxx . . $ Max_window_h. / DEFAULT_HUD_HEIGHTcxx . . $ `Descent3/hud.h:262:9`!; |
| 1225 | int16_t r = l + grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(item->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.) + 10; |
| 1226 | int16_t b = t + grtext_GetTextHeightcxx . . $ grtext_GetTextHeight(5c4306d8553b3696).(item->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.); |
| 1227 | item->dirty_rectcxx . . $ tHUDItem#dirty_rect..setcxx . . $ t_dirty_rect#set(6f3a90be462c391b).(l, t, r, b); |
| 1228 | } |
| 1229 | |
| 1230 | // Do FreeSpace printing effect |
| 1231 | if (Hud_persistent_msg_id2cxx . . $ Hud_persistent_msg_id2. != HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!) { |
| 1232 | Hud_persistent_msg_char_timercxx . . $ Hud_persistent_msg_char_timer. -= Frametimecxx . . $ Frametime.; |
| 1233 | while (Hud_persistent_msg_char_timercxx . . $ Hud_persistent_msg_char_timer. < 0) { |
| 1234 | tHUDItemcxx . . $ tHUDItem# *item = GetHUDItemcxx . . $ GetHUDItem(59e21a775e1fa362).(Hud_persistent_msg_idcxx . . $ Hud_persistent_msg_id.); |
| 1235 | tHUDItemcxx . . $ tHUDItem# *item2 = GetHUDItemcxx . . $ GetHUDItem(59e21a775e1fa362).(Hud_persistent_msg_id2cxx . . $ Hud_persistent_msg_id2.); |
| 1236 | |
| 1237 | item->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.[Hud_persistent_msg_current_lencxx . . $ Hud_persistent_msg_current_len.] = item2->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.[0]; |
| 1238 | Hud_persistent_msg_current_lencxx . . $ Hud_persistent_msg_current_len.++; |
| 1239 | |
| 1240 | // Check for more chars |
| 1241 | if (!item->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.[Hud_persistent_msg_current_lencxx . . $ Hud_persistent_msg_current_len.]) { |
| 1242 | FreeHUDItemcxx . . $ FreeHUDItem(d4f767463ce0a6b3).(Hud_persistent_msg_id2cxx . . $ Hud_persistent_msg_id2.); |
| 1243 | Hud_persistent_msg_id2cxx . . $ Hud_persistent_msg_id2. = HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!; |
| 1244 | Sound_systemcxx . . $ Sound_system..StopSoundLoopingcxx . . $ hlsSystem#StopSoundLooping(d4f767463ce0a6b3).(Hud_persistent_msg_sound_handlecxx . . $ Hud_persistent_msg_sound_handle.); |
| 1245 | Hud_persistent_msg_sound_handlecxx . . $ Hud_persistent_msg_sound_handle. = SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!; |
| 1246 | break; // stop printing chars |
| 1247 | } else { // dp next char |
| 1248 | item2->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.[0] = item->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.[Hud_persistent_msg_current_lencxx . . $ Hud_persistent_msg_current_len.]; |
| 1249 | item->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.[Hud_persistent_msg_current_lencxx . . $ Hud_persistent_msg_current_len.] = 0; |
| 1250 | item2->xcxx . . $ tHUDItem#x. = item->xcxx . . $ tHUDItem#x. + RenderHUDGetTextLineWidthcxx . . $ RenderHUDGetTextLineWidth(5c4306d8553b3696).(item->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.); |
| 1251 | Hud_persistent_msg_char_timercxx . . $ Hud_persistent_msg_char_timer. += CHAR_DELAYcxx . . $ `Descent3/hudmessage.cpp:1195:9`!; |
| 1252 | } |
| 1253 | } |
| 1254 | } |
| 1255 | |
| 1256 | // If time out, clear message |
| 1257 | if (Hud_persistent_msg_timercxx . . $ Hud_persistent_msg_timer. <= 0.0f) { |
| 1258 | void ClearPersistentHUDMessagecxx . . $ ClearPersistentHUDMessage(49f6e7a06ebc5aa8).(); |
| 1259 | ClearPersistentHUDMessagecxx . . $ ClearPersistentHUDMessage(49f6e7a06ebc5aa8).(); |
| 1260 | } |
| 1261 | } |
| 1262 | } |
| 1263 | } |
| 1264 | |
| 1265 | void RenderHUDMsgDirtyRectscxx . . $ RenderHUDMsgDirtyRects(49f6e7a06ebc5aa8).() { |
| 1266 | // clean hud message dirty rects |
| 1267 | HUD_msg_dirty_rectcxx . . $ HUD_msg_dirty_rect..fillcxx . . $ t_dirty_rect#fill(cb2f890c2fdad230).(GR_BLACKcxx . . $ GR_BLACK.); |
| 1268 | |
| 1269 | // clean input message dirty rects |
| 1270 | HUD_inmsg_dirty_rectcxx . . $ HUD_inmsg_dirty_rect..fillcxx . . $ t_dirty_rect#fill(cb2f890c2fdad230).(GR_BLACKcxx . . $ GR_BLACK.); |
| 1271 | |
| 1272 | // clean remnant persistant messages |
| 1273 | HUD_persist_dirty_rectcxx . . $ HUD_persist_dirty_rect.[0].fillcxx . . $ t_dirty_rect#fill(cb2f890c2fdad230).(GR_BLACKcxx . . $ GR_BLACK.); |
| 1274 | HUD_persist_dirty_rectcxx . . $ HUD_persist_dirty_rect.[1].fillcxx . . $ t_dirty_rect#fill(cb2f890c2fdad230).(GR_BLACKcxx . . $ GR_BLACK.); |
| 1275 | } |
| 1276 | |
| 1277 | // reset hud messages. |
| 1278 | void ResetHUDMessagescxx . . $ ResetHUDMessages(49f6e7a06ebc5aa8).() { |
| 1279 | Hud_timercxx . . $ Hud_timer. = 0.0f; |
| 1280 | Num_hud_messagescxx . . $ Num_hud_messages. = 0; |
| 1281 | Hud_scroll_offsetcxx . . $ Hud_scroll_offset. = 0; |
| 1282 | ResetPersistentHUDMessagecxx . . $ ResetPersistentHUDMessage(49f6e7a06ebc5aa8).(); |
| 1283 | HUDUnpauseMessagescxx . . $ HUDUnpauseMessages(49f6e7a06ebc5aa8).(); |
| 1284 | |
| 1285 | HUD_inmsg_dirty_rectcxx . . $ HUD_inmsg_dirty_rect..resetcxx . . $ t_dirty_rect#reset(49f6e7a06ebc5aa8).(); |
| 1286 | HUD_msg_dirty_rectcxx . . $ HUD_msg_dirty_rect..resetcxx . . $ t_dirty_rect#reset(49f6e7a06ebc5aa8).(); |
| 1287 | HUD_persist_dirty_rectcxx . . $ HUD_persist_dirty_rect.[0].resetcxx . . $ t_dirty_rect#reset(49f6e7a06ebc5aa8).(); |
| 1288 | HUD_persist_dirty_rectcxx . . $ HUD_persist_dirty_rect.[1].resetcxx . . $ t_dirty_rect#reset(49f6e7a06ebc5aa8).(); |
| 1289 | |
| 1290 | void ResetHUDLevelItemscxx . . $ ResetHUDLevelItems(49f6e7a06ebc5aa8).(); |
| 1291 | ResetHUDLevelItemscxx . . $ ResetHUDLevelItems(49f6e7a06ebc5aa8).(); |
| 1292 | } |
| 1293 | |
| 1294 | struct phud_messagecxx . . $ phud_message# { |
| 1295 | char messagecxx . . $ phud_message#message.[HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2]; |
| 1296 | ddgr_colorcxx . . $ ddgr_color# colorcxx . . $ phud_message#color.; |
| 1297 | int xcxx . . $ phud_message#x., ycxx . . $ phud_message#y.; |
| 1298 | float timecxx . . $ phud_message#time.; |
| 1299 | int flagscxx . . $ phud_message#flags.; |
| 1300 | int sound_indexcxx . . $ phud_message#sound_index.; |
| 1301 | }; |
| 1302 | |
| 1303 | #define PHUD_QUEUE_SIZEcxx . . $ `Descent3/hudmessage.cpp:1303:9`! 3 |
| 1304 | |
| 1305 | phud_messagecxx . . $ phud_message# PHUD_message_queuecxx . . $ PHUD_message_queue.[PHUD_QUEUE_SIZEcxx . . $ `Descent3/hudmessage.cpp:1303:9`!]; |
| 1306 | |
| 1307 | int Num_queued_PHUD_messagescxx . . $ Num_queued_PHUD_messages. = 0; |
| 1308 | |
| 1309 | // adds a message to the persistant message queue |
| 1310 | void QueuePersistentHUDMessagecxx . . $ QueuePersistentHUDMessage(e60fbdfbe7e9abc2).(ddgr_colorcxx . . $ ddgr_color# color, int x, int y, float time, int flags, int sound_index, char *message) { |
| 1311 | if (Num_queued_PHUD_messagescxx . . $ Num_queued_PHUD_messages. == PHUD_QUEUE_SIZEcxx . . $ `Descent3/hudmessage.cpp:1303:9`!) |
| 1312 | return; |
| 1313 | |
| 1314 | phud_messagecxx . . $ phud_message# *pp = &PHUD_message_queuecxx . . $ PHUD_message_queue.[Num_queued_PHUD_messagescxx . . $ Num_queued_PHUD_messages.++]; |
| 1315 | |
| 1316 | pp->colorcxx . . $ phud_message#color. = color; |
| 1317 | pp->xcxx . . $ phud_message#x. = x; |
| 1318 | pp->ycxx . . $ phud_message#y. = y; |
| 1319 | pp->timecxx . . $ phud_message#time. = time; |
| 1320 | pp->flagscxx . . $ phud_message#flags. = flags; |
| 1321 | pp->sound_indexcxx . . $ phud_message#sound_index. = sound_index; |
| 1322 | strcpy(pp->messagecxx . . $ phud_message#message., message); |
| 1323 | } |
| 1324 | |
| 1325 | // Start playing a persistent HUD message |
| 1326 | void StartPersistentHUDMessagecxx . . $ StartPersistentHUDMessage(e60fbdfbe7e9abc2).(ddgr_colorcxx . . $ ddgr_color# color, int x, int y, float time, int flags, int sound_index, char *message) { |
| 1327 | if (Demo_flagscxx . . $ Demo_flags. == DF_RECORDINGcxx . . $ `lib/demofile.h:122:9`!) { |
| 1328 | DemoWritePersistantHUDMessagecxx . . $ DemoWritePersistantHUDMessage(e60fbdfbe7e9abc2).(color, x, y, time, flags, sound_index, message); |
| 1329 | } |
| 1330 | |
| 1331 | // set x and y if special formatting. |
| 1332 | grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!); |
| 1333 | if (x == HUD_MSG_PERSISTENT_CENTERcxx . . $ `Descent3/hud.h:312:9`!) { |
| 1334 | x = Game_window_xcxx . . $ Game_window_x. + (Game_window_wcxx . . $ Game_window_w. - grtext_GetLineWidthcxx . . $ `grtext/grtext.h:172:9`!(message)) / 2; |
| 1335 | } |
| 1336 | if (y == HUD_MSG_PERSISTENT_CENTERcxx . . $ `Descent3/hud.h:312:9`!) { |
| 1337 | y = Game_window_ycxx . . $ Game_window_y. + (Game_window_hcxx . . $ Game_window_h. - grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!)) / 2; |
| 1338 | } |
| 1339 | |
| 1340 | // add custom text item |
| 1341 | tHUDItemcxx . . $ tHUDItem# huditem; |
| 1342 | |
| 1343 | memset(&huditem, 0, sizeof(huditem)); |
| 1344 | |
| 1345 | huditem.alphacxx . . $ tHUDItem#alpha. = HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!; |
| 1346 | huditem.colorcxx . . $ tHUDItem#color. = color; |
| 1347 | huditem.typecxx . . $ tHUDItem#type. = HUD_ITEM_CUSTOMTEXTcxx . . $ `Descent3/hud.h:444:9`!; |
| 1348 | huditem.xcxx . . $ tHUDItem#x. = x * DEFAULT_HUD_WIDTHcxx . . $ `Descent3/hud.h:261:9`! / Max_window_wcxx . . $ Max_window_w.; |
| 1349 | huditem.ycxx . . $ tHUDItem#y. = y * DEFAULT_HUD_HEIGHTcxx . . $ `Descent3/hud.h:262:9`! / Max_window_hcxx . . $ Max_window_h.; |
| 1350 | huditem.datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text. = message; |
| 1351 | huditem.statcxx . . $ tHUDItem#stat. = STAT_MESSAGEScxx . . $ `Descent3/hud.h:280:9`!; |
| 1352 | huditem.flagscxx . . $ tHUDItem#flags. = HUD_FLAG_PERSISTANTcxx . . $ `Descent3/hud.h:449:9`! | HUD_FLAG_SMALLcxx . . $ `Descent3/hud.h:450:9`!; // when hud is shrunk, this will draw outside of normal view |
| 1353 | |
| 1354 | AddHUDItemcxx . . $ AddHUDItem(c7a20e4e05358911).(&huditem); |
| 1355 | |
| 1356 | Hud_persistent_msg_idcxx . . $ Hud_persistent_msg_id. = huditem.idcxx . . $ tHUDItem#id.; |
| 1357 | Hud_persistent_msg_timercxx . . $ Hud_persistent_msg_timer. = time; |
| 1358 | Hud_persistent_msg_flagscxx . . $ Hud_persistent_msg_flags. = flags; |
| 1359 | |
| 1360 | // Set up for FreeSpace-style effect |
| 1361 | if (flags & HPF_FREESPACE_DRAWcxx . . $ `Descent3/hud.h:402:9`!) { |
| 1362 | |
| 1363 | // Create additional hud item for leading character |
| 1364 | static char single_char[2] = { 'a', '\0' }; ; // single-character string |
| 1365 | huditem.alphacxx . . $ tHUDItem#alpha. = 255; |
| 1366 | huditem.datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text. = single_char; |
| 1367 | huditem.saturation_countcxx . . $ tHUDItem#saturation_count. = 2; |
| 1368 | AddHUDItemcxx . . $ AddHUDItem(c7a20e4e05358911).(&huditem); |
| 1369 | Hud_persistent_msg_id2cxx . . $ Hud_persistent_msg_id2. = huditem.idcxx . . $ tHUDItem#id.; |
| 1370 | |
| 1371 | tHUDItemcxx . . $ tHUDItem# *item = GetHUDItemcxx . . $ GetHUDItem(59e21a775e1fa362).(Hud_persistent_msg_idcxx . . $ Hud_persistent_msg_id.); |
| 1372 | tHUDItemcxx . . $ tHUDItem# *item2 = GetHUDItemcxx . . $ GetHUDItem(59e21a775e1fa362).(Hud_persistent_msg_id2cxx . . $ Hud_persistent_msg_id2.); |
| 1373 | |
| 1374 | item2->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.[0] = item->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.[0]; |
| 1375 | item->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.[0] = 0; |
| 1376 | |
| 1377 | Hud_persistent_msg_current_lencxx . . $ Hud_persistent_msg_current_len. = 0; |
| 1378 | Hud_persistent_msg_char_timercxx . . $ Hud_persistent_msg_char_timer. = CHAR_DELAYcxx . . $ `Descent3/hudmessage.cpp:1195:9`!; |
| 1379 | |
| 1380 | if (sound_index != SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!) |
| 1381 | Hud_persistent_msg_sound_handlecxx . . $ Hud_persistent_msg_sound_handle. = Sound_systemcxx . . $ Sound_system..Play2dSoundcxx . . $ hlsSystem#Play2dSound(d251026853493025).(sound_index); |
| 1382 | } |
| 1383 | } |
| 1384 | |
| 1385 | // adds a persistent hud message that is timed, or infinite until removed |
| 1386 | // for infinite, time = -1.0f |
| 1387 | // for centering on an axis, set either x or y to -1. |
| 1388 | void AddPersistentHUDMessagecxx . . $ AddPersistentHUDMessage(2c96e75cbf2ca747).(ddgr_colorcxx . . $ ddgr_color# color, int x, int y, float time, int flags, int sound_index, const char *fmt, |
| 1389 | ...) { |
| 1390 | std::va_listcxx . . $ std/va_list# args; |
| 1391 | char temp_message[HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2]; |
| 1392 | |
| 1393 | // start new message |
| 1394 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(args, fmt); |
| 1395 | std::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(temp_message, HUD_MESSAGE_LENGTHcxx . . $ `Descent3/hud.h:259:9`! * 2, fmt, args); |
| 1396 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(args); |
| 1397 | |
| 1398 | if (Hud_persistent_msg_idcxx . . $ Hud_persistent_msg_id. != HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!) // already one active, so queue the new one |
| 1399 | QueuePersistentHUDMessagecxx . . $ QueuePersistentHUDMessage(e60fbdfbe7e9abc2).(color, x, y, time, flags, sound_index, temp_message); |
| 1400 | else |
| 1401 | StartPersistentHUDMessagecxx . . $ StartPersistentHUDMessage(e60fbdfbe7e9abc2).(color, x, y, time, flags, sound_index, temp_message); |
| 1402 | } |
| 1403 | |
| 1404 | // Clears the current message, and plays the next in the queue |
| 1405 | void ClearPersistentHUDMessagecxx . . $ ClearPersistentHUDMessage(49f6e7a06ebc5aa8).() { |
| 1406 | // free persistent message currently visible |
| 1407 | if (Hud_persistent_msg_idcxx . . $ Hud_persistent_msg_id. != HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!) { |
| 1408 | tHUDItemcxx . . $ tHUDItem# *item = GetHUDItemcxx . . $ GetHUDItem(59e21a775e1fa362).(Hud_persistent_msg_idcxx . . $ Hud_persistent_msg_id.); |
| 1409 | if (item) { |
| 1410 | t_dirty_rectcxx . . $ t_dirty_rect# *r = &item->dirty_rectcxx . . $ tHUDItem#dirty_rect.; |
| 1411 | HUD_persist_dirty_rectcxx . . $ HUD_persist_dirty_rect.[0].setcxx . . $ t_dirty_rect#set(6f3a90be462c391b).(r->rcxx . . $ t_dirty_rect#r.[0].lcxx . . $ t_dirty_rect#$anonymous_type_0#l., r->rcxx . . $ t_dirty_rect#r.[0].tcxx . . $ t_dirty_rect#$anonymous_type_0#t., r->rcxx . . $ t_dirty_rect#r.[0].rcxx . . $ t_dirty_rect#$anonymous_type_0#r., r->rcxx . . $ t_dirty_rect#r.[0].bcxx . . $ t_dirty_rect#$anonymous_type_0#b.); |
| 1412 | } |
| 1413 | FreeHUDItemcxx . . $ FreeHUDItem(d4f767463ce0a6b3).(Hud_persistent_msg_idcxx . . $ Hud_persistent_msg_id.); |
| 1414 | Hud_persistent_msg_idcxx . . $ Hud_persistent_msg_id. = HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!; |
| 1415 | } |
| 1416 | if (Hud_persistent_msg_id2cxx . . $ Hud_persistent_msg_id2. != HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!) { |
| 1417 | tHUDItemcxx . . $ tHUDItem# *item = GetHUDItemcxx . . $ GetHUDItem(59e21a775e1fa362).(Hud_persistent_msg_id2cxx . . $ Hud_persistent_msg_id2.); |
| 1418 | if (item) { |
| 1419 | t_dirty_rectcxx . . $ t_dirty_rect# *r = &item->dirty_rectcxx . . $ tHUDItem#dirty_rect.; |
| 1420 | HUD_persist_dirty_rectcxx . . $ HUD_persist_dirty_rect.[1].setcxx . . $ t_dirty_rect#set(6f3a90be462c391b).(r->rcxx . . $ t_dirty_rect#r.[0].lcxx . . $ t_dirty_rect#$anonymous_type_0#l., r->rcxx . . $ t_dirty_rect#r.[0].tcxx . . $ t_dirty_rect#$anonymous_type_0#t., r->rcxx . . $ t_dirty_rect#r.[0].rcxx . . $ t_dirty_rect#$anonymous_type_0#r., r->rcxx . . $ t_dirty_rect#r.[0].bcxx . . $ t_dirty_rect#$anonymous_type_0#b.); |
| 1421 | } |
| 1422 | FreeHUDItemcxx . . $ FreeHUDItem(d4f767463ce0a6b3).(Hud_persistent_msg_id2cxx . . $ Hud_persistent_msg_id2.); |
| 1423 | Hud_persistent_msg_id2cxx . . $ Hud_persistent_msg_id2. = HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!; |
| 1424 | } |
| 1425 | |
| 1426 | if (Hud_persistent_msg_sound_handlecxx . . $ Hud_persistent_msg_sound_handle. != SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!) { |
| 1427 | Sound_systemcxx . . $ Sound_system..StopSoundLoopingcxx . . $ hlsSystem#StopSoundLooping(d4f767463ce0a6b3).(Hud_persistent_msg_sound_handlecxx . . $ Hud_persistent_msg_sound_handle.); |
| 1428 | Hud_persistent_msg_sound_handlecxx . . $ Hud_persistent_msg_sound_handle. = SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!; |
| 1429 | } |
| 1430 | |
| 1431 | // Check for queued message |
| 1432 | if (Num_queued_PHUD_messagescxx . . $ Num_queued_PHUD_messages.) { |
| 1433 | phud_messagecxx . . $ phud_message# *pp = &PHUD_message_queuecxx . . $ PHUD_message_queue.[0]; |
| 1434 | StartPersistentHUDMessagecxx . . $ StartPersistentHUDMessage(e60fbdfbe7e9abc2).(pp->colorcxx . . $ phud_message#color., pp->xcxx . . $ phud_message#x., pp->ycxx . . $ phud_message#y., pp->timecxx . . $ phud_message#time., pp->flagscxx . . $ phud_message#flags., pp->sound_indexcxx . . $ phud_message#sound_index., pp->messagecxx . . $ phud_message#message.); |
| 1435 | *pp =cxx . . $ phud_message#`operator=`(1cc17a31ac7a4143). PHUD_message_queuecxx . . $ PHUD_message_queue.[1]; |
| 1436 | Num_queued_PHUD_messagescxx . . $ Num_queued_PHUD_messages.--; |
| 1437 | } |
| 1438 | } |
| 1439 | |
| 1440 | // Clears all the persistent hud messages |
| 1441 | void ResetPersistentHUDMessagecxx . . $ ResetPersistentHUDMessage(49f6e7a06ebc5aa8).() { |
| 1442 | Num_queued_PHUD_messagescxx . . $ Num_queued_PHUD_messages. = 0; |
| 1443 | ClearPersistentHUDMessagecxx . . $ ClearPersistentHUDMessage(49f6e7a06ebc5aa8).(); |
| 1444 | } |
| 1445 | |
| 1446 | ///////////////////////////////////////////////////////////////////////// |
| 1447 | // HUD Message System |
| 1448 | ///////////////////////////////////////////////////////////////////////// |
| 1449 | |
| 1450 | // opens a hud rollback console. |
| 1451 | void OpenHUDMessageConsolecxx . . $ OpenHUDMessageConsole(49f6e7a06ebc5aa8).() { |
| 1452 | if (Game_msg_con_viscxx . . $ Game_msg_con_vis.) { |
| 1453 | CloseGameMessageConsolecxx . . $ CloseGameMessageConsole(49f6e7a06ebc5aa8).(); |
| 1454 | } |
| 1455 | |
| 1456 | HUD_msg_con_viscxx . . $ HUD_msg_con_vis. = HUD_msg_concxx . . $ HUD_msg_con..Opencxx . . $ MsgListConsole#Open(80f7bbf7fc8b8824).(TXT_HUDMSGPOPUP_TITLEcxx . . $ `Descent3/stringtable.h:810:9`!, GAME_MSGCON_Xcxx . . $ `Descent3/hudmessage.cpp:404:9`!, GAME_MSGCON_Ycxx . . $ `Descent3/hudmessage.cpp:405:9`!, GAME_MSGCON_Wcxx . . $ `Descent3/hudmessage.cpp:402:9`!, GAME_MSGCON_Hcxx . . $ `Descent3/hudmessage.cpp:403:9`!); |
| 1457 | } |
| 1458 | |
| 1459 | // closes hud rollback console |
| 1460 | void CloseHUDMessageConsolecxx . . $ CloseHUDMessageConsole(49f6e7a06ebc5aa8).() { |
| 1461 | if (HUD_msg_con_viscxx . . $ HUD_msg_con_vis.) { |
| 1462 | HUD_msg_concxx . . $ HUD_msg_con..Closecxx . . $ MsgListConsole#Close(49f6e7a06ebc5aa8).(); |
| 1463 | HUD_msg_con_viscxx . . $ HUD_msg_con_vis. = false; |
| 1464 | } |
| 1465 | } |
| 1466 | |
| 1467 | // toggles hud rollback console |
| 1468 | void ToggleHUDMessageConsolecxx . . $ ToggleHUDMessageConsole(49f6e7a06ebc5aa8).() { |
| 1469 | if (HUD_msg_con_viscxx . . $ HUD_msg_con_vis.) |
| 1470 | CloseHUDMessageConsolecxx . . $ CloseHUDMessageConsole(49f6e7a06ebc5aa8).(); |
| 1471 | else |
| 1472 | OpenHUDMessageConsolecxx . . $ OpenHUDMessageConsole(49f6e7a06ebc5aa8).(); |
| 1473 | } |
| 1474 | |
| 1475 | ///////////////////////////////////////////////////////////////////////// |
| 1476 | // Game Message System |
| 1477 | ///////////////////////////////////////////////////////////////////////// |
| 1478 | // resets game message list to no messages |
| 1479 | void ResetGameMessagescxx . . $ ResetGameMessages(49f6e7a06ebc5aa8).() { |
| 1480 | Game_msg_listcxx . . $ Game_msg_list..resetcxx . . $ tMsgList#reset(49f6e7a06ebc5aa8).(); |
| 1481 | Game_msg_concxx . . $ Game_msg_con..AttachMsgListcxx . . $ MsgListConsole#AttachMsgList(df01d1f481ab84b9).(&Game_msg_listcxx . . $ Game_msg_list.); |
| 1482 | HUD_msg_listcxx . . $ HUD_msg_list..resetcxx . . $ tMsgList#reset(49f6e7a06ebc5aa8).(); |
| 1483 | HUD_msg_concxx . . $ HUD_msg_con..AttachMsgListcxx . . $ MsgListConsole#AttachMsgList(df01d1f481ab84b9).(&HUD_msg_listcxx . . $ HUD_msg_list.); |
| 1484 | } |
| 1485 | |
| 1486 | void AddGameMessagecxx . . $ AddGameMessage(85c52e162fed56f9).(const char *msg) { |
| 1487 | int secs = (int)Gametimecxx . . $ Gametime.; |
| 1488 | |
| 1489 | Game_msg_listcxx . . $ Game_msg_list..addcxx . . $ tMsgList#add(8b3ed2aaeef03f3f).(msg, (uint8_tcxx . . $ uint8_t#)Current_missioncxx . . $ Current_mission..cur_levelcxx . . $ tMission#cur_level., (secs / 3600), (secs / 60), secs % 60); |
| 1490 | } |
| 1491 | |
| 1492 | void SGSGameMessagescxx . . $ SGSGameMessages(3639e799710acb68).(CFILEcxx . . $ CFILE# *fp) { |
| 1493 | int i = 0; |
| 1494 | const char *msg; |
| 1495 | |
| 1496 | cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(fp, (int16_t)Game_msg_listcxx . . $ Game_msg_list..m_nmsgcxx . . $ tMsgList#m_nmsg.); |
| 1497 | |
| 1498 | while ((msg = Game_msg_listcxx . . $ Game_msg_list..getcxx . . $ tMsgList#get(f7ae7e56280f18ae).(i++)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 1499 | cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(fp, msg); |
| 1500 | } |
| 1501 | } |
| 1502 | |
| 1503 | void LGSGameMessagescxx . . $ LGSGameMessages(3639e799710acb68).(CFILEcxx . . $ CFILE# *fp) { |
| 1504 | int n; |
| 1505 | char buf[512]; // some level designers can be nuts. |
| 1506 | |
| 1507 | n = (int)cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(fp); |
| 1508 | |
| 1509 | Game_msg_listcxx . . $ Game_msg_list..resetcxx . . $ tMsgList#reset(49f6e7a06ebc5aa8).(); |
| 1510 | while (n) { |
| 1511 | n--; |
| 1512 | cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(buf, sizeof(buf), fp); |
| 1513 | buf[511] = 0; |
| 1514 | Game_msg_listcxx . . $ Game_msg_list..addcxx . . $ tMsgList#add(8b3ed2aaeef03f3f).(buf); |
| 1515 | } |
| 1516 | } |
| 1517 | |
| 1518 | // toggles game message console |
| 1519 | void ToggleGameMessageConsolecxx . . $ ToggleGameMessageConsole(49f6e7a06ebc5aa8).() { |
| 1520 | if (Game_msg_con_viscxx . . $ Game_msg_con_vis.) |
| 1521 | CloseGameMessageConsolecxx . . $ CloseGameMessageConsole(49f6e7a06ebc5aa8).(); |
| 1522 | else |
| 1523 | OpenGameMessageConsolecxx . . $ OpenGameMessageConsole(49f6e7a06ebc5aa8).(); |
| 1524 | } |
| 1525 | |
| 1526 | // game message console |
| 1527 | void OpenGameMessageConsolecxx . . $ OpenGameMessageConsole(49f6e7a06ebc5aa8).() { |
| 1528 | if (HUD_msg_con_viscxx . . $ HUD_msg_con_vis.) { |
| 1529 | CloseHUDMessageConsolecxx . . $ CloseHUDMessageConsole(49f6e7a06ebc5aa8).(); |
| 1530 | } |
| 1531 | Game_msg_con_viscxx . . $ Game_msg_con_vis. = |
| 1532 | Game_msg_concxx . . $ Game_msg_con..Opencxx . . $ MsgListConsole#Open(80f7bbf7fc8b8824).(TXT_HUD_GAMEMESSAGEScxx . . $ `Descent3/stringtable.h:588:9`!, GAME_MSGCON_Xcxx . . $ `Descent3/hudmessage.cpp:404:9`!, GAME_MSGCON_Ycxx . . $ `Descent3/hudmessage.cpp:405:9`!, GAME_MSGCON_Wcxx . . $ `Descent3/hudmessage.cpp:402:9`!, GAME_MSGCON_Hcxx . . $ `Descent3/hudmessage.cpp:403:9`!); |
| 1533 | } |
| 1534 | |
| 1535 | void CloseGameMessageConsolecxx . . $ CloseGameMessageConsole(49f6e7a06ebc5aa8).() { |
| 1536 | Game_msg_concxx . . $ Game_msg_con..Closecxx . . $ MsgListConsole#Close(49f6e7a06ebc5aa8).(); |
| 1537 | Game_msg_con_viscxx . . $ Game_msg_con_vis. = false; |
| 1538 | } |
| 1539 | |
| 1540 | ////////////////////////////////////////////////////////////////////////////// |
| 1541 | |
| 1542 | #define MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`! 4 |
| 1543 | |
| 1544 | tMsgListcxx . . $ tMsgList#::tMsgListcxx . . $ tMsgList#tMsgList(49f6e7a06ebc5aa8).() { |
| 1545 | m_nmsgcxx . . $ tMsgList#m_nmsg. = 0; |
| 1546 | m_limitcxx . . $ tMsgList#m_limit. = 64; |
| 1547 | m_msgcxx . . $ tMsgList#m_msg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1548 | } |
| 1549 | |
| 1550 | bool tMsgListcxx . . $ tMsgList#::addcxx . . $ tMsgList#add(8b3ed2aaeef03f3f).(const char *msg, uint8_tcxx . . $ uint8_t# lvl, uint8_tcxx . . $ uint8_t# hr, uint8_tcxx . . $ uint8_t# min, uint8_tcxx . . $ uint8_t# sec) { |
| 1551 | char buf[2048]; |
| 1552 | |
| 1553 | if (!m_limitcxx . . $ tMsgList#m_limit.) |
| 1554 | m_limitcxx . . $ tMsgList#m_limit. = 64; |
| 1555 | |
| 1556 | if (m_msgcxx . . $ tMsgList#m_msg. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 1557 | m_msgcxx . . $ tMsgList#m_msg. = (char **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(char *) * m_limit); |
| 1558 | m_nmsgcxx . . $ tMsgList#m_nmsg. = 0; |
| 1559 | } |
| 1560 | |
| 1561 | if (m_nmsgcxx . . $ tMsgList#m_nmsg. == m_limitcxx . . $ tMsgList#m_limit. && m_nmsgcxx . . $ tMsgList#m_nmsg. > 0) { |
| 1562 | int i; |
| 1563 | mem_freecxx . . $ `mem/mem.h:80:9`!(m_msg[0]); |
| 1564 | for (i = 1; i < m_nmsgcxx . . $ tMsgList#m_nmsg.; i++) |
| 1565 | m_msgcxx . . $ tMsgList#m_msg.[i - 1] = m_msgcxx . . $ tMsgList#m_msg.[i]; |
| 1566 | m_nmsgcxx . . $ tMsgList#m_nmsg.--; |
| 1567 | } |
| 1568 | |
| 1569 | if (lvl > 0) { |
| 1570 | snprintf(buf, sizeof(buf), "[%d.%d.%d.%d] %s", lvl, hr, min, sec, msg); |
| 1571 | m_msgcxx . . $ tMsgList#m_msg.[m_nmsgcxx . . $ tMsgList#m_nmsg.++] = mem_strdupcxx . . $ `mem/mem.h:81:9`!(buf); |
| 1572 | } else { |
| 1573 | m_msgcxx . . $ tMsgList#m_msg.[m_nmsgcxx . . $ tMsgList#m_nmsg.++] = mem_strdupcxx . . $ `mem/mem.h:81:9`!(msg); |
| 1574 | } |
| 1575 | |
| 1576 | return true; |
| 1577 | } |
| 1578 | |
| 1579 | void tMsgListcxx . . $ tMsgList#::resetcxx . . $ tMsgList#reset(49f6e7a06ebc5aa8).() { |
| 1580 | if (m_msgcxx . . $ tMsgList#m_msg.) { |
| 1581 | while (m_nmsgcxx . . $ tMsgList#m_nmsg.) { |
| 1582 | m_nmsgcxx . . $ tMsgList#m_nmsg.--; |
| 1583 | if (m_msgcxx . . $ tMsgList#m_msg.[m_nmsgcxx . . $ tMsgList#m_nmsg.]) { |
| 1584 | mem_freecxx . . $ `mem/mem.h:80:9`!(m_msg[m_nmsg]); |
| 1585 | } |
| 1586 | } |
| 1587 | mem_freecxx . . $ `mem/mem.h:80:9`!(m_msg); |
| 1588 | m_msgcxx . . $ tMsgList#m_msg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1589 | } |
| 1590 | m_nmsgcxx . . $ tMsgList#m_nmsg. = 0; |
| 1591 | } |
| 1592 | |
| 1593 | const char *tMsgListcxx . . $ tMsgList#::getcxx . . $ tMsgList#get(f7ae7e56280f18ae).(int i) { |
| 1594 | if (m_msgcxx . . $ tMsgList#m_msg.) { |
| 1595 | if (i < m_nmsgcxx . . $ tMsgList#m_nmsg.) { |
| 1596 | return m_msgcxx . . $ tMsgList#m_msg.[i]; |
| 1597 | } |
| 1598 | } |
| 1599 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1600 | } |
| 1601 | |
| 1602 | ////////////////////////////////////////////////////////////////////////////// |
| 1603 | |
| 1604 | MsgListConsolecxx . . $ MsgListConsole#::MsgListConsolecxx . . $ MsgListConsole#MsgListConsole(49f6e7a06ebc5aa8).() { |
| 1605 | m_openedcxx . . $ MsgListConsole#m_opened. = false; |
| 1606 | m_listcxx . . $ MsgListConsole#m_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1607 | m_buffercxx . . $ MsgListConsole#m_buffer. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1608 | m_buflinecxx . . $ MsgListConsole#m_bufline. = 0; |
| 1609 | m_conlinescxx . . $ MsgListConsole#m_conlines. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1610 | n_conlinescxx . . $ MsgListConsole#n_conlines. = 0; |
| 1611 | } |
| 1612 | |
| 1613 | MsgListConsolecxx . . $ MsgListConsole#::~cxx . . $ MsgListConsole#`~MsgListConsole`(ced63f7c635d850d).MsgListConsolecxx . . $ MsgListConsole#() {} |
| 1614 | |
| 1615 | // registers dimensions of box |
| 1616 | bool MsgListConsolecxx . . $ MsgListConsole#::Opencxx . . $ MsgListConsole#Open(80f7bbf7fc8b8824).(const char *title, int x, int y, int w, int h) { |
| 1617 | m_xcxx . . $ MsgListConsole#m_x. = x; |
| 1618 | m_ycxx . . $ MsgListConsole#m_y. = y; |
| 1619 | m_wcxx . . $ MsgListConsole#m_w. = w; |
| 1620 | m_hcxx . . $ MsgListConsole#m_h. = h; |
| 1621 | |
| 1622 | if (!m_listcxx . . $ MsgListConsole#m_list.) |
| 1623 | return false; |
| 1624 | |
| 1625 | // determine text buffer dimensions |
| 1626 | m_buflencxx . . $ MsgListConsole#m_buflen. = 2048; |
| 1627 | |
| 1628 | redo_copy: |
| 1629 | m_buffercxx . . $ MsgListConsole#m_buffer. = (char *)mem_malloccxx . . $ `mem/mem.h:79:9`!(m_buflen); |
| 1630 | if (m_buffercxx . . $ MsgListConsole#m_buffer.) { |
| 1631 | m_buffercxx . . $ MsgListConsole#m_buffer.[0] = 0; |
| 1632 | m_openedcxx . . $ MsgListConsole#m_opened. = true; |
| 1633 | } else { |
| 1634 | m_openedcxx . . $ MsgListConsole#m_opened. = false; |
| 1635 | return false; |
| 1636 | } |
| 1637 | |
| 1638 | // generate text buffer |
| 1639 | int i, len, j; |
| 1640 | char *bufptr = m_buffercxx . . $ MsgListConsole#m_buffer.; |
| 1641 | |
| 1642 | for (i = 0; i < m_listcxx . . $ MsgListConsole#m_list.->m_nmsgcxx . . $ tMsgList#m_nmsg.; i++) { |
| 1643 | const char *msg = m_listcxx . . $ MsgListConsole#m_list.->m_msgcxx . . $ tMsgList#m_msg.[i]; |
| 1644 | if ((strlen(m_buffercxx . . $ MsgListConsole#m_buffer.) + strlen(msg) + 2) >= (unsigned)(m_buflencxx . . $ MsgListConsole#m_buflen.)) { |
| 1645 | // reallocate buffer |
| 1646 | mem_freecxx . . $ `mem/mem.h:80:9`!(m_buffer); |
| 1647 | m_buflencxx . . $ MsgListConsole#m_buflen. = m_buflencxx . . $ MsgListConsole#m_buflen. * 2; |
| 1648 | goto redo_copy; |
| 1649 | } |
| 1650 | |
| 1651 | textaux_WordWrapcxx . . $ textaux_WordWrap(2480230cce71d9d7).(msg, bufptr, m_wcxx . . $ MsgListConsole#m_w. - MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`! * 2, HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!); |
| 1652 | bufptr += strlen(bufptr); |
| 1653 | |
| 1654 | // append newline character if there are more messages. |
| 1655 | if (i < (m_listcxx . . $ MsgListConsole#m_list.->m_nmsgcxx . . $ tMsgList#m_nmsg. - 1)) { |
| 1656 | *bufptr = '\n'; |
| 1657 | bufptr++; |
| 1658 | } |
| 1659 | } |
| 1660 | |
| 1661 | // allocate console line pointers |
| 1662 | int c = 0; |
| 1663 | int y2 = grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!) + MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`! + 3; |
| 1664 | while (y2 < (m_hcxx . . $ MsgListConsole#m_h. - MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`! - grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!))) { |
| 1665 | y2 += (grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!) + 1); |
| 1666 | c++; |
| 1667 | } |
| 1668 | |
| 1669 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(c > 0); |
| 1670 | m_conlinescxx . . $ MsgListConsole#m_conlines. = (char **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(char *) * c); |
| 1671 | n_conlinescxx . . $ MsgListConsole#n_conlines. = c; |
| 1672 | memset(m_conlinescxx . . $ MsgListConsole#m_conlines., 0, sizeof(char *) * c); |
| 1673 | |
| 1674 | // get pointer to first visible line. |
| 1675 | c = 0; |
| 1676 | m_buflinecxx . . $ MsgListConsole#m_bufline. = 0; |
| 1677 | len = strlen(m_buffercxx . . $ MsgListConsole#m_buffer.); |
| 1678 | bufptr = m_buffercxx . . $ MsgListConsole#m_buffer.; |
| 1679 | for (i = 0; i <= len; i++) { |
| 1680 | if (m_buffercxx . . $ MsgListConsole#m_buffer.[i] == '\n' || m_buffercxx . . $ MsgListConsole#m_buffer.[i] == 0) { |
| 1681 | if (c == n_conlinescxx . . $ MsgListConsole#n_conlines.) { |
| 1682 | // scroll pointers up, store new one. |
| 1683 | for (j = 1; j < n_conlinescxx . . $ MsgListConsole#n_conlines.; j++) |
| 1684 | m_conlinescxx . . $ MsgListConsole#m_conlines.[j - 1] = m_conlinescxx . . $ MsgListConsole#m_conlines.[j]; |
| 1685 | c--; |
| 1686 | } |
| 1687 | m_conlinescxx . . $ MsgListConsole#m_conlines.[c] = bufptr; |
| 1688 | bufptr = &m_buffercxx . . $ MsgListConsole#m_buffer.[i + 1]; |
| 1689 | m_buflinecxx . . $ MsgListConsole#m_bufline.++; |
| 1690 | c++; |
| 1691 | } |
| 1692 | } |
| 1693 | |
| 1694 | m_numlinescxx . . $ MsgListConsole#m_numlines. = m_buflinecxx . . $ MsgListConsole#m_bufline.; |
| 1695 | m_keydowntimecxx . . $ MsgListConsole#m_keydowntime. = 0.0f; |
| 1696 | |
| 1697 | strcpy(m_titlecxx . . $ MsgListConsole#m_title., title); |
| 1698 | m_curmsgscxx . . $ MsgListConsole#m_curmsgs. = m_listcxx . . $ MsgListConsole#m_list.->m_nmsgcxx . . $ tMsgList#m_nmsg.; |
| 1699 | |
| 1700 | SuspendControlscxx . . $ SuspendControls(49f6e7a06ebc5aa8).(); |
| 1701 | |
| 1702 | return true; |
| 1703 | } |
| 1704 | |
| 1705 | void MsgListConsolecxx . . $ MsgListConsole#::Closecxx . . $ MsgListConsole#Close(49f6e7a06ebc5aa8).() { |
| 1706 | if (m_openedcxx . . $ MsgListConsole#m_opened.) { |
| 1707 | if (m_conlinescxx . . $ MsgListConsole#m_conlines.) |
| 1708 | mem_freecxx . . $ `mem/mem.h:80:9`!(m_conlines); |
| 1709 | if (m_buffercxx . . $ MsgListConsole#m_buffer.) |
| 1710 | mem_freecxx . . $ `mem/mem.h:80:9`!(m_buffer); |
| 1711 | m_openedcxx . . $ MsgListConsole#m_opened. = false; |
| 1712 | ResumeControlscxx . . $ ResumeControls(49f6e7a06ebc5aa8).(); |
| 1713 | } |
| 1714 | } |
| 1715 | |
| 1716 | void MsgListConsolecxx . . $ MsgListConsole#::AttachMsgListcxx . . $ MsgListConsole#AttachMsgList(df01d1f481ab84b9).(tMsgListcxx . . $ tMsgList# *msglist) { |
| 1717 | m_listcxx . . $ MsgListConsole#m_list. = msglist; |
| 1718 | m_buflinecxx . . $ MsgListConsole#m_bufline. = 0; |
| 1719 | } |
| 1720 | |
| 1721 | void MsgListConsolecxx . . $ MsgListConsole#::Drawcxx . . $ MsgListConsole#Draw(49f6e7a06ebc5aa8).() { |
| 1722 | g3Pointcxx . . $ g3Point# *pntlist[4], points[4]; |
| 1723 | int y, i; |
| 1724 | |
| 1725 | if (!m_openedcxx . . $ MsgListConsole#m_opened. || !m_listcxx . . $ MsgListConsole#m_list.) |
| 1726 | return; |
| 1727 | |
| 1728 | // change in buffer, do 'slow' update |
| 1729 | if (m_curmsgscxx . . $ MsgListConsole#m_curmsgs. != m_listcxx . . $ MsgListConsole#m_list.->m_nmsgcxx . . $ tMsgList#m_nmsg.) { |
| 1730 | char buf[32]; |
| 1731 | strcpy(buf, m_titlecxx . . $ MsgListConsole#m_title.); |
| 1732 | this->Closecxx . . $ MsgListConsole#Close(49f6e7a06ebc5aa8).(); |
| 1733 | this->Opencxx . . $ MsgListConsole#Open(80f7bbf7fc8b8824).(buf, m_xcxx . . $ MsgListConsole#m_x., m_ycxx . . $ MsgListConsole#m_y., m_wcxx . . $ MsgListConsole#m_w., m_hcxx . . $ MsgListConsole#m_h.); |
| 1734 | } |
| 1735 | |
| 1736 | // draw background window. |
| 1737 | points[0].p3_sxcxx . . $ g3Point#p3_sx. = m_xcxx . . $ MsgListConsole#m_x.; |
| 1738 | points[0].p3_sycxx . . $ g3Point#p3_sy. = m_ycxx . . $ MsgListConsole#m_y.; |
| 1739 | points[1].p3_sxcxx . . $ g3Point#p3_sx. = m_xcxx . . $ MsgListConsole#m_x. + m_wcxx . . $ MsgListConsole#m_w.; |
| 1740 | points[1].p3_sycxx . . $ g3Point#p3_sy. = m_ycxx . . $ MsgListConsole#m_y.; |
| 1741 | points[2].p3_sxcxx . . $ g3Point#p3_sx. = m_xcxx . . $ MsgListConsole#m_x. + m_wcxx . . $ MsgListConsole#m_w.; |
| 1742 | points[2].p3_sycxx . . $ g3Point#p3_sy. = m_ycxx . . $ MsgListConsole#m_y. + m_hcxx . . $ MsgListConsole#m_h.; |
| 1743 | points[3].p3_sxcxx . . $ g3Point#p3_sx. = m_xcxx . . $ MsgListConsole#m_x.; |
| 1744 | points[3].p3_sycxx . . $ g3Point#p3_sy. = m_ycxx . . $ MsgListConsole#m_y. + m_hcxx . . $ MsgListConsole#m_h.; |
| 1745 | |
| 1746 | for (i = 0; i < 4; i++) { |
| 1747 | points[i].p3_zcxx . . $ `lib/3d.h:247:9`! = 0; |
| 1748 | points[i].p3_flagscxx . . $ g3Point#p3_flags. = PF_PROJECTEDcxx . . $ `lib/3d.h:214:9`!; |
| 1749 | pntlist[i] = &points[i]; |
| 1750 | } |
| 1751 | |
| 1752 | rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(0); |
| 1753 | rend_SetTextureTypecxx . . $ rend_SetTextureType(cccd9781d96f97ff).(TT_FLATcxx . . $ TT_FLAT.); |
| 1754 | rend_SetAlphaTypecxx . . $ rend_SetAlphaType(4af4fd0e2b26c4ac).(AT_CONSTANTcxx . . $ `lib/renderer.h:400:9`!); |
| 1755 | rend_SetLightingcxx . . $ rend_SetLighting(e55526c9d3dd1656).(LS_NONEcxx . . $ LS_NONE.); |
| 1756 | rend_SetFlatColorcxx . . $ rend_SetFlatColor(cb2f890c2fdad230).(GR_BLACKcxx . . $ GR_BLACK.); |
| 1757 | rend_SetAlphaValuecxx . . $ rend_SetAlphaValue(ac50b47256ae7414).(192); |
| 1758 | rend_DrawPolygon2Dcxx . . $ rend_DrawPolygon2D(1464bdba6025a51).(0, pntlist, 4); |
| 1759 | |
| 1760 | // set up text rendering. |
| 1761 | grtext_Resetcxx . . $ grtext_Reset(49f6e7a06ebc5aa8).(); |
| 1762 | grtext_SetParameterscxx . . $ grtext_SetParameters(1559a299834bcdd5).(m_xcxx . . $ MsgListConsole#m_x. + MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`!, m_ycxx . . $ MsgListConsole#m_y. + MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`! - 1, m_xcxx . . $ MsgListConsole#m_x. + m_wcxx . . $ MsgListConsole#m_w. - MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`!, |
| 1763 | m_ycxx . . $ MsgListConsole#m_y. + m_hcxx . . $ MsgListConsole#m_h. - MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`!); |
| 1764 | grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!); |
| 1765 | grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 255, 0)); |
| 1766 | grtext_Putscxx . . $ grtext_Puts(3139f19a0dbb8edf).(m_xcxx . . $ MsgListConsole#m_x. + MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`! + 4, m_ycxx . . $ MsgListConsole#m_y. + MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`! - 1, m_titlecxx . . $ MsgListConsole#m_title.); |
| 1767 | |
| 1768 | y = m_ycxx . . $ MsgListConsole#m_y. + grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!) + MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`! + 1; |
| 1769 | rend_SetFlatColorcxx . . $ rend_SetFlatColor(cb2f890c2fdad230).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 255, 0)); |
| 1770 | rend_DrawLinecxx . . $ rend_DrawLine(748afa4755bc9595).(m_xcxx . . $ MsgListConsole#m_x. + MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`!, y, m_xcxx . . $ MsgListConsole#m_x. + m_wcxx . . $ MsgListConsole#m_w. - MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`!, y); |
| 1771 | |
| 1772 | // draw all lines until bottom |
| 1773 | y += 2; |
| 1774 | for (i = 0; i < n_conlinescxx . . $ MsgListConsole#n_conlines.; i++) { |
| 1775 | char *sptr = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1776 | if (i < (n_conlinescxx . . $ MsgListConsole#n_conlines. - 1)) { |
| 1777 | sptr = m_conlinescxx . . $ MsgListConsole#m_conlines.[i + 1]; |
| 1778 | } |
| 1779 | if (sptr) { |
| 1780 | sptr[-1] = 0; |
| 1781 | } |
| 1782 | grtext_Putscxx . . $ grtext_Puts(3139f19a0dbb8edf).(m_xcxx . . $ MsgListConsole#m_x. + MSGL_BORDER_THICKNESScxx . . $ `Descent3/hudmessage.cpp:1542:9`!, y, m_conlinescxx . . $ MsgListConsole#m_conlines.[i]); |
| 1783 | if (sptr) { |
| 1784 | sptr[-1] = '\n'; |
| 1785 | } |
| 1786 | y += (grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!) + 1); |
| 1787 | if (!sptr) { |
| 1788 | break; |
| 1789 | } |
| 1790 | } |
| 1791 | |
| 1792 | grtext_Flushcxx . . $ grtext_Flush(49f6e7a06ebc5aa8).(); |
| 1793 | } |
| 1794 | |
| 1795 | void MsgListConsolecxx . . $ MsgListConsole#::DoInputcxx . . $ MsgListConsole#DoInput(49f6e7a06ebc5aa8).() { |
| 1796 | if (m_openedcxx . . $ MsgListConsole#m_opened.) { |
| 1797 | int i, offset_count = 0; // = ddio_KeyDownCount(KEY_DOWN) - ddio_KeyDownCount(KEY_UP); |
| 1798 | float key_time = ddio_KeyDownTimecxx . . $ ddio_KeyDownTime(5cde91ea12d43f46).(KEY_DOWNcxx . . $ `ddio/ddio_common.h:319:9`!) - ddio_KeyDownTimecxx . . $ ddio_KeyDownTime(5cde91ea12d43f46).(KEY_UPcxx . . $ `ddio/ddio_common.h:318:9`!); |
| 1799 | char *lineptr; |
| 1800 | |
| 1801 | if (m_numlinescxx . . $ MsgListConsole#m_numlines. <= n_conlinescxx . . $ MsgListConsole#n_conlines.) { |
| 1802 | offset_count = 0; // no need to offset if no need to scroll |
| 1803 | } |
| 1804 | |
| 1805 | if (key_time == 0.0f) { |
| 1806 | m_keydowntimecxx . . $ MsgListConsole#m_keydowntime. = 0.0f; |
| 1807 | } else { |
| 1808 | m_keydowntimecxx . . $ MsgListConsole#m_keydowntime. += key_time; |
| 1809 | } |
| 1810 | if (m_keydowntimecxx . . $ MsgListConsole#m_keydowntime. < -0.1f) { |
| 1811 | offset_count = -1; |
| 1812 | m_keydowntimecxx . . $ MsgListConsole#m_keydowntime. = 0.0f; |
| 1813 | } else if (m_keydowntimecxx . . $ MsgListConsole#m_keydowntime. > 0.1f) { |
| 1814 | offset_count = 1; |
| 1815 | m_keydowntimecxx . . $ MsgListConsole#m_keydowntime. = 0.0f; |
| 1816 | } |
| 1817 | |
| 1818 | // scroll offset_count amount. |
| 1819 | if (offset_count < 0) { |
| 1820 | // look back from m_conlines[0] |
| 1821 | if ((m_buflinecxx . . $ MsgListConsole#m_bufline. + offset_count - n_conlinescxx . . $ MsgListConsole#n_conlines.) < 0) |
| 1822 | offset_count = -(m_buflinecxx . . $ MsgListConsole#m_bufline. - n_conlinescxx . . $ MsgListConsole#n_conlines.); |
| 1823 | |
| 1824 | m_buflinecxx . . $ MsgListConsole#m_bufline. = m_buflinecxx . . $ MsgListConsole#m_bufline. + offset_count; |
| 1825 | |
| 1826 | if (offset_count < 0) { |
| 1827 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "bufline=%d\n", m_bufline); |
| 1828 | } |
| 1829 | |
| 1830 | while (offset_count < 0) { |
| 1831 | offset_count++; |
| 1832 | for (i = n_conlinescxx . . $ MsgListConsole#n_conlines. - 1; i > 0; i--) |
| 1833 | m_conlinescxx . . $ MsgListConsole#m_conlines.[i] = m_conlinescxx . . $ MsgListConsole#m_conlines.[i - 1]; |
| 1834 | |
| 1835 | // go back until hit previous newline of beginning of buffer. |
| 1836 | for (lineptr = m_conlinescxx . . $ MsgListConsole#m_conlines.[0] - 1; lineptr != m_buffercxx . . $ MsgListConsole#m_buffer. && lineptr[-1] != '\n'; lineptr--) |
| 1837 | ; |
| 1838 | m_conlinescxx . . $ MsgListConsole#m_conlines.[0] = lineptr; |
| 1839 | } |
| 1840 | } else if (offset_count > 0) { |
| 1841 | // look forward from m_conlines[n_conlines-1] |
| 1842 | if ((m_buflinecxx . . $ MsgListConsole#m_bufline. + offset_count) > m_numlinescxx . . $ MsgListConsole#m_numlines.) |
| 1843 | offset_count = m_numlinescxx . . $ MsgListConsole#m_numlines. - m_buflinecxx . . $ MsgListConsole#m_bufline.; |
| 1844 | |
| 1845 | m_buflinecxx . . $ MsgListConsole#m_bufline. = m_buflinecxx . . $ MsgListConsole#m_bufline. + offset_count; |
| 1846 | |
| 1847 | if (offset_count > 0) { |
| 1848 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "bufline=%d\n", m_bufline); |
| 1849 | } |
| 1850 | |
| 1851 | while (offset_count > 0) { |
| 1852 | offset_count--; |
| 1853 | for (i = 1; i < n_conlinescxx . . $ MsgListConsole#n_conlines.; i++) |
| 1854 | m_conlinescxx . . $ MsgListConsole#m_conlines.[i - 1] = m_conlinescxx . . $ MsgListConsole#m_conlines.[i]; |
| 1855 | |
| 1856 | // go forward until we hit a newline or end of buffer (if end, then error!) |
| 1857 | for (lineptr = m_conlinescxx . . $ MsgListConsole#m_conlines.[n_conlinescxx . . $ MsgListConsole#n_conlines. - 1]; lineptr[0] != '\n'; lineptr++) |
| 1858 | ; |
| 1859 | { |
| 1860 | if (lineptr[0] == 0) { |
| 1861 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 1862 | offset_count = 0; |
| 1863 | lineptr = m_conlinescxx . . $ MsgListConsole#m_conlines.[n_conlinescxx . . $ MsgListConsole#n_conlines. - 1]; |
| 1864 | break; |
| 1865 | } |
| 1866 | } |
| 1867 | if (lineptr[0]) |
| 1868 | lineptr++; |
| 1869 | m_conlinescxx . . $ MsgListConsole#m_conlines.[n_conlinescxx . . $ MsgListConsole#n_conlines. - 1] = lineptr; |
| 1870 | } |
| 1871 | } |
| 1872 | } |
| 1873 | } |