1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-19 02:46:35 -05:00

Finished orientation values. (#198)

* Finished directions for entity.
This commit is contained in:
Tim Sarbin 2019-11-17 02:54:22 -05:00 committed by GitHub
parent 297184376f
commit 4254b0f020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View File

@ -2,7 +2,6 @@ package d2scene
import ( import (
"image/color" "image/color"
"log"
"github.com/OpenDiablo2/D2Shared/d2helper" "github.com/OpenDiablo2/D2Shared/d2helper"
@ -113,7 +112,6 @@ func (v *Game) Update(tickTime float64) {
newDirection := d2render.DirectionLookup[directionIndex] newDirection := d2render.DirectionLookup[directionIndex]
if newDirection != v.mapEngine.Hero.AnimatedEntity.GetDirection() { if newDirection != v.mapEngine.Hero.AnimatedEntity.GetDirection() {
v.mapEngine.Hero.AnimatedEntity.SetMode(d2enum.AnimationModePlayerTownNeutral.String(), v.mapEngine.Hero.Equipment.RightHand.GetWeaponClass(), newDirection) v.mapEngine.Hero.AnimatedEntity.SetMode(d2enum.AnimationModePlayerTownNeutral.String(), v.mapEngine.Hero.Equipment.RightHand.GetWeaponClass(), newDirection)
log.Printf("Angle: %d -> %d", directionIndex, newDirection)
} }
} }

View File

@ -73,7 +73,7 @@ func CreateAnimatedEntity(x, y int32, object *d2datadict.ObjectLookupRecord, fil
} }
// DirectionLookup is used to decode the direction offset indexes // DirectionLookup is used to decode the direction offset indexes
var DirectionLookup = []int{9, 15, 5, 6, 4, 10, 2, 8, 0, 0, 0, 0, 0, 0, 0, 0} var DirectionLookup = []int{9, 15, 5, 6, 4, 12, 10, 2, 8, 13, 1, 7, 0, 14, 11, 3}
func (v AnimatedEntity) GetDirection() int { func (v AnimatedEntity) GetDirection() int {
return v.direction return v.direction