1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-01-13 14:27:08 +00:00

Compare commits

...

2 commits

Author SHA1 Message Date
biroder bf8a80150d Make the get_headband_spritesheet function static[ci skip] 2024-12-03 22:41:17 +02:00
Edward Stuckey f7e76e09a2
Fix "More Rust" mode for freeware (#288)
The engine would previously use the upscaled spritesheet for the headbands since the "original_textures" setting is only used with the Nicalis releases.
2024-12-03 22:30:57 +02:00
2 changed files with 5 additions and 7 deletions

View file

@ -4,6 +4,7 @@ use crate::framework::context::Context;
use crate::framework::error::GameResult;
use crate::framework::graphics;
use crate::game::frame::Frame;
use crate::game::npc::NPC;
use crate::game::scripting::tsc::text_script::IllustrationState;
use crate::game::shared_game_state::SharedGameState;
use crate::graphics::font::Font;
@ -78,10 +79,7 @@ impl GameEntity<()> for Credits {
if state.more_rust {
// draw sue's headband separately because rust doesn't let me mutate the texture set multiple times at once
let headband_spritesheet = {
let base = if state.settings.original_textures { "ogph" } else { "plus" };
format!("headband/{}/Casts", base)
};
let headband_spritesheet = NPC::get_headband_spritesheet(state, "Casts");
let batch = state.texture_set.get_or_load_batch(ctx, &state.constants, headband_spritesheet.as_str())?;

View file

@ -223,8 +223,8 @@ impl NPC {
[42, 92, 280, 284].contains(&self.npc_type)
}
fn get_headband_spritesheet(&self, state: &SharedGameState, texture_name: &str) -> String {
let base_dir = if state.settings.original_textures { "ogph" } else { "plus" };
pub fn get_headband_spritesheet(state: &SharedGameState, texture_name: &str) -> String {
let base_dir = if state.settings.original_textures || state.constants.is_base() { "ogph" } else { "plus" };
format!("headband/{}/{}", base_dir, texture_name)
}
}
@ -677,7 +677,7 @@ impl GameEntity<([&mut Player; 2], &NPCList, &mut Stage, &mut BulletManager, &mu
if self.is_sue() && state.more_rust {
// draw crab headband
let headband_spritesheet = self.get_headband_spritesheet(state, &*texture_ref);
let headband_spritesheet = Self::get_headband_spritesheet(state, &*texture_ref);
let batch = state.texture_set.get_or_load_batch(ctx, &state.constants, headband_spritesheet.as_str())?;
batch.add_rect(final_x, final_y, &self.anim_rect);
batch.draw(ctx)?;