mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-01-14 05:16:43 -05:00
Actually use renderpass2 (#485)
This commit is contained in:
parent
255ffc75da
commit
9f7f1ae072
@ -68,6 +68,7 @@ func (mr *MapRenderer) Render(target d2render.Surface) {
|
|||||||
endY := int(math.Min(float64(mapSize.Height), math.Ceil(etyf)))
|
endY := int(math.Min(float64(mapSize.Height), math.Ceil(etyf)))
|
||||||
|
|
||||||
mr.renderPass1(target, startX, startY, endX, endY)
|
mr.renderPass1(target, startX, startY, endX, endY)
|
||||||
|
mr.renderPass2(target, startX, startY, endX, endY)
|
||||||
if mr.debugVisLevel > 0 {
|
if mr.debugVisLevel > 0 {
|
||||||
mr.renderDebug(mr.debugVisLevel, target, startX, startY, endX, endY)
|
mr.renderDebug(mr.debugVisLevel, target, startX, startY, endX, endY)
|
||||||
}
|
}
|
||||||
@ -116,10 +117,10 @@ func (mr *MapRenderer) renderPass2(target d2render.Surface, startX, startY, endX
|
|||||||
// TODO: Do not loop over every entity every frame
|
// TODO: Do not loop over every entity every frame
|
||||||
for _, mapEntity := range *mr.mapEngine.Entities() {
|
for _, mapEntity := range *mr.mapEngine.Entities() {
|
||||||
entityX, entityY := mapEntity.GetPosition()
|
entityX, entityY := mapEntity.GetPosition()
|
||||||
if (int(entityX) != tileX) || (int(entityY) != tileY) {
|
if mapEntity.GetLayer() != 1 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if mapEntity.GetLayer() != 1 {
|
if (int(entityX) != tileX) || (int(entityY) != tileY) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
target.PushTranslation(mr.viewport.GetTranslationScreen())
|
target.PushTranslation(mr.viewport.GetTranslationScreen())
|
||||||
@ -142,10 +143,10 @@ func (mr *MapRenderer) renderPass3(target d2render.Surface, startX, startY, endX
|
|||||||
// TODO: Do not loop over every entity every frame
|
// TODO: Do not loop over every entity every frame
|
||||||
for _, mapEntity := range *mr.mapEngine.Entities() {
|
for _, mapEntity := range *mr.mapEngine.Entities() {
|
||||||
entityX, entityY := mapEntity.GetPosition()
|
entityX, entityY := mapEntity.GetPosition()
|
||||||
if (int(entityX) != tileX) || (int(entityY) != tileY) {
|
if mapEntity.GetLayer() == 1 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if mapEntity.GetLayer() == 1 {
|
if (int(entityX) != tileX) || (int(entityY) != tileY) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
target.PushTranslation(mr.viewport.GetTranslationScreen())
|
target.PushTranslation(mr.viewport.GetTranslationScreen())
|
||||||
|
Loading…
Reference in New Issue
Block a user