Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
rs-tiled
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
rs-tiled
Commits
2fc22393
Commit
2fc22393
authored
7 years ago
by
Matthew Hall
Browse files
Options
Downloads
Plain Diff
Merge branch 'afonso360-impl_clone'
parents
8a03e94a
7ee21f28
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib.rs
+12
-12
12 additions, 12 deletions
src/lib.rs
with
12 additions
and
12 deletions
src/lib.rs
+
12
−
12
View file @
2fc22393
...
@@ -14,7 +14,7 @@ use xml::attribute::OwnedAttribute;
...
@@ -14,7 +14,7 @@ use xml::attribute::OwnedAttribute;
use
base64
::{
u8de
as
decode_base64
,
Base64Error
};
use
base64
::{
u8de
as
decode_base64
,
Base64Error
};
use
flate2
::
read
::{
ZlibDecoder
,
GzDecoder
};
use
flate2
::
read
::{
ZlibDecoder
,
GzDecoder
};
#[derive(Debug)]
#[derive(Debug
,
Copy,
Clone
)]
pub
enum
ParseTileError
{
pub
enum
ParseTileError
{
ColourError
,
ColourError
,
OrientationError
,
OrientationError
,
...
@@ -76,7 +76,7 @@ macro_rules! parse_tag {
...
@@ -76,7 +76,7 @@ macro_rules! parse_tag {
}
}
}
}
#[derive(Debug,
PartialEq,
Eq)]
#[derive(Debug,
PartialEq,
Eq
,
Copy,
Clone
)]
pub
struct
Colour
{
pub
struct
Colour
{
pub
red
:
u8
,
pub
red
:
u8
,
pub
green
:
u8
,
pub
green
:
u8
,
...
@@ -158,7 +158,7 @@ impl std::error::Error for TiledError {
...
@@ -158,7 +158,7 @@ impl std::error::Error for TiledError {
}
}
#[derive(Debug,
PartialEq)]
#[derive(Debug,
PartialEq
,
Clone
)]
pub
enum
PropertyValue
{
pub
enum
PropertyValue
{
BoolValue
(
bool
),
BoolValue
(
bool
),
FloatValue
(
f32
),
FloatValue
(
f32
),
...
@@ -213,7 +213,7 @@ fn parse_properties<R: Read>(parser: &mut EventReader<R>) -> Result<Properties,
...
@@ -213,7 +213,7 @@ fn parse_properties<R: Read>(parser: &mut EventReader<R>) -> Result<Properties,
}
}
/// All Tiled files will be parsed into this. Holds all the layers and tilesets
/// All Tiled files will be parsed into this. Holds all the layers and tilesets
#[derive(Debug,
PartialEq)]
#[derive(Debug,
PartialEq
,
Clone
)]
pub
struct
Map
{
pub
struct
Map
{
pub
version
:
String
,
pub
version
:
String
,
pub
orientation
:
Orientation
,
pub
orientation
:
Orientation
,
...
@@ -284,7 +284,7 @@ impl Map {
...
@@ -284,7 +284,7 @@ impl Map {
}
}
}
}
#[derive(Debug,
PartialEq,
Eq)]
#[derive(Debug,
PartialEq,
Eq
,
Copy,
Clone
)]
pub
enum
Orientation
{
pub
enum
Orientation
{
Orthogonal
,
Orthogonal
,
Isometric
,
Isometric
,
...
@@ -307,7 +307,7 @@ impl FromStr for Orientation {
...
@@ -307,7 +307,7 @@ impl FromStr for Orientation {
}
}
/// A tileset, usually the tilesheet image.
/// A tileset, usually the tilesheet image.
#[derive(Debug,
PartialEq)]
#[derive(Debug,
PartialEq
,
Clone
)]
pub
struct
Tileset
{
pub
struct
Tileset
{
/// The GID of the first tile stored
/// The GID of the first tile stored
pub
first_gid
:
u32
,
pub
first_gid
:
u32
,
...
@@ -420,7 +420,7 @@ impl Tileset {
...
@@ -420,7 +420,7 @@ impl Tileset {
}
}
}
}
#[derive(Debug,
PartialEq)]
#[derive(Debug,
PartialEq
,
Clone
)]
pub
struct
Tile
{
pub
struct
Tile
{
pub
id
:
u32
,
pub
id
:
u32
,
pub
images
:
Vec
<
Image
>
,
pub
images
:
Vec
<
Image
>
,
...
@@ -456,7 +456,7 @@ impl Tile {
...
@@ -456,7 +456,7 @@ impl Tile {
}
}
}
}
#[derive(Debug,
PartialEq,
Eq)]
#[derive(Debug,
PartialEq,
Eq
,
Clone
)]
pub
struct
Image
{
pub
struct
Image
{
/// The filepath of the image
/// The filepath of the image
pub
source
:
String
,
pub
source
:
String
,
...
@@ -480,7 +480,7 @@ impl Image {
...
@@ -480,7 +480,7 @@ impl Image {
}
}
}
}
#[derive(Debug,
PartialEq)]
#[derive(Debug,
PartialEq
,
Clone
)]
pub
struct
Layer
{
pub
struct
Layer
{
pub
name
:
String
,
pub
name
:
String
,
pub
opacity
:
f32
,
pub
opacity
:
f32
,
...
@@ -515,7 +515,7 @@ impl Layer {
...
@@ -515,7 +515,7 @@ impl Layer {
}
}
}
}
#[derive(Debug,
PartialEq)]
#[derive(Debug,
PartialEq
,
Clone
)]
pub
struct
ObjectGroup
{
pub
struct
ObjectGroup
{
pub
name
:
String
,
pub
name
:
String
,
pub
opacity
:
f32
,
pub
opacity
:
f32
,
...
@@ -547,7 +547,7 @@ impl ObjectGroup {
...
@@ -547,7 +547,7 @@ impl ObjectGroup {
}
}
}
}
#[derive(Debug,
PartialEq)]
#[derive(Debug,
PartialEq
,
Clone
)]
pub
enum
ObjectShape
{
pub
enum
ObjectShape
{
Rect
{
Rect
{
width
:
f32
,
width
:
f32
,
...
@@ -565,7 +565,7 @@ pub enum ObjectShape {
...
@@ -565,7 +565,7 @@ pub enum ObjectShape {
},
},
}
}
#[derive(Debug,
PartialEq)]
#[derive(Debug,
PartialEq
,
Clone
)]
pub
struct
Object
{
pub
struct
Object
{
pub
id
:
u32
,
pub
id
:
u32
,
pub
gid
:
u32
,
pub
gid
:
u32
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment