Debian Codegraph @

netgames/includes/DMFC.h

raw symbols SCIP
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.h $
21 * $Revision: 1.3 $
22 * $Date: 2004/02/09 04:14:49 $
23 * $Author: kevinb $
24 *
25 * Major header file for DMFC
26 *
27 * $Log: DMFC.h,v $
28 * Revision 1.3 2004/02/09 04:14:49 kevinb
29 * Added newlines to all headers to reduce number of warnings printed
30 *
31 * Made some small changes to get everything compiling.
32 *
33 * All Ready to merge the 1.5 tree.
34 *
35 * Revision 1.2 2000/09/22 18:50:30 icculus
36 * Removing some x86 ASM for non-x86 builds.
37 *
38 * Revision 1.1.1.1 2000/04/18 00:00:30 icculus
39 * initial checkin
40 *
41 *
42 * 125 10/21/99 3:32p Matt
43 * Mac merge
44 *
45 * 124 8/11/99 1:21p Jeff
46 * exported needed functions for camera windows
47 *
48 * 123 7/16/99 2:43p Jeff
49 * changed CreateMenuItemWArgs function
50 *
51 * 122 7/11/99 3:32p Jeff
52 * exported game arguments, made command line option to specify
53 * autoexec.dmfc
54 *
55 * 121 7/07/99 12:16p Jeff
56 * all mangles symbol names fixed. Finished making interface functions.
57 *
58 * 120 6/12/99 10:59p Jeff
59 * fixed messed up #ifdef for __LINUX__
60 *
61 * 119 6/10/99 6:31p Jeff
62 * fixed mprintf define
63 *
64 * 118 5/12/99 11:04p Jeff
65 * dmfc and multiplayer games now have endian friendly packets (*whew*)
66 *
67 * 117 5/10/99 10:21p Ardussi
68 * changes to compile on Mac
69 *
70 * 116 4/27/99 12:36p Jeff
71 * fixed flags
72 *
73 * 115 4/24/99 11:13p Jeff
74 * added flags for creating a newui window for a title bar
75 *
76 * 114 4/20/99 7:27p Jeff
77 * fixed new MAX_PLAYERS
78 *
79 * 113 4/19/99 6:02p Jeff
80 * fixed macros (mprintf and Debug_break) for Linux
81 *
82 * 112 4/19/99 5:46p Jeff
83 * added int3/assert macros for Linux
84 *
85 * 111 4/03/99 9:26p Jeff
86 * changed dialogs that weren't using UID_OK and UID_CANCEL to use and
87 * handle them properly
88 *
89 * 110 3/17/99 12:23p Jeff
90 * converted DMFC to be COM interface
91 *
92 * 109 3/11/99 6:30p Jeff
93 * numerous fixes to demo system in multiplayer games (when
94 * recording/playback a demo in a multiplayer game)
95 *
96 * 108 3/05/99 12:02p Kevin
97 * New color scheme for new art
98 *
99 * 107 2/28/99 11:05p Jeff
100 * fixed ASSERT define in Release builds
101 *
102 * 106 2/28/99 3:06a Jeff
103 * adjust ok/cancel y offset for new ui artwork
104 *
105 * 105 2/11/99 12:54a Jeff
106 * changed names of exported variables
107 *
108 * 103 2/07/99 1:19a Jeff
109 * added new multiplayer game events EVT_GAMEOBJKILLED and
110 * EVT_GAMEOBJDESTROYED
111 *
112 * 102 2/03/99 4:09p Jeff
113 * moved function pointers to seperate file. created autoexec.dmfc
114 *
115 * 101 1/31/99 7:25p Matt
116 * Renamed a bunch of functions to have HUD capitalized
117 *
118 * 100 1/24/99 8:31p Jeff
119 * updated stat manager to print team scores
120 *
121 * 98 1/15/99 3:50a Jeff
122 * new events required new handlers
123 *
124 * 96 1/07/99 5:01p Jeff
125 * added Int3's and updated all net games to use stats manager...correctly
126 * too
127 *
128 * 95 1/06/99 7:02p Jeff
129 * added a multiplayer event for game controls
130 *
131 * 94 1/04/99 12:21p Jeff
132 * added support for hosts.allow/deny and updates stats manager a little
133 *
134 * 93 12/13/98 5:32p Jeff
135 * fixed ugly crash due to freeing memory allocated in another heap
136 *
137 * 92 12/08/98 4:47p Jeff
138 * umm, various changes, fixed pilot pics so that they work for everyone
139 * now
140 *
141 * 91 12/08/98 3:29p Jeff
142 * updated the team control dialog so the server can determine if they
143 * want to make the clients wait
144 *
145 * 90 12/08/98 12:17p Jeff
146 * various changes that include an improved Team Control dialog (doesn't
147 * switch teams until exit..) and spew/respawn players that change teams
148 *
149 * 89 12/04/98 7:04p Jeff
150 * almost finished up dmfc stat manager
151 *
152 * 88 12/03/98 7:05p Jeff
153 * updated new stats
154 *
155 * 87 12/01/98 6:56p Jeff
156 * put in quick and dirty implementation of pilot pics for testing
157 *
158 * 86 11/20/98 5:52p Jeff
159 * updated hyper anarchy and hoard a little
160 *
161 * 85 11/19/98 5:56p Jeff
162 * added slider exported and improved Hoard
163 *
164 * 84 11/18/98 5:48p Jeff
165 * added function/struct to get information from the DLL before it loads
166 *
167 * 83 11/17/98 6:29p Jeff
168 * mod can specify whether or not to display the team setup dialog on team
169 * game start. Added a menu item to display team setup dialog in mid-game
170 *
171 * 82 11/16/98 5:35p Jeff
172 * removed log functions, added support for changing team names, fixed ctf
173 * to work better with different team names
174 *
175 * 81 11/13/98 6:36p Jeff
176 * created dmfc_dll (a DLL version of DMFC) and converted current mods to
177 * use it
178 *
179 * 80 11/12/98 12:16p Jeff
180 * more changes to handle (ignore) dedicated server
181 *
182 * 79 11/11/98 7:18p Jeff
183 * changes made so that a dedicated server's team is always -1 (team game
184 * or not)
185 *
186 * 78 11/09/98 11:54a Jeff
187 * Added Player_colors
188 *
189 * 77 11/02/98 4:38p Jeff
190 * added ability to sort and display by efficiency
191 *
192 * 76 11/01/98 1:59a Jeff
193 * made a $help inputcommand for help in a dedicated server environment
194 *
195 * 75 10/30/98 12:46p Jeff
196 * cut down a couple bytes on memory usage
197 *
198 * 74 10/29/98 7:01p Jeff
199 * creation of team placement dialog. Moved TranslateEvent into DMFC
200 *
201 * 73 10/24/98 2:18p Jeff
202 *
203 * 72 10/23/98 11:22a Jeff
204 * changes to handle mixcase, and display the client netgame info
205 * correctly
206 *
207 * 71 10/20/98 4:35p Jeff
208 * added a flag for menu to add a <None> to MIT_PLIST...
209 *
210 * 70 10/20/98 12:17p Jeff
211 *
212 * 69 10/19/98 7:18p Matt
213 * Added system to support different types of damage to the player and
214 * have these different types make different sounds.
215 *
216 * 68 10/18/98 7:59p Jeff
217 * functions added to dmfc for client->server objnum matching. Banning
218 * now uses tracker id when available.
219 *
220 * 67 10/17/98 7:30p Jeff
221 * network_address compares don't compare port on somethings
222 *
223 * 66 10/15/98 6:18p Jeff
224 * created the is player banned event, removed prejoin event
225 *
226 * 65 10/15/98 1:34p Jeff
227 * added scrollable onscreen menu. Remove ban in dmfc. prejoin event
228 *
229 * 64 10/14/98 11:26p Jeff
230 * added scrollable menus
231 *
232 * 63 10/13/98 12:03p Kevin
233 * Changed use of preprocessors for debug, etc.
234 *
235 * 62 10/13/98 2:15a Jeff
236 * created new event for when a player leaves a multiplayer game. Fixed
237 * some 'english' bugs in the network games.
238 *
239 * 61 10/11/98 2:57a Jeff
240 * added new multiplayer event EVT_GAME_INTERVAL, which is to be called on
241 * interval, and EVT_HUD_INTERVAL is only to be called when the hud is to
242 * be rendered
243 *
244 * 60 10/08/98 3:37p Jeff
245 * general improvements (Netgame info things, save to registry). Changes
246 * so it would send packets on NETSEQ_OBJECTS
247 *
248 * 59 10/05/98 2:49p Jeff
249 *
250 * 58 10/01/98 7:02p Jeff
251 * implemented colored HUD callsigns
252 *
253 * 57 10/01/98 11:30a Jeff
254 * made the observer mode events into just a client event
255 *
256 * 56 9/30/98 4:21p Jeff
257 * team changing is handled correctly
258 *
259 * 55 9/30/98 3:50p Jeff
260 * general improvements (many)
261 *
262 * 54 9/29/98 3:04p Jeff
263 * added time in game and start_time support
264 *
265 * 53 9/28/98 5:05p Jeff
266 * made the statisitical death messages an option in the menu
267 *
268 * 52 9/25/98 7:25p Jeff
269 *
270 * 51 9/25/98 4:50p Jeff
271 *
272 * 50 9/24/98 6:54p Jeff
273 * added DisconnectMe() and made use of it when you get kicked/banned
274 *
275 * 49 9/24/98 5:52p Jeff
276 * starting adding statistical death messages, checked in for testing
277 *
278 * 48 9/23/98 4:17p Jeff
279 * basic changes/improvements, started changing death messages
280 *
281 * 47 9/21/98 7:11p Jeff
282 * made InputCommand interface API and moved existing input commands to
283 * the interface. Changed mprintf/ASSERT so they are valid in DMFC
284 *
285 * $NoKeywords: $
286 */
287
288 #ifndef __DMFC_H__
289 #define __DMFC_H__cxx . . $ `netgames/includes/DMFC.h:289:9`!
290
291 #include <stdio.h>
292 #include <stdarg.h>
293 #include <time.h>
294 #include "gamedll_header.h"cxx . . $ `<file>/netgames/includes/gamedll_header.h`/
295 #include "DMFCKeyCodes.h"cxx . . $ `<file>/netgames/includes/DMFCKeyCodes.h`/
296
297 #if ((defined POSIXcxx . . $ `<built-in>:478:9`!) && (!defined __i386__))
298 #include <signal.h>
299 #endif
300
301 #ifndef RELEASE
302
303 #ifdef WIN32
304 #ifdef DEBUG_BREAK
305 #undef DEBUG_BREAK
306 #endif
307 #define DEBUG_BREAK() \
308 do { \
309 if (DLLDebugBreak_callback_stop) \
310 DLLDebugBreak_callback_stop(); \
311 debug_break(); \
312 if (DebugBreak_callback_resume) \
313 DebugBreak_callback_resume(); \
314 } while (0)
315
316 #define DLLASSERT(x) \
317 do { \
318 DLLassert(x, #x, __FILE__, __LINE__); \
319 } while (0)
320 #define DLLmprintf(...) DLLDebug_ConsolePrintf(__VA_ARGS__)
321 #ifdef ASSERT
322 #undef ASSERT
323 #endif
324 #define ASSERT(x) \
325 do { \
326 DLLassert(x, #x, __FILE__, __LINE__); \
327 } while (0)
328
329 #ifdef Int3
330 #undef Int3
331 #endif
332 #define Int3() \
333 do { \
334 mprintf(0, "Int3 at %s line %d.\n", __FILE__, __LINE__); \
335 if (DLLDebugBreak_callback_stop) \
336 DLLDebugBreak_callback_stop(); \
337 debug_break(); \
338 if (DLLDebugBreak_callback_resume) \
339 DLLDebugBreak_callback_resume(); \
340 } while (0)
341 #elif defined(POSIXcxx . . $ `<built-in>:478:9`!)
342 // For some reason Linux doesn't like the \ continuation character, so I have to uglify this
343 #define DLLmprintfcxx . . $ `netgames/includes/DMFC.h:343:9`!(...) DLLDebug_ConsolePrintf(__VA_ARGS__)
344 #ifdef DEBUG_BREAKcxx . . $ `misc/pserror.h:238:9`!
345 #undef DEBUG_BREAKcxx . . $ `misc/pserror.h:238:9`!
346 #endif
347 #if (defined __i386__) || defined(__x86_64__cxx . . $ `<built-in>:437:9`!)
348 #define DEBUG_BREAKcxx . . $ `netgames/includes/DMFC.h:348:9`!() \
349 do { \
350 if (DLLDebugBreak_callback_stop) \
351 DLLDebugBreak_callback_stop(); \
352 __asm__ __volatile__("int $3"); \
353 if (DLLDebugBreak_callback_resume) \
354 DLLDebugBreak_callback_resume(); \
355 } while (0)
356 #else
357 #define DEBUG_BREAK() \
358 do { \
359 if (DLLDebugBreak_callback_stop) \
360 DLLDebugBreak_callback_stop(); \
361 raise(SIGTRAP); \
362 if (DLLDebugBreak_callback_resume) \
363 DLLDebugBreak_callback_resume(); \
364 } while (0)
365 #endif
366
367 #ifdef ASSERTcxx . . $ `misc/pserror.h:246:9`!
368 #undef ASSERTcxx . . $ `misc/pserror.h:246:9`!
369 #endif
370 #define ASSERTcxx . . $ `netgames/includes/DMFC.h:370:9`!(x) \
371 do { \
372 DLLassert(x, #x, __FILE__, __LINE__); \
373 } while (0)
374 #define DLLASSERTcxx . . $ `netgames/includes/DMFC.h:374:9`!(x) ASSERT(x)
375 #ifdef Int3cxx . . $ `misc/pserror.h:247:9`!
376 #undef Int3cxx . . $ `misc/pserror.h:247:9`!
377 #endif
378 #define Int3cxx . . $ `netgames/includes/DMFC.h:378:9`!() \
379 do { \
380 mprintfcxx . . $ `netgames/dmfc/dmfcinternal.h:275:9`!(0, "Int3 at %s line %d.\n", __FILE__, __LINE__); \
381 DEBUG_BREAKcxx . . $ `netgames/includes/DMFC.h:348:9`!(); \
382 } while (0)
383 #define HEAPCHECKcxx . . $ `netgames/includes/DMFC.h:383:9`!()
384 #else
385 #ifdef DEBUG_BREAK
386 #undef DEBUG_BREAK
387 #define DEBUG_BREAK()
388 #endif
389 #define DLLASSERT(x)
390 #define DLLmprintf(...)
391 #ifdef Int3
392 #undef Int3
393 #define Int3()
394 #endif
395 #define Int3()
396 #ifdef ASSERT
397 #undef ASSERT
398 #define ASSERT(x)
399 #endif
400 #endif // OS check
401
402 #else // Release build
403 #ifdef DEBUG_BREAK
404 #undef DEBUG_BREAK
405 #define DEBUG_BREAK()
406 #endif
407 #define DLLASSERT(x)
408 #define DLLmprintf(...)
409 #ifdef Int3
410 #undef Int3
411 #define Int3()
412 #endif
413 #define Int3()
414 #ifdef ASSERT
415 #undef ASSERT
416 #define ASSERT(x)
417 #endif
418 #endif
419
420 #ifdef mprintfcxx . . $ `ddebug/mono.h:82:9`! // undefine mprintf and redirect it to use DLLmprintf
421 #undef mprintfcxx . . $ `ddebug/mono.h:82:9`!
422 #endif
423 #define mprintfcxx . . $ `netgames/includes/DMFC.h:423:9`! DLLmprintf
424
425 #define DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`! MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!
426 #define DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! 4
427 #define RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`! 0
428 #define BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`! 1
429 #define GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`! 2
430 #define YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`! 3
431
432 #define GR_GREYcxx . . $ `netgames/includes/DMFC.h:432:9`! GR_RGB(128, 128, 128)
433 #define GR_GRAYcxx . . $ `netgames/includes/DMFC.h:433:9`! GR_GREY
434
435 #define SP_ALLcxx . . $ `netgames/includes/DMFC.h:435:9`! -1
436 #define SP_SERVERcxx . . $ `netgames/includes/DMFC.h:436:9`! -2
437 #define SPH_DMFCFUNCcxx . . $ `netgames/includes/DMFC.h:437:9`! 0
438 #define SPH_FUNCcxx . . $ `netgames/includes/DMFC.h:438:9`! 1
439
440 #define HI_TEXTcxx . . $ `netgames/includes/DMFC.h:440:9`! 0
441 #define HI_BITMAPcxx . . $ `netgames/includes/DMFC.h:441:9`! 1
442
443 #define MAX_TEAMNAME_LENcxx . . $ `netgames/includes/DMFC.h:443:9`! 16
444
445 // Defines for the window camera views
446 #define CV_NONEcxx . . $ `netgames/includes/DMFC.h:446:9`! 0 // View not active
447 #define CV_REARVIEWcxx . . $ `netgames/includes/DMFC.h:447:9`! 1 // Rear view
448 #define CV_MARKER1cxx . . $ `netgames/includes/DMFC.h:448:9`! 2 // Marker view
449 #define CV_MARKER2cxx . . $ `netgames/includes/DMFC.h:449:9`! 3 // Marker view
450 #define CV_MARKER3cxx . . $ `netgames/includes/DMFC.h:450:9`! 4 // Marker view
451 #define CV_MARKER4cxx . . $ `netgames/includes/DMFC.h:451:9`! 5 // Marker view
452 #define CV_MARKER5cxx . . $ `netgames/includes/DMFC.h:452:9`! 6 // Marker view
453 #define CV_MARKER6cxx . . $ `netgames/includes/DMFC.h:453:9`! 7 // Marker view
454 #define CV_MARKER7cxx . . $ `netgames/includes/DMFC.h:454:9`! 8 // Last marker view
455 #define CV_MARKER8cxx . . $ `netgames/includes/DMFC.h:455:9`! 9 // Last marker view
456 #define CV_GUIDEBOTcxx . . $ `netgames/includes/DMFC.h:456:9`! 10 // Guide-Bot
457 #define NUM_CAMERA_VIEWScxx . . $ `netgames/includes/DMFC.h:457:9`! 3
458
459 /// special characters in the fonts
460 #define CHAR_LEFT_ARROWcxx . . $ `netgames/includes/DMFC.h:460:9`! 24
461 #define CHAR_UP_ARROWcxx . . $ `netgames/includes/DMFC.h:461:9`! 25
462 #define CHAR_RIGHT_ARROWcxx . . $ `netgames/includes/DMFC.h:462:9`! 26
463 #define CHAR_DOWN_ARROWcxx . . $ `netgames/includes/DMFC.h:463:9`! 27
464 #define CHAR_CHECKBOX_OFFcxx . . $ `netgames/includes/DMFC.h:464:9`! 28
465 #define CHAR_CHECKBOX_ONcxx . . $ `netgames/includes/DMFC.h:465:9`! 29
466 #define CHAR_RADIO_OFFcxx . . $ `netgames/includes/DMFC.h:466:9`! 30
467 #define CHAR_RADIO_ONcxx . . $ `netgames/includes/DMFC.h:467:9`! 31
468
469 // The following defines are RGB definitions for colors that should be used throughout the UI for text
470 #define UICOL_HOTSPOT_LOcxx . . $ `netgames/includes/DMFC.h:470:9`! \
471 GR_RGB(85, 234, 3) // Color for a hotspot when it isn't in focus//GR_RGB(50,50,255) // Color for a hotspot
472 // when it isn't in focus
473 #define UICOL_HOTSPOT_HIcxx . . $ `netgames/includes/DMFC.h:473:9`! GR_RGB(207, 248, 105) // Color for a hotspot when it is in focus
474 #define UICOL_TEXT_NORMALcxx . . $ `netgames/includes/DMFC.h:474:9`! GR_RGB(206, 254, 241) // Color for text that is used for labels
475 #define UICOL_WINDOW_TITLEcxx . . $ `netgames/includes/DMFC.h:475:9`! GR_RGB(207, 248, 105) // Color for window title text
476 #define UICOL_TEXT_AUXcxx . . $ `netgames/includes/DMFC.h:476:9`! GR_RGB(200, 200, 200) // Color for auxillary text (text that isn't a label)
477 #define UICOL_LISTBOX_LOcxx . . $ `netgames/includes/DMFC.h:477:9`! GR_RGB(85, 234, 3) // Color for listbox text that isn't in focus
478 #define UICOL_LISTBOX_HIcxx . . $ `netgames/includes/DMFC.h:478:9`! GR_RGB(207, 248, 105) // Color for listbox text that is in focus
479 #define UICOL_BUTTON_LOcxx . . $ `netgames/includes/DMFC.h:479:9`! GR_RGB(85, 234, 3) // Color for text on a button that isn't in focus
480 #define UICOL_BUTTON_HIcxx . . $ `netgames/includes/DMFC.h:480:9`! GR_RGB(207, 248, 105) // Color for text on a button that is in focus
481 #define UIALPHA_HOTSPOT_LOcxx . . $ `netgames/includes/DMFC.h:481:9`! 192 // Alpha value for hotspots not in focus
482 #define UIALPHA_HOTSPOT_HIcxx . . $ `netgames/includes/DMFC.h:482:9`! 255 // Alpha value for hotspots in focus
483 #define OKCANCEL_YOFFSETcxx . . $ `netgames/includes/DMFC.h:483:9`! 50 // subtract this from the height of the window
484
485 // additional flags for creating a newui window
486 #define NUWF_TITLENONEcxx . . $ `netgames/includes/DMFC.h:486:9`! 0x00000000 // don't display a title bar
487 #define NUWF_TITLESMALLcxx . . $ `netgames/includes/DMFC.h:487:9`! 0x00100000 // display a small title bar
488 #define NUWF_TITLEMEDcxx . . $ `netgames/includes/DMFC.h:488:9`! 0x00200000 // display a medium size title bar
489 #define NUWF_TITLELARGEcxx . . $ `netgames/includes/DMFC.h:489:9`! 0x00300000 // display a large title bar
490 #define NUWF_TITLEBARMASKcxx . . $ `netgames/includes/DMFC.h:490:9`! 0x00300000 // mask to use with flags to get title bar flags
491
492 // predefined return values for DLLDoUI/DLLPollUI...exit the dialog immediatly!!
493 #define NEWUIRES_FORCEQUITcxx . . $ `netgames/includes/DMFC.h:493:9`! -2
494 #define UID_OKcxx . . $ `netgames/includes/DMFC.h:494:9`! 0xEE
495 #define UID_CANCELcxx . . $ `netgames/includes/DMFC.h:495:9`! 0xEF
496
497 #define MAX_MENUNAMEcxx . . $ `netgames/includes/DMFC.h:497:9`! 32
498 #define MF_SERVERcxx . . $ `netgames/includes/DMFC.h:498:9`! 0x0001
499 #define MF_CLIENTcxx . . $ `netgames/includes/DMFC.h:499:9`! 0x0002
500 #define MF_ALLcxx . . $ `netgames/includes/DMFC.h:500:9`! 0x0003
501
502 #define REGT_STRINGcxx . . $ `netgames/includes/DMFC.h:502:9`! 0
503 #define REGT_DWORDcxx . . $ `netgames/includes/DMFC.h:503:9`! 1
504 #define CFG_NOERRORcxx . . $ `netgames/includes/DMFC.h:504:9`! 0 // There was no error
505 #define CFG_ALREADYOPENcxx . . $ `netgames/includes/DMFC.h:505:9`! 1 // The registry/cfg is already open
506 #define CFG_OUTOFMEMORYcxx . . $ `netgames/includes/DMFC.h:506:9`! 2 // Out of memory
507 #define CFG_NOCFGFILEcxx . . $ `netgames/includes/DMFC.h:507:9`! 3 // You didn't give a config file name
508 #define CFG_NOTOPENcxx . . $ `netgames/includes/DMFC.h:508:9`! 4 // You haven't opened the config file yet
509 #define CFG_KEYNOTFOUNDcxx . . $ `netgames/includes/DMFC.h:509:9`! 5 // The key you're looking up hasn't been created or isn't in the registry
510 #define CFG_RECORDNOTFOUNDcxx . . $ `netgames/includes/DMFC.h:510:9`! 6 // The record you're lookup up isn't in the active key
511 #define CFG_CANTCREATEcxx . . $ `netgames/includes/DMFC.h:511:9`! 7 // There was an error trying to create a record
512
513 #define MIT_NORMALcxx . . $ `netgames/includes/DMFC.h:513:9`! 0 // Allowed to have submenus
514 #define MIT_PLISTcxx . . $ `netgames/includes/DMFC.h:514:9`! 1 // A Player List
515 #define MIT_STATEcxx . . $ `netgames/includes/DMFC.h:515:9`! 2 // Radio Button like submenu list
516 #define MIT_STATEITEMcxx . . $ `netgames/includes/DMFC.h:516:9`! 3 // Given to the submenu list items of the above
517 #define MIT_CUSTOMcxx . . $ `netgames/includes/DMFC.h:517:9`! \
518 4 // use this along with filled in tCustomMenu* (as the only parm in the variable parms section
519 // of MenuItem constructor to create a user defined menu list
520
521 #define MAX_STRING_LENcxx . . $ `netgames/includes/DMFC.h:521:9`! 32 // Maximum string length for a menu title
522 #define MAX_DMFC_TIMERScxx . . $ `netgames/includes/DMFC.h:522:9`! 16
523 #define MAX_DEATH_MSGScxx . . $ `netgames/includes/DMFC.h:523:9`! 32
524
525 #define MAX_CALLSIGN_SIZEcxx . . $ `netgames/includes/DMFC.h:525:9`! 25
526 #define MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`! 64
527 #define DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`! 0
528 #define DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`! 1
529
530 #define MAX_DBNAME_SIZEcxx . . $ `netgames/includes/DMFC.h:530:9`! 32
531 #define MAX_DBLABEL_SIZEcxx . . $ `netgames/includes/DMFC.h:531:9`! 128
532
533 struct tCustomMenucxx . . $ tCustomMenu# {
534 int (*GetListCountcxx . . $ tCustomMenu#GetListCount.)(void); // this function should return the number of items in the list
535 char *(*GetItemcxx . . $ tCustomMenu#GetItem.)(int index); // this function should return a string of the item at the given index, NULL on error
536 };
537
538 struct tPInfoStatcxx . . $ tPInfoStat# {
539 int slotcxx . . $ tPInfoStat#slot.; // player record slot
540 int killscxx . . $ tPInfoStat#kills.; // number of times you killed this player
541 int deathscxx . . $ tPInfoStat#deaths.; // number of times this player killed you
542 };
543
544 enum slot_statecxx . . $ slot_state# { STATE_EMPTYcxx . . $ STATE_EMPTY., STATE_INGAMEcxx . . $ STATE_INGAME., STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED. };
545
546 struct t_dstatcxx . . $ t_dstat# {
547 int killscxx . . $ t_dstat#kills.[2], deathscxx . . $ t_dstat#deaths.[2], suicidescxx . . $ t_dstat#suicides.[2];
548 };
549
550 class PInfocxx . . $ PInfo#;
551
552 struct player_recordcxx . . $ player_record# {
553 slot_statecxx . . $ slot_state# statecxx . . $ player_record#state.; // state of this slot
554 char callsigncxx . . $ player_record#callsign.[MAX_CALLSIGN_SIZEcxx . . $ `netgames/includes/DMFC.h:525:9`!]; // Player's callsign
555 char *tracker_idcxx . . $ player_record#tracker_id.; // Player's master tracker ID, NULL if there isn't one
556 network_addresscxx . . $ network_address# net_addrcxx . . $ player_record#net_addr.; // Player's address
557 int pnumcxx . . $ player_record#pnum.; // Player's pnum
558 unioncxx . . $ player_record#$anonymous_type_0# {
559 float disconnect_timecxx . . $ player_record#$anonymous_type_0#disconnect_time.; // Time player disconnected
560 float start_timecxx . . $ player_record#$anonymous_type_0#start_time.; // Time the player entered the game
561 };
562 float total_time_in_gamecxx . . $ player_record#total_time_in_game.; // Total time the player has been in the game
563 t_dstatcxx . . $ t_dstat# dstatscxx . . $ player_record#dstats.; // DMFC's stats
564 void *user_infocxx . . $ player_record#user_info.; // Multiplayer Mod user defined struct pointer
565 int user_info_sizecxx . . $ player_record#user_info_size.; // Size of user_info;
566
567 int8_t teamcxx . . $ player_record#team.; // The player's team (for when they reconnect)
568 PInfocxx . . $ PInfo# *pinfocxx . . $ player_record#pinfo.; // Pointer to player info (who killed whom)
569 };
570
571 #define MIF_INCLUDENONEcxx . . $ `netgames/includes/DMFC.h:571:9`! \
572 0x01 // for MIT_PSTATE, this will place a <None> at the top, it will send a -1 to the function, if selected
573 // #define MIF_IGNORESERVER 0x02 //for MIT_PSTATE, this will keep the server out of the list
574 // #define MIF_IGNOREME 0x04 //for MIT_PSTATE, this will keep your pnum out of the list
575
576 #define MAX_COLUMN_TITLE_SIZEcxx . . $ `netgames/includes/DMFC.h:576:9`! 15
577
578 enum tColumnTypecxx . . $ tColumnType#{
579 DSCOL_KILLS_LEVELcxx . . $ DSCOL_KILLS_LEVEL.,
580 DSCOL_KILLS_OVERALLcxx . . $ DSCOL_KILLS_OVERALL.,
581 DSCOL_KILLS_BOTHcxx . . $ DSCOL_KILLS_BOTH.,
582 DSCOL_DEATHS_LEVELcxx . . $ DSCOL_DEATHS_LEVEL.,
583 DSCOL_DEATHS_OVERALLcxx . . $ DSCOL_DEATHS_OVERALL.,
584 DSCOL_DEATHS_BOTHcxx . . $ DSCOL_DEATHS_BOTH.,
585 DSCOL_SUICIDES_LEVELcxx . . $ DSCOL_SUICIDES_LEVEL.,
586 DSCOL_SUICIDES_OVERALLcxx . . $ DSCOL_SUICIDES_OVERALL.,
587 DSCOL_SUICIDES_BOTHcxx . . $ DSCOL_SUICIDES_BOTH.,
588 DSCOL_PILOT_NAMEcxx . . $ DSCOL_PILOT_NAME.,
589 DSCOL_PILOT_TEAMcxx . . $ DSCOL_PILOT_TEAM.,
590 DSCOL_PINGcxx . . $ DSCOL_PING.,
591 DSCOL_CUSTOMcxx . . $ DSCOL_CUSTOM.,
592 DSCOL_BLANKcxx . . $ DSCOL_BLANK.,
593 DSCOL_BMPcxx . . $ DSCOL_BMP.
594 };
595
596 enum tColorTypecxx . . $ tColorType# { DSCOLOR_NORMALcxx . . $ DSCOLOR_NORMAL., DSCOLOR_TEAMcxx . . $ DSCOLOR_TEAM., DSCOLOR_SHIPCOLORcxx . . $ DSCOLOR_SHIPCOLOR., DSCOLOR_CUSTOMcxx . . $ DSCOLOR_CUSTOM. };
597
598 struct tDmfcStatsColumnInfocxx . . $ tDmfcStatsColumnInfo# {
599 // what type of information should be displayed in this column, use custom if you want
600 // the callback to fill in your own data
601 tColumnTypecxx . . $ tColumnType# typecxx . . $ tDmfcStatsColumnInfo#type.;
602 // what type of color to use
603 tColorTypecxx . . $ tColorType# color_typecxx . . $ tDmfcStatsColumnInfo#color_type.;
604 // title for column
605 char titlecxx . . $ tDmfcStatsColumnInfo#title.[MAX_COLUMN_TITLE_SIZEcxx . . $ `netgames/includes/DMFC.h:576:9`!];
606 // width of the column (note: columns will not be rendered if the total width of the
607 // columns exceeds the width of the display)
608 int widthcxx . . $ tDmfcStatsColumnInfo#width.;
609 // color of the text for this column (if color type is custom)
610 ddgr_colorcxx . . $ ddgr_color# colorcxx . . $ tDmfcStatsColumnInfo#color.;
611 };
612
613 //=====================================================================
614 // tDmfcStatsInit flags
615 #define DSIF_SEPERATE_BY_TEAMcxx . . $ `netgames/includes/DMFC.h:615:9`! \
616 0x00000001 // this tells the stats manager to seperate the players by
617 // team (useful only in a team game). By default it will
618 // list all the players in a straight list
619 #define DSIF_SHOW_PICcxx . . $ `netgames/includes/DMFC.h:619:9`! \
620 0x00000002 // The pilot's picture (if available else logo if available) should
621 // be shown in the detailed section
622 #define DSIF_ONLY_X_PLAYERS_SHOWNcxx . . $ `netgames/includes/DMFC.h:622:9`! \
623 0x000004 // If set, than the MaxNumberDisplayed member of tDmfcStatsInit
624 // must also be valid (throughout the lifetime of the stats
625 // being displayed). The stat manager will only display
626 // (*MaxNumberDisplayed) stats (checked each frame).
627 #define DSIF_SHOW_OBSERVERICONcxx . . $ `netgames/includes/DMFC.h:627:9`! \
628 0x00000008 // if this flag is given, the observer mode icon will be
629 // displayed as the first item in the column
630 #define DSIF_NOLASTKILLERcxx . . $ `netgames/includes/DMFC.h:630:9`! 0x00000010 // don't display the "Last Killer"
631 #define DSIF_NOLASTVICTIMcxx . . $ `netgames/includes/DMFC.h:631:9`! 0x00000020 // don't display the "Last Victim"
632 #define DSIF_NODETAILEDINFOcxx . . $ `netgames/includes/DMFC.h:632:9`! 0x00000040 // don't display the detailed stats
633 #define DSIF_SHOWPLAYERVIEWcxx . . $ `netgames/includes/DMFC.h:633:9`! \
634 0x00000080 // display the current view of the selected player (only available if DSIF_NODETAILEDINFO is also set)
635
636 //=====================================================================
637 struct tDmfcStatsInitcxx . . $ tDmfcStatsInit# {
638 // see the DSIF_* for the list of available flags and descriptions
639 int flagscxx . . $ tDmfcStatsInit#flags.;
640 // points to an array of player record numbers, sorted to however you want them sorted. Each
641 // frame this array will be used when displaying the stats.
642 int *SortedPlayerRecordscxx . . $ tDmfcStatsInit#SortedPlayerRecords.;
643 // the number of columns you want printed in the player list column for each player
644 int cColumnCountPlayerListcxx . . $ tDmfcStatsInit#cColumnCountPlayerList.;
645 // the number of columns you want printed in the detailed player info
646 int cColumnCountDetailedcxx . . $ tDmfcStatsInit#cColumnCountDetailed.;
647 // Informtaion for the player list columns (array of tDmfcStatsColumnInfo structs)
648 tDmfcStatsColumnInfocxx . . $ tDmfcStatsColumnInfo# *PlayerListColumnscxx . . $ tDmfcStatsInit#PlayerListColumns.;
649 // Information for the detailed columns (array of tDmfcStatsColumnInfo structs)
650 tDmfcStatsColumnInfocxx . . $ tDmfcStatsColumnInfo# *DetailedColumnscxx . . $ tDmfcStatsInit#DetailedColumns.;
651 // Callback function when the stats manager needs to get information when displaying a playerlist column
652 // precord_num: contains the player record number of the player it needs information about
653 // column_num: which column (index into the PlayerListColumns array) it is working on
654 // buffer: buffer to fill in for your data
655 // buffer_size: number of bytes you can use for your data (IT MUST BE NULL TERMINATED STRING)
656 void (*clbPlayerColumncxx . . $ tDmfcStatsInit#clbPlayerColumn.)(int precord_num, int column_num, char *buffer, int buffer_size);
657 // Callback function when the stats manager needs to get information when displaying a detailed column
658 // precord_num: contains the player record number of the player it needs information about
659 // column_num: which column (index into the DetailedColumns array) it is working on
660 // buffer: buffer to fill in for your data
661 // buffer_size: number of bytes you can use for your data (IT MUST BE NULL TERMINATED STRING)
662 void (*clbDetailedColumncxx . . $ tDmfcStatsInit#clbDetailedColumn.)(int precord_num, int column_num, char *buffer, int buffer_size);
663 // Callback function when the stats manager needs to draw the custom bitmap on the playerlist column
664 // precord_num: contains the player record number of the player it displaying
665 // column_num: which column (index into the PlayerListColumns array) it is working on
666 // x,y,w,h: the (x,y) position of the upper left corner of the area, and the allowed width/height
667 // handle the drawing in this function
668 void (*clbPlayerColumnBMPcxx . . $ tDmfcStatsInit#clbPlayerColumnBMP.)(int precord_num, int column_num, int x, int y, int w, int h, uint8_tcxx . . $ uint8_t# alpha_to_use);
669 // Callback function when the stats manager needs to draw the custom bitmap on the detailed column
670 // precord_num: contains the player record number of the player it displaying
671 // column_num: which column (index into the DetailedColumns array) it is working on
672 // x,y,w,h: the (x,y) position of the upper left corner of the area, and the allowed width/height
673 // handle the drawing in this function
674 void (*clbDetailedColumnBMPcxx . . $ tDmfcStatsInit#clbDetailedColumnBMP.)(int precord_num, int column_num, int x, int y, int w, int h, uint8_tcxx . . $ uint8_t# alpha_to_use);
675 // Callback function when the stats manager needs to display team info for a particular team
676 // team: contains the team it's displaying about (0 = red, ... 3 = yellow)
677 // buffer: buffer to fill in for your data
678 // buffer_size: number of bytes you can use for your data (IT MUST BE NULL TERMINATED STRING)
679 void (*clTeamLinecxx . . $ tDmfcStatsInit#clTeamLine.)(int team, char *buffer, int buffer_size);
680 // Points to a buffer that contains the name of the multiplayer game (NULL TERMINATED STRING)
681 char *GameNamecxx . . $ tDmfcStatsInit#GameName.;
682 // if the DSIF_ONLY_X_PLAYERS_SHOWN flag is set, than the stat manager checks this value (dereferenced) every frame
683 // and will only show this many players
684 int *MaxNumberDisplayedcxx . . $ tDmfcStatsInit#MaxNumberDisplayed.;
685 };
686
687 #endif