Skip to content

Load sprites from sprites.ron file - #486

Closed
debris wants to merge 1 commit into
ozkriff:masterfrom
debris:sprites-ron
Closed

Load sprites from sprites.ron file#486
debris wants to merge 1 commit into
ozkriff:masterfrom
debris:sprites-ron

Conversation

@debris

@debris debris commented Jun 9, 2019

Copy link
Copy Markdown
Contributor

@debris

debris commented Jun 11, 2019

Copy link
Copy Markdown
Contributor Author

rebased on latest master

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
Copy Markdown
Contributor Author

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
Copy Markdown
Owner

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
Copy Markdown
Owner

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

ozkriff commented Jun 13, 2019

Copy link
Copy Markdown
Owner

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

@ozkriff ozkriff closed this Jun 13, 2019
@debris
debris deleted the sprites-ron branch June 14, 2019 09:18
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.

2 participants