diff options
Diffstat (limited to 'pkg/messages/types/svcBspDecal.go')
| -rw-r--r-- | pkg/messages/types/svcBspDecal.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/messages/types/svcBspDecal.go b/pkg/messages/types/svcBspDecal.go index 484497f..dda81dd 100644 --- a/pkg/messages/types/svcBspDecal.go +++ b/pkg/messages/types/svcBspDecal.go | |||
| @@ -17,7 +17,7 @@ type vectorCoord struct { | |||
| 17 | Valid bool | 17 | Valid bool |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | func ParseSvcBspDecal(reader *bitreader.ReaderType) SvcBspDecal { | 20 | func ParseSvcBspDecal(reader *bitreader.Reader) SvcBspDecal { |
| 21 | svcBspDecal := SvcBspDecal{ | 21 | svcBspDecal := SvcBspDecal{ |
| 22 | Pos: readVectorCoords(reader), | 22 | Pos: readVectorCoords(reader), |
| 23 | DecalTextureIndex: int16(reader.TryReadBits(9)), | 23 | DecalTextureIndex: int16(reader.TryReadBits(9)), |
| @@ -30,7 +30,7 @@ func ParseSvcBspDecal(reader *bitreader.ReaderType) SvcBspDecal { | |||
| 30 | return svcBspDecal | 30 | return svcBspDecal |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | func readVectorCoords(reader *bitreader.ReaderType) []vectorCoord { | 33 | func readVectorCoords(reader *bitreader.Reader) []vectorCoord { |
| 34 | const COORD_INTEGER_BITS uint8 = 14 | 34 | const COORD_INTEGER_BITS uint8 = 14 |
| 35 | const COORD_FRACTIONAL_BITS uint8 = 5 | 35 | const COORD_FRACTIONAL_BITS uint8 = 5 |
| 36 | const COORD_DENOMINATOR uint8 = 1 << COORD_FRACTIONAL_BITS | 36 | const COORD_DENOMINATOR uint8 = 1 << COORD_FRACTIONAL_BITS |
| @@ -42,10 +42,10 @@ func readVectorCoords(reader *bitreader.ReaderType) []vectorCoord { | |||
| 42 | if integer != 0 || fraction != 0 { | 42 | if integer != 0 || fraction != 0 { |
| 43 | sign := reader.TryReadBits(1) | 43 | sign := reader.TryReadBits(1) |
| 44 | if integer != 0 { | 44 | if integer != 0 { |
| 45 | integer = reader.TryReadBits(int(COORD_INTEGER_BITS)) + 1 | 45 | integer = reader.TryReadBits(uint64(COORD_INTEGER_BITS)) + 1 |
| 46 | } | 46 | } |
| 47 | if fraction != 0 { | 47 | if fraction != 0 { |
| 48 | fraction = reader.TryReadBits(int(COORD_FRACTIONAL_BITS)) | 48 | fraction = reader.TryReadBits(uint64(COORD_FRACTIONAL_BITS)) |
| 49 | } | 49 | } |
| 50 | value = float32(integer) + float32(fraction)*COORD_RESOLUTION | 50 | value = float32(integer) + float32(fraction)*COORD_RESOLUTION |
| 51 | if sign != 0 { | 51 | if sign != 0 { |