add analog camera exports

This commit is contained in:
danielryb 2024-10-22 03:50:34 +02:00
parent e862a38135
commit 2fbd3e8f1e

View file

@ -26,6 +26,18 @@ float analog_camera_y_sensitivity = 500.0f;
static const float analog_cam_threshold = 0.1f; static const float analog_cam_threshold = 0.1f;
RECOMP_EXPORT s32 recomp_is_analog_cam_enabled(void) {
return recomp_analog_cam_enabled();
}
RECOMP_EXPORT bool recomp_is_analog_cam_active(void) {
return analog_cam_active;
}
RECOMP_EXPORT VecGeo recomp_get_analog_cam_pos(void) {
return analog_camera_pos;
}
void update_analog_camera_params(Camera* camera) { void update_analog_camera_params(Camera* camera) {
// recomp_printf("Camera at: %.2f %.2f %.2f\n" // recomp_printf("Camera at: %.2f %.2f %.2f\n"
// " eye: %.2f %.2f %.2f\n" // " eye: %.2f %.2f %.2f\n"
@ -46,7 +58,7 @@ void update_analog_camera_params(Camera* camera) {
} }
} }
void update_analog_cam(Camera* c) { RECOMP_EXPORT void recomp_update_analog_cam(Camera* c) {
can_use_analog_cam = true; can_use_analog_cam = true;
Player* player = GET_PLAYER(c->play); Player* player = GET_PLAYER(c->play);
@ -783,7 +795,7 @@ RECOMP_PATCH s32 Camera_Normal1(Camera* camera) {
// @recomp Update the analog camera. // @recomp Update the analog camera.
if (recomp_analog_cam_enabled()) { if (recomp_analog_cam_enabled()) {
update_analog_cam(camera); recomp_update_analog_cam(camera);
if (analog_cam_active) { if (analog_cam_active) {
spB4.pitch = analog_camera_pos.pitch; spB4.pitch = analog_camera_pos.pitch;
@ -1023,7 +1035,7 @@ RECOMP_PATCH s32 Camera_Jump2(Camera* camera) {
// @recomp Update the analog camera. // @recomp Update the analog camera.
if (recomp_analog_cam_enabled()) { if (recomp_analog_cam_enabled()) {
update_analog_cam(camera); recomp_update_analog_cam(camera);
if (analog_cam_active) { if (analog_cam_active) {
spB4.pitch = analog_camera_pos.pitch; spB4.pitch = analog_camera_pos.pitch;
@ -1373,7 +1385,7 @@ RECOMP_PATCH s32 Camera_Parallel1(Camera* camera) {
// @recomp Update the analog camera. // @recomp Update the analog camera.
if (recomp_analog_cam_enabled()) { if (recomp_analog_cam_enabled()) {
update_analog_cam(camera); recomp_update_analog_cam(camera);
if (analog_cam_active) { if (analog_cam_active) {
sp90.pitch = analog_camera_pos.pitch; sp90.pitch = analog_camera_pos.pitch;
@ -1583,7 +1595,7 @@ RECOMP_PATCH s32 Camera_Normal3(Camera* camera) {
// @recomp Update the analog camera. // @recomp Update the analog camera.
if (recomp_analog_cam_enabled()) { if (recomp_analog_cam_enabled()) {
update_analog_cam(camera); recomp_update_analog_cam(camera);
if (analog_cam_active) { if (analog_cam_active) {
sp80.pitch = analog_camera_pos.pitch; sp80.pitch = analog_camera_pos.pitch;
@ -1821,7 +1833,7 @@ RECOMP_PATCH s32 Camera_Jump3(Camera* camera) {
// @recomp Update the analog camera. // @recomp Update the analog camera.
if (recomp_analog_cam_enabled()) { if (recomp_analog_cam_enabled()) {
update_analog_cam(camera); recomp_update_analog_cam(camera);
if (analog_cam_active) { if (analog_cam_active) {
spAC.pitch = analog_camera_pos.pitch; spAC.pitch = analog_camera_pos.pitch;