mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-12-26 12:06:24 -05:00
Show special tiles in mapdebug (#386)
More useful than the floor stuff Also method for testing if special
This commit is contained in:
parent
4b6065b2bf
commit
75112ec736
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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++ {
|
||||
|
Loading…
Reference in New Issue
Block a user