Skip to content

Commit

Permalink
reorganized modules
Browse files Browse the repository at this point in the history
  • Loading branch information
greaka committed Jun 2, 2019
1 parent 810abde commit b350906
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 26 deletions.
5 changes: 4 additions & 1 deletion src/device.rs → src/device/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use crate::{pipeline, worker::Device};
mod worker;

use crate::pipeline;
use worker::Device;

static mut DEVICE: Option<Device> = None;

Expand Down
File renamed without changes.
24 changes: 0 additions & 24 deletions src/exports.rs

This file was deleted.

3 changes: 3 additions & 0 deletions src/exports/combat.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
use arcdps_bindings::*;

pub fn cbt(_ev: &cbtevent, _src: &ag, _dst: &ag, _skillname: String, _id: u64, _revision: u64) {}
40 changes: 40 additions & 0 deletions src/exports/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
mod combat;

use crate::{device, pipeline};
use arcdps_bindings::*;
use std::ffi::CString;
use winapi::shared::ntdef::PCCHAR;

pub fn imgui(not_charsel_or_loading: u32) -> usize {
if not_charsel_or_loading > 0 {
let _ = device::send_to_device(|| pipeline::Arc {
msgtype: pipeline::Mtype::Imgui as i32,
msg: Some(pipeline::arc::Msg::Imgui(true)),
});
}
0
}

pub fn combat(
ev: *mut cbtevent,
src: *mut ag,
dst: *mut ag,
skillname: PCCHAR,
id: u64,
revision: u64,
) -> usize {
let s_ev: &cbtevent;
let s_src: &ag;
let s_dst: &ag;
let s_skillname: String;
unsafe {
s_ev = &*ev;
s_src = &*src;
s_dst = &*dst;
s_skillname = CString::from_raw(skillname)
.into_string()
.unwrap_or_default();
}
combat::cbt(&s_ev, &s_src, &s_dst, s_skillname, id, revision);
0
}
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
mod arcdps;
mod device;
mod exports;
mod worker;

pub mod pipeline {
include!(concat!(env!("OUT_DIR"), "/pipeline.rs"));
Expand Down

0 comments on commit b350906

Please sign in to comment.