Skip to content

Commit

Permalink
changes suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
khanghugo committed Jul 11, 2024
1 parent 8c6a8e2 commit 93ddf52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 2 additions & 11 deletions src/modules/tas_studio/editor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,8 @@ struct InsertCameraLineAdjustment {
did_split: bool,
}

/// Camera view edit modes.
///
/// `CameraViewAdjustmentMode::Alt` adjusts differently for different kinds of line depending on
/// implementation.
///
/// If target_yaw, result is velocity_lock.
// More to come I guess
/// `CameraViewAdjustmentMode::Alt` adjusts different things depending on the line type. For
/// target_yaw lines, it adjusts the velocity_lock angle.
#[derive(Debug, Clone, Copy)]
pub enum CameraViewAdjustmentMode {
Yaw,
Expand Down Expand Up @@ -1286,11 +1281,7 @@ impl Editor {
if let Some(hovered_line_idx) = self.hovered_line_idx {
// For camera editor camera line editing.
if mouse.buttons.is_right_down() && !self.prev_mouse_state.buttons.is_right_down() {
// Mouse was released last frame so the adjustment cannot be active.
assert!(self.camera_view_adjustment.is_none());

// There are no other adjustments in the camera editor at the moment; and anyhow
// when more are added, this condition should still be upheld.
assert!(!self.is_any_adjustment_active());

let line = &self.branch().branch.script.lines[hovered_line_idx];
Expand Down
6 changes: 3 additions & 3 deletions src/modules/tas_studio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,7 @@ pub fn draw(marker: MainThreadMarker, tri: &TriangleApi) {
let callbacks = Callbacks {
enable_mouse_look: &|| enable_mouse_look(marker),
disable_mouse_look: &|| disable_mouse_look(marker),
get_viewangles: &|| get_viewangles(marker),
get_viewangles: &|| unsafe { get_viewangles(marker) },
change_view_origin: &|origin| change_view_origin(marker, origin),
};
if let Err(err) = editor.tick(
Expand Down Expand Up @@ -2198,10 +2198,10 @@ fn disable_mouse_look(marker: MainThreadMarker) {
client::activate_mouse(marker, false);
}

fn get_viewangles(marker: MainThreadMarker) -> [f32; 3] {
unsafe fn get_viewangles(marker: MainThreadMarker) -> [f32; 3] {
let mut view_angles = [0.; 3];

unsafe { engine::hudGetViewAngles.get(marker)(&mut view_angles) };
engine::hudGetViewAngles.get(marker)(&mut view_angles);

view_angles
}
Expand Down

0 comments on commit 93ddf52

Please sign in to comment.