Skip to content

Commit

Permalink
Fix file path issue on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tslocum committed Jan 29, 2022
1 parent abe4da2 commit 2d2dec4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tiled.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (l *loader) open(name string) (fs.File, error) {
if l == nil || l.FileSystem == nil {
return os.Open(name)
}
return l.FileSystem.Open(name)
return l.FileSystem.Open(filepath.ToSlash(name))
}

// WithFileSystem returns an option to load level from a passed filesystem
Expand Down
2 changes: 1 addition & 1 deletion tmx_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (m *Map) TileGIDToTile(gid uint32) (*LayerTile, error) {

// GetFileFullPath returns path to file relative to map file
func (m *Map) GetFileFullPath(fileName string) string {
return filepath.Join(m.baseDir, fileName)
return filepath.FromSlash(filepath.Join(filepath.ToSlash(m.baseDir), filepath.ToSlash(fileName)))
}

// UnmarshalXML decodes a single XML element beginning with the given start element.
Expand Down

0 comments on commit 2d2dec4

Please sign in to comment.