From 4b5ce2ae58e01a7694b6c9624fd038774a9cb416 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 12 Jul 2024 23:32:59 +0200 Subject: [PATCH] Bump a bunch of versions on different dependencies (#10) --- soulmemory-rs/Cargo.toml | 20 ++++++++++---------- soulmemory-rs/src/app.rs | 2 +- soulmemory-rs/src/lib.rs | 2 +- soulmemory-rs/src/render_hooks.rs | 16 ++++++++-------- soulmemory-rs/src/tas/tas.rs | 2 +- test-window/Cargo.toml | 14 +++++++------- test-window/src/main.rs | 2 +- test-window/src/support/mod.rs | 1 + 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/soulmemory-rs/Cargo.toml b/soulmemory-rs/Cargo.toml index e2b0a3c..3739c2f 100644 --- a/soulmemory-rs/Cargo.toml +++ b/soulmemory-rs/Cargo.toml @@ -9,23 +9,23 @@ crate-type = ["lib", "cdylib"] [dependencies] ilhook = "2.1.0" -mem-rs = "0.1.4" +mem-rs = "0.1.7" #mem-rs = { path="C:/projects/mem-rs" } -chrono = "0.4.19" -lazy_static = "1.4.0" +chrono = "0.4.38" +lazy_static = "1.5.0" -serde = { version = "1.0.199", features = ["derive"] } -serde_json = "1.0.116" +serde = { version = "1.0.204", features = ["derive"] } +serde_json = "1.0.120" -imgui = { version = "0.11.0", features = ["tables-api"] } -hudhook = "0.5.0" +imgui = { version = "0.12.0", features = ["tables-api"] } +hudhook = "0.7.1" -log = "0.4.17" -log4rs = {version = "1.1.1", features = ["all_components" ] } +log = "0.4.22" +log4rs = {version = "1.3.0", features = ["all_components" ] } rand = "0.8.5" [dependencies.windows] -version = "0.56.0" +version = "0.58.0" features = [ "Win32_Foundation", "Win32_System_Memory", diff --git a/soulmemory-rs/src/app.rs b/soulmemory-rs/src/app.rs index 60e8a58..9d68b28 100644 --- a/soulmemory-rs/src/app.rs +++ b/soulmemory-rs/src/app.rs @@ -131,7 +131,7 @@ impl Default for App App { game: Box::new(MockGame::new()), - hmodule: HINSTANCE(0), + hmodule: HINSTANCE(std::ptr::null_mut()), server: Server::default(), widgets: Vec::new(), } diff --git a/soulmemory-rs/src/lib.rs b/soulmemory-rs/src/lib.rs index 7acdf9a..6ba77f0 100644 --- a/soulmemory-rs/src/lib.rs +++ b/soulmemory-rs/src/lib.rs @@ -33,7 +33,7 @@ use crate::render_hooks::RenderHooks; pub use app::App; -static mut HMODULE: HINSTANCE = HINSTANCE(0); +static mut HMODULE: HINSTANCE = HINSTANCE(std::ptr::null_mut()); #[no_mangle] #[allow(non_snake_case)] diff --git a/soulmemory-rs/src/render_hooks.rs b/soulmemory-rs/src/render_hooks.rs index 9eae3fc..3cb1b3b 100644 --- a/soulmemory-rs/src/render_hooks.rs +++ b/soulmemory-rs/src/render_hooks.rs @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use hudhook::HINSTANCE as HUDHOOK_HINSTANCE; +//use hudhook::{windows::Win32::Foundation::HINSTANCE as HUDHOOK_HINSTANCE, ImguiRenderLoop}; +use hudhook::*; use hudhook::Hudhook; -use hudhook::hooks::{ImguiRenderLoop}; use hudhook::hooks::dx11::ImguiDx11Hooks; use hudhook::hooks::dx12::ImguiDx12Hooks; use hudhook::hooks::dx9::ImguiDx9Hooks; @@ -33,19 +33,19 @@ impl RenderHooks let instance = App::get_instance(); let app = instance.lock().unwrap(); + let render_hooks = RenderHooks::new(); let mut builder = Hudhook::builder(); builder = match app.game.get_dx_version() { - DxVersion::Dx9 => builder.with(RenderHooks::new().into_hook::()), - DxVersion::Dx11 => builder.with(RenderHooks::new().into_hook::()), - DxVersion::Dx12 => builder.with(RenderHooks::new().into_hook::()), + DxVersion::Dx9 => builder.with::(render_hooks), + DxVersion::Dx11 => builder.with::(render_hooks), + DxVersion::Dx12 => builder.with::(render_hooks), }; + //builder.with_hmodule(HUDHOOK_HINSTANCE(app.hmodule.0)); - if let Err(e) = builder.with_hmodule(HUDHOOK_HINSTANCE(app.hmodule.0)) - .build() - .apply() + if let Err(e) = builder.build().apply() { panic!("{:?}", e) } diff --git a/soulmemory-rs/src/tas/tas.rs b/soulmemory-rs/src/tas/tas.rs index d85fab0..7174907 100644 --- a/soulmemory-rs/src/tas/tas.rs +++ b/soulmemory-rs/src/tas/tas.rs @@ -67,7 +67,7 @@ pub fn get_xinput_get_state_fn_address() -> u64 for xinput_version in xinput_versions { let hmodule = GetModuleHandleA(xinput_version.as_ptr()); - if hmodule != HINSTANCE(0) + if hmodule != HINSTANCE(std::ptr::null_mut()) { let address = GetProcAddress(hmodule.0 as *const c_void, "XInputGetState\0".as_ptr()); info!("{} address 0x{:x}", xinput_version, address as u64); diff --git a/test-window/Cargo.toml b/test-window/Cargo.toml index c6614a6..43c1f71 100644 --- a/test-window/Cargo.toml +++ b/test-window/Cargo.toml @@ -6,13 +6,13 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -copypasta = "0.8" +copypasta = "0.10.1" glium = { version = "0.34.0", default-features = true, features = ["glutin_backend"] } -image = "0.23" -imgui = "0.11.0" -imgui-glium-renderer = "0.11.0" +image = "0.25.1" +imgui = "0.12.0" +imgui-glium-renderer = "0.12.0" -winit = { version = "0.29.3", default-features = false } +winit = { version = "0.29.15", default-features = false } soulmemory-rs = { path = "../soulmemory-rs" } @@ -22,12 +22,12 @@ soulmemory-rs = { path = "../soulmemory-rs" } # imgui-examples -> glium -> glutin -> wayland-client -> scoped-tls # so not worth bumping MSRV for this basically to keep CI happy # FIXME: Remove this for imgui-rs v0.10 and bump MSRV -scoped-tls = "=1.0.0" +#scoped-tls = "=1.0.0" rand = "0.9.0-alpha.1" chrono = "0.4.22" [dependencies.windows] -version = "0.56.0" +version = "0.58.0" features = [ "Win32_Foundation", "Win32_System_Memory", diff --git a/test-window/src/main.rs b/test-window/src/main.rs index 43f0c40..d183f91 100644 --- a/test-window/src/main.rs +++ b/test-window/src/main.rs @@ -8,7 +8,7 @@ use soulmemory_rs::games::*; mod support; fn main() { - App::init(&String::from("mockgame.exe"), HINSTANCE(0)); + App::init(&String::from("mockgame.exe"), HINSTANCE(std::ptr::null_mut())); let system = support::init("test window"); system.main_loop(move |run, ui| diff --git a/test-window/src/support/mod.rs b/test-window/src/support/mod.rs index 2cb4639..60c9fd9 100644 --- a/test-window/src/support/mod.rs +++ b/test-window/src/support/mod.rs @@ -35,6 +35,7 @@ pub fn init(title: &str) -> System { }; let event_loop = EventLoop::new().expect("Failed to create EventLoop"); + let builder = WindowBuilder::new() .with_title(title) .with_inner_size(LogicalSize::new(1920, 1080));