Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

7 changed files with 702 additions and 2825 deletions

View File

@ -1,2 +0,0 @@
[registries.strafesnet]
index = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"

2171
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,32 +1,17 @@
[package]
name = "map-tool"
version = "1.5.7"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.75"
clap = { version = "4.4.2", features = ["derive"] }
flate2 = "1.0.27"
image = "0.25.2"
image_dds = "0.6.0"
lazy-regex = "3.1.0"
rbx_binary = { version = "0.7.4", registry = "strafesnet" }
rbx_dom_weak = { version = "2.7.0", registry = "strafesnet" }
rbx_reflection_database = { version = "0.2.10", registry = "strafesnet" }
rbx_xml = { version = "0.13.3", registry = "strafesnet" }
strafesnet_bsp_loader = { version = "0.2.1", registry = "strafesnet" }
strafesnet_deferred_loader = { version = "0.4.0", features = ["legacy"], registry = "strafesnet" }
strafesnet_rbx_loader = { version = "0.5.1", registry = "strafesnet" }
strafesnet_snf = { version = "0.2.0", registry = "strafesnet" }
vbsp = "0.6.0"
vmdl = "0.2.0"
vmt-parser = "0.2.0"
vpk = "0.2.0"
vtf = "0.3.0"
rbx_binary = "0.7.1"
rbx_dom_weak = "2.5.0"
rbx_reflection_database = "0.2.7"
#[profile.release]
#lto = true
#strip = true
#codegen-units = 1
[profile.release]
lto = true
strip = true
codegen-units = 1

28
LICENSE
View File

@ -1,23 +1,9 @@
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
MIT License
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
Copyright (c) <year> <copyright holders>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

21
src/error.rs Normal file
View File

@ -0,0 +1,21 @@
#[derive(Debug)]
pub struct Error {
pub message: String,
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "{}", self.message)
}
}
impl std::error::Error for Error {}
impl Error {
// has to be Box<Self> to fit with the result in prelude.rs
pub fn new(message: &str) -> Box<Self> {
Box::new(Self {
message: message.to_string(),
})
}
}

File diff suppressed because it is too large Load Diff

19
src/prelude.rs Normal file
View File

@ -0,0 +1,19 @@
pub use crate::error::Error;
pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
pub type StdResult<T, E> = std::result::Result<T, E>;
// i just wanted to mess around with macros a bit
// so heres labelprint as a macro
#[macro_export]
macro_rules! lprint {
($expr:expr) => {{
let ___this_file = std::file!();
let ___line = std::line!();
// let ___column = column!();
println!("[{}:{}] {}", ___this_file, ___line, $expr);
}};
($expr:expr, $($arg:tt)*) => {{
lprint!(format!($expr, $($arg)*));
}};
}