-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from importing prims to importing alocs
- Loading branch information
Showing
10 changed files
with
107 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,23 @@ | ||
use std::env; | ||
|
||
use glacier2obj::{connect::game_connection::GameConnection, extract::prim_extraction::PrimExtraction, json_serde::entities_json::EntitiesJson, package::package_scan::PackageScan, scene::scene_scan::SceneScan}; | ||
use glacier2obj::{connect::game_connection::GameConnection, extract::aloc_extraction::AlocExtraction, json_serde::entities_json::EntitiesJson, package::package_scan::PackageScan}; | ||
|
||
// Based on mount_game_files example from rpkg-rs | ||
pub fn main() { | ||
let args: Vec<String> = env::args().collect(); | ||
if args.len() < 9 { | ||
eprintln!("Usage: cargo run -- example export_scenario <path to a Retail directory> <game version (H2016 | HM2 | HM3)> <path to a hashlist> <path to toFind file> <path to prims.json file> <path to pfBoxes.json file> <path to a Runtime directory> <path to output prims directory>"); | ||
if args.len() < 7 { | ||
eprintln!("Usage: cargo run -- example export_scenario <path to a Retail directory> <game version (H2016 | HM2 | HM3)> <path to prims.json file> <path to pfBoxes.json file> <path to a Runtime directory> <path to output prims directory>"); | ||
return; | ||
} | ||
let brick_tblu_hashes: Vec<String> = EntitiesJson::get_brick_tblu_hashes(GameConnection::get_brick_hashes_from_game()); | ||
println!("Scene tblu hashes: {:?}", brick_tblu_hashes); | ||
let mut scan: SceneScan = SceneScan::new(brick_tblu_hashes, args[3].clone()); | ||
let partition_manager = PackageScan::scan_packages(args[1].clone(), args[2].clone()).unwrap(); | ||
|
||
//scan.scan_scenario(&partition_manager); | ||
//scan.output_to_file(args[4].clone()); | ||
|
||
GameConnection::get_entity_list_from_game(args[4].as_str(), args[5].as_str(), args[6].as_str()); | ||
let prims_json = EntitiesJson::build_from_prims_file(args[5].clone()); | ||
let needed_prim_hashes = PrimExtraction::get_needed_prim_hashes(&prims_json, args[8].clone()); | ||
GameConnection::get_entity_list_from_game(args[3].as_str(), args[4].as_str()); | ||
let prims_json = EntitiesJson::build_from_alocs_file(args[3].clone()); | ||
let needed_prim_hashes = AlocExtraction::get_all_aloc_hashes(&prims_json, args[6].clone()); | ||
if needed_prim_hashes.is_empty() { | ||
println!("All prim files already exist. Skipping extraction."); | ||
} else { | ||
println!("Extracting {} prims.", needed_prim_hashes.len()); | ||
PrimExtraction::extract_prims(args[7].clone(), needed_prim_hashes, &partition_manager, args[8].clone()); | ||
AlocExtraction::extract_alocs(args[5].clone(), needed_prim_hashes, &partition_manager, args[6].clone()); | ||
} | ||
println!("Done building prims.json and extracting prims from scenario.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.