Skip to content

Commit

Permalink
Merge branch 'master' into fix-readme-31
Browse files Browse the repository at this point in the history
  • Loading branch information
joarfish authored Dec 20, 2020
2 parents ce94176 + 58798f2 commit eb8068a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions sheep/src/format/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ pub struct AmethystNamedFormat;

/// `NameSprite` represents a field in a `SerializedNamedSpriteSheet`.
/// All of the fields, except `name`, mimic the `SpritePosition` struct.
#[derive(Clone, Debug, PartialEq, Serialize)]
struct NamedSpritePosition {
name: String,
x: f32,
y: f32,
width: f32,
height: f32,
offsets: Option<[f32; 2]>,
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct NamedSpritePosition {
pub name: String,
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub offsets: Option<[f32; 2]>,
}

impl From<(&SpriteAnchor, String)> for NamedSpritePosition {
Expand All @@ -31,11 +31,11 @@ impl From<(&SpriteAnchor, String)> for NamedSpritePosition {
/// `SerializedNamedSpriteSheet` is the serializable representation of the sprite sheet.
/// It is similar to `SerializedSpriteSheet`, except that it has a `Vec` of `NamedSpritePosition`s
/// instead of `SpriteAnchor`s
#[derive(Clone, Debug, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct SerializedNamedSpriteSheet {
texture_width: f32,
texture_height: f32,
sprites: Vec<NamedSpritePosition>,
pub texture_width: f32,
pub texture_height: f32,
pub sprites: Vec<NamedSpritePosition>,
}

impl Format for AmethystNamedFormat {
Expand Down
2 changes: 1 addition & 1 deletion sheep/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub use {
#[cfg(feature = "amethyst")]
pub use format::amethyst::{AmethystFormat, SerializedSpriteSheet, SpritePosition};
#[cfg(feature = "amethyst")]
pub use format::named::AmethystNamedFormat;
pub use format::named::{AmethystNamedFormat, NamedSpritePosition, SerializedNamedSpriteSheet};

use sprite::{create_pixel_buffer, write_sprite};

Expand Down

0 comments on commit eb8068a

Please sign in to comment.