Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load sprites from sprites.ron file #486

Closed
wants to merge 1 commit into from

Conversation

@debris
Copy link
Contributor

debris commented Jun 9, 2019

@debris debris force-pushed the debris:sprites-ron branch from 3b35f86 to 2735896 Jun 11, 2019
@debris

This comment has been minimized.

Copy link
Contributor Author

debris commented Jun 11, 2019

rebased on latest master

@@ -30,6 +34,11 @@ use crate::{

const BLOOD_SPRITE_DURATION: i32 = 6;

lazy_static! {
static ref SPRITES: HashMap<String, SpriteInfo> = ron::de::from_str(include_str!("../../../assets/sprites.ron"))

This comment has been minimized.

Copy link
@debris

debris Jun 11, 2019

Author Contributor

include_str! loads file at compile time whereas utils::deserialize_from_file does it during runtime. Which one would you like to use?

This comment has been minimized.

Copy link
@ozkriff

ozkriff Jun 11, 2019

Owner

I definitely prefer not having any global variables, even for config-like stuff. So yeah, it should be loaded at runtime and stored as a new field in the BattleView struct I guess.

This comment has been minimized.

Copy link
@ozkriff

ozkriff Jun 13, 2019

Owner

FYI: I've started implementing what I've written above on top of your commits.

@ozkriff

This comment has been minimized.

Copy link
Owner

ozkriff commented Jun 13, 2019

Thanks! Rebased, extended and merged manually to master :)

@ozkriff ozkriff closed this Jun 13, 2019
@debris debris deleted the debris:sprites-ron branch Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.