| 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/Dmfc/dmfcstats.cpp $ |
| 21 | * $Revision: 1.1.1.1 $ |
| 22 | * $Date: 2003/08/26 03:57:21 $ |
| 23 | * $Author: kevinb $ |
| 24 | * |
| 25 | * Functions for in-game stats system |
| 26 | * |
| 27 | * $Log: dmfcstats.cpp,v $ |
| 28 | * Revision 1.1.1.1 2003/08/26 03:57:21 kevinb |
| 29 | * initial 1.5 import |
| 30 | * |
| 31 | * |
| 32 | * 34 10/26/99 10:32a Jeff |
| 33 | * fixed COM interface bug |
| 34 | * |
| 35 | * 33 9/03/99 5:48p Jeff |
| 36 | * fixed crash if the stats is brought up before all player records are |
| 37 | * recieved |
| 38 | * |
| 39 | * 32 7/14/99 11:48a Jeff |
| 40 | * localized text for patch fixes |
| 41 | * |
| 42 | * 31 7/11/99 6:09p Jeff |
| 43 | * for team games (or where the divide up by teams flag is set), process |
| 44 | * everyone in the game and display them, before the disconnected people, |
| 45 | * so everyone is displayed. |
| 46 | * |
| 47 | * 30 7/09/99 6:17p Jeff |
| 48 | * fixed bugs when scrolling down in a dedicated server game |
| 49 | * |
| 50 | * 29 7/06/99 11:47p Jeff |
| 51 | * selected pilot when stats are enabled is yourself, not server |
| 52 | * |
| 53 | * 28 5/23/99 3:04a Jason |
| 54 | * fixed bug with player rankings not being updated correctly |
| 55 | * |
| 56 | * 27 5/22/99 1:12a Jeff |
| 57 | * correctly handle Viewer_object |
| 58 | * |
| 59 | * 26 5/19/99 5:26p Jeff |
| 60 | * fixed crash trying to view stats before getting player records from |
| 61 | * server |
| 62 | * |
| 63 | * 25 5/13/99 4:55p Ardussi |
| 64 | * changes for compiling on the Mac |
| 65 | * |
| 66 | * 24 5/03/99 12:07p Jeff |
| 67 | * safety precautions |
| 68 | * |
| 69 | * 23 3/29/99 7:20p Jeff |
| 70 | * added vis stuff for coop stat views |
| 71 | * |
| 72 | * 22 3/27/99 4:53p Jeff |
| 73 | * player rankings in multiplayer games implemented. Fixed join message |
| 74 | * so it doesn't get cut off |
| 75 | * |
| 76 | * 21 3/17/99 12:25p Jeff |
| 77 | * converted DMFC to be COM interface |
| 78 | * |
| 79 | * 20 3/05/99 1:30p Jeff |
| 80 | * fixed 99% of the high res issues |
| 81 | * |
| 82 | * 19 2/11/99 12:51a Jeff |
| 83 | * changed names of exported variables |
| 84 | * |
| 85 | * 18 2/08/99 7:49p Jeff |
| 86 | * removed calls to get frame parameters (function is dead..pending |
| 87 | * removal) |
| 88 | * |
| 89 | * 17 2/08/99 5:22p Jeff |
| 90 | * exported rend_SetZBuffer...fixed up small view of stats |
| 91 | * |
| 92 | * 16 2/08/99 12:06a Jeff |
| 93 | * some new flags for more configuration. Added an option to see from a |
| 94 | * player's view |
| 95 | * |
| 96 | * 15 2/06/99 6:59p Jeff |
| 97 | * created RenderHUDGetTextLineWidth and RenderHUDGetTextHeight |
| 98 | * |
| 99 | * 14 1/31/99 7:26p Matt |
| 100 | * Renamed a bunch of functions to have HUD capitalized |
| 101 | * |
| 102 | * 13 1/24/99 8:31p Jeff |
| 103 | * updated stat manager to show team information |
| 104 | * |
| 105 | * 12 1/20/99 8:07p Jeff |
| 106 | * disconnected players in color mode team show up as grey |
| 107 | * |
| 108 | * 11 1/19/99 3:55a Jeff |
| 109 | * all strings localized out |
| 110 | * |
| 111 | * 10 1/16/99 2:55p Jeff |
| 112 | * possibly fixed some stat manager bugs...needs testing |
| 113 | * |
| 114 | * 9 1/13/99 4:36p Jeff |
| 115 | * fixed scroll bug |
| 116 | * |
| 117 | * 8 1/07/99 5:01p Jeff |
| 118 | * added Int3's and updated all net games to use stats manager...correctly |
| 119 | * too |
| 120 | * |
| 121 | * 7 1/04/99 12:21p Jeff |
| 122 | * added support for hosts.allow/deny and updates stats manager a little |
| 123 | * |
| 124 | * 6 12/08/98 4:47p Jeff |
| 125 | * umm, various changes, fixed pilot pics so that they work for everyone |
| 126 | * now |
| 127 | * |
| 128 | * 5 12/08/98 3:29p Jeff |
| 129 | * updated the team control dialog so the server can determine if they |
| 130 | * want to make the clients wait |
| 131 | * |
| 132 | * 4 12/08/98 12:17p Jeff |
| 133 | * various changes that include an improved Team Control dialog (doesn't |
| 134 | * switch teams until exit..) and spew/respawn players that change teams |
| 135 | * |
| 136 | * 3 12/04/98 7:04p Jeff |
| 137 | * almost finished up dmfc stat manager |
| 138 | * |
| 139 | * 2 12/03/98 7:05p Jeff |
| 140 | * updated new stats |
| 141 | * |
| 142 | * $NoKeywords: $ |
| 143 | */ |
| 144 | |
| 145 | #include "gamedll_header.h"cxx . . $ `<file>/netgames/includes/gamedll_header.h`/ |
| 146 | #include "DMFC.h"cxx . . $ `<file>/netgames/includes/DMFC.h`/ |
| 147 | #include "dmfcinternal.h"cxx . . $ `<file>/netgames/dmfc/dmfcinternal.h`/ |
| 148 | |
| 149 | |
| 150 | #include <algorithm> |
| 151 | |
| 152 | extern DMFCBasecxx . . $ DMFCBase# *basethiscxx . . $ basethis.; |
| 153 | extern player_recordcxx . . $ player_record# Player_recordscxx . . $ Player_records.[MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!]; |
| 154 | |
| 155 | #define ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`! 2 |
| 156 | #define PAGE_DISP_TIMEcxx . . $ `netgames/dmfc/dmfcstats.cpp:156:9`! 2.0f |
| 157 | #define ALPHA_IN_TIMEcxx . . $ `netgames/dmfc/dmfcstats.cpp:157:9`! 0.4f |
| 158 | |
| 159 | #define PLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:159:9`! 400 |
| 160 | #define PLIST_WIN_Hcxx . . $ `netgames/dmfc/dmfcstats.cpp:160:9`! 440 |
| 161 | #define PLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:161:9`! 10 |
| 162 | #define PLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:162:9`! 20 |
| 163 | #define DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`! 210 |
| 164 | #define DLIST_WIN_Hcxx . . $ `netgames/dmfc/dmfcstats.cpp:164:9`! 440 |
| 165 | #define DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`! PLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:159:9`! + PLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:161:9`! + 10 |
| 166 | #define DLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:166:9`! 20 |
| 167 | |
| 168 | // constructor |
| 169 | CDmfcStatscxx . . $ CDmfcStats#::CDmfcStatscxx . . $ CDmfcStats#CDmfcStats(49f6e7a06ebc5aa8).() { |
| 170 | m_cPtrscxx . . $ CDmfcStats#m_cPtrs. = 0; |
| 171 | m_initcxx . . $ CDmfcStats#m_init. = false; |
| 172 | m_flagscxx . . $ CDmfcStats#m_flags. = 0; |
| 173 | m_SortedPRecscxx . . $ CDmfcStats#m_SortedPRecs. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 174 | m_pMaxNumberDisplayedcxx . . $ CDmfcStats#m_pMaxNumberDisplayed. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 175 | m_MaxCountcxx . . $ CDmfcStats#m_MaxCount. = 0; |
| 176 | m_iPLColCountcxx . . $ CDmfcStats#m_iPLColCount. = 0; |
| 177 | m_iDColCountcxx . . $ CDmfcStats#m_iDColCount. = 0; |
| 178 | m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 179 | m_DColInfocxx . . $ CDmfcStats#m_DColInfo. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 180 | m_PLColCallbackcxx . . $ CDmfcStats#m_PLColCallback. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 181 | m_DColCallbackcxx . . $ CDmfcStats#m_DColCallback. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 182 | m_PLColCallbackBMPcxx . . $ CDmfcStats#m_PLColCallbackBMP. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 183 | m_DColCallbackBMPcxx . . $ CDmfcStats#m_DColCallbackBMP. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 184 | m_TeamCallbackcxx . . $ CDmfcStats#m_TeamCallback. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 185 | m_GameNamecxx . . $ CDmfcStats#m_GameName. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 186 | m_top_indexcxx . . $ CDmfcStats#m_top_index. = 0; |
| 187 | m_selected_indexcxx . . $ CDmfcStats#m_selected_index. = 0; |
| 188 | m_bottom_indexcxx . . $ CDmfcStats#m_bottom_index. = -1; |
| 189 | m_enabledcxx . . $ CDmfcStats#m_enabled. = false; |
| 190 | m_font_heightcxx . . $ CDmfcStats#m_font_height. = 0; |
| 191 | m_y_start_plistcxx . . $ CDmfcStats#m_y_start_plist. = 0; |
| 192 | m_y_start_detailcxx . . $ CDmfcStats#m_y_start_detail. = 0; |
| 193 | m_x_start_plistcxx . . $ CDmfcStats#m_x_start_plist. = 0; |
| 194 | m_x_start_detailcxx . . $ CDmfcStats#m_x_start_detail. = 0; |
| 195 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = 0; |
| 196 | m_highlight_bmpcxx . . $ CDmfcStats#m_highlight_bmp. = BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!; |
| 197 | m_background_bmpcxx . . $ CDmfcStats#m_background_bmp. = BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!; |
| 198 | m_page_indexcxx . . $ CDmfcStats#m_page_index. = 0; |
| 199 | m_can_fit_countcxx . . $ CDmfcStats#m_can_fit_count. = -1; |
| 200 | m_page_display_timecxx . . $ CDmfcStats#m_page_display_time. = 0; |
| 201 | m_has_multiple_pagescxx . . $ CDmfcStats#m_has_multiple_pages. = false; |
| 202 | m_alphacxx . . $ CDmfcStats#m_alpha. = 0; |
| 203 | alpha_in_timecxx . . $ CDmfcStats#alpha_in_time. = 0; |
| 204 | } |
| 205 | |
| 206 | // destructor |
| 207 | CDmfcStatscxx . . $ CDmfcStats#::~cxx . . $ CDmfcStats#`~CDmfcStats`(ced63f7c635d850d).CDmfcStatscxx . . $ CDmfcStats#() { |
| 208 | if (m_GameNamecxx . . $ CDmfcStats#m_GameName.) { |
| 209 | freecxx . . $ free(bd21765a0afc8e3c).(m_GameNamecxx . . $ CDmfcStats#m_GameName.); |
| 210 | } |
| 211 | if (m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.) { |
| 212 | freecxx . . $ free(bd21765a0afc8e3c).(m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.); |
| 213 | } |
| 214 | if (m_DColInfocxx . . $ CDmfcStats#m_DColInfo.) { |
| 215 | freecxx . . $ free(bd21765a0afc8e3c).(m_DColInfocxx . . $ CDmfcStats#m_DColInfo.); |
| 216 | } |
| 217 | |
| 218 | if (m_highlight_bmpcxx . . $ CDmfcStats#m_highlight_bmp. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) |
| 219 | DLLbm_FreeBitmap(m_highlight_bmpcxx . . $ CDmfcStats#m_highlight_bmp.); |
| 220 | |
| 221 | if (m_background_bmpcxx . . $ CDmfcStats#m_background_bmp. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) |
| 222 | DLLbm_FreeBitmap(m_background_bmpcxx . . $ CDmfcStats#m_background_bmp.); |
| 223 | } |
| 224 | |
| 225 | // initialization member function |
| 226 | bool CDmfcStatscxx . . $ CDmfcStats#::Initializecxx . . $ CDmfcStats#Initialize(645910a8ad01b658).(tDmfcStatsInitcxx . . $ tDmfcStatsInit# *init_info) { |
| 227 | m_font_heightcxx . . $ CDmfcStats#m_font_height. = DLLgrfont_GetHeight(basethiscxx . . $ basethis.->Game_fontscxx . . $ DMFCBase#Game_fonts.[HUD_FONT_INDEXcxx . . $ `Descent3/gamefont.h:97:9`!]); |
| 228 | // m_font_height = DLLRenderHUDGetTextHeight("X"); |
| 229 | m_flagscxx . . $ CDmfcStats#m_flags. = init_info->flagscxx . . $ tDmfcStatsInit#flags.; |
| 230 | m_SortedPRecscxx . . $ CDmfcStats#m_SortedPRecs. = init_info->SortedPlayerRecordscxx . . $ tDmfcStatsInit#SortedPlayerRecords.; |
| 231 | if (!m_SortedPRecscxx . . $ CDmfcStats#m_SortedPRecs.) |
| 232 | goto error_init; |
| 233 | m_pMaxNumberDisplayedcxx . . $ CDmfcStats#m_pMaxNumberDisplayed. = init_info->MaxNumberDisplayedcxx . . $ tDmfcStatsInit#MaxNumberDisplayed.; |
| 234 | if ((m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_ONLY_X_PLAYERS_SHOWNcxx . . $ `netgames/includes/DMFC.h:622:9`!) && (!m_pMaxNumberDisplayedcxx . . $ CDmfcStats#m_pMaxNumberDisplayed.)) |
| 235 | goto error_init; |
| 236 | |
| 237 | m_PLColCallbackcxx . . $ CDmfcStats#m_PLColCallback. = init_info->clbPlayerColumncxx . . $ tDmfcStatsInit#clbPlayerColumn.; |
| 238 | m_DColCallbackcxx . . $ CDmfcStats#m_DColCallback. = init_info->clbDetailedColumncxx . . $ tDmfcStatsInit#clbDetailedColumn.; |
| 239 | m_PLColCallbackBMPcxx . . $ CDmfcStats#m_PLColCallbackBMP. = init_info->clbPlayerColumnBMPcxx . . $ tDmfcStatsInit#clbPlayerColumnBMP.; |
| 240 | m_DColCallbackBMPcxx . . $ CDmfcStats#m_DColCallbackBMP. = init_info->clbDetailedColumnBMPcxx . . $ tDmfcStatsInit#clbDetailedColumnBMP.; |
| 241 | m_TeamCallbackcxx . . $ CDmfcStats#m_TeamCallback. = init_info->clTeamLinecxx . . $ tDmfcStatsInit#clTeamLine.; |
| 242 | |
| 243 | m_iPLColCountcxx . . $ CDmfcStats#m_iPLColCount. = init_info->cColumnCountPlayerListcxx . . $ tDmfcStatsInit#cColumnCountPlayerList.; |
| 244 | m_iDColCountcxx . . $ CDmfcStats#m_iDColCount. = init_info->cColumnCountDetailedcxx . . $ tDmfcStatsInit#cColumnCountDetailed.; |
| 245 | |
| 246 | if (m_iPLColCountcxx . . $ CDmfcStats#m_iPLColCount. > 0 && !init_info->PlayerListColumnscxx . . $ tDmfcStatsInit#PlayerListColumns.) |
| 247 | goto error_init; |
| 248 | |
| 249 | if (m_iDColCountcxx . . $ CDmfcStats#m_iDColCount. > 0 && !init_info->DetailedColumnscxx . . $ tDmfcStatsInit#DetailedColumns.) |
| 250 | goto error_init; |
| 251 | |
| 252 | if (m_iPLColCountcxx . . $ CDmfcStats#m_iPLColCount. > 0) { |
| 253 | m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo. = (tDmfcStatsColumnInfocxx . . $ tDmfcStatsColumnInfo# *)malloccxx . . $ malloc(9f008b2a9698428b).(sizeof(tDmfcStatsColumnInfocxx . . $ tDmfcStatsColumnInfo#) * m_iPLColCountcxx . . $ CDmfcStats#m_iPLColCount.); |
| 254 | if (!m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.) |
| 255 | goto error_init; |
| 256 | memcpy(m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo., init_info->PlayerListColumnscxx . . $ tDmfcStatsInit#PlayerListColumns., sizeof(tDmfcStatsColumnInfocxx . . $ tDmfcStatsColumnInfo#) * m_iPLColCountcxx . . $ CDmfcStats#m_iPLColCount.); |
| 257 | } |
| 258 | |
| 259 | if (m_iDColCountcxx . . $ CDmfcStats#m_iDColCount. > 0) { |
| 260 | m_DColInfocxx . . $ CDmfcStats#m_DColInfo. = (tDmfcStatsColumnInfocxx . . $ tDmfcStatsColumnInfo# *)malloccxx . . $ malloc(9f008b2a9698428b).(sizeof(tDmfcStatsColumnInfocxx . . $ tDmfcStatsColumnInfo#) * m_iDColCountcxx . . $ CDmfcStats#m_iDColCount.); |
| 261 | if (!m_DColInfocxx . . $ CDmfcStats#m_DColInfo.) { |
| 262 | goto error_init; |
| 263 | } |
| 264 | memcpy(m_DColInfocxx . . $ CDmfcStats#m_DColInfo., init_info->DetailedColumnscxx . . $ tDmfcStatsInit#DetailedColumns., sizeof(tDmfcStatsColumnInfocxx . . $ tDmfcStatsColumnInfo#) * m_iDColCountcxx . . $ CDmfcStats#m_iDColCount.); |
| 265 | } |
| 266 | |
| 267 | if (init_info->GameNamecxx . . $ tDmfcStatsInit#GameName.) { |
| 268 | m_GameNamecxx . . $ CDmfcStats#m_GameName. = strdup(init_info->GameNamecxx . . $ tDmfcStatsInit#GameName.); |
| 269 | } |
| 270 | |
| 271 | m_y_start_plistcxx . . $ CDmfcStats#m_y_start_plist. = PLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:162:9`! + 2 * (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 272 | m_y_start_detailcxx . . $ CDmfcStats#m_y_start_detail. = DLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:166:9`! + (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 273 | m_x_start_plistcxx . . $ CDmfcStats#m_x_start_plist. = PLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:161:9`!; |
| 274 | m_x_start_detailcxx . . $ CDmfcStats#m_x_start_detail. = DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`!; |
| 275 | |
| 276 | m_highlight_bmpcxx . . $ CDmfcStats#m_highlight_bmp. = DLLbm_AllocBitmap(32, 32, 0); |
| 277 | m_background_bmpcxx . . $ CDmfcStats#m_background_bmp. = DLLbm_AllocBitmap(32, 32, 0); |
| 278 | uint16_tcxx . . $ uint16_t# *data; |
| 279 | |
| 280 | if (m_highlight_bmpcxx . . $ CDmfcStats#m_highlight_bmp. == -1) |
| 281 | m_highlight_bmpcxx . . $ CDmfcStats#m_highlight_bmp. = BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!; |
| 282 | if (m_background_bmpcxx . . $ CDmfcStats#m_background_bmp. == -1) |
| 283 | m_background_bmpcxx . . $ CDmfcStats#m_background_bmp. = BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!; |
| 284 | |
| 285 | if (m_highlight_bmpcxx . . $ CDmfcStats#m_highlight_bmp. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) { |
| 286 | data = DLLbm_data(m_highlight_bmpcxx . . $ CDmfcStats#m_highlight_bmp., 0); |
| 287 | for (int x = 0; x < 32 * 32; x++) { |
| 288 | data[x] = GR_RGB16cxx . . $ GR_RGB16(6461fafb79bad5b9).(50, 50, 50) | OPAQUE_FLAGcxx . . $ `lib/grdefs.h:72:9`!; |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | if (m_background_bmpcxx . . $ CDmfcStats#m_background_bmp. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) { |
| 293 | data = DLLbm_data(m_background_bmpcxx . . $ CDmfcStats#m_background_bmp., 0); |
| 294 | for (int x = 0; x < 32 * 32; x++) { |
| 295 | data[x] = GR_RGB16cxx . . $ GR_RGB16(6461fafb79bad5b9).(0, 0, 0) | OPAQUE_FLAGcxx . . $ `lib/grdefs.h:72:9`!; |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | m_initcxx . . $ CDmfcStats#m_init. = true; |
| 300 | return true; |
| 301 | |
| 302 | error_init: |
| 303 | if (m_GameNamecxx . . $ CDmfcStats#m_GameName.) { |
| 304 | freecxx . . $ free(bd21765a0afc8e3c).(m_GameNamecxx . . $ CDmfcStats#m_GameName.); |
| 305 | } |
| 306 | if (m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.) { |
| 307 | freecxx . . $ free(bd21765a0afc8e3c).(m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.); |
| 308 | } |
| 309 | if (m_DColInfocxx . . $ CDmfcStats#m_DColInfo.) { |
| 310 | freecxx . . $ free(bd21765a0afc8e3c).(m_DColInfocxx . . $ CDmfcStats#m_DColInfo.); |
| 311 | } |
| 312 | return false; |
| 313 | } |
| 314 | |
| 315 | //================================= |
| 316 | |
| 317 | // enables/disables the displaying of the stats screen |
| 318 | void CDmfcStatscxx . . $ CDmfcStats#::Enablecxx . . $ CDmfcStats#Enable(b45ddcbc8423892c).(bool enable) { |
| 319 | m_enabledcxx . . $ CDmfcStats#m_enabled. = enable; |
| 320 | if (enable) { |
| 321 | player_recordcxx . . $ player_record# *pr = PRec_GetPRecordByPnumcxx . . $ PRec_GetPRecordByPnum(6359c6f28dd028ae).(basethiscxx . . $ basethis.->GetPlayerNumcxx . . $ DMFCBase#GetPlayerNum(b126dc7c1de90089).()); |
| 322 | if (pr && pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.) { |
| 323 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = pr - Player_recordscxx . . $ Player_records.; |
| 324 | } else { |
| 325 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = 0; |
| 326 | } |
| 327 | alpha_in_timecxx . . $ CDmfcStats#alpha_in_time. = 0; |
| 328 | m_alphacxx . . $ CDmfcStats#m_alpha. = 0; |
| 329 | m_page_indexcxx . . $ CDmfcStats#m_page_index. = 0; |
| 330 | m_can_fit_countcxx . . $ CDmfcStats#m_can_fit_count. = -1; |
| 331 | m_page_display_timecxx . . $ CDmfcStats#m_page_display_time. = 0; |
| 332 | m_has_multiple_pagescxx . . $ CDmfcStats#m_has_multiple_pages. = false; |
| 333 | |
| 334 | basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[basethiscxx . . $ basethis.->GetPlayerNumcxx . . $ DMFCBase#GetPlayerNum(b126dc7c1de90089).()].small_dll_objcxx . . $ player#small_dll_obj. = -1; |
| 335 | if (m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SHOWPLAYERVIEWcxx . . $ `netgames/includes/DMFC.h:633:9`!) { |
| 336 | player_recordcxx . . $ player_record# *pr = basethiscxx . . $ basethis.->GetPlayerRecordcxx . . $ DMFCBase#GetPlayerRecord(6359c6f28dd028ae).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.); |
| 337 | if (pr && pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) { |
| 338 | basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[basethiscxx . . $ basethis.->GetPlayerNumcxx . . $ DMFCBase#GetPlayerNum(b126dc7c1de90089).()].small_dll_objcxx . . $ player#small_dll_obj. = basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[pr->pnumcxx . . $ player_record#pnum.].objnumcxx . . $ player#objnum.; |
| 339 | } |
| 340 | } |
| 341 | } else { |
| 342 | basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[basethiscxx . . $ basethis.->GetPlayerNumcxx . . $ DMFCBase#GetPlayerNum(b126dc7c1de90089).()].small_dll_objcxx . . $ player#small_dll_obj. = -1; |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | // returns the state of the stats manager |
| 347 | bool CDmfcStatscxx . . $ CDmfcStats#::IsEnabledcxx . . $ CDmfcStats#IsEnabled(c9857a73d68e59ba).() { return m_enabledcxx . . $ CDmfcStats#m_enabled.; } |
| 348 | |
| 349 | // scrolls the player list down one |
| 350 | void CDmfcStatscxx . . $ CDmfcStats#::ScrollDowncxx . . $ CDmfcStats#ScrollDown(49f6e7a06ebc5aa8).() { |
| 351 | if (CanScrollDowncxx . . $ CDmfcStats#CanScrollDown(c9857a73d68e59ba).()) { |
| 352 | |
| 353 | if (m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SEPERATE_BY_TEAMcxx . . $ `netgames/includes/DMFC.h:615:9`!) { |
| 354 | // we need to handle team stats a bit different |
| 355 | // we must state on connected people until no more |
| 356 | // connected people exist, then go through the list |
| 357 | // through disconnected people |
| 358 | player_recordcxx . . $ player_record# *pr = basethiscxx . . $ basethis.->GetPlayerRecordcxx . . $ DMFCBase#GetPlayerRecord(6359c6f28dd028ae).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.); |
| 359 | if (!pr || pr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY.) { |
| 360 | m_selected_indexcxx . . $ CDmfcStats#m_selected_index.++; |
| 361 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = m_translatecxx . . $ CDmfcStats#m_translate.[m_selected_indexcxx . . $ CDmfcStats#m_selected_index.]; |
| 362 | } else { |
| 363 | bool isingame = (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? true : false; |
| 364 | |
| 365 | while (1) { |
| 366 | m_selected_indexcxx . . $ CDmfcStats#m_selected_index.++; |
| 367 | if (m_selected_indexcxx . . $ CDmfcStats#m_selected_index. == (m_MaxCountcxx . . $ CDmfcStats#m_MaxCount. - 1)) { |
| 368 | // we hit the bottom |
| 369 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = m_translatecxx . . $ CDmfcStats#m_translate.[m_selected_indexcxx . . $ CDmfcStats#m_selected_index.]; |
| 370 | |
| 371 | if (!isingame) |
| 372 | break; // we have gotten to the bottom of everyone |
| 373 | |
| 374 | pr = basethiscxx . . $ basethis.->GetPlayerRecordcxx . . $ DMFCBase#GetPlayerRecord(6359c6f28dd028ae).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.); |
| 375 | |
| 376 | // check to see if we want this player |
| 377 | if (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) |
| 378 | break; |
| 379 | |
| 380 | // now go through the disconnected folk |
| 381 | isingame = false; |
| 382 | m_selected_indexcxx . . $ CDmfcStats#m_selected_index. = -1; // set to -1, since it will be incremented right away |
| 383 | continue; |
| 384 | } |
| 385 | |
| 386 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = m_translatecxx . . $ CDmfcStats#m_translate.[m_selected_indexcxx . . $ CDmfcStats#m_selected_index.]; |
| 387 | pr = basethiscxx . . $ basethis.->GetPlayerRecordcxx . . $ DMFCBase#GetPlayerRecord(6359c6f28dd028ae).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.); |
| 388 | |
| 389 | if (!pr || pr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY.) |
| 390 | continue; |
| 391 | |
| 392 | // should we use this player? |
| 393 | if (isingame) { |
| 394 | if (pr->statecxx . . $ player_record#state. != STATE_INGAMEcxx . . $ STATE_INGAME.) |
| 395 | continue; // move to the next |
| 396 | } else { |
| 397 | if (pr->statecxx . . $ player_record#state. != STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.) |
| 398 | continue; // move to the next |
| 399 | } |
| 400 | |
| 401 | // all matches up if we haven't continue by here |
| 402 | break; |
| 403 | } |
| 404 | } |
| 405 | } else { |
| 406 | m_selected_indexcxx . . $ CDmfcStats#m_selected_index.++; |
| 407 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = m_translatecxx . . $ CDmfcStats#m_translate.[m_selected_indexcxx . . $ CDmfcStats#m_selected_index.]; |
| 408 | } |
| 409 | |
| 410 | m_page_indexcxx . . $ CDmfcStats#m_page_index. = 0; |
| 411 | m_can_fit_countcxx . . $ CDmfcStats#m_can_fit_count. = -1; |
| 412 | m_page_display_timecxx . . $ CDmfcStats#m_page_display_time. = 0; |
| 413 | m_has_multiple_pagescxx . . $ CDmfcStats#m_has_multiple_pages. = false; |
| 414 | |
| 415 | basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[basethiscxx . . $ basethis.->GetPlayerNumcxx . . $ DMFCBase#GetPlayerNum(b126dc7c1de90089).()].small_dll_objcxx . . $ player#small_dll_obj. = -1; |
| 416 | if (m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SHOWPLAYERVIEWcxx . . $ `netgames/includes/DMFC.h:633:9`!) { |
| 417 | player_recordcxx . . $ player_record# *pr = basethiscxx . . $ basethis.->GetPlayerRecordcxx . . $ DMFCBase#GetPlayerRecord(6359c6f28dd028ae).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.); |
| 418 | if (pr && pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) { |
| 419 | basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[basethiscxx . . $ basethis.->GetPlayerNumcxx . . $ DMFCBase#GetPlayerNum(b126dc7c1de90089).()].small_dll_objcxx . . $ player#small_dll_obj. = basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[pr->pnumcxx . . $ player_record#pnum.].objnumcxx . . $ player#objnum.; |
| 420 | } |
| 421 | } |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | // scrolls the player list up one |
| 426 | void CDmfcStatscxx . . $ CDmfcStats#::ScrollUpcxx . . $ CDmfcStats#ScrollUp(49f6e7a06ebc5aa8).() { |
| 427 | if (CanScrollUpcxx . . $ CDmfcStats#CanScrollUp(c9857a73d68e59ba).()) { |
| 428 | if (m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SEPERATE_BY_TEAMcxx . . $ `netgames/includes/DMFC.h:615:9`!) { |
| 429 | // we need to handle team stats a bit different |
| 430 | // we must state on connected people until no more |
| 431 | // connected people exist, then go through the list |
| 432 | // through disconnected people |
| 433 | player_recordcxx . . $ player_record# *pr = basethiscxx . . $ basethis.->GetPlayerRecordcxx . . $ DMFCBase#GetPlayerRecord(6359c6f28dd028ae).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.); |
| 434 | if (!pr || pr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY.) { |
| 435 | m_selected_indexcxx . . $ CDmfcStats#m_selected_index.--; |
| 436 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = m_translatecxx . . $ CDmfcStats#m_translate.[m_selected_indexcxx . . $ CDmfcStats#m_selected_index.]; |
| 437 | } else { |
| 438 | bool isingame = (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? true : false; |
| 439 | |
| 440 | while (1) { |
| 441 | m_selected_indexcxx . . $ CDmfcStats#m_selected_index.--; |
| 442 | if (m_selected_indexcxx . . $ CDmfcStats#m_selected_index. == 0) { |
| 443 | // we hit the top |
| 444 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = m_translatecxx . . $ CDmfcStats#m_translate.[m_selected_indexcxx . . $ CDmfcStats#m_selected_index.]; |
| 445 | |
| 446 | if (isingame) |
| 447 | break; // we have gotten to the top of everyone |
| 448 | |
| 449 | pr = basethiscxx . . $ basethis.->GetPlayerRecordcxx . . $ DMFCBase#GetPlayerRecord(6359c6f28dd028ae).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.); |
| 450 | |
| 451 | // check to see if we want this player |
| 452 | if (pr->statecxx . . $ player_record#state. == STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.) |
| 453 | break; |
| 454 | |
| 455 | // now go through the connected folk |
| 456 | isingame = true; |
| 457 | m_selected_indexcxx . . $ CDmfcStats#m_selected_index. = m_MaxCountcxx . . $ CDmfcStats#m_MaxCount.; // set to m_MaxCount, since it will be incremented right away |
| 458 | continue; |
| 459 | } |
| 460 | |
| 461 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = m_translatecxx . . $ CDmfcStats#m_translate.[m_selected_indexcxx . . $ CDmfcStats#m_selected_index.]; |
| 462 | pr = basethiscxx . . $ basethis.->GetPlayerRecordcxx . . $ DMFCBase#GetPlayerRecord(6359c6f28dd028ae).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.); |
| 463 | |
| 464 | if (!pr || pr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY.) |
| 465 | continue; |
| 466 | |
| 467 | // should we use this player? |
| 468 | if (isingame) { |
| 469 | if (pr->statecxx . . $ player_record#state. != STATE_INGAMEcxx . . $ STATE_INGAME.) |
| 470 | continue; // move to the next |
| 471 | } else { |
| 472 | if (pr->statecxx . . $ player_record#state. != STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.) |
| 473 | continue; // move to the next |
| 474 | } |
| 475 | |
| 476 | // all matches up if we haven't continue by here |
| 477 | break; |
| 478 | } |
| 479 | } |
| 480 | } else { |
| 481 | m_selected_indexcxx . . $ CDmfcStats#m_selected_index.--; |
| 482 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = m_translatecxx . . $ CDmfcStats#m_translate.[m_selected_indexcxx . . $ CDmfcStats#m_selected_index.]; |
| 483 | } |
| 484 | |
| 485 | m_page_indexcxx . . $ CDmfcStats#m_page_index. = 0; |
| 486 | m_can_fit_countcxx . . $ CDmfcStats#m_can_fit_count. = -1; |
| 487 | m_page_display_timecxx . . $ CDmfcStats#m_page_display_time. = 0; |
| 488 | m_has_multiple_pagescxx . . $ CDmfcStats#m_has_multiple_pages. = false; |
| 489 | |
| 490 | basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[basethiscxx . . $ basethis.->GetPlayerNumcxx . . $ DMFCBase#GetPlayerNum(b126dc7c1de90089).()].small_dll_objcxx . . $ player#small_dll_obj. = -1; |
| 491 | if (m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SHOWPLAYERVIEWcxx . . $ `netgames/includes/DMFC.h:633:9`!) { |
| 492 | player_recordcxx . . $ player_record# *pr = basethiscxx . . $ basethis.->GetPlayerRecordcxx . . $ DMFCBase#GetPlayerRecord(6359c6f28dd028ae).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.); |
| 493 | if (pr && pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) { |
| 494 | basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[basethiscxx . . $ basethis.->GetPlayerNumcxx . . $ DMFCBase#GetPlayerNum(b126dc7c1de90089).()].small_dll_objcxx . . $ player#small_dll_obj. = basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[pr->pnumcxx . . $ player_record#pnum.].objnumcxx . . $ player#objnum.; |
| 495 | } |
| 496 | } |
| 497 | } |
| 498 | } |
| 499 | |
| 500 | // returns true if the player list can scroll down any more |
| 501 | bool CDmfcStatscxx . . $ CDmfcStats#::CanScrollDowncxx . . $ CDmfcStats#CanScrollDown(c9857a73d68e59ba).() { return (m_selected_indexcxx . . $ CDmfcStats#m_selected_index. < (m_MaxCountcxx . . $ CDmfcStats#m_MaxCount. - 1)) ? true : false; } |
| 502 | |
| 503 | // returns true if the player list can scroll up any more |
| 504 | bool CDmfcStatscxx . . $ CDmfcStats#::CanScrollUpcxx . . $ CDmfcStats#CanScrollUp(c9857a73d68e59ba).() { return (bool)(m_selected_indexcxx . . $ CDmfcStats#m_selected_index. > 0); } |
| 505 | |
| 506 | void drawlinecxx . . $ drawline(3c27ae030892e7bf).(int lx, int rx, int y, float perc) { |
| 507 | int width = ((float)(rx - lx)) * perc; |
| 508 | int center = lx + (rx - lx) / 2; |
| 509 | |
| 510 | width = width / 2; |
| 511 | lx = center - width; |
| 512 | rx = center + width; |
| 513 | |
| 514 | /* |
| 515 | rx = lx + width; |
| 516 | */ |
| 517 | |
| 518 | int ny = y; |
| 519 | basethiscxx . . $ basethis.->ConvertHUDCoordcxx . . $ DMFCBase#ConvertHUDCoord(d9d96f10f2d1e5b).(lx, y, &lx, &y); |
| 520 | basethiscxx . . $ basethis.->ConvertHUDCoordcxx . . $ DMFCBase#ConvertHUDCoord(d9d96f10f2d1e5b).(rx, ny, &rx, &ny); |
| 521 | DLLrend_DrawLine(lx, y, rx, ny); |
| 522 | } |
| 523 | |
| 524 | // renders the stats screen |
| 525 | void CDmfcStatscxx . . $ CDmfcStats#::Rendercxx . . $ CDmfcStats#Render(49f6e7a06ebc5aa8).() { |
| 526 | int i, c, curr_x, curr_y; |
| 527 | player_recordcxx . . $ player_record# *pr; |
| 528 | char buffer[256]; |
| 529 | DLLrend_SetFlatColor(GR_WHITEcxx . . $ GR_WHITE.); |
| 530 | float perc_done = (alpha_in_timecxx . . $ CDmfcStats#alpha_in_time. < ALPHA_IN_TIMEcxx . . $ `netgames/dmfc/dmfcstats.cpp:157:9`!) ? (alpha_in_timecxx . . $ CDmfcStats#alpha_in_time. / ALPHA_IN_TIMEcxx . . $ `netgames/dmfc/dmfcstats.cpp:157:9`!) : 1.0f; |
| 531 | bool need_to_display_observer_icon; |
| 532 | bool is_dedicated_server; |
| 533 | int last_team = -1; |
| 534 | int teams_displayed = 0; |
| 535 | bool team_disp[DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!]; |
| 536 | |
| 537 | for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) { |
| 538 | team_disp[i] = false; |
| 539 | } |
| 540 | |
| 541 | // render all the player list columns |
| 542 | curr_x = m_x_start_plistcxx . . $ CDmfcStats#m_x_start_plist.; |
| 543 | curr_y = PLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:162:9`! + 1; |
| 544 | |
| 545 | // render window and headings |
| 546 | DLLRenderHUDQuad(PLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:161:9`!, PLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:162:9`!, PLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:159:9`!, PLIST_WIN_Hcxx . . $ `netgames/dmfc/dmfcstats.cpp:160:9`!, 0, 0, 1, 1, m_background_bmpcxx . . $ CDmfcStats#m_background_bmp., perc_done * 200.0f, |
| 547 | 0); |
| 548 | |
| 549 | DLLgrtext_SetFont(basethiscxx . . $ basethis.->Game_fontscxx . . $ DMFCBase#Game_fonts.[HUD_FONT_INDEXcxx . . $ `Descent3/gamefont.h:97:9`!]); |
| 550 | int l_width = DLLRenderHUDGetTextLineWidth(m_GameNamecxx . . $ CDmfcStats#m_GameName.); |
| 551 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, (PLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:159:9`! / 2) - (l_width / 2), curr_y, m_GameNamecxx . . $ CDmfcStats#m_GameName.); |
| 552 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 553 | for (c = 0; c < m_iPLColCountcxx . . $ CDmfcStats#m_iPLColCount.; c++) { |
| 554 | strcpy(buffer, m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].titlecxx . . $ tDmfcStatsColumnInfo#title.); |
| 555 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].widthcxx . . $ tDmfcStatsColumnInfo#width., buffer, false); |
| 556 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, curr_x, curr_y, buffer); |
| 557 | curr_x += m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].widthcxx . . $ tDmfcStatsColumnInfo#width.; |
| 558 | } |
| 559 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + (ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!) / 2); |
| 560 | if (m_iPLColCountcxx . . $ CDmfcStats#m_iPLColCount. > 0) |
| 561 | drawlinecxx . . $ drawline(3c27ae030892e7bf).(PLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:161:9`!, PLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:161:9`! + PLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:159:9`! - 1, curr_y, perc_done); |
| 562 | |
| 563 | curr_x = m_x_start_plistcxx . . $ CDmfcStats#m_x_start_plist.; |
| 564 | curr_y = m_y_start_plistcxx . . $ CDmfcStats#m_y_start_plist. + 4; |
| 565 | |
| 566 | bool displaying_in_game_players = true; |
| 567 | bool not_overflowing = true; |
| 568 | bool update_bottom_index = true; |
| 569 | |
| 570 | redisplay_list: |
| 571 | |
| 572 | for (i = m_top_indexcxx . . $ CDmfcStats#m_top_index.; i < m_MaxCountcxx . . $ CDmfcStats#m_MaxCount.; i++) { |
| 573 | pr = PRec_GetPRecordcxx . . $ PRec_GetPRecord(6359c6f28dd028ae).(m_translatecxx . . $ CDmfcStats#m_translate.[i]); |
| 574 | |
| 575 | if (!pr || pr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY.) |
| 576 | continue; |
| 577 | |
| 578 | if (m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SEPERATE_BY_TEAMcxx . . $ `netgames/includes/DMFC.h:615:9`!) { |
| 579 | // for team games we seperate disconnected and ingame people |
| 580 | if (displaying_in_game_players) { |
| 581 | // filter out non-ingame players |
| 582 | if (pr->statecxx . . $ player_record#state. != STATE_INGAMEcxx . . $ STATE_INGAME.) |
| 583 | continue; |
| 584 | } else { |
| 585 | // filter out non-disconnected players |
| 586 | if (pr->statecxx . . $ player_record#state. != STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.) |
| 587 | continue; |
| 588 | } |
| 589 | } |
| 590 | |
| 591 | is_dedicated_server = basethiscxx . . $ basethis.->IsPlayerDedicatedServercxx . . $ DMFCBase#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr); |
| 592 | |
| 593 | if ((m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SEPERATE_BY_TEAMcxx . . $ `netgames/includes/DMFC.h:615:9`!) && (last_team != pr->teamcxx . . $ player_record#team.) && !is_dedicated_server) { |
| 594 | i--; // this line doesn't count |
| 595 | last_team = pr->teamcxx . . $ player_record#team.; |
| 596 | buffer[0] = '\0'; |
| 597 | |
| 598 | if (!team_disp[last_team]) { |
| 599 | teams_displayed++; |
| 600 | team_disp[last_team] = true; |
| 601 | } |
| 602 | |
| 603 | if (m_TeamCallbackcxx . . $ CDmfcStats#m_TeamCallback.) { |
| 604 | snprintf(buffer, sizeof(buffer), DTXT_TEAMLABELcxx . . $ `netgames/dmfc/dmfcinternal.h:2735:9`!, basethiscxx . . $ basethis.->GetTeamStringcxx . . $ DMFCBase#GetTeamString(f7ae7e56280f18ae).(pr->teamcxx . . $ player_record#team.)); |
| 605 | int length = strlen(buffer); |
| 606 | buffer[length] = ' '; // lose the \0 |
| 607 | |
| 608 | (*m_TeamCallbackcxx . . $ CDmfcStats#m_TeamCallback.)(pr->teamcxx . . $ player_record#team., &buffer[length], sizeof(buffer) - length - 1); |
| 609 | buffer[sizeof(buffer) - 1] = '\0'; |
| 610 | |
| 611 | int width = (PLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:161:9`! + PLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:159:9`! - curr_x - 5); |
| 612 | float ratio = DEFAULT_HUD_WIDTHcxx . . $ `Descent3/hud.h:261:9`! / ((float)*basethiscxx . . $ basethis.->Game_window_wcxx . . $ DMFCBase#Game_window_w.); |
| 613 | |
| 614 | // clip the string to the width |
| 615 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(width, buffer, false); |
| 616 | |
| 617 | int l = ratio * ((float)DLLRenderHUDGetTextLineWidth(buffer)); |
| 618 | int x = (width / 2) - (l / 2); |
| 619 | |
| 620 | DLLRenderHUDText(basethiscxx . . $ basethis.->GetTeamColorcxx . . $ DMFCBase#GetTeamColor(46cc46841198e427).(pr->teamcxx . . $ player_record#team.), m_alphacxx . . $ CDmfcStats#m_alpha., 0, x, curr_y, buffer); |
| 621 | } |
| 622 | |
| 623 | goto skip_line; // don't process this line |
| 624 | } |
| 625 | |
| 626 | // draw the highlight bar if selected bitmap |
| 627 | if (m_selected_indexcxx . . $ CDmfcStats#m_selected_index. == i) { |
| 628 | DLLRenderHUDQuad(m_x_start_plistcxx . . $ CDmfcStats#m_x_start_plist., curr_y, PLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:159:9`!, m_font_heightcxx . . $ CDmfcStats#m_font_height., 0, 0, 1, 1, m_highlight_bmpcxx . . $ CDmfcStats#m_highlight_bmp., |
| 629 | perc_done * 128.0f, 0); |
| 630 | } |
| 631 | |
| 632 | need_to_display_observer_icon = |
| 633 | (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? (basethiscxx . . $ basethis.->IsPlayerObservercxx . . $ DMFCBase#IsPlayerObserver(83c267b20bac841a).(pr->pnumcxx . . $ player_record#pnum.) ? true : false) : false; |
| 634 | |
| 635 | for (c = 0; c < m_iPLColCountcxx . . $ CDmfcStats#m_iPLColCount.; c++) { |
| 636 | buffer[0] = '\0'; |
| 637 | |
| 638 | if (!is_dedicated_server || m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].typecxx . . $ tDmfcStatsColumnInfo#type. == DSCOL_PILOT_NAMEcxx . . $ DSCOL_PILOT_NAME. || m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].typecxx . . $ tDmfcStatsColumnInfo#type. == DSCOL_BLANKcxx . . $ DSCOL_BLANK.) { |
| 639 | switch (m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].typecxx . . $ tDmfcStatsColumnInfo#type.) { |
| 640 | case DSCOL_BMPcxx . . $ DSCOL_BMP.: |
| 641 | break; |
| 642 | case DSCOL_KILLS_LEVELcxx . . $ DSCOL_KILLS_LEVEL.: |
| 643 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]); |
| 644 | break; |
| 645 | case DSCOL_KILLS_OVERALLcxx . . $ DSCOL_KILLS_OVERALL.: |
| 646 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 647 | break; |
| 648 | case DSCOL_KILLS_BOTHcxx . . $ DSCOL_KILLS_BOTH.: |
| 649 | snprintf(buffer, sizeof(buffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!], pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 650 | break; |
| 651 | case DSCOL_DEATHS_LEVELcxx . . $ DSCOL_DEATHS_LEVEL.: |
| 652 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]); |
| 653 | break; |
| 654 | case DSCOL_DEATHS_OVERALLcxx . . $ DSCOL_DEATHS_OVERALL.: |
| 655 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 656 | break; |
| 657 | case DSCOL_DEATHS_BOTHcxx . . $ DSCOL_DEATHS_BOTH.: |
| 658 | snprintf(buffer, sizeof(buffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!], pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 659 | break; |
| 660 | case DSCOL_SUICIDES_LEVELcxx . . $ DSCOL_SUICIDES_LEVEL.: |
| 661 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]); |
| 662 | break; |
| 663 | case DSCOL_SUICIDES_OVERALLcxx . . $ DSCOL_SUICIDES_OVERALL.: |
| 664 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 665 | break; |
| 666 | case DSCOL_SUICIDES_BOTHcxx . . $ DSCOL_SUICIDES_BOTH.: |
| 667 | snprintf(buffer, sizeof(buffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!], |
| 668 | pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 669 | break; |
| 670 | case DSCOL_PILOT_NAMEcxx . . $ DSCOL_PILOT_NAME.: |
| 671 | strcpy(buffer, pr->callsigncxx . . $ player_record#callsign.); |
| 672 | break; |
| 673 | case DSCOL_PILOT_TEAMcxx . . $ DSCOL_PILOT_TEAM.: |
| 674 | snprintf(buffer, sizeof(buffer), "%s", basethiscxx . . $ basethis.->GetTeamStringcxx . . $ DMFCBase#GetTeamString(f7ae7e56280f18ae).(pr->teamcxx . . $ player_record#team.)); |
| 675 | break; |
| 676 | case DSCOL_PINGcxx . . $ DSCOL_PING.: |
| 677 | if (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) |
| 678 | snprintf(buffer, sizeof(buffer), "%.0f", basethiscxx . . $ basethis.->NetPlayerscxx . . $ DMFCBase#NetPlayers.[pr->pnumcxx . . $ player_record#pnum.].ping_timecxx . . $ netplayer#ping_time. * 1000.0f); |
| 679 | else |
| 680 | strcpy(buffer, "N/A"); |
| 681 | break; |
| 682 | case DSCOL_CUSTOMcxx . . $ DSCOL_CUSTOM.: |
| 683 | if (m_PLColCallbackcxx . . $ CDmfcStats#m_PLColCallback.) |
| 684 | (*m_PLColCallbackcxx . . $ CDmfcStats#m_PLColCallback.)(m_translatecxx . . $ CDmfcStats#m_translate.[i], c, buffer, sizeof(buffer)); |
| 685 | break; |
| 686 | case DSCOL_BLANKcxx . . $ DSCOL_BLANK.: |
| 687 | buffer[0] = '\0'; |
| 688 | break; |
| 689 | } |
| 690 | } else { |
| 691 | strcpy(buffer, "N/A"); |
| 692 | } |
| 693 | |
| 694 | int width_to_use = m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].widthcxx . . $ tDmfcStatsColumnInfo#width.; |
| 695 | |
| 696 | if (m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].typecxx . . $ tDmfcStatsColumnInfo#type. != DSCOL_BMPcxx . . $ DSCOL_BMP.) { |
| 697 | |
| 698 | if (need_to_display_observer_icon) { |
| 699 | if (m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SHOW_OBSERVERICONcxx . . $ `netgames/includes/DMFC.h:627:9`! && m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].typecxx . . $ tDmfcStatsColumnInfo#type. == DSCOL_PILOT_NAMEcxx . . $ DSCOL_PILOT_NAME.) { |
| 700 | need_to_display_observer_icon = false; |
| 701 | DLLRenderHUDQuad(curr_x, curr_y, m_font_heightcxx . . $ CDmfcStats#m_font_height., m_font_heightcxx . . $ CDmfcStats#m_font_height., 0, 0, 1, 1, basethiscxx . . $ basethis.->hBitmapObservercxx . . $ DMFCBase#hBitmapObserver., |
| 702 | m_alphacxx . . $ CDmfcStats#m_alpha., 0); |
| 703 | curr_x += m_font_heightcxx . . $ CDmfcStats#m_font_height. + 1; |
| 704 | width_to_use -= (m_font_heightcxx . . $ CDmfcStats#m_font_height. + 1); |
| 705 | } |
| 706 | } |
| 707 | |
| 708 | // clip the string to the width |
| 709 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(width_to_use, (PLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:161:9`! + PLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:159:9`! - curr_x - 5)), buffer, false); |
| 710 | |
| 711 | // print out string |
| 712 | ddgr_colorcxx . . $ ddgr_color# color; |
| 713 | switch (m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].color_typecxx . . $ tDmfcStatsColumnInfo#color_type.) { |
| 714 | case DSCOLOR_NORMALcxx . . $ DSCOLOR_NORMAL.: |
| 715 | color = (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? GR_GREENcxx . . $ GR_GREEN. : GR_GREYcxx . . $ `netgames/includes/DMFC.h:432:9`!; |
| 716 | break; |
| 717 | case DSCOLOR_TEAMcxx . . $ DSCOLOR_TEAM.: |
| 718 | color = (m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].typecxx . . $ tDmfcStatsColumnInfo#type. == DSCOL_PILOT_NAMEcxx . . $ DSCOL_PILOT_NAME.) |
| 719 | ? (basethiscxx . . $ basethis.->GetTeamColorcxx . . $ DMFCBase#GetTeamColor(46cc46841198e427).(pr->teamcxx . . $ player_record#team.)) |
| 720 | : ((pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? (basethiscxx . . $ basethis.->GetTeamColorcxx . . $ DMFCBase#GetTeamColor(46cc46841198e427).(pr->teamcxx . . $ player_record#team.)) : (GR_GREYcxx . . $ `netgames/includes/DMFC.h:432:9`!)); |
| 721 | break; |
| 722 | case DSCOLOR_SHIPCOLORcxx . . $ DSCOLOR_SHIPCOLOR.: |
| 723 | color = (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? basethiscxx . . $ basethis.->Player_colorscxx . . $ DMFCBase#Player_colors.[pr->pnumcxx . . $ player_record#pnum.] : GR_GREYcxx . . $ `netgames/includes/DMFC.h:432:9`!; |
| 724 | break; |
| 725 | case DSCOLOR_CUSTOMcxx . . $ DSCOLOR_CUSTOM.: |
| 726 | color = m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].colorcxx . . $ tDmfcStatsColumnInfo#color.; |
| 727 | break; |
| 728 | default: |
| 729 | color = (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? GR_GREENcxx . . $ GR_GREEN. : GR_GREYcxx . . $ `netgames/includes/DMFC.h:432:9`!; |
| 730 | break; |
| 731 | }; |
| 732 | |
| 733 | DLLRenderHUDText(color, m_alphacxx . . $ CDmfcStats#m_alpha., 0, curr_x, curr_y, buffer); |
| 734 | } else { |
| 735 | |
| 736 | // we need to draw a custom bitmap |
| 737 | (*m_PLColCallbackBMPcxx . . $ CDmfcStats#m_PLColCallbackBMP.)(m_translatecxx . . $ CDmfcStats#m_translate.[i], c, curr_x, curr_y, m_PLColInfocxx . . $ CDmfcStats#m_PLColInfo.[c].widthcxx . . $ tDmfcStatsColumnInfo#width., m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!, |
| 738 | m_alphacxx . . $ CDmfcStats#m_alpha.); |
| 739 | } |
| 740 | |
| 741 | curr_x += width_to_use; |
| 742 | |
| 743 | if (curr_x > PLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:159:9`! + PLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:161:9`!) |
| 744 | break; // we can't fit anymore columns |
| 745 | } |
| 746 | |
| 747 | // update the bottom index |
| 748 | if (update_bottom_index || i > m_bottom_indexcxx . . $ CDmfcStats#m_bottom_index.) { |
| 749 | m_bottom_indexcxx . . $ CDmfcStats#m_bottom_index. = i; |
| 750 | update_bottom_index = false; // we force an update the first time through |
| 751 | } |
| 752 | skip_line: |
| 753 | curr_x = m_x_start_plistcxx . . $ CDmfcStats#m_x_start_plist.; |
| 754 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 755 | |
| 756 | if ((curr_y + m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!) > PLIST_WIN_Hcxx . . $ `netgames/dmfc/dmfcstats.cpp:160:9`! + PLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:162:9`!) { |
| 757 | not_overflowing = false; |
| 758 | break; // we are done here |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | if ((m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SEPERATE_BY_TEAMcxx . . $ `netgames/includes/DMFC.h:615:9`!) && displaying_in_game_players && not_overflowing) { |
| 763 | // we can continue displaying, but just the disconnected people now |
| 764 | last_team = -1; // so we redraw the team names |
| 765 | displaying_in_game_players = false; |
| 766 | |
| 767 | // display the disconnected people |
| 768 | goto redisplay_list; |
| 769 | } |
| 770 | |
| 771 | // Display the remaining teams |
| 772 | if ((m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SEPERATE_BY_TEAMcxx . . $ `netgames/includes/DMFC.h:615:9`!) && (teams_displayed < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!) && |
| 773 | ((curr_y + m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!) < PLIST_WIN_Hcxx . . $ `netgames/dmfc/dmfcstats.cpp:160:9`! + PLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:162:9`!)) { |
| 774 | int tcount = basethiscxx . . $ basethis.->GetNumTeamscxx . . $ DMFCBase#GetNumTeams(b126dc7c1de90089).(); |
| 775 | for (i = 0; i < tcount; i++) { |
| 776 | if (team_disp[i]) |
| 777 | continue; |
| 778 | |
| 779 | team_disp[i] = true; |
| 780 | last_team = i; |
| 781 | buffer[0] = '\0'; |
| 782 | teams_displayed++; |
| 783 | |
| 784 | if (m_TeamCallbackcxx . . $ CDmfcStats#m_TeamCallback.) { |
| 785 | snprintf(buffer, sizeof(buffer), DTXT_TEAMLABELcxx . . $ `netgames/dmfc/dmfcinternal.h:2735:9`!, basethiscxx . . $ basethis.->GetTeamStringcxx . . $ DMFCBase#GetTeamString(f7ae7e56280f18ae).(i)); |
| 786 | int length = strlen(buffer); |
| 787 | buffer[length] = ' '; // lose the \0 |
| 788 | |
| 789 | (*m_TeamCallbackcxx . . $ CDmfcStats#m_TeamCallback.)(i, &buffer[length], sizeof(buffer) - length - 1); |
| 790 | buffer[sizeof(buffer) - 1] = '\0'; |
| 791 | |
| 792 | int width = (PLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:161:9`! + PLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:159:9`! - curr_x - 5); |
| 793 | float ratio = DEFAULT_HUD_WIDTHcxx . . $ `Descent3/hud.h:261:9`! / ((float)*basethiscxx . . $ basethis.->Game_window_wcxx . . $ DMFCBase#Game_window_w.); |
| 794 | |
| 795 | // clip the string to the width |
| 796 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(width, buffer, false); |
| 797 | |
| 798 | int l = ratio * ((float)DLLRenderHUDGetTextLineWidth(buffer)); |
| 799 | int x = (width / 2) - (l / 2); |
| 800 | |
| 801 | DLLRenderHUDText(basethiscxx . . $ basethis.->GetTeamColorcxx . . $ DMFCBase#GetTeamColor(46cc46841198e427).(i), m_alphacxx . . $ CDmfcStats#m_alpha., 0, x, curr_y, buffer); |
| 802 | } |
| 803 | |
| 804 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 805 | |
| 806 | if ((curr_y + m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!) > PLIST_WIN_Hcxx . . $ `netgames/dmfc/dmfcstats.cpp:160:9`! + PLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:162:9`!) { |
| 807 | break; // we are done here |
| 808 | } |
| 809 | } |
| 810 | } |
| 811 | |
| 812 | // render the detailed menu |
| 813 | curr_x = m_x_start_detailcxx . . $ CDmfcStats#m_x_start_detail.; |
| 814 | curr_y = DLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:166:9`! + 1; |
| 815 | |
| 816 | DLLRenderHUDQuad(DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`!, DLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:166:9`!, DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`!, DLIST_WIN_Hcxx . . $ `netgames/dmfc/dmfcstats.cpp:164:9`!, 0, 0, 1, 1, m_background_bmpcxx . . $ CDmfcStats#m_background_bmp., perc_done * 200.0f, |
| 817 | 0); |
| 818 | pr = PRec_GetPRecordcxx . . $ PRec_GetPRecord(6359c6f28dd028ae).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.); |
| 819 | if (!pr || pr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY. || pr->pinfocxx . . $ player_record#pinfo. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 820 | return; |
| 821 | |
| 822 | is_dedicated_server = basethiscxx . . $ basethis.->IsPlayerDedicatedServercxx . . $ DMFCBase#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr); |
| 823 | |
| 824 | // display the heading for the player |
| 825 | strcpy(buffer, pr->callsigncxx . . $ player_record#callsign.); |
| 826 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`!, buffer, false); |
| 827 | l_width = DLLRenderHUDGetTextLineWidth(buffer); |
| 828 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`! + (DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`! / 2) - (l_width / 2), curr_y, buffer); |
| 829 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 830 | |
| 831 | if (m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SHOW_PICcxx . . $ `netgames/includes/DMFC.h:619:9`! && pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME. && !is_dedicated_server) { |
| 832 | |
| 833 | if (basethiscxx . . $ basethis.->PilotPicBmpHandlescxx . . $ DMFCBase#PilotPicBmpHandles.[pr->pnumcxx . . $ player_record#pnum.] > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) { |
| 834 | // display the pilot picture |
| 835 | DLLRenderHUDQuad(DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`! + (DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`! / 2) - 32, curr_y, 64, 64, 0, 0, 1, 1, |
| 836 | basethiscxx . . $ basethis.->PilotPicBmpHandlescxx . . $ DMFCBase#PilotPicBmpHandles.[pr->pnumcxx . . $ player_record#pnum.], m_alphacxx . . $ CDmfcStats#m_alpha., 0); |
| 837 | curr_y += 70; |
| 838 | } else if (basethiscxx . . $ basethis.->AreLogosEnabledcxx . . $ DMFCBase#AreLogosEnabled(c9857a73d68e59ba).()) { // only show logo's if enabled |
| 839 | bool animated; |
| 840 | int bmp_to_disp = BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!; |
| 841 | int logo_handle = basethiscxx . . $ basethis.->GetPlayerLogoBmpcxx . . $ DMFCBase#GetPlayerLogoBmp(87ec94c72a760af5).(pr->pnumcxx . . $ player_record#pnum., &animated); |
| 842 | if (logo_handle != -1) { |
| 843 | if (animated) { |
| 844 | // display a vclip |
| 845 | |
| 846 | vclipcxx . . $ vclip# *vc = &basethiscxx . . $ basethis.->GameVClipscxx . . $ DMFCBase#GameVClips.[logo_handle]; |
| 847 | float interval = 1.0f / 10.0f; |
| 848 | int frames_elapsed = (int)(alpha_in_timecxx . . $ CDmfcStats#alpha_in_time. / interval); |
| 849 | |
| 850 | int frame = frames_elapsed % vc->num_framescxx . . $ vclip#num_frames.; |
| 851 | bmp_to_disp = vc->framescxx . . $ vclip#frames.[frame]; |
| 852 | |
| 853 | } else { |
| 854 | bmp_to_disp = logo_handle; |
| 855 | } |
| 856 | DLLRenderHUDQuad(DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`! + (DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`! / 2) - 32, curr_y, 64, 64, 0, 0, 1, 1, bmp_to_disp, m_alphacxx . . $ CDmfcStats#m_alpha., 0); |
| 857 | curr_y += 70; |
| 858 | } |
| 859 | } |
| 860 | } |
| 861 | |
| 862 | int old_y = curr_y; |
| 863 | int max_w = 0; |
| 864 | int x_to_use = curr_x + 5; |
| 865 | PInfocxx . . $ PInfo# *pi; |
| 866 | tPExtraInfocxx . . $ tPExtraInfo# *ei; |
| 867 | pi = (PInfocxx . . $ PInfo# *)pr->pinfocxx . . $ player_record#pinfo.; |
| 868 | ei = pi->GetExtraInfocxx . . $ PInfo#GetExtraInfo(f456be6123535f67).(); |
| 869 | |
| 870 | // drawline(DLIST_WIN_X,DLIST_WIN_X+DLIST_WIN_W-1,curr_y,perc_done); curr_y += 3; |
| 871 | |
| 872 | // game status |
| 873 | strcpy(buffer, DTXT_STAT_STATUScxx . . $ `netgames/dmfc/dmfcinternal.h:2685:9`!); |
| 874 | // l_width = (DLLgrtext_GetTextLineWidth(buffer)*(*basethis->Hud_aspect_x)); |
| 875 | l_width = DLLRenderHUDGetTextLineWidth(buffer); |
| 876 | max_w = l_width; |
| 877 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 878 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 879 | |
| 880 | // ranking (if available) |
| 881 | int player_rank; |
| 882 | char player_rank_buffer[64]; |
| 883 | player_rank = |
| 884 | (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME. && !is_dedicated_server) ? GetPlayerRankIndex(pr->pnumcxx . . $ player_record#pnum., player_rank_buffer) : -1; |
| 885 | |
| 886 | if (player_rank != -1) { |
| 887 | strcpy(buffer, DTXT_RANKcxx . . $ `netgames/dmfc/dmfcinternal.h:2709:9`!); |
| 888 | l_width = DLLRenderHUDGetTextLineWidth(buffer); |
| 889 | if (l_width > max_w) |
| 890 | max_w = l_width; |
| 891 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 892 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 893 | } |
| 894 | |
| 895 | // team (if available) |
| 896 | if (basethiscxx . . $ basethis.->GetNumTeamscxx . . $ DMFCBase#GetNumTeams(b126dc7c1de90089).() > 1 && !is_dedicated_server) { |
| 897 | strcpy(buffer, DTXT_STAT_TEAMcxx . . $ `netgames/dmfc/dmfcinternal.h:2686:9`!); |
| 898 | l_width = DLLRenderHUDGetTextLineWidth(buffer); |
| 899 | if (l_width > max_w) |
| 900 | max_w = l_width; |
| 901 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 902 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 903 | } |
| 904 | |
| 905 | // time in game |
| 906 | strcpy(buffer, DTXT_STAT_PLAYTIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2687:9`!); |
| 907 | l_width = DLLRenderHUDGetTextLineWidth(buffer); |
| 908 | if (l_width > max_w) |
| 909 | max_w = l_width; |
| 910 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 911 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 912 | |
| 913 | uint8_tcxx . . $ uint8_t# streak_type = 0; |
| 914 | |
| 915 | if (!is_dedicated_server) { |
| 916 | // none of this should be displayed for a dedicated server |
| 917 | |
| 918 | if (ei->kills_in_a_rowcxx . . $ tPExtraInfo#kills_in_a_row.) |
| 919 | streak_type = 1; |
| 920 | else if (ei->deaths_in_a_rowcxx . . $ tPExtraInfo#deaths_in_a_row.) |
| 921 | streak_type = 2; |
| 922 | |
| 923 | // kills/deaths in a row |
| 924 | if (streak_type > 0) { |
| 925 | strcpy(buffer, DTXT_STAT_STREAKcxx . . $ `netgames/dmfc/dmfcinternal.h:2688:9`!); |
| 926 | l_width = DLLRenderHUDGetTextLineWidth(buffer); |
| 927 | if (l_width > max_w) |
| 928 | max_w = l_width; |
| 929 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 930 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 931 | } |
| 932 | |
| 933 | // last player you killed |
| 934 | if (!(m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_NOLASTVICTIMcxx . . $ `netgames/includes/DMFC.h:631:9`!)) { |
| 935 | strcpy(buffer, DTXT_STAT_LASTVICTIMcxx . . $ `netgames/dmfc/dmfcinternal.h:2689:9`!); |
| 936 | l_width = DLLRenderHUDGetTextLineWidth(buffer); |
| 937 | if (l_width > max_w) |
| 938 | max_w = l_width; |
| 939 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 940 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 941 | } |
| 942 | |
| 943 | // last player to kill you |
| 944 | if (!(m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_NOLASTKILLERcxx . . $ `netgames/includes/DMFC.h:630:9`!)) { |
| 945 | strcpy(buffer, DTXT_STAT_LASTKILLERcxx . . $ `netgames/dmfc/dmfcinternal.h:2690:9`!); |
| 946 | l_width = DLLRenderHUDGetTextLineWidth(buffer); |
| 947 | if (l_width > max_w) |
| 948 | max_w = l_width; |
| 949 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 950 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 951 | } |
| 952 | } |
| 953 | |
| 954 | curr_y = old_y; |
| 955 | x_to_use += (max_w + 5); |
| 956 | int width_to_clip; |
| 957 | |
| 958 | width_to_clip = DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`! + DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`! - x_to_use - 5; |
| 959 | |
| 960 | // game status |
| 961 | if (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) { |
| 962 | if (basethiscxx . . $ basethis.->IsPlayerDedicatedServercxx . . $ DMFCBase#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr)) { |
| 963 | strcpy(buffer, DTXT_STAT_SERVERcxx . . $ `netgames/dmfc/dmfcinternal.h:2691:9`!); |
| 964 | } else { |
| 965 | if (basethiscxx . . $ basethis.->IsPlayerObservercxx . . $ DMFCBase#IsPlayerObserver(83c267b20bac841a).(pr->pnumcxx . . $ player_record#pnum.)) { |
| 966 | strcpy(buffer, DTXT_STAT_OBSERVERcxx . . $ `netgames/dmfc/dmfcinternal.h:2692:9`!); |
| 967 | } else { |
| 968 | strcpy(buffer, DTXT_STAT_PLAYINGcxx . . $ `netgames/dmfc/dmfcinternal.h:2693:9`!); |
| 969 | } |
| 970 | } |
| 971 | } else { |
| 972 | strcpy(buffer, DTXT_STAT_DISCONNECTEDcxx . . $ `netgames/dmfc/dmfcinternal.h:2694:9`!); |
| 973 | } |
| 974 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(width_to_clip, buffer, false); |
| 975 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 976 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 977 | |
| 978 | // player ranking (if available) |
| 979 | if (player_rank != -1) { |
| 980 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(width_to_clip, player_rank_buffer, false); |
| 981 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, player_rank_buffer); |
| 982 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 983 | } |
| 984 | |
| 985 | // team (if available) |
| 986 | if (basethiscxx . . $ basethis.->GetNumTeamscxx . . $ DMFCBase#GetNumTeams(b126dc7c1de90089).() > 1 && !is_dedicated_server) { |
| 987 | strcpy(buffer, basethiscxx . . $ basethis.->GetTeamStringcxx . . $ DMFCBase#GetTeamString(f7ae7e56280f18ae).(pr->teamcxx . . $ player_record#team.)); |
| 988 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(width_to_clip, buffer, false); |
| 989 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 990 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 991 | } |
| 992 | |
| 993 | // time in game |
| 994 | strcpy(buffer, basethiscxx . . $ basethis.->GetTimeStringcxx . . $ DMFCBase#GetTimeString(3b344d7a46e3c2ff).(basethiscxx . . $ basethis.->GetTimeInGamecxx . . $ DMFCBase#GetTimeInGame(5cde91ea12d43f46).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.))); |
| 995 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(width_to_clip, buffer, false); |
| 996 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 997 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 998 | |
| 999 | if (!is_dedicated_server) { |
| 1000 | switch (streak_type) { |
| 1001 | case 1: // kills in a row |
| 1002 | snprintf(buffer, sizeof(buffer), "%d %s", ei->kills_in_a_rowcxx . . $ tPExtraInfo#kills_in_a_row., |
| 1003 | (ei->kills_in_a_rowcxx . . $ tPExtraInfo#kills_in_a_row. == 1) ? DTXT_STAT_KILLcxx . . $ `netgames/dmfc/dmfcinternal.h:2695:9`! : DTXT_STAT_KILLScxx . . $ `netgames/dmfc/dmfcinternal.h:2696:9`!); |
| 1004 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(width_to_clip, buffer, false); |
| 1005 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 1006 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 1007 | break; |
| 1008 | case 2: // deaths in a row |
| 1009 | snprintf(buffer, sizeof(buffer), "%d %s", ei->deaths_in_a_rowcxx . . $ tPExtraInfo#deaths_in_a_row., |
| 1010 | (ei->deaths_in_a_rowcxx . . $ tPExtraInfo#deaths_in_a_row. == 1) ? DTXT_STAT_DEATHcxx . . $ `netgames/dmfc/dmfcinternal.h:2697:9`! : DTXT_STAT_DEATHScxx . . $ `netgames/dmfc/dmfcinternal.h:2698:9`!); |
| 1011 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(width_to_clip, buffer, false); |
| 1012 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 1013 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 1014 | break; |
| 1015 | default: |
| 1016 | break; |
| 1017 | } |
| 1018 | |
| 1019 | player_recordcxx . . $ player_record# *tpr; |
| 1020 | // last player you killed |
| 1021 | if (ei->last_kill_numcxx . . $ tPExtraInfo#last_kill_num. != -1) { |
| 1022 | tpr = PRec_GetPRecordcxx . . $ PRec_GetPRecord(6359c6f28dd028ae).(ei->last_kill_numcxx . . $ tPExtraInfo#last_kill_num.); |
| 1023 | if (tpr && tpr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.) { |
| 1024 | strcpy(buffer, tpr->callsigncxx . . $ player_record#callsign.); |
| 1025 | } else { |
| 1026 | buffer[0] = '\0'; |
| 1027 | } |
| 1028 | } else { |
| 1029 | buffer[0] = '\0'; |
| 1030 | } |
| 1031 | if (!(m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_NOLASTVICTIMcxx . . $ `netgames/includes/DMFC.h:631:9`!)) { |
| 1032 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(width_to_clip, buffer, false); |
| 1033 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 1034 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 1035 | } |
| 1036 | |
| 1037 | // last player to kill you |
| 1038 | if (ei->last_death_numcxx . . $ tPExtraInfo#last_death_num. != -1) { |
| 1039 | tpr = PRec_GetPRecordcxx . . $ PRec_GetPRecord(6359c6f28dd028ae).(ei->last_death_numcxx . . $ tPExtraInfo#last_death_num.); |
| 1040 | if (tpr && tpr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.) { |
| 1041 | strcpy(buffer, tpr->callsigncxx . . $ player_record#callsign.); |
| 1042 | } else { |
| 1043 | buffer[0] = '\0'; |
| 1044 | } |
| 1045 | } else { |
| 1046 | buffer[0] = '\0'; |
| 1047 | } |
| 1048 | if (!(m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_NOLASTKILLERcxx . . $ `netgames/includes/DMFC.h:630:9`!)) { |
| 1049 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(width_to_clip, buffer, false); |
| 1050 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, x_to_use, curr_y, buffer); |
| 1051 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 1052 | } |
| 1053 | } |
| 1054 | |
| 1055 | // drawline(DLIST_WIN_X,DLIST_WIN_X+DLIST_WIN_W-1,curr_y,perc_done); curr_y += 10; |
| 1056 | |
| 1057 | curr_x = m_x_start_detailcxx . . $ CDmfcStats#m_x_start_detail.; |
| 1058 | |
| 1059 | // now do the detail columns (if any for this player) |
| 1060 | for (c = 0; c < m_iDColCountcxx . . $ CDmfcStats#m_iDColCount.; c++) { |
| 1061 | strcpy(buffer, m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].titlecxx . . $ tDmfcStatsColumnInfo#title.); |
| 1062 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].widthcxx . . $ tDmfcStatsColumnInfo#width., buffer, false); |
| 1063 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, curr_x, curr_y, buffer); |
| 1064 | curr_x += m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].widthcxx . . $ tDmfcStatsColumnInfo#width.; |
| 1065 | } |
| 1066 | |
| 1067 | if (m_iDColCountcxx . . $ CDmfcStats#m_iDColCount. > 0) |
| 1068 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 1069 | curr_x = m_x_start_detailcxx . . $ CDmfcStats#m_x_start_detail.; |
| 1070 | |
| 1071 | if (m_iDColCountcxx . . $ CDmfcStats#m_iDColCount. > 0) |
| 1072 | drawlinecxx . . $ drawline(3c27ae030892e7bf).(DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`!, DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`! + DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`! - 1, curr_y, perc_done); |
| 1073 | curr_y += 3; |
| 1074 | |
| 1075 | for (c = 0; c < m_iDColCountcxx . . $ CDmfcStats#m_iDColCount.; c++) { |
| 1076 | buffer[0] = '\0'; |
| 1077 | if (!is_dedicated_server || m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].typecxx . . $ tDmfcStatsColumnInfo#type. == DSCOL_PILOT_NAMEcxx . . $ DSCOL_PILOT_NAME. || m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].typecxx . . $ tDmfcStatsColumnInfo#type. == DSCOL_BLANKcxx . . $ DSCOL_BLANK.) { |
| 1078 | switch (m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].typecxx . . $ tDmfcStatsColumnInfo#type.) { |
| 1079 | case DSCOL_BMPcxx . . $ DSCOL_BMP.: |
| 1080 | break; |
| 1081 | case DSCOL_KILLS_LEVELcxx . . $ DSCOL_KILLS_LEVEL.: |
| 1082 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]); |
| 1083 | break; |
| 1084 | case DSCOL_KILLS_OVERALLcxx . . $ DSCOL_KILLS_OVERALL.: |
| 1085 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 1086 | break; |
| 1087 | case DSCOL_KILLS_BOTHcxx . . $ DSCOL_KILLS_BOTH.: |
| 1088 | snprintf(buffer, sizeof(buffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!], pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 1089 | break; |
| 1090 | case DSCOL_DEATHS_LEVELcxx . . $ DSCOL_DEATHS_LEVEL.: |
| 1091 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]); |
| 1092 | break; |
| 1093 | case DSCOL_DEATHS_OVERALLcxx . . $ DSCOL_DEATHS_OVERALL.: |
| 1094 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 1095 | break; |
| 1096 | case DSCOL_DEATHS_BOTHcxx . . $ DSCOL_DEATHS_BOTH.: |
| 1097 | snprintf(buffer, sizeof(buffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!], pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 1098 | break; |
| 1099 | case DSCOL_SUICIDES_LEVELcxx . . $ DSCOL_SUICIDES_LEVEL.: |
| 1100 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]); |
| 1101 | break; |
| 1102 | case DSCOL_SUICIDES_OVERALLcxx . . $ DSCOL_SUICIDES_OVERALL.: |
| 1103 | snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 1104 | break; |
| 1105 | case DSCOL_SUICIDES_BOTHcxx . . $ DSCOL_SUICIDES_BOTH.: |
| 1106 | snprintf(buffer, sizeof(buffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!], |
| 1107 | pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]); |
| 1108 | break; |
| 1109 | case DSCOL_PILOT_NAMEcxx . . $ DSCOL_PILOT_NAME.: |
| 1110 | strcpy(buffer, pr->callsigncxx . . $ player_record#callsign.); |
| 1111 | break; |
| 1112 | case DSCOL_PILOT_TEAMcxx . . $ DSCOL_PILOT_TEAM.: |
| 1113 | snprintf(buffer, sizeof(buffer), "%s", basethiscxx . . $ basethis.->GetTeamStringcxx . . $ DMFCBase#GetTeamString(f7ae7e56280f18ae).(pr->teamcxx . . $ player_record#team.)); |
| 1114 | break; |
| 1115 | case DSCOL_PINGcxx . . $ DSCOL_PING.: |
| 1116 | if (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) |
| 1117 | snprintf(buffer, sizeof(buffer), "%.0f", basethiscxx . . $ basethis.->NetPlayerscxx . . $ DMFCBase#NetPlayers.[pr->pnumcxx . . $ player_record#pnum.].ping_timecxx . . $ netplayer#ping_time. * 1000.0f); |
| 1118 | else |
| 1119 | strcpy(buffer, "---"); |
| 1120 | break; |
| 1121 | case DSCOL_CUSTOMcxx . . $ DSCOL_CUSTOM.: |
| 1122 | if (m_DColCallbackcxx . . $ CDmfcStats#m_DColCallback.) |
| 1123 | (*m_DColCallbackcxx . . $ CDmfcStats#m_DColCallback.)(m_selected_preccxx . . $ CDmfcStats#m_selected_prec., c, buffer, sizeof(buffer)); |
| 1124 | break; |
| 1125 | case DSCOL_BLANKcxx . . $ DSCOL_BLANK.: |
| 1126 | buffer[0] = '\0'; |
| 1127 | break; |
| 1128 | } |
| 1129 | } else { |
| 1130 | strcpy(buffer, "N/A"); |
| 1131 | } |
| 1132 | |
| 1133 | if (m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].typecxx . . $ tDmfcStatsColumnInfo#type. != DSCOL_BMPcxx . . $ DSCOL_BMP.) { |
| 1134 | |
| 1135 | // clip the string to the width |
| 1136 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].widthcxx . . $ tDmfcStatsColumnInfo#width., (DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`! + DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`! - curr_x - 5)), buffer, false); |
| 1137 | |
| 1138 | // print out string |
| 1139 | ddgr_colorcxx . . $ ddgr_color# color; |
| 1140 | switch (m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].color_typecxx . . $ tDmfcStatsColumnInfo#color_type.) { |
| 1141 | case DSCOLOR_NORMALcxx . . $ DSCOLOR_NORMAL.: |
| 1142 | color = (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? GR_GREENcxx . . $ GR_GREEN. : GR_GREYcxx . . $ `netgames/includes/DMFC.h:432:9`!; |
| 1143 | break; |
| 1144 | case DSCOLOR_TEAMcxx . . $ DSCOLOR_TEAM.: |
| 1145 | color = basethiscxx . . $ basethis.->GetTeamColorcxx . . $ DMFCBase#GetTeamColor(46cc46841198e427).(pr->teamcxx . . $ player_record#team.); |
| 1146 | break; |
| 1147 | case DSCOLOR_SHIPCOLORcxx . . $ DSCOLOR_SHIPCOLOR.: |
| 1148 | color = (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? basethiscxx . . $ basethis.->Player_colorscxx . . $ DMFCBase#Player_colors.[pr->pnumcxx . . $ player_record#pnum.] : GR_GREYcxx . . $ `netgames/includes/DMFC.h:432:9`!; |
| 1149 | break; |
| 1150 | case DSCOLOR_CUSTOMcxx . . $ DSCOLOR_CUSTOM.: |
| 1151 | color = m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].colorcxx . . $ tDmfcStatsColumnInfo#color.; |
| 1152 | break; |
| 1153 | default: |
| 1154 | color = (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? GR_GREENcxx . . $ GR_GREEN. : GR_GREYcxx . . $ `netgames/includes/DMFC.h:432:9`!; |
| 1155 | break; |
| 1156 | }; |
| 1157 | |
| 1158 | DLLRenderHUDText(color, m_alphacxx . . $ CDmfcStats#m_alpha., 0, curr_x, curr_y, buffer); |
| 1159 | |
| 1160 | } else { |
| 1161 | // we need to draw a custom bitmap |
| 1162 | (*m_DColCallbackBMPcxx . . $ CDmfcStats#m_DColCallbackBMP.)(m_selected_preccxx . . $ CDmfcStats#m_selected_prec., c, curr_x, curr_y, m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].widthcxx . . $ tDmfcStatsColumnInfo#width., m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!, |
| 1163 | m_alphacxx . . $ CDmfcStats#m_alpha.); |
| 1164 | } |
| 1165 | |
| 1166 | curr_x += m_DColInfocxx . . $ CDmfcStats#m_DColInfo.[c].widthcxx . . $ tDmfcStatsColumnInfo#width.; |
| 1167 | |
| 1168 | if (curr_x > DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`! + DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`!) |
| 1169 | break; // we can't fit anymore columns |
| 1170 | } |
| 1171 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 1172 | |
| 1173 | // finally do the who-killed-who stats for the player |
| 1174 | int col_callsign, col_kills, col_deaths; |
| 1175 | col_callsign = m_x_start_detailcxx . . $ CDmfcStats#m_x_start_detail. + 5; |
| 1176 | col_kills = col_callsign + 100; |
| 1177 | col_deaths = col_kills + 50; |
| 1178 | int colw_callsign, colw_kills, colw_deaths; |
| 1179 | colw_callsign = col_kills - col_callsign; |
| 1180 | colw_kills = col_deaths - col_kills; |
| 1181 | colw_deaths = DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`! + DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`! - col_deaths; |
| 1182 | |
| 1183 | if (!(m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_NODETAILEDINFOcxx . . $ `netgames/includes/DMFC.h:632:9`!)) { |
| 1184 | |
| 1185 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, col_callsign, curr_y, DTXT_STAT_PILOTNAMELABELcxx . . $ `netgames/dmfc/dmfcinternal.h:2699:9`!); |
| 1186 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, col_kills, curr_y, DTXT_STAT_KILLScxx . . $ `netgames/dmfc/dmfcinternal.h:2696:9`!); |
| 1187 | DLLRenderHUDText(GR_WHITEcxx . . $ GR_WHITE., m_alphacxx . . $ CDmfcStats#m_alpha., 0, col_deaths, curr_y, DTXT_STAT_DEATHScxx . . $ `netgames/dmfc/dmfcinternal.h:2698:9`!); |
| 1188 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 1189 | drawlinecxx . . $ drawline(3c27ae030892e7bf).(DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`!, DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`! + DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`! - 1, curr_y, perc_done); |
| 1190 | curr_y += 3; |
| 1191 | |
| 1192 | if (m_can_fit_countcxx . . $ CDmfcStats#m_can_fit_count. == -1) { |
| 1193 | // we need to recalculate the how-many-items-can-fit-on-this-page value |
| 1194 | int count = 0; |
| 1195 | int y = curr_y; |
| 1196 | |
| 1197 | while (y + (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!) < DLIST_WIN_Hcxx . . $ `netgames/dmfc/dmfcstats.cpp:164:9`! + DLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:166:9`!) { |
| 1198 | count++; |
| 1199 | y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 1200 | } |
| 1201 | m_can_fit_countcxx . . $ CDmfcStats#m_can_fit_count. = count; |
| 1202 | } |
| 1203 | |
| 1204 | tPInfoStatcxx . . $ tPInfoStat# stat; |
| 1205 | player_recordcxx . . $ player_record# *dpr; |
| 1206 | int stats_displayed = 0; |
| 1207 | bool clean_exit = true; |
| 1208 | int start_index = (m_page_indexcxx . . $ CDmfcStats#m_page_index. * m_can_fit_countcxx . . $ CDmfcStats#m_can_fit_count.); |
| 1209 | bool team_game = (basethiscxx . . $ basethis.->GetNumTeamscxx . . $ DMFCBase#GetNumTeams(b126dc7c1de90089).() > 1) ? true : false; |
| 1210 | |
| 1211 | if (basethiscxx . . $ basethis.->FindPInfoStatFirstcxx . . $ DMFCBase#FindPInfoStatFirst(e8124cb919632806).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec., &stat)) { |
| 1212 | if (stat.slotcxx . . $ tPInfoStat#slot. != m_selected_preccxx . . $ CDmfcStats#m_selected_prec.) { |
| 1213 | dpr = basethiscxx . . $ basethis.->GetPlayerRecordcxx . . $ DMFCBase#GetPlayerRecord(6359c6f28dd028ae).(stat.slotcxx . . $ tPInfoStat#slot.); |
| 1214 | stats_displayed++; |
| 1215 | |
| 1216 | ASSERTcxx . . $ `netgames/includes/DMFC.h:370:9`!(dpr != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 1217 | if (dpr && start_index < stats_displayed) { |
| 1218 | ddgr_colorcxx . . $ ddgr_color# color; |
| 1219 | color = (dpr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) |
| 1220 | ? ((team_game) ? basethiscxx . . $ basethis.->GetTeamColorcxx . . $ DMFCBase#GetTeamColor(46cc46841198e427).(dpr->teamcxx . . $ player_record#team.) : basethiscxx . . $ basethis.->Player_colorscxx . . $ DMFCBase#Player_colors.[dpr->pnumcxx . . $ player_record#pnum.]) |
| 1221 | : GR_GREYcxx . . $ `netgames/includes/DMFC.h:432:9`!; |
| 1222 | |
| 1223 | strcpy(buffer, dpr->callsigncxx . . $ player_record#callsign.); |
| 1224 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(colw_callsign - 5, buffer, false); |
| 1225 | DLLRenderHUDText(color, m_alphacxx . . $ CDmfcStats#m_alpha., 0, col_callsign, curr_y, buffer); |
| 1226 | |
| 1227 | snprintf(buffer, sizeof(buffer), "%d", stat.killscxx . . $ tPInfoStat#kills.); |
| 1228 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(colw_kills - 5, buffer, false); |
| 1229 | DLLRenderHUDText(color, m_alphacxx . . $ CDmfcStats#m_alpha., 0, col_kills, curr_y, buffer); |
| 1230 | |
| 1231 | snprintf(buffer, sizeof(buffer), "%d", stat.deathscxx . . $ tPInfoStat#deaths.); |
| 1232 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(colw_deaths - 5, buffer, false); |
| 1233 | DLLRenderHUDText(color, m_alphacxx . . $ CDmfcStats#m_alpha., 0, col_deaths, curr_y, buffer); |
| 1234 | |
| 1235 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 1236 | } |
| 1237 | } |
| 1238 | |
| 1239 | while (basethiscxx . . $ basethis.->FindPInfoStatNextcxx . . $ DMFCBase#FindPInfoStatNext(4ead3766c292904).(&stat)) { |
| 1240 | if (stat.slotcxx . . $ tPInfoStat#slot. != m_selected_preccxx . . $ CDmfcStats#m_selected_prec.) { |
| 1241 | dpr = basethiscxx . . $ basethis.->GetPlayerRecordcxx . . $ DMFCBase#GetPlayerRecord(6359c6f28dd028ae).(stat.slotcxx . . $ tPInfoStat#slot.); |
| 1242 | stats_displayed++; |
| 1243 | |
| 1244 | ASSERTcxx . . $ `netgames/includes/DMFC.h:370:9`!(dpr != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 1245 | if (dpr && start_index < stats_displayed) { |
| 1246 | ddgr_colorcxx . . $ ddgr_color# color; |
| 1247 | color = (dpr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) |
| 1248 | ? ((team_game) ? basethiscxx . . $ basethis.->GetTeamColorcxx . . $ DMFCBase#GetTeamColor(46cc46841198e427).(dpr->teamcxx . . $ player_record#team.) : basethiscxx . . $ basethis.->Player_colorscxx . . $ DMFCBase#Player_colors.[dpr->pnumcxx . . $ player_record#pnum.]) |
| 1249 | : GR_GREYcxx . . $ `netgames/includes/DMFC.h:432:9`!; |
| 1250 | |
| 1251 | strcpy(buffer, dpr->callsigncxx . . $ player_record#callsign.); |
| 1252 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(colw_callsign - 5, buffer, false); |
| 1253 | DLLRenderHUDText(color, m_alphacxx . . $ CDmfcStats#m_alpha., 0, col_callsign, curr_y, buffer); |
| 1254 | |
| 1255 | snprintf(buffer, sizeof(buffer), "%d", stat.killscxx . . $ tPInfoStat#kills.); |
| 1256 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(colw_kills - 5, buffer, false); |
| 1257 | DLLRenderHUDText(color, m_alphacxx . . $ CDmfcStats#m_alpha., 0, col_kills, curr_y, buffer); |
| 1258 | |
| 1259 | snprintf(buffer, sizeof(buffer), "%d", stat.deathscxx . . $ tPInfoStat#deaths.); |
| 1260 | basethiscxx . . $ basethis.->ClipStringcxx . . $ DMFCBase#ClipString(8677479218165cd4).(colw_deaths - 5, buffer, false); |
| 1261 | DLLRenderHUDText(color, m_alphacxx . . $ CDmfcStats#m_alpha., 0, col_deaths, curr_y, buffer); |
| 1262 | |
| 1263 | curr_y += (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!); |
| 1264 | } |
| 1265 | } |
| 1266 | |
| 1267 | if (curr_y + (m_font_heightcxx . . $ CDmfcStats#m_font_height. + ROW_PIXEL_GAPcxx . . $ `netgames/dmfc/dmfcstats.cpp:155:9`!) > DLIST_WIN_Hcxx . . $ `netgames/dmfc/dmfcstats.cpp:164:9`! + DLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:166:9`!) { |
| 1268 | |
| 1269 | if (basethiscxx . . $ basethis.->FindPInfoStatNextcxx . . $ DMFCBase#FindPInfoStatNext(4ead3766c292904).(&stat)) { |
| 1270 | clean_exit = false; // there are more stats |
| 1271 | m_has_multiple_pagescxx . . $ CDmfcStats#m_has_multiple_pages. = true; |
| 1272 | } |
| 1273 | |
| 1274 | break; // can't fit anymore |
| 1275 | } |
| 1276 | } |
| 1277 | } |
| 1278 | basethiscxx . . $ basethis.->FindPInfoStatClosecxx . . $ DMFCBase#FindPInfoStatClose(49f6e7a06ebc5aa8).(); |
| 1279 | |
| 1280 | m_page_display_timecxx . . $ CDmfcStats#m_page_display_time. += *basethiscxx . . $ basethis.->Frametimecxx . . $ DMFCBase#Frametime.; |
| 1281 | if ((m_page_display_timecxx . . $ CDmfcStats#m_page_display_time. >= PAGE_DISP_TIMEcxx . . $ `netgames/dmfc/dmfcstats.cpp:156:9`!) && m_has_multiple_pagescxx . . $ CDmfcStats#m_has_multiple_pages.) { |
| 1282 | if (!clean_exit) |
| 1283 | m_page_indexcxx . . $ CDmfcStats#m_page_index.++; |
| 1284 | else |
| 1285 | m_page_indexcxx . . $ CDmfcStats#m_page_index. = 0; // if there was a clean exit, that means we were on the last page, |
| 1286 | // go back to the beginning |
| 1287 | m_page_display_timecxx . . $ CDmfcStats#m_page_display_time. = 0; |
| 1288 | } |
| 1289 | } |
| 1290 | |
| 1291 | if (m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SHOWPLAYERVIEWcxx . . $ `netgames/includes/DMFC.h:633:9`! && m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_NODETAILEDINFOcxx . . $ `netgames/includes/DMFC.h:632:9`! && pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) { |
| 1292 | DLLgrtext_Flush(); |
| 1293 | |
| 1294 | float x, y, w, h; |
| 1295 | x = (float)DLIST_WIN_Xcxx . . $ `netgames/dmfc/dmfcstats.cpp:165:9`! + 2; |
| 1296 | y = (float)curr_y; |
| 1297 | h = w = (float)stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(DLIST_WIN_Wcxx . . $ `netgames/dmfc/dmfcstats.cpp:163:9`! - 4, (DLIST_WIN_Ycxx . . $ `netgames/dmfc/dmfcstats.cpp:166:9`! + DLIST_WIN_Hcxx . . $ `netgames/dmfc/dmfcstats.cpp:164:9`! - curr_y) - 4); |
| 1298 | objectcxx . . $ object# *obj_view = &basethiscxx . . $ basethis.->Objectscxx . . $ DMFCBase#Objects.[basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[pr->pnumcxx . . $ player_record#pnum.].objnumcxx . . $ player#objnum.]; |
| 1299 | |
| 1300 | x *= *basethiscxx . . $ basethis.->Hud_aspect_xcxx . . $ DMFCBase#Hud_aspect_x.; |
| 1301 | y *= *basethiscxx . . $ basethis.->Hud_aspect_ycxx . . $ DMFCBase#Hud_aspect_y.; |
| 1302 | w *= *basethiscxx . . $ basethis.->Hud_aspect_xcxx . . $ DMFCBase#Hud_aspect_x.; |
| 1303 | h *= *basethiscxx . . $ basethis.->Hud_aspect_ycxx . . $ DMFCBase#Hud_aspect_y.; |
| 1304 | x += *basethiscxx . . $ basethis.->Game_window_xcxx . . $ DMFCBase#Game_window_x.; |
| 1305 | y += *basethiscxx . . $ basethis.->Game_window_ycxx . . $ DMFCBase#Game_window_y.; |
| 1306 | |
| 1307 | if (obj_view->typecxx . . $ object#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!) { |
| 1308 | DisplayPlayerViewcxx . . $ CDmfcStats#DisplayPlayerView(d6b429e444e082f0).((int)x, (int)y, (int)w, (int)h, obj_view); |
| 1309 | } |
| 1310 | } |
| 1311 | |
| 1312 | alpha_in_timecxx . . $ CDmfcStats#alpha_in_time. += *basethiscxx . . $ basethis.->Frametimecxx . . $ DMFCBase#Frametime.; |
| 1313 | m_alphacxx . . $ CDmfcStats#m_alpha. = (perc_done * 255.0f); |
| 1314 | } |
| 1315 | |
| 1316 | // validates all the variables |
| 1317 | void CDmfcStatscxx . . $ CDmfcStats#::ValidateInfocxx . . $ CDmfcStats#ValidateInfo(49f6e7a06ebc5aa8).() { |
| 1318 | // change index to match the last selected prec num so it doesn't move around |
| 1319 | int new_idx = -1; |
| 1320 | for (int p = 0; p < m_MaxCountcxx . . $ CDmfcStats#m_MaxCount.; p++) { |
| 1321 | if (m_translatecxx . . $ CDmfcStats#m_translate.[p] == m_selected_preccxx . . $ CDmfcStats#m_selected_prec.) { |
| 1322 | // found it, update the index |
| 1323 | new_idx = p; |
| 1324 | break; |
| 1325 | } |
| 1326 | } |
| 1327 | |
| 1328 | if (new_idx == -1) { |
| 1329 | // the old prec wasn't found |
| 1330 | m_selected_indexcxx . . $ CDmfcStats#m_selected_index. = 0; |
| 1331 | } else { |
| 1332 | m_selected_indexcxx . . $ CDmfcStats#m_selected_index. = new_idx; |
| 1333 | } |
| 1334 | |
| 1335 | // make sure selected index is in view |
| 1336 | while (m_selected_indexcxx . . $ CDmfcStats#m_selected_index. < m_top_indexcxx . . $ CDmfcStats#m_top_index.) { |
| 1337 | m_top_indexcxx . . $ CDmfcStats#m_top_index.--; |
| 1338 | } |
| 1339 | if (m_bottom_indexcxx . . $ CDmfcStats#m_bottom_index. != -1) { // make sure it has been set in a frame |
| 1340 | while (m_selected_indexcxx . . $ CDmfcStats#m_selected_index. > m_bottom_indexcxx . . $ CDmfcStats#m_bottom_index.) { |
| 1341 | m_top_indexcxx . . $ CDmfcStats#m_top_index.++; |
| 1342 | m_bottom_indexcxx . . $ CDmfcStats#m_bottom_index.++; |
| 1343 | } |
| 1344 | } |
| 1345 | } |
| 1346 | |
| 1347 | // the do-it-all function, call once per frame |
| 1348 | void CDmfcStatscxx . . $ CDmfcStats#::DoFramecxx . . $ CDmfcStats#DoFrame(49f6e7a06ebc5aa8).() { |
| 1349 | if (!m_enabledcxx . . $ CDmfcStats#m_enabled.) |
| 1350 | return; |
| 1351 | |
| 1352 | int high_count; |
| 1353 | int count; |
| 1354 | int index; |
| 1355 | static slot_statecxx . . $ slot_state# last_state = STATE_EMPTYcxx . . $ STATE_EMPTY.; |
| 1356 | player_recordcxx . . $ player_record# *pr; |
| 1357 | |
| 1358 | if (m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_ONLY_X_PLAYERS_SHOWNcxx . . $ `netgames/includes/DMFC.h:622:9`!) |
| 1359 | high_count = *m_pMaxNumberDisplayedcxx . . $ CDmfcStats#m_pMaxNumberDisplayed.; |
| 1360 | else |
| 1361 | high_count = MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; |
| 1362 | |
| 1363 | // count the number of players in the game/disconnected |
| 1364 | // build translation table |
| 1365 | count = 0; |
| 1366 | index = 0; |
| 1367 | |
| 1368 | if (m_SortedPRecscxx . . $ CDmfcStats#m_SortedPRecs.[0] != 0) { |
| 1369 | count = 0; |
| 1370 | index = 0; |
| 1371 | } |
| 1372 | |
| 1373 | for (int p = 0; p < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; p++) { |
| 1374 | |
| 1375 | // increase count to see how many at most there are to display |
| 1376 | pr = PRec_GetPRecordcxx . . $ PRec_GetPRecord(6359c6f28dd028ae).(p); |
| 1377 | if (pr && pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY. && !basethiscxx . . $ basethis.->IsPlayerDedicatedServercxx . . $ DMFCBase#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr)) |
| 1378 | count++; |
| 1379 | |
| 1380 | // update translation table |
| 1381 | pr = PRec_GetPRecordcxx . . $ PRec_GetPRecord(6359c6f28dd028ae).(m_SortedPRecscxx . . $ CDmfcStats#m_SortedPRecs.[p]); |
| 1382 | if (pr && pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY. && !basethiscxx . . $ basethis.->IsPlayerDedicatedServercxx . . $ DMFCBase#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr)) { |
| 1383 | m_translatecxx . . $ CDmfcStats#m_translate.[index] = m_SortedPRecscxx . . $ CDmfcStats#m_SortedPRecs.[p]; |
| 1384 | index++; |
| 1385 | } |
| 1386 | } |
| 1387 | |
| 1388 | if (m_flagscxx . . $ CDmfcStats#m_flags. & DSIF_SEPERATE_BY_TEAMcxx . . $ `netgames/includes/DMFC.h:615:9`!) { |
| 1389 | // Seperate by teams |
| 1390 | int team_index; |
| 1391 | int real_index = 0; |
| 1392 | int num_teams = basethiscxx . . $ basethis.->GetNumTeamscxx . . $ DMFCBase#GetNumTeams(b126dc7c1de90089).(); |
| 1393 | int temp_array[MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!]; |
| 1394 | int prec, p; |
| 1395 | |
| 1396 | bool getting_ingame_people = true; |
| 1397 | |
| 1398 | get_disconnected_people: |
| 1399 | |
| 1400 | for (team_index = 0; team_index < num_teams; team_index++) { |
| 1401 | for (p = 0; p < index; p++) { |
| 1402 | prec = m_translatecxx . . $ CDmfcStats#m_translate.[p]; |
| 1403 | pr = PRec_GetPRecordcxx . . $ PRec_GetPRecord(6359c6f28dd028ae).(prec); |
| 1404 | if (pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY. && pr->teamcxx . . $ player_record#team. == team_index) { |
| 1405 | |
| 1406 | // we must make sure to move all disconnected people to the |
| 1407 | // bottom |
| 1408 | if ((getting_ingame_people && pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) || |
| 1409 | (!getting_ingame_people && pr->statecxx . . $ player_record#state. == STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.)) { |
| 1410 | temp_array[real_index] = prec; |
| 1411 | real_index++; |
| 1412 | } |
| 1413 | } |
| 1414 | } |
| 1415 | // next team |
| 1416 | } |
| 1417 | |
| 1418 | if (getting_ingame_people) { |
| 1419 | getting_ingame_people = false; |
| 1420 | goto get_disconnected_people; |
| 1421 | } |
| 1422 | |
| 1423 | memcpy(m_translatecxx . . $ CDmfcStats#m_translate., temp_array, sizeof(int) * MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!); |
| 1424 | } |
| 1425 | |
| 1426 | m_MaxCountcxx . . $ CDmfcStats#m_MaxCount. = stdcxx . . $ std/::mincxx . . $ std/min(7d979dd22a97e265).({high_count, count, index}); |
| 1427 | |
| 1428 | pr = PRec_GetPRecordcxx . . $ PRec_GetPRecord(6359c6f28dd028ae).(m_selected_preccxx . . $ CDmfcStats#m_selected_prec.); |
| 1429 | if (!pr || pr->statecxx . . $ player_record#state. != last_state) { |
| 1430 | m_can_fit_countcxx . . $ CDmfcStats#m_can_fit_count. = -1; // we need to recalc this |
| 1431 | m_page_indexcxx . . $ CDmfcStats#m_page_index. = 0; |
| 1432 | m_has_multiple_pagescxx . . $ CDmfcStats#m_has_multiple_pages. = false; |
| 1433 | if (pr) |
| 1434 | last_state = pr->statecxx . . $ player_record#state.; |
| 1435 | } |
| 1436 | |
| 1437 | ValidateInfocxx . . $ CDmfcStats#ValidateInfo(49f6e7a06ebc5aa8).(); |
| 1438 | |
| 1439 | Rendercxx . . $ CDmfcStats#Render(49f6e7a06ebc5aa8).(); |
| 1440 | |
| 1441 | // save the last selected prec num for the next frame |
| 1442 | m_selected_preccxx . . $ CDmfcStats#m_selected_prec. = m_translatecxx . . $ CDmfcStats#m_translate.[m_selected_indexcxx . . $ CDmfcStats#m_selected_index.]; |
| 1443 | } |
| 1444 | |
| 1445 | void CDmfcStatscxx . . $ CDmfcStats#::DisplayPlayerViewcxx . . $ CDmfcStats#DisplayPlayerView(d6b429e444e082f0).(int x, int y, int w, int h, objectcxx . . $ object# *viewer) { |
| 1446 | objectcxx . . $ object# *save_viewer_object = *basethiscxx . . $ basethis.->Viewer_objectcxx . . $ DMFCBase#Viewer_object.; |
| 1447 | |
| 1448 | DLLrend_SetZBufferState(1); |
| 1449 | |
| 1450 | // Set up for rendering |
| 1451 | DLLStartFrame(x, y, x + w, y + h, true); |
| 1452 | |
| 1453 | // Reset facings for mine stuff |
| 1454 | DLLResetFacings(); |
| 1455 | |
| 1456 | // Set the viewer for this render |
| 1457 | *basethiscxx . . $ basethis.->Viewer_objectcxx . . $ DMFCBase#Viewer_object. = viewer; |
| 1458 | |
| 1459 | // Render the world |
| 1460 | DLLGameRenderWorld(viewer, &viewer->poscxx . . $ object#pos., viewer->roomnumcxx . . $ object#roomnum., &viewer->orientcxx . . $ object#orient., *basethiscxx . . $ basethis.->Render_zoomcxx . . $ DMFCBase#Render_zoom., false); |
| 1461 | |
| 1462 | // Restore the viewre |
| 1463 | *basethiscxx . . $ basethis.->Viewer_objectcxx . . $ DMFCBase#Viewer_object. = save_viewer_object; |
| 1464 | |
| 1465 | // Done rendering |
| 1466 | DLLEndFrame(); |
| 1467 | } |