1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
//! `IPlayerObject` — generated by `cargo xtask gen-omp` from `Server/Components/Objects/objects.hpp`.
//! Implemented by `PlayerObject` in the server's `Objects`.
//!
//! Do not edit: change `xtask/omp-wrappers.toml` or the generator and
//! regenerate. Slots are clang's layout of the header for each ABI, checked
//! against the official binaries by `cargo xtask check-abi --generated`.
#![allow(unused_imports)]
use crate::omp::containers::{FlatSet, HybridString, Pair, Span};
use crate::omp::types::{
Colour, GTAQuat, Hours, Microseconds, Milliseconds, Minutes, Seconds, StringView, TimePoint,
UID, Vector2, Vector3, Vector4, WorldTimePoint,
};
use crate::omp::vtable::{call_vtable_small_struct, opaque, slots, virtual_fns};
use crate::omp::*;
slots! {
/// `void IBaseObject::setDrawDistance(float)`
SLOT_SET_DRAW_DISTANCE: usize = 6, 5;
/// `float IBaseObject::getDrawDistance()`
SLOT_GET_DRAW_DISTANCE: usize = 7, 6;
/// `void IBaseObject::setModel(int)`
SLOT_SET_MODEL: usize = 8, 7;
/// `int IBaseObject::getModel()`
SLOT_GET_MODEL: usize = 9, 8;
/// `void IBaseObject::setCameraCollision(bool)`
SLOT_SET_CAMERA_COLLISION: usize = 10, 9;
/// `bool IBaseObject::getCameraCollision()`
SLOT_GET_CAMERA_COLLISION: usize = 11, 10;
/// `void IBaseObject::move(const ObjectMoveData &)`
SLOT_MOVE: usize = 12, 11;
/// `bool IBaseObject::isMoving()`
SLOT_IS_MOVING: usize = 13, 12;
/// `void IBaseObject::stop()`
SLOT_STOP: usize = 14, 13;
/// `const ObjectMoveData & IBaseObject::getMovingData()`
SLOT_GET_MOVING_DATA: usize = 15, 14;
/// `void IBaseObject::attachToVehicle(IVehicle &, Vector3, Vector3)`
SLOT_ATTACH_TO_VEHICLE: usize = 16, 15;
/// `void IBaseObject::resetAttachment()`
SLOT_RESET_ATTACHMENT: usize = 17, 16;
/// `const ObjectAttachmentData & IBaseObject::getAttachmentData()`
SLOT_GET_ATTACHMENT_DATA: usize = 18, 17;
/// `bool IBaseObject::getMaterialData(uint32_t, const ObjectMaterialData *&)`
SLOT_GET_MATERIAL_DATA: usize = 19, 18;
/// `void IBaseObject::setMaterial(uint32_t, int, StringView, StringView, Colour)`
SLOT_SET_MATERIAL: usize = 20, 19;
/// `void IBaseObject::setMaterialText(uint32_t, StringView, ObjectMaterialSize, StringView, int, bool, Colour, Colour, ObjectMaterialTextAlign)`
SLOT_SET_MATERIAL_TEXT: usize = 21, 20;
/// `void IPlayerObject::attachToObject(IPlayerObject &, Vector3, Vector3)`
SLOT_ATTACH_TO_OBJECT: usize = 22, 21;
/// `void IPlayerObject::attachToPlayer(IPlayer &, Vector3, Vector3)`
SLOT_ATTACH_TO_PLAYER: usize = 23, 22;
}
virtual_fns! {
/// `void IBaseObject::setDrawDistance(float)`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
pub fn player_object_set_draw_distance(
player_object: IPlayerObject,
draw_distance: f32,
) = [0, SLOT_SET_DRAW_DISTANCE];
/// `float IBaseObject::getDrawDistance()`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
#[must_use]
pub fn player_object_draw_distance(
player_object: IPlayerObject,
) -> f32 = [0, SLOT_GET_DRAW_DISTANCE] or 0.0;
/// `void IBaseObject::setModel(int)`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
pub fn player_object_set_model(player_object: IPlayerObject, model: i32) = [0, SLOT_SET_MODEL];
/// `int IBaseObject::getModel()`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
#[must_use]
pub fn player_object_model(player_object: IPlayerObject) -> i32 = [0, SLOT_GET_MODEL] or 0;
/// `void IBaseObject::setCameraCollision(bool)`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
pub fn player_object_set_camera_collision(
player_object: IPlayerObject,
collision: bool,
) = [0, SLOT_SET_CAMERA_COLLISION];
/// `bool IBaseObject::getCameraCollision()`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
#[must_use]
pub fn player_object_camera_collision(
player_object: IPlayerObject,
) -> bool = [0, SLOT_GET_CAMERA_COLLISION] or false;
/// `void IBaseObject::move(const ObjectMoveData &)`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
pub fn player_object_move(player_object: IPlayerObject, data: &ObjectMoveData) = [0, SLOT_MOVE];
/// `bool IBaseObject::isMoving()`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
#[must_use]
pub fn player_object_is_moving(
player_object: IPlayerObject,
) -> bool = [0, SLOT_IS_MOVING] or false;
/// `void IBaseObject::stop()`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
pub fn player_object_stop(player_object: IPlayerObject) = [0, SLOT_STOP];
/// `const ObjectMoveData & IBaseObject::getMovingData()`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
#[must_use]
pub fn player_object_moving_data(
player_object: IPlayerObject,
) -> *const ObjectMoveData = [0, SLOT_GET_MOVING_DATA] or std::ptr::null();
/// `void IBaseObject::attachToVehicle(IVehicle &, Vector3, Vector3)`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
pub fn player_object_attach_to_vehicle(
player_object: IPlayerObject,
vehicle: *mut IVehicle,
offset: Vector3,
rotation: Vector3,
) = [0, SLOT_ATTACH_TO_VEHICLE];
/// `void IBaseObject::resetAttachment()`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
pub fn player_object_reset_attachment(
player_object: IPlayerObject,
) = [0, SLOT_RESET_ATTACHMENT];
/// `const ObjectAttachmentData & IBaseObject::getAttachmentData()`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
#[must_use]
pub fn player_object_attachment_data(
player_object: IPlayerObject,
) -> *const ObjectAttachmentData = [0, SLOT_GET_ATTACHMENT_DATA] or std::ptr::null();
/// `bool IBaseObject::getMaterialData(uint32_t, const ObjectMaterialData *&)`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
#[must_use]
pub fn player_object_material_data(
player_object: IPlayerObject,
material_index: u32,
out: *mut *const ObjectMaterialData,
) -> bool = [0, SLOT_GET_MATERIAL_DATA] or false;
/// `void IBaseObject::setMaterial(uint32_t, int, StringView, StringView, Colour)`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
pub fn player_object_set_material(
player_object: IPlayerObject,
material_index: u32,
model: i32,
texture_library: StringView,
texture_name: StringView,
colour: Colour,
) = [0, SLOT_SET_MATERIAL];
/// `void IBaseObject::setMaterialText(uint32_t, StringView, ObjectMaterialSize, StringView, int, bool, Colour, Colour, ObjectMaterialTextAlign)`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
pub fn player_object_set_material_text(
player_object: IPlayerObject,
material_index: u32,
text: StringView,
material_size: i32,
font_face: StringView,
font_size: i32,
bold: bool,
font_colour: Colour,
background_colour: Colour,
align: i32,
) = [0, SLOT_SET_MATERIAL_TEXT];
/// `void IPlayerObject::attachToObject(IPlayerObject &, Vector3, Vector3)`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
pub fn player_object_attach_to_object(
player_object: IPlayerObject,
object: *mut IPlayerObject,
offset: Vector3,
rotation: Vector3,
) = [0, SLOT_ATTACH_TO_OBJECT];
/// `void IPlayerObject::attachToPlayer(IPlayer &, Vector3, Vector3)`.
///
/// # Safety
/// `player_object` must be a live `IPlayerObject`.
pub fn player_object_attach_to_player(
player_object: IPlayerObject,
player: *mut IPlayer,
offset: Vector3,
rotation: Vector3,
) = [0, SLOT_ATTACH_TO_PLAYER];
}