Fix Windows compabibility

This commit is contained in:
Trevor Slocum 2021-12-15 10:02:15 -08:00
parent 2485cf9a20
commit 9ef2ed3157
1 changed files with 2 additions and 2 deletions

View File

@ -91,7 +91,7 @@ func LoadMap(filePath string) {
}
// Parse .tmx file.
m, err := loader.LoadFromFile(filePath)
m, err := loader.LoadFromFile(filepath.FromSlash(filePath))
if err != nil {
log.Fatalf("error parsing world: %+v", err)
}
@ -101,7 +101,7 @@ func LoadMap(filePath string) {
tileset := m.Tilesets[0]
imgPath := filepath.Join("./map/", tileset.Image.Source)
f, err := asset.FS.Open(imgPath)
f, err := asset.FS.Open(filepath.FromSlash(imgPath))
if err != nil {
panic(err)
}