Commit 9a82e5c4 authored by Oscar Campos's avatar Oscar Campos Committed by Oscar Campos
Browse files

fix: fix issues all around gdnative

parent de4a478a
......@@ -24,6 +24,8 @@ import (
"os"
"reflect"
"strings"
"gopkg.in/bufio.v1"
)
const (
......@@ -711,7 +713,7 @@ func parseKeyValueExpr(expr *ast.KeyValueExpr) (string, string) {
func parseSignalArgs(composite *ast.CompositeLit) string {
buffer := bytes.NewBuffer(nil)
buffer := bufio.NewBuffer(nil)
fileSet := token.NewFileSet()
printer.Fprint(buffer, fileSet, composite)
......
......@@ -363,72 +363,3 @@ func (p *Property) SetGetter(getter *InstancePropertyGet) {
func (p *Property) GetName() string {
return p.propertyName
}
// GoTypeToVariant will check the given Go type and convert it to its
// Variant type. The value is returned as a Variant.
func GoTypeToVariant(value reflect.Value) Variant {
var result Variant
switch v := value.Interface().(type) {
case Bool:
result = NewVariantBool(v)
case Int:
result = NewVariantInt(Int64T(v))
case Int64T:
result = NewVariantInt(v)
case Double:
result = NewVariantReal(v)
case Real:
result = NewVariantReal(Double(v))
case String:
result = NewVariantString(v)
case Vector2:
result = NewVariantVector2(v)
case Rect2:
result = NewVariantRect2(v)
case Vector3:
result = NewVariantVector3(v)
case Transform2D:
result = NewVariantTransform2D(v)
case Plane:
result = NewVariantPlane(v)
case Quat:
result = NewVariantQuat(v)
case Aabb:
result = NewVariantAabb(v)
case Basis:
result = NewVariantBasis(v)
case Transform:
result = NewVariantTransform(v)
case Color:
result = NewVariantColor(v)
case NodePath:
result = NewVariantNodePath(v)
case Rid:
result = NewVariantRid(v)
case Object:
result = NewVariantObject(v)
case Dictionary:
result = NewVariantDictionary(v)
case Array:
result = NewVariantArray(v)
case PoolByteArray:
result = NewVariantPoolByteArray(v)
case PoolIntArray:
result = NewVariantPoolIntArray(v)
case PoolRealArray:
result = NewVariantPoolRealArray(v)
case PoolStringArray:
result = NewVariantPoolStringArray(v)
case PoolVector2Array:
result = NewVariantPoolVector2Array(v)
case PoolVector3Array:
result = NewVariantPoolVector3Array(v)
case PoolColorArray:
result = NewVariantPoolColorArray(v)
default:
result = NewVariantObject(v.(Object))
}
return result
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment