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
Closed

Conversation

debris
Copy link
Contributor

@debris debris commented Jun 9, 2019

@debris
Copy link
Contributor Author

@debris 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"))
Copy link
Contributor Author

@debris debris Jun 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Owner

@ozkriff ozkriff Jun 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Owner

@ozkriff ozkriff Jun 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ozkriff
Copy link
Owner

@ozkriff ozkriff commented Jun 13, 2019

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

@ozkriff ozkriff closed this Jun 13, 2019
@debris debris deleted the sprites-ron branch Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants