Skip to content

Commit

Permalink
unexport datatype.type
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Feb 23, 2021
1 parent 035c126 commit 71c3cab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion draco/draco.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (dt DataType) Size() uint32 {
}
}

func (dt DataType) Type() reflect.Type {
func (dt DataType) goType() reflect.Type {
reflect.TypeOf((*uint8)(nil))
switch dt {
case DT_BOOL:
Expand Down
6 changes: 3 additions & 3 deletions draco/mesh.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ func (m *Mesh) AttrData(pa *PointAttr, buffer interface{}) (interface{}, bool) {
n := m.NumPoints() * uint32(pa.NumComponents())
if buffer == nil {
dt = pa.DataType()
buffer = reflect.MakeSlice(reflect.SliceOf(dt.Type()), int(n), int(n)).Interface()
buffer = reflect.MakeSlice(reflect.SliceOf(dt.goType()), int(n), int(n)).Interface()
} else {
v := reflect.ValueOf(buffer)
if v.IsNil() {
buffer = reflect.MakeSlice(reflect.SliceOf(dt.Type()), int(n), int(n)).Interface()
buffer = reflect.MakeSlice(reflect.SliceOf(dt.goType()), int(n), int(n)).Interface()
}
if v.Kind() != reflect.Slice {
panic(fmt.Sprintf("draco-go: expecting a slice but got %s", v.Kind()))
Expand Down Expand Up @@ -94,7 +94,7 @@ func (m *Mesh) AttrData(pa *PointAttr, buffer interface{}) (interface{}, bool) {
panic("draco-go: unsupported data type")
}
if l < int(n) {
tmp := reflect.MakeSlice(reflect.SliceOf(dt.Type()), int(n)-l, int(n)-l).Interface()
tmp := reflect.MakeSlice(reflect.SliceOf(dt.goType()), int(n)-l, int(n)-l).Interface()
buffer = reflect.AppendSlice(reflect.ValueOf(buffer), reflect.ValueOf(tmp)).Interface()
}
}
Expand Down

0 comments on commit 71c3cab

Please sign in to comment.