Skip to content

Commit

Permalink
Add bxt-rs max acceleration yaw offset related hooks (#521)
Browse files Browse the repository at this point in the history
* Add bxt-rs accelerated yawspeed related hooks

* change to Max Acceleration Yaw Offset

* update hlstrafe

* changes suggested and update hlstrafe

* update hlstrafe

* update hlstrafe 2
  • Loading branch information
khanghugo authored Jul 12, 2024
1 parent 07f9904 commit d56095e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions BunnymodXT/modules/HwDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@
using namespace std::literals;

// Callbacks for bxt-rs.
struct on_tas_playback_frame_max_accel_yaw_offset {
float value;
float start;
float target;
float accel;
unsigned char dir;
};

struct on_tas_playback_frame_data {
unsigned strafe_cycle_frame_count;
std::array<float, 4> prev_predicted_trace_fractions;
std::array<float, 4> prev_predicted_trace_normal_zs;
on_tas_playback_frame_max_accel_yaw_offset max_accel_yaw_offset;
};

// Change the variable name if you change the parameters!
Expand Down Expand Up @@ -2468,6 +2477,13 @@ int HwDLL::CallOnTASPlaybackFrame() {
StrafeState.StrafeCycleFrameCount,
PrevFractions,
PrevNormalzs,
on_tas_playback_frame_max_accel_yaw_offset {
StrafeState.MaxAccelYawOffsetValue, // value
StrafeState.MaxAccelYawOffsetStart, // start
StrafeState.MaxAccelYawOffsetTarget, // target
StrafeState.MaxAccelYawOffsetAccel, // accel
static_cast<unsigned char>(StrafeState.MaxAccelYawOffsetDir), // dir
},
});
}

Expand Down
2 changes: 1 addition & 1 deletion hlstrafe
Submodule hlstrafe updated 3 files
+1 −1 hltas
+62 −5 src/hlstrafe.cpp
+16 −1 src/hlstrafe.hpp

0 comments on commit d56095e

Please sign in to comment.