Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 277faf0

Browse files
committed
bindings
1 parent c83b8ae commit 277faf0

File tree

1 file changed

+64
-20
lines changed

1 file changed

+64
-20
lines changed

code/__DEFINES/bindings.dm

Lines changed: 64 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,179 +11,223 @@
1111

1212
#define AUXMOS (__auxmos || __detect_auxmos())
1313

14-
/proc/__auxmos_shutdown()
15-
return call_ext(AUXMOS, "byond:auxmos_shutdown_ffi")()
14+
/proc/byondapi_stack_trace(msg)
15+
CRASH(msg)
1616

1717
/datum/controller/subsystem/air/proc/process_excited_groups_auxtools(remaining)
1818
return call_ext(AUXMOS, "byond:groups_hook_ffi")(src, remaining)
1919

20-
/datum/controller/subsystem/air/proc/process_turfs_auxtools(remaining)
21-
return call_ext(AUXMOS, "byond:process_turf_hook_ffi")(src, remaining)
20+
/proc/finalize_gas_refs()
21+
return call_ext(AUXMOS, "byond:finalize_gas_refs_ffi")()
2222

23-
/datum/controller/subsystem/air/proc/finish_turf_processing_auxtools(time_remaining)
24-
return call_ext(AUXMOS, "byond:finish_process_turfs_ffi")(time_remaining)
23+
/datum/controller/subsystem/air/proc/auxtools_update_reactions()
24+
return call_ext(AUXMOS, "byond:update_reactions_ffi")()
2525

26-
/datum/controller/subsystem/air/proc/thread_running()
27-
return call_ext(AUXMOS, "byond:thread_running_hook_ffi")()
26+
/proc/auxtools_atmos_init(gas_data)
27+
return call_ext(AUXMOS, "byond:hook_init_ffi")(gas_data)
28+
29+
/proc/_auxtools_register_gas(gas)
30+
return call_ext(AUXMOS, "byond:hook_register_gas_ffi")(gas)
2831

2932
/turf/proc/__update_auxtools_turf_adjacency_info()
3033
return call_ext(AUXMOS, "byond:hook_infos_ffi")(src)
3134

3235
/turf/proc/update_air_ref(flag)
3336
return call_ext(AUXMOS, "byond:hook_register_turf_ffi")(src, flag)
3437

35-
/proc/finalize_gas_refs()
36-
return call_ext(AUXMOS, "byond:finalize_gas_refs_ffi")()
38+
/datum/controller/subsystem/air/proc/process_turfs_auxtools(remaining)
39+
return call_ext(AUXMOS, "byond:process_turf_hook_ffi")(src, remaining)
3740

38-
/datum/controller/subsystem/air/proc/auxtools_update_reactions()
39-
return call_ext(AUXMOS, "byond:update_reactions_ffi")()
41+
/datum/controller/subsystem/air/proc/finish_turf_processing_auxtools(time_remaining)
42+
return call_ext(AUXMOS, "byond:finish_process_turfs_ffi")(time_remaining)
4043

41-
/proc/auxtools_atmos_init(gas_data)
42-
return call_ext(AUXMOS, "byond:hook_init_ffi")(gas_data)
44+
/datum/controller/subsystem/air/proc/thread_running()
45+
return call_ext(AUXMOS, "byond:thread_running_hook_ffi")()
4346

44-
/proc/_auxtools_register_gas(gas)
45-
return call_ext(AUXMOS, "byond:hook_register_gas_ffi")(gas)
47+
/datum/controller/subsystem/air/proc/process_turf_equalize_auxtools(remaining)
48+
return call_ext(AUXMOS, "byond:equalize_hook_ffi")(src, remaining)
4649

4750
/datum/gas_mixture/proc/__auxtools_parse_gas_string(string)
4851
return call_ext(AUXMOS, "byond:parse_gas_string_ffi")(src, string)
4952

53+
/// Returns: the total amount of gas mixtures in the arena, including "free" ones.
5054
/datum/controller/subsystem/air/proc/get_max_gas_mixes()
5155
return call_ext(AUXMOS, "byond:hook_max_gas_mixes_ffi")()
5256

