Debian Codegraph @

netgames/hoard/Hoard.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
19 #ifndef __HOARD_APP_H_
20 #define __HOARD_APP_H_cxx . . $ `netgames/hoard/Hoard.h:20:9`!
21
22 #include "osiris_share.h"cxx . . $ `<file>/Descent3/osiris_share.h`/
23 #include "d3events.h"cxx . . $ `<file>/lib/d3events.h`/
24
25 void HoardGameInitcxx . . $ HoardGameInit(d4f767463ce0a6b3).(int teams);
26
27 //!!!!!!!ADD YOUR EVENT HANDLER OVERRIDES HERE!!!!!!!!!!!
28 void OnIntervalcxx . . $ OnInterval(49f6e7a06ebc5aa8).(void);
29 void OnHUDIntervalcxx . . $ OnHUDInterval(49f6e7a06ebc5aa8).(void);
30 void OnKeypresscxx . . $ OnKeypress(d4f767463ce0a6b3).(int key);
31 void OnServerGameCreatedcxx . . $ OnServerGameCreated(49f6e7a06ebc5aa8).(void);
32 void OnClientLevelStartcxx . . $ OnClientLevelStart(49f6e7a06ebc5aa8).(void);
33 void OnClientLevelEndcxx . . $ OnClientLevelEnd(49f6e7a06ebc5aa8).(void);
34 void OnGameStateRequestcxx . . $ OnGameStateRequest(d4f767463ce0a6b3).(int player_num);
35 void OnPlayerConnectcxx . . $ OnPlayerConnect(d4f767463ce0a6b3).(int player_num);
36 void OnServerPlayerChangeSegmentcxx . . $ OnServerPlayerChangeSegment(b1146eedae1e1d0b).(int player_num, int newseg, int oldseg);
37 void OnClientPlayerChangeSegmentcxx . . $ OnClientPlayerChangeSegment(b1146eedae1e1d0b).(int player_num, int newseg, int oldseg);
38 void OnServerCollidecxx . . $ OnServerCollide(6273fa812ac58a8).(objectcxx . . $ object# *me_obj, objectcxx . . $ object# *it_obj);
39 void OnClientCollidecxx . . $ OnClientCollide(6273fa812ac58a8).(objectcxx . . $ object# *me_obj, objectcxx . . $ object# *it_obj);
40 void OnClientPlayerKilledcxx . . $ OnClientPlayerKilled(766a1b7183ffa4b4).(objectcxx . . $ object# *killer_obj, int victim_pnum);
41 void OnPLRIntervalcxx . . $ OnPLRInterval(49f6e7a06ebc5aa8).(void);
42 void OnPrintScorescxx . . $ OnPrintScores(d4f767463ce0a6b3).(int level);
43 void OnPLRInitcxx . . $ OnPLRInit(49f6e7a06ebc5aa8).(void);
44 void OnSaveStatsToFilecxx . . $ OnSaveStatsToFile(49f6e7a06ebc5aa8).(void);
45 void OnClientShowUIcxx . . $ OnClientShowUI(6ca3d68f5c5f0975).(int id, void *user_data);
46 void OnDisconnectSaveStatsToFilecxx . . $ OnDisconnectSaveStatsToFile(49f6e7a06ebc5aa8).(void);
47 void OnLevelEndSaveStatsToFilecxx . . $ OnLevelEndSaveStatsToFile(49f6e7a06ebc5aa8).(void);
48 extern IDMFCcxx . . $ IDMFC# *DMFCBasecxx . . $ DMFCBase.;
49
50 /*************************************************************************************************
51 *The following functions and declaration are needed to connect the DLL to the game. These must *
52 *stay here and must call the functions that are in them. You can not delete from here, but you *
53 *can add to it no problem
54 **
55 *************************************************************************************************
56 */
57 // These next two function prototypes MUST appear in the extern "C" block if called
58 // from a CPP file.
59 #ifdef __cpluspluscxx . . $ `<built-in>:467:9`!
60 extern "C" {
61 #endif
62 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameInit(int *api_func, uint8_tcxx . . $ uint8_t# *all_ok, int num_teams_to_use);
63 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameCall(int eventnum, dllinfocxx . . $ dllinfo# *data);
64 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameClose();
65 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGetGameInfo(tDLLOptionscxx . . $ tDLLOptions# *options);
66 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! GetGOScriptID(const char *name, uint8_tcxx . . $ uint8_t# isdoor);
67 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLPTRcxx . . $ `lib/module.h:94:10`! CreateInstance(int id);
68 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DestroyInstance(int id, void *ptr);
69 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int16_t DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data);
70 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! SaveRestoreState(void *file_ptr, uint8_tcxx . . $ uint8_t# saving_state);
71 #ifdef __cpluspluscxx . . $ `<built-in>:467:9`!
72 }
73 #endif
74
75
76 // The main entry point where the game calls the dll
77 void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameCallcxx . . $ DLLGameCall(32ca0c0c7dbc2fcf).(int eventnum, dllinfocxx . . $ dllinfo# *data) {
78 if ((eventnum < EVT_CLIENT_INTERVALcxx . . $ `lib/d3events.h:85:9`!) && (DMFCBasecxx . . $ DMFCBase.->GetLocalRolecxx . . $ IDMFC#GetLocalRole(b126dc7c1de90089).() != LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!)) {
79 return;
80 }
81
82 DMFCBasecxx . . $ DMFCBase.->TranslateEventcxx . . $ IDMFC#TranslateEvent(32ca0c0c7dbc2fcf).(eventnum, data);
83 }
84
85 // GetGOScriptID
86 // Purpose:
87 // Given the name of the object (from it's pagename), this function will search through it's
88 // list of General Object Scripts for a script with a matching name (to see if there is a script
89 // for that type/id of object within this DLL). If a matching scriptname is found, a UNIQUE ID
90 // is to be returned back to Descent 3. This ID will be used from here on out for all future
91 // interaction with the DLL. Since doors are not part of the generic object's, it's possible
92 // for a door to have the same name as a generic object (OBJ_POWERUP, OBJ_BUILDING, OBJ_CLUTTER
93 // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a
94 // door, else it is a 0. The return value is the unique identifier, else -1 if the script
95 // does not exist in the DLL.
96 int DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! GetGOScriptIDcxx . . $ GetGOScriptID(a2648ab7e2ef960e).(const char *name, uint8_tcxx . . $ uint8_t# isdoor) { return -1; }
97
98 // CreateInstance
99 // Purpose:
100 // Given an ID from a call to GetGOScriptID(), this function will create a new instance for that
101 // particular script (by allocating and initializing memory, etc.). A pointer to this instance
102 // is to be returned back to Descent 3. This pointer will be passed around, along with the ID
103 // for CallInstanceEvent() and DestroyInstance(). Return NULL if there was an error.
104 void DLLFUNCCALLPTRcxx . . $ `lib/module.h:94:10`! CreateInstancecxx . . $ CreateInstance(d1680a912d714170).(int id) { return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; }
105
106 // DestroyInstance
107 // Purpose:
108 // Given an ID, and a pointer to a particular instance of a script, this function will delete and
109 // destruct all information associated with that script, so it will no longer exist.
110 void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DestroyInstancecxx . . $ DestroyInstance(6ca3d68f5c5f0975).(int id, void *ptr) {}
111
112 // CallInstanceEvent
113 // Purpose:
114 // Given an ID, a pointer to a script instance, an event and a pointer to the struct of
115 // information about the event, this function will translate who this event belongs to and
116 // passes the event to that instance of the script to be handled. Return a combination of
117 // CONTINUE_CHAIN and CONTINUE_DEFAULT, to give instructions on what to do based on the
118 // event. CONTINUE_CHAIN means to continue through the chain of scripts (custom script, level
119 // script, mission script, and finally default script). If CONTINUE_CHAIN is not specified,
120 // than the chain is broken and those scripts of lower priority will never get the event. Return
121 // CONTINUE_DEFAULT in order to tell D3 if you want process the normal action that is built into
122 // the game for that event. This only pertains to certain events. If the chain continues
123 // after this script, than the CONTINUE_DEFAULT setting will be overridden by lower priority
124 // scripts return value.
125 int16_t DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! CallInstanceEventcxx . . $ CallInstanceEvent(79be2a5a01598f29).(int id, void *ptr, int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
126 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
127 }
128
129 // SaveRestoreState
130 // Purpose:
131 // This function is called when Descent 3 is saving or restoring the game state. In this function
132 // you should save/restore any global data that you want preserved through load/save (which includes
133 // demos). You must be very careful with this function, corrupting the file (reading or writing too
134 // much or too little) may be hazardous to the game (possibly making it impossible to restore the
135 // state). It would be best to use version information to keep older versions of saved states still
136 // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE
137 // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should
138 // write data to the file_ptr, 0 when you should read in the data.
139 int DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! SaveRestoreStatecxx . . $ SaveRestoreState(5276b51c10b71c09).(void *file_ptr, uint8_tcxx . . $ uint8_t# saving_state) { return 0; }
140
141
142 #endif