Skip to content

Commit

Permalink
rollback debug change which affected py-randomprime interface
Browse files Browse the repository at this point in the history
  • Loading branch information
toasterparty committed May 22, 2024
1 parent 2f7ae61 commit 561b6c9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/bin/randomprime_patcher.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{panic, process::Command, time::Instant};
use std::{panic, process::Command};

use clap::Format;
use randomprime::{patch_config::PatchConfig, patches, reader_writer, structs};
Expand Down Expand Up @@ -78,10 +78,9 @@ fn maybe_pause_at_exit() {
}

fn main_inner() -> Result<(), String> {
let start_time = Instant::now();
let patch_config = PatchConfig::from_cli_options()?;
let pn = ProgressNotifier::new(patch_config.quiet);
patches::patch_iso(patch_config, pn, start_time)?;
patches::patch_iso(patch_config, pn)?;
println!("Done");
Ok(())
}
Expand Down
5 changes: 1 addition & 4 deletions src/c_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::{
os::raw::c_char,
panic,
path::Path,
time::Instant,
};

use serde::Serialize;
Expand Down Expand Up @@ -101,16 +100,14 @@ fn inner(
cb_data: *const (),
cb: extern "C" fn(*const (), *const c_char),
) -> Result<(), String> {
let start_time = Instant::now();

let config_json = unsafe { CStr::from_ptr(config_json) }
.to_str()
.map_err(|e| format!("JSON parse failed: {}", e))?;

let patch_config = PatchConfig::from_json(config_json)?;

let pn = ProgressNotifier::new(cb_data, cb);
patches::patch_iso(patch_config, pn, start_time)?;
patches::patch_iso(patch_config, pn)?;

Ok(())
}
Expand Down
3 changes: 2 additions & 1 deletion src/patches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15382,10 +15382,11 @@ fn patch_arboretum_sandstone(patcher: &mut PrimePatcher<'_, '_>) {
});
}

pub fn patch_iso<T>(config: PatchConfig, mut pn: T, start_time: Instant) -> Result<(), String>
pub fn patch_iso<T>(config: PatchConfig, mut pn: T) -> Result<(), String>
where
T: structs::ProgressNotifier,
{
let start_time = Instant::now();
let mut audio_override_patches: Vec<AudioOverridePatch> = Vec::new();
for (pak_name, rooms) in pickup_meta::ROOM_INFO.iter() {
let world = World::from_pak(pak_name).unwrap();
Expand Down

0 comments on commit 561b6c9

Please sign in to comment.