57+
/// Returns: the amount of gas mixtures that are attached to a byond gas mixture.
5358
/datum/controller/subsystem/air/proc/get_amt_gas_mixes()
5459
return call_ext(AUXMOS, "byond:hook_amt_gas_mixes_ffi")()
5560

61+
/// Args: (list). Takes every gas in the list and makes them all identical, scaled to their respective volumes. The total heat and amount of substance in all of the combined gases is conserved.
5662
/proc/equalize_all_gases_in_list(gas_list)
5763
return call_ext(AUXMOS, "byond:equalize_all_hook_ffi")(gas_list)
5864

65+
/// Args: (temperature). Returns: how much oxidizer for fire is in the mixture at the given temperature. If temperature is omitted, just uses current temperature instead.
5966
/datum/gas_mixture/proc/get_oxidation_power(temp)
6067
return call_ext(AUXMOS, "byond:oxidation_power_hook_ffi")(src, temp)
6168

69+
/// Args: (temperature). Returns: how much fuel for fire is in the mixture at the given temperature. If temperature is omitted, just uses current temperature instead.
6270
/datum/gas_mixture/proc/get_fuel_amount(temp)
6371
return call_ext(AUXMOS, "byond:fuel_amount_hook_ffi")(src, temp)
6472

73+
/// Args: (mixture). Makes `src` a copy of `mixture`, with volumes taken into account.
6574
/datum/gas_mixture/proc/equalize_with(total)
6675
return call_ext(AUXMOS, "byond:equalize_with_hook_ffi")(src, total)
6776

77+
/// Args: (mixture, ratio). Transfers `ratio` of `src` to `mixture`.
6878
/datum/gas_mixture/proc/transfer_ratio_to(other, ratio)
6979
return call_ext(AUXMOS, "byond:transfer_ratio_hook_ffi")(src, other, ratio)
7080

81+
/// Args: (mixture, amount). Takes the `amount` given and transfers it from `src` to `mixture`.
7182
/datum/gas_mixture/proc/transfer_to(other, moles)
7283
return call_ext(AUXMOS, "byond:transfer_hook_ffi")(src, other, moles)
7384

85+
/// Args: (heat). Adds a given amount of heat to the mixture, i.e. in joules taking into account capacity.
7486
/datum/gas_mixture/proc/adjust_heat(temp)
7587
return call_ext(AUXMOS, "byond:adjust_heat_hook_ffi")(src, temp)
7688

89+
/// Args: (holder). Runs all reactions on this gas mixture. Holder is used by the reactions, and can be any arbitrary datum or null.
7790
/datum/gas_mixture/proc/react(holder)
7891
return call_ext(AUXMOS, "byond:react_hook_ffi")(src, holder)
7992

93+
/// Returns: true if the two mixtures are different enough for processing, false otherwise.
8094
/datum/gas_mixture/proc/compare(other)
8195
return call_ext(AUXMOS, "byond:compare_hook_ffi")(src, other)
8296

97+
/// Clears the gas mixture my removing all of its gases.
8398
/datum/gas_mixture/proc/clear()
8499
return call_ext(AUXMOS, "byond:clear_hook_ffi")(src)
85100

101+
/// Marks the mix as immutable, meaning it will never change. This cannot be undone.
86102
/datum/gas_mixture/proc/mark_immutable()
87103
return call_ext(AUXMOS, "byond:mark_immutable_hook_ffi")(src)
88104

105+
/// Args: (mixture, ratio, gas_list). Takes gases given by `gas_list` and moves `ratio` amount of those gases from `src` into `mixture`.
89106
/datum/gas_mixture/proc/scrub_into(into, ratio_v, gas_list)
90107
return call_ext(AUXMOS, "byond:scrub_into_hook_ffi")(src, into, ratio_v, gas_list)
91108

109+
///Args: (flag). As get_gases(), but only returns gases with the given flag.
92110
/datum/gas_mixture/proc/get_by_flag(flag_val)
93111
return call_ext(AUXMOS, "byond:get_by_flag_hook_ffi")(src, flag_val)
94112

113+
///Args: (mixture, flag, amount). Takes `amount` from src that have the given `flag` and puts them into the given `mixture`. Returns: 0 if gas didn't have any with that flag, 1 if it did.
95114
/datum/gas_mixture/proc/__remove_by_flag(into, flag_val, amount_val)
96115
return call_ext(AUXMOS, "byond:remove_by_flag_hook_ffi")(src, into, flag_val, amount_val)
97116

117+
///Args: (coefficient). Divides all gases by this amount.
98118
/datum/gas_mixture/proc/divide(num_val)
99119
return call_ext(AUXMOS, "byond:divide_hook_ffi")(src, num_val)
100120

121+
///Args: (coefficient). Multiplies all gases by this amount.
101122
/datum/gas_mixture/proc/multiply(num_val)
102123
return call_ext(AUXMOS, "byond:multiply_hook_ffi")(src, num_val)
103124

125+
///Args: (amount). Subtracts the given amount from each gas.
104126
/datum/gas_mixture/proc/subtract(num_val)
105127
return call_ext(AUXMOS, "byond:subtract_hook_ffi")(src, num_val)
106128

129+
///Args: (amount). Adds the given amount to each gas.
107130
/datum/gas_mixture/proc/add(num_val)
108131
return call_ext(AUXMOS, "byond:add_hook_ffi")(src, num_val)
109132

133+
/// Args: (gas_id_1, amount_1, gas_id_2, amount_2, ...). As adjust_moles, but with variadic arguments.
110134
/datum/gas_mixture/proc/adjust_multi(...)
111135
var/list/args_copy = args.Copy()
112136
args_copy.Insert(1, src)
113137
return call_ext(AUXMOS, "byond:adjust_multi_hook_ffi")(arglist(args_copy))
114138

139+
/// Args: (gas_id, moles, temp). Adjusts the given gas's amount by the given amount, with that gas being treated as if it is at the given temperature.
115140
/datum/gas_mixture/proc/adjust_moles_temp(id_val, num_val, temp_val)
116141
return call_ext(AUXMOS, "byond:adjust_moles_temp_hook_ffi")(src, id_val, num_val, temp_val)
117142

143+
/// Args: (gas_id, moles). Adjusts the given gas's amount by the given amount, e.g. (GAS_O2, -0.1) will remove 0.1 moles of oxygen from the mixture.
118144
/datum/gas_mixture/proc/adjust_moles(id_val, num_val)
119145
return call_ext(AUXMOS, "byond:adjust_moles_hook_ffi")(src, id_val, num_val)
120146

147+
/// Args: (gas_id, moles). Sets the amount of substance of the given gas, in moles.
121148
/datum/gas_mixture/proc/set_moles(gas_id, amt_val)
122149
return call_ext(AUXMOS, "byond:set_moles_hook_ffi")(src, gas_id, amt_val)
123150

151+
/// Args: (gas_id). Returns: the amount of substance of the given gas, in moles.
124152
/datum/gas_mixture/proc/get_moles(gas_id)
125153
return call_ext(AUXMOS, "byond:get_moles_hook_ffi")(src, gas_id)
126154

155+
/// Args: (volume). Sets the volume of the gas.
127156
/datum/gas_mixture/proc/set_volume(vol_arg)
128157
return call_ext(AUXMOS, "byond:set_volume_hook_ffi")(src, vol_arg)
129158

159+
/// Args: (gas_id). Returns the heat capacity from the given gas, in J/K (probably).
130160
/datum/gas_mixture/proc/partial_heat_capacity(gas_id)
131161
return call_ext(AUXMOS, "byond:partial_heat_capacity_ffi")(src, gas_id)
132162

163+
/// Args: (temperature). Sets the temperature of the mixture. Will be set to 2.7 if it's too low.
133164
/datum/gas_mixture/proc/set_temperature(arg_temp)
134165
return call_ext(AUXMOS, "byond:set_temperature_hook_ffi")(src, arg_temp)
135166

167+
/// Returns: a list of the gases in the mixture, associated with their IDs.
136168
/datum/gas_mixture/proc/get_gases()
137169
return call_ext(AUXMOS, "byond:get_gases_hook_ffi")(src)
138170

171+
/// Args: (src, mixture, conductivity) or (src, conductivity, temperature, heat_capacity). Adjusts temperature of src based on parameters. Returns: temperature of sharer after sharing is complete.
139172
/datum/gas_mixture/proc/temperature_share(...)
140173
var/list/args_copy = args.Copy()
141174
args_copy.Insert(1, src)
142175
return call_ext(AUXMOS, "byond:temperature_share_hook_ffi")(arglist(args_copy))
143176

177+
/// Arg: (mixture). Makes src into a copy of the argument mixture.
144178
/datum/gas_mixture/proc/copy_from(giver)
145179
return call_ext(AUXMOS, "byond:copy_from_hook_ffi")(src, giver)
146180

181+
/// Args: (mixture, amount). Takes the given amount of gas from src and puts it into the argument mixture. Amount is amount of substance in moles.
147182
/datum/gas_mixture/proc/__remove(into, amount_arg)
148183
return call_ext(AUXMOS, "byond:remove_hook_ffi")(src, into, amount_arg)
149184

185+
/// Args: (mixture, ratio). Takes the given ratio of gas from src and puts it into the argument mixture. Ratio is a number between 0 and 1.
150186
/datum/gas_mixture/proc/__remove_ratio(into, ratio_arg)
151187
return call_ext(AUXMOS, "byond:remove_ratio_hook_ffi")(src, into, ratio_arg)
152188

189+
/// Args: (mixture). Merges the gas from the giver into src, without modifying the giver mix.
153190
/datum/gas_mixture/proc/merge(giver)
154191
return call_ext(AUXMOS, "byond:merge_hook_ffi")(src, giver)
155192

193+
/// Returns: the mix's thermal energy, the product of the mixture's heat capacity and its temperature.
156194
/datum/gas_mixture/proc/thermal_energy()
157195
return call_ext(AUXMOS, "byond:thermal_energy_hook_ffi")(src)
158196

197+
/// Returns: the mix's volume, in liters.
159198
/datum/gas_mixture/proc/return_volume()
160199
return call_ext(AUXMOS, "byond:return_volume_hook_ffi")(src)
161200

201+
/// Returns: the mix's temperature, in kelvins.
162202
/datum/gas_mixture/proc/return_temperature()
163203
return call_ext(AUXMOS, "byond:return_temperature_hook_ffi")(src)
164204

205+
/// Returns: the mix's pressure, in kilopascals.
165206
/datum/gas_mixture/proc/return_pressure()
166207
return call_ext(AUXMOS, "byond:return_pressure_hook_ffi")(src)
167208

209+
/// Returns: Amount of substance, in moles.
168210
/datum/gas_mixture/proc/total_moles()
169211
return call_ext(AUXMOS, "byond:total_moles_hook_ffi")(src)
170212

213+
/// Args: (min_heat_cap). Sets the mix's minimum heat capacity.
171214
/datum/gas_mixture/proc/set_min_heat_capacity(arg_min)
172215
return call_ext(AUXMOS, "byond:min_heat_cap_hook_ffi")(src, arg_min)
173216

217+
/// Returns: Heat capacity, in J/K (probably).
174218
/datum/gas_mixture/proc/heat_capacity()
175219
return call_ext(AUXMOS, "byond:heat_cap_hook_ffi")(src)
176220

221+
/// Adds the gas mixture's ID to the queue of mixtures that have been deleted, to be reused later.
222+
/// This version is only if auxcleanup is not being used; it should be called from /datum/gas_mixture/Del.
177223
/datum/gas_mixture/proc/__gasmixture_unregister()
178224
return call_ext(AUXMOS, "byond:unregister_gasmixture_hook_ffi")(src)
179225

226+
/// Fills in the first unused slot in the gas mixtures vector, or adds another one, then sets the argument ByondValue to point to it.
180227
/datum/gas_mixture/proc/__gasmixture_register()
181228
return call_ext(AUXMOS, "byond:register_gasmixture_hook_ffi")(src)
182229

230+
/// Args: (ms). Runs callbacks until time limit is reached. If time limit is omitted, runs all callbacks.
183231
/proc/process_atmos_callbacks(remaining)
184232
return call_ext(AUXMOS, "byond:atmos_callback_handle_ffi")(remaining)
185233

186-
/datum/controller/subsystem/air/proc/process_turf_equalize_auxtools(remaining)
187-
return call_ext(AUXMOS, "byond:equalize_hook_ffi")(src, remaining)
188-
189-

0 commit comments

Comments
 (0)