diff options
Diffstat (limited to 'pkg/messages/types/svcBspDecal.go')
| -rw-r--r-- | pkg/messages/types/svcBspDecal.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/pkg/messages/types/svcBspDecal.go b/pkg/messages/types/svcBspDecal.go index fc5698f..9ef2458 100644 --- a/pkg/messages/types/svcBspDecal.go +++ b/pkg/messages/types/svcBspDecal.go | |||
| @@ -2,23 +2,23 @@ package messages | |||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "github.com/pektezol/bitreader" | 4 | "github.com/pektezol/bitreader" |
| 5 | "github.com/pektezol/sdp.go/pkg/writer" | 5 | "github.com/pektezol/sdp.go/pkg/types" |
| 6 | ) | 6 | ) |
| 7 | 7 | ||
| 8 | type SvcBspDecal struct { | 8 | type SvcBspDecal struct { |
| 9 | Pos []vectorCoord | 9 | Pos []vectorCoord `json:"pos"` |
| 10 | DecalTextureIndex int16 | 10 | DecalTextureIndex int16 `json:"decal_texture_index"` |
| 11 | EntityIndex uint16 | 11 | EntityIndex uint16 `json:"entity_index"` |
| 12 | ModelIndex uint16 | 12 | ModelIndex uint16 `json:"model_index"` |
| 13 | LowPriority bool | 13 | LowPriority bool `json:"low_priority"` |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | type vectorCoord struct { | 16 | type vectorCoord struct { |
| 17 | Value float32 | 17 | Value float32 `json:"value"` |
| 18 | Valid bool | 18 | Valid bool `json:"valid"` |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | func ParseSvcBspDecal(reader *bitreader.Reader) SvcBspDecal { | 21 | func ParseSvcBspDecal(reader *bitreader.Reader, demo *types.Demo) SvcBspDecal { |
| 22 | svcBspDecal := SvcBspDecal{ | 22 | svcBspDecal := SvcBspDecal{ |
| 23 | Pos: readVectorCoords(reader), | 23 | Pos: readVectorCoords(reader), |
| 24 | DecalTextureIndex: int16(reader.TryReadBits(9)), | 24 | DecalTextureIndex: int16(reader.TryReadBits(9)), |
| @@ -28,11 +28,11 @@ func ParseSvcBspDecal(reader *bitreader.Reader) SvcBspDecal { | |||
| 28 | svcBspDecal.ModelIndex = uint16(reader.TryReadBits(11)) | 28 | svcBspDecal.ModelIndex = uint16(reader.TryReadBits(11)) |
| 29 | } | 29 | } |
| 30 | svcBspDecal.LowPriority = reader.TryReadBool() | 30 | svcBspDecal.LowPriority = reader.TryReadBool() |
| 31 | writer.TempAppendLine("\t\tPosition: %v", svcBspDecal.Pos) | 31 | demo.Writer.TempAppendLine("\t\tPosition: %v", svcBspDecal.Pos) |
| 32 | writer.TempAppendLine("\t\tDecal Texture Index: %d", svcBspDecal.DecalTextureIndex) | 32 | demo.Writer.TempAppendLine("\t\tDecal Texture Index: %d", svcBspDecal.DecalTextureIndex) |
| 33 | writer.TempAppendLine("\t\tEntity Index: %d", svcBspDecal.EntityIndex) | 33 | demo.Writer.TempAppendLine("\t\tEntity Index: %d", svcBspDecal.EntityIndex) |
| 34 | writer.TempAppendLine("\t\tModel Index: %d", svcBspDecal.ModelIndex) | 34 | demo.Writer.TempAppendLine("\t\tModel Index: %d", svcBspDecal.ModelIndex) |
| 35 | writer.TempAppendLine("\t\tLow Priority: %t", svcBspDecal.LowPriority) | 35 | demo.Writer.TempAppendLine("\t\tLow Priority: %t", svcBspDecal.LowPriority) |
| 36 | return svcBspDecal | 36 | return svcBspDecal |
| 37 | } | 37 | } |
| 38 | 38 | ||