Show special tiles in mapdebug (#386)

More useful than the floor stuff

Also method for testing if special
This commit is contained in:
Ziemas 2020-06-22 04:14:06 +02:00 committed by GitHub
parent 4b6065b2bf
commit 75112ec736
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 5 deletions

View File

@ -42,3 +42,12 @@ func (tile TileType) UpperWall() bool {
return false
}
}
func (tile TileType) Special() bool {
switch tile {
case 10, 11:
return true
default:
return false
}
}

View File

@ -160,7 +160,7 @@ func (m *MapEngine) GetStartPosition() (float64, float64) {
for tileX := 0; tileX < m.size.Width; tileX++ {
tile := m.tiles[tileX+(tileY*m.size.Width)]
for _, wall := range tile.Walls {
if wall.Type == 10 && (wall.Style == 10 || wall.Style == 31) {
if wall.Type.Special() && wall.Style == 30 {
return float64(tileX) + 0.5, float64(tileY) + 0.5
}
}

View File

@ -281,10 +281,18 @@ func (mr *MapRenderer) renderTileDebug(ax, ay int, debugVisLevel int, target d2r
tile := mr.mapEngine.TileAt(ax, ay)
for i, floor := range tile.Floors {
target.PushTranslation(-20, 10+(i+1)*14)
target.DrawText("f: %v-%v", floor.Style, floor.Sequence)
target.Pop()
//for i, floor := range tile.Floors {
// target.PushTranslation(-20, 10+(i+1)*14)
// target.DrawText("f: %v-%v", floor.Style, floor.Sequence)
// target.Pop()
//}
for i, wall := range tile.Walls {
if wall.Type.Special() {
target.PushTranslation(-20, 10+(i+1)*14)
target.DrawText("s: %v-%v", wall.Style, wall.Sequence)
target.Pop()
}
}
for yy := 0; yy < 5; yy++ {