Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trims off effect layers, makes rendering a bit more sane #295

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions internal/app/render/bucket/level/chunk/unit/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@
plane, _ := p.Vars().Float("plane")
layer, _ := p.Vars().Float("layer")

// Layers can have essentially effect values added onto them
// We should clip them off to reduce the max possible layer to like 4999 (likely far lower)
const BACKGROUND_LAYER = 20_000
const TOPDOWN_LAYER = 10_000
const EFFECTS_LAYER = 5000
if layer > BACKGROUND_LAYER {
layer -= BACKGROUND_LAYER
}
if layer > TOPDOWN_LAYER {
layer -= TOPDOWN_LAYER
}
if layer > EFFECTS_LAYER {
layer -= EFFECTS_LAYER
}

Check failure on line 108 in internal/app/render/bucket/level/chunk/unit/unit.go

View workflow job for this annotation

GitHub Actions / Lint Source Code

File is not `gofmt`-ed with `-s` (gofmt)
layer = plane*10_000 + layer*1000

// When mobs are on the same Layer with object they are always rendered above them (BYOND specific stuff).
Expand Down
Loading