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
//! `IActor` — generated by `cargo xtask gen-omp` from `Server/Components/Actors/actors.hpp`.
//! Implemented by `Actor` in the server's `Actors`.
//!
//! 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 IActor::setSkin(int)`
SLOT_SET_SKIN: usize = 6, 5;
/// `int IActor::getSkin()`
SLOT_GET_SKIN: usize = 7, 6;
/// `void IActor::applyAnimation(const AnimationData &)`
SLOT_APPLY_ANIMATION: usize = 8, 7;
/// `const AnimationData & IActor::getAnimation()`
SLOT_GET_ANIMATION: usize = 9, 8;
/// `void IActor::clearAnimations()`
SLOT_CLEAR_ANIMATIONS: usize = 10, 9;
/// `void IActor::setHealth(float)`
SLOT_SET_HEALTH: usize = 11, 10;
/// `float IActor::getHealth()`
SLOT_GET_HEALTH: usize = 12, 11;
/// `void IActor::setInvulnerable(bool)`
SLOT_SET_INVULNERABLE: usize = 13, 12;
/// `bool IActor::isInvulnerable()`
SLOT_IS_INVULNERABLE: usize = 14, 13;
/// `bool IActor::isStreamedInForPlayer(const IPlayer &)`
SLOT_IS_STREAMED_IN_FOR_PLAYER: usize = 15, 14;
/// `void IActor::streamInForPlayer(IPlayer &)`
SLOT_STREAM_IN_FOR_PLAYER: usize = 16, 15;
/// `void IActor::streamOutForPlayer(IPlayer &)`
SLOT_STREAM_OUT_FOR_PLAYER: usize = 17, 16;
/// `const ActorSpawnData & IActor::getSpawnData()`
SLOT_GET_SPAWN_DATA: usize = 18, 17;
}
virtual_fns! {
/// `void IActor::setSkin(int)`.
///
/// # Safety
/// `actor` must be a live `IActor`.
pub fn actor_set_skin(actor: IActor, id: i32) = [0, SLOT_SET_SKIN];
/// `int IActor::getSkin()`.
///
/// # Safety
/// `actor` must be a live `IActor`.
#[must_use]
pub fn actor_skin(actor: IActor) -> i32 = [0, SLOT_GET_SKIN] or 0;
/// `void IActor::applyAnimation(const AnimationData &)`.
///
/// # Safety
/// `actor` must be a live `IActor`.
pub fn actor_apply_animation(
actor: IActor,
animation: &AnimationData,
) = [0, SLOT_APPLY_ANIMATION];
/// `const AnimationData & IActor::getAnimation()`.
///
/// # Safety
/// `actor` must be a live `IActor`.
#[must_use]
pub fn actor_animation(
actor: IActor,
) -> *const AnimationData = [0, SLOT_GET_ANIMATION] or std::ptr::null();
/// `void IActor::clearAnimations()`.
///
/// # Safety
/// `actor` must be a live `IActor`.
pub fn actor_clear_animations(actor: IActor) = [0, SLOT_CLEAR_ANIMATIONS];
/// `void IActor::setHealth(float)`.
///
/// # Safety
/// `actor` must be a live `IActor`.
pub fn actor_set_health(actor: IActor, health: f32) = [0, SLOT_SET_HEALTH];
/// `float IActor::getHealth()`.
///
/// # Safety
/// `actor` must be a live `IActor`.
#[must_use]
pub fn actor_health(actor: IActor) -> f32 = [0, SLOT_GET_HEALTH] or 0.0;
/// `void IActor::setInvulnerable(bool)`.
///
/// # Safety
/// `actor` must be a live `IActor`.
pub fn actor_set_invulnerable(actor: IActor, invuln: bool) = [0, SLOT_SET_INVULNERABLE];
/// `bool IActor::isInvulnerable()`.
///
/// # Safety
/// `actor` must be a live `IActor`.
#[must_use]
pub fn actor_is_invulnerable(actor: IActor) -> bool = [0, SLOT_IS_INVULNERABLE] or false;
/// `bool IActor::isStreamedInForPlayer(const IPlayer &)`.
///
/// # Safety
/// `actor` must be a live `IActor`.
#[must_use]
pub fn actor_is_streamed_in_for_player(
actor: IActor,
player: *mut IPlayer,
) -> bool = [0, SLOT_IS_STREAMED_IN_FOR_PLAYER] or false;
/// `void IActor::streamInForPlayer(IPlayer &)`.
///
/// # Safety
/// `actor` must be a live `IActor`.
pub fn actor_stream_in_for_player(
actor: IActor,
player: *mut IPlayer,
) = [0, SLOT_STREAM_IN_FOR_PLAYER];
/// `void IActor::streamOutForPlayer(IPlayer &)`.
///
/// # Safety
/// `actor` must be a live `IActor`.
pub fn actor_stream_out_for_player(
actor: IActor,
player: *mut IPlayer,
) = [0, SLOT_STREAM_OUT_FOR_PLAYER];
/// `const ActorSpawnData & IActor::getSpawnData()`.
///
/// # Safety
/// `actor` must be a live `IActor`.
#[must_use]
pub fn actor_spawn_data(
actor: IActor,
) -> *const ActorSpawnData = [0, SLOT_GET_SPAWN_DATA] or std::ptr::null();
}