1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-12-29 05:27:20 -05:00

Lower wall stuff (#205)

Move to top of render order and remove offset
This commit is contained in:
Ziemas 2019-11-18 01:01:17 +01:00 committed by Tim Sarbin
parent 7f6e14c5d0
commit 30b680d9d1
2 changed files with 12 additions and 14 deletions

View File

@ -204,6 +204,17 @@ func (v *Engine) RenderRegion(region EngineRegion, target *ebiten.Image) {
func (v *Engine) RenderPass1(region *Region, offX, offY, x, y int, target *ebiten.Image) {
tile := region.DS1.Tiles[y][x]
// Draw lower walls
for i := range tile.Walls {
if tile.Walls[i].Orientation <= 15 {
continue
}
if tile.Walls[i].Hidden || tile.Walls[i].Orientation == 10 || tile.Walls[i].Orientation == 11 || tile.Walls[i].Orientation == 0 {
continue
}
region.RenderTile(offX+int(v.OffsetX), offY+int(v.OffsetY), x, y, d2enum.RegionLayerTypeWalls, i, target)
}
for i := range tile.Floors {
if tile.Floors[i].Hidden || tile.Floors[i].Prop1 == 0 {
continue
@ -217,16 +228,6 @@ func (v *Engine) RenderPass1(region *Region, offX, offY, x, y int, target *ebite
region.RenderTile(offX+int(v.OffsetX), offY+int(v.OffsetY), x, y, d2enum.RegionLayerTypeShadows, i, target)
}
// Draw lower walls
for i := range tile.Walls {
if tile.Walls[i].Orientation <= 15 {
continue
}
if tile.Walls[i].Hidden || tile.Walls[i].Orientation == 10 || tile.Walls[i].Orientation == 11 || tile.Walls[i].Orientation == 0 {
continue
}
region.RenderTile(offX+int(v.OffsetX), offY+int(v.OffsetY), x, y, d2enum.RegionLayerTypeWalls, i, target)
}
}
func (v *Engine) RenderPass2(region *Region, offX, offY, x, y int, target *ebiten.Image) {

View File

@ -224,10 +224,7 @@ func (v *Region) renderWall(tile d2ds1.WallRecord, offsetX, offsetY int, target
}
yAdjust := 0
if tile.Orientation > 15 {
// Lower Walls
yAdjust = 80
} else if tile.Orientation == 15 {
if tile.Orientation == 15 {
// Roof
yAdjust = -int(tileData.RoofHeight)
} else {