Skip to content

nil crash #101

Open
Open
@objarni

Description

@objarni

Describe the bug
tilepix crashes with message "cannot create sprite from nil tileset" on simple example program.

To Reproduce

  1. Clone https://github.com/objarni/rescue-on-fractal-bun
  2. Modify the replace directive in go.mod so that it points to latest version of tilepix on your machine
    (I tried running the latest version instead of latest release since the latest release crashed, but with a different error)
  3. go run examples/tiled_test/main.go
  4. Crash with output:
ERRO[0000] TileLayer.Batch: layers' tileset is nil       error="cannot create sprite from nil tileset"
ERRO[0000] TileLayer.Draw: could not get batch           error="cannot create sprite from nil tileset"
ERRO[0000] Map.DrawAll: could not draw layer             error="cannot create sprite from nil tileset"
panic: cannot create sprite from nil tileset

Expected behavior
tiled_test/main.go is a copy-paste of the front page example program, but with GhostForest.tmx instead.

A guess is that something is assumed about how .tmx files are structured that I am missing (I'm a new user to Tiled aswell as tilepix).

Environment (please complete the following information):

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/olof/.cache/go-build"
GOENV="/home/olof/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/olof/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/olof/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/snap/go/current"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/snap/go/current/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/olof/repos/github/rescue-on-fractal-bun/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build719279645=/tmp/go-build -gno-record-gcc-switches"

Additional context

Thanks for a neat little library! I wouldn't mind pair-programming with you to help fix this issue :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions