danaugrs 7 年之前
父節點
當前提交
8ddeeafafa

+ 0 - 1
core/node.go

@@ -505,7 +505,6 @@ func (n *Node) Add(ichild INode) *Node {
 	child := ichild.GetNode()
 	if n == child {
 		panic("Node.Add: object can't be added as a child of itself")
-		return nil
 	}
 	// If this child already has a parent,
 	// removes it from this parent children list

+ 2 - 7
gui/builder.go

@@ -387,11 +387,8 @@ func (b *Builder) ParseString(desc string) error {
 				}
 			}
 			return ms, nil
-
-		default:
-			return v, nil
 		}
-		return nil, nil
+		return v, nil
 	}
 
 	// Get map[string]interface{} with lower case keys from parsed descritor
@@ -1017,10 +1014,8 @@ func AttribCheckFloat(b *Builder, am map[string]interface{}, fname string) error
 	case float64:
 		am[fname] = float32(n)
 		return nil
-	default:
-		return b.err(am, fname, fmt.Sprintf("Not a number:%T", v))
 	}
-	return nil
+	return b.err(am, fname, fmt.Sprintf("Not a number:%T", v))
 }
 
 // AttribCheckInt checks and convert attribute to int

+ 3 - 0
gui/checkradio.go

@@ -16,6 +16,7 @@ const (
 	radioOFF = string(icon.RadioButtonUnchecked)
 )
 
+// CheckRadio is a GUI element that can be either a checkbox or a radio button
 type CheckRadio struct {
 	Panel             // Embedded panel
 	Label      *Label // Text label
@@ -30,8 +31,10 @@ type CheckRadio struct {
 	subroot    bool // indicates root subcription
 }
 
+// CheckRadioStyle contains the styling of a CheckRadio
 type CheckRadioStyle BasicStyle
 
+// CheckRadioStyles contains an CheckRadioStyle for each valid GUI state
 type CheckRadioStyles struct {
 	Normal   CheckRadioStyle
 	Over     CheckRadioStyle

+ 2 - 2
gui/edit.go

@@ -27,7 +27,7 @@ type Edit struct {
 	styles      *EditStyles
 }
 
-// EditStyle
+// EditStyle contains the styling of an Edit
 type EditStyle struct {
 	Border      RectBounds
 	Paddings    RectBounds
@@ -38,7 +38,7 @@ type EditStyle struct {
 	HolderColor math32.Color4
 }
 
-// EditStyles
+// EditStyles contains an EditStyle for each valid GUI state
 type EditStyles struct {
 	Normal   EditStyle
 	Over     EditStyle

+ 5 - 5
gui/hboxlayout.go

@@ -134,7 +134,7 @@ func (bl *HBoxLayout) Recalc(ipan IPanel) {
 	// Calculates the total width, expanded width, fixed width and
 	// the sum of the expand factor for all items.
 	var twidth float32
-	var ewidth float32
+	//var ewidth float32
 	var fwidth float32
 	var texpand float32
 	ecount := 0
@@ -157,10 +157,10 @@ func (bl *HBoxLayout) Recalc(ipan IPanel) {
 		// Calculate width of expanded items
 		if params.Expand > 0 {
 			texpand += params.Expand
-			ewidth += pan.Width()
-			if pos > 0 {
-				ewidth += bl.spacing
-			}
+			//ewidth += pan.Width()
+			//if pos > 0 {
+			//	ewidth += bl.spacing
+			//}
 			ecount++
 			// Calculate width of fixed items
 		} else {

+ 48 - 41
gui/scroller.go

@@ -9,6 +9,7 @@ import (
 	"math"
 )
 
+// Scroller is the GUI element that allows scrolling of IPanels
 type Scroller struct {
 	Panel                          // Embedded panel
 	vert           bool            // vertical/horizontal scroller flag
@@ -26,8 +27,10 @@ type Scroller struct {
 	scrollBarEvent bool
 }
 
+// ScrollerStyle contains the styling of a Scroller
 type ScrollerStyle BasicStyle
 
+// ScrollerStyles contains a ScrollerStyle for each valid GUI state
 type ScrollerStyles struct {
 	Normal   ScrollerStyle
 	Over     ScrollerStyle
@@ -145,7 +148,7 @@ func (s *Scroller) Remove(item IPanel) {
 	}
 }
 
-// GetItem returns the item at the specified position.
+// ItemAt returns the item at the specified position.
 // Returns nil if the position is invalid.
 func (s *Scroller) ItemAt(pos int) IPanel {
 
@@ -213,7 +216,7 @@ func (s *Scroller) ItemVisible(pos int) bool {
 
 	// Vertical scroller
 	if s.vert {
-		var height float32 = 0
+		var height float32
 		for i := s.first; i < len(s.items); i++ {
 			item := s.items[pos]
 			height += item.GetPanel().height
@@ -225,21 +228,21 @@ func (s *Scroller) ItemVisible(pos int) bool {
 			}
 		}
 		return false
-		// Horizontal scroller
-	} else {
-		var width float32 = 0
-		for i := s.first; i < len(s.items); i++ {
-			item := s.items[pos]
-			width += item.GetPanel().width
-			if width > s.width {
-				return false
-			}
-			if pos == i {
-				return true
-			}
+	}
+
+	// Horizontal scroller
+	var width float32
+	for i := s.first; i < len(s.items); i++ {
+		item := s.items[pos]
+		width += item.GetPanel().width
+		if width > s.width {
+			return false
+		}
+		if pos == i {
+			return true
 		}
-		return false
 	}
+	return false
 }
 
 // SetStyles set the scroller styles overriding the default style
@@ -249,6 +252,7 @@ func (s *Scroller) SetStyles(ss *ScrollerStyles) {
 	s.update()
 }
 
+// ApplyStyle applies the specified style to the Scroller
 func (s *Scroller) ApplyStyle(style int) {
 
 	switch style {
@@ -263,16 +267,19 @@ func (s *Scroller) ApplyStyle(style int) {
 	}
 }
 
+// SetAutoWidth sets the maximum automatic width
 func (s *Scroller) SetAutoWidth(maxWidth float32) {
 
 	s.maxAutoWidth = maxWidth
 }
 
+// SetAutoHeight sets the maximum automatic height
 func (s *Scroller) SetAutoHeight(maxHeight float32) {
 
 	s.maxAutoHeight = maxHeight
 }
 
+// SetAutoButtonSize specified whether the scrollbutton size should be adjusted relative to the size of the content/view
 func (s *Scroller) SetAutoButtonSize(autoButtonSize bool) {
 
 	s.autoButtonSize = autoButtonSize
@@ -337,8 +344,8 @@ func (s *Scroller) autoSize() {
 		return
 	}
 
-	var width float32 = 0
-	var height float32 = 0
+	var width float32
+	var height float32
 	for _, item := range s.items {
 		panel := item.GetPanel()
 		if panel.Width() > width {
@@ -379,7 +386,7 @@ func (s *Scroller) vRecalc() {
 	if s.first > 0 {
 		scroll = true
 	} else {
-		var posY float32 = 0
+		var posY float32
 		for _, item := range s.items[s.first:] {
 			posY += item.TotalHeight()
 			if posY > s.height {
@@ -392,7 +399,7 @@ func (s *Scroller) vRecalc() {
 
 	// Compute size of scroll button
 	if scroll && s.autoButtonSize {
-		var totalHeight float32 = 0
+		var totalHeight float32
 		for _, item := range s.items {
 			// TODO OPTIMIZATION
 			// Break when the view/content proportion becomes smaller than the minimum button size
@@ -407,7 +414,7 @@ func (s *Scroller) vRecalc() {
 		width -= s.vscroll.Width()
 	}
 
-	var posY float32 = 0
+	var posY float32
 	// Sets positions of all items
 	for pos, ipan := range s.items {
 		item := ipan.GetPanel()
@@ -444,7 +451,7 @@ func (s *Scroller) hRecalc() {
 	if s.first > 0 {
 		scroll = true
 	} else {
-		var posX float32 = 0
+		var posX float32
 		for _, item := range s.items[s.first:] {
 			posX += item.GetPanel().Width()
 			if posX > s.width {
@@ -457,7 +464,7 @@ func (s *Scroller) hRecalc() {
 
 	// Compute size of scroll button
 	if scroll && s.autoButtonSize {
-		var totalWidth float32 = 0
+		var totalWidth float32
 		for _, item := range s.items {
 			// TODO OPTIMIZATION
 			// Break when the view/content proportion becomes smaller than the minimum button size
@@ -472,7 +479,7 @@ func (s *Scroller) hRecalc() {
 		height -= s.hscroll.Height()
 	}
 
-	var posX float32 = 0
+	var posX float32
 	// Sets positions of all items
 	for pos, ipan := range s.items {
 		item := ipan.GetPanel()
@@ -507,7 +514,7 @@ func (s *Scroller) maxFirst() int {
 
 	// Vertical scroller
 	if s.vert {
-		var height float32 = 0
+		var height float32
 		pos := len(s.items) - 1
 		if pos < 0 {
 			return 0
@@ -524,26 +531,26 @@ func (s *Scroller) maxFirst() int {
 			}
 		}
 		return pos + 1
-		// Horizontal scroller
-	} else {
-		var width float32 = 0
-		pos := len(s.items) - 1
-		if pos < 0 {
-			return 0
+	}
+
+	// Horizontal scroller
+	var width float32
+	pos := len(s.items) - 1
+	if pos < 0 {
+		return 0
+	}
+	for {
+		item := s.items[pos]
+		width += item.GetPanel().Width()
+		if width > s.Width() {
+			break
 		}
-		for {
-			item := s.items[pos]
-			width += item.GetPanel().Width()
-			if width > s.Width() {
-				break
-			}
-			pos--
-			if pos < 0 {
-				break
-			}
+		pos--
+		if pos < 0 {
+			break
 		}
-		return pos + 1
 	}
+	return pos + 1
 }
 
 // setVScrollBar sets the visibility state of the vertical scrollbar

+ 3 - 2
gui/slider.go

@@ -22,6 +22,7 @@ import (
 
 **/
 
+// Slider is the GUI element for sliders and progress bars
 type Slider struct {
 	Panel                     // Embedded panel
 	slider      Panel         // embedded slider panel
@@ -35,10 +36,10 @@ type Slider struct {
 	scaleFactor float32       // scale factor (default = 1.0)
 }
 
-// SliderStyle
+// SliderStyle contains the styling of a Slider
 type SliderStyle BasicStyle
 
-// All Slider styles
+// SliderStyles contains a SliderStyle for each valid GUI state
 type SliderStyles struct {
 	Normal   SliderStyle
 	Over     SliderStyle

+ 3 - 0
gui/splitter.go

@@ -9,6 +9,7 @@ import (
 	"github.com/g3n/engine/window"
 )
 
+// Splitter is a GUI element that splits two panels and can be adjusted
 type Splitter struct {
 	Panel                     // Embedded panel
 	P0        Panel           // Left/Top panel
@@ -22,12 +23,14 @@ type Splitter struct {
 	mouseOver bool            // mouse is over the spacer panel
 }
 
+// SplitterStyle contains the styling of a Splitter
 type SplitterStyle struct {
 	SpacerBorderColor math32.Color4
 	SpacerColor       math32.Color4
 	SpacerSize        float32
 }
 
+// SplitterStyles contains a SplitterStyle for each valid GUI state
 type SplitterStyles struct {
 	Normal SplitterStyle
 	Over   SplitterStyle

+ 5 - 5
gui/vboxlayout.go

@@ -134,7 +134,7 @@ func (bl *VBoxLayout) Recalc(ipan IPanel) {
 	// Calculates the total height, expanded height, fixed height and
 	// the sum of the expand factor for all items.
 	var theight float32
-	var eheight float32
+	//var eheight float32
 	var fheight float32
 	var texpand float32
 	ecount := 0
@@ -157,10 +157,10 @@ func (bl *VBoxLayout) Recalc(ipan IPanel) {
 		// Calculate height of expanded items
 		if params.Expand > 0 {
 			texpand += params.Expand
-			eheight += pan.Height()
-			if pos > 0 {
-				eheight += bl.spacing
-			}
+			//eheight += pan.Height()
+			//if pos > 0 {
+			//	eheight += bl.spacing
+			//}
 			ecount++
 			// Calculate width of fixed items
 		} else {

+ 2 - 2
gui/window.go

@@ -42,7 +42,7 @@ type Window struct {
 	mouseY     float32
 }
 
-// WindowStyle
+// WindowStyle contains the styling of a Window
 type WindowStyle struct {
 	Border           RectBounds
 	Paddings         RectBounds
@@ -53,7 +53,7 @@ type WindowStyle struct {
 	TitleFgColor     math32.Color4
 }
 
-// WindowStyles
+// WindowStyles contains a WindowStyle for each valid GUI state
 type WindowStyles struct {
 	Normal   WindowStyle
 	Over     WindowStyle

+ 0 - 2
loader/collada/animation.go

@@ -344,8 +344,6 @@ func (si *SamplerInstance) Interpolate(inp float32) (float32, bool) {
 		return si.linearInterp(inp, idx), true
 	case "BSPLINE":
 		return si.linearInterp(inp, idx), true
-	default:
-		return 0, false
 	}
 
 	return 0, false

+ 0 - 2
loader/collada/collada.go

@@ -354,7 +354,6 @@ func (d *Decoder) decAsset(assetStart xml.StartElement, a *Asset) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decScene(start xml.StartElement, dom *Collada) error {
@@ -373,7 +372,6 @@ func (d *Decoder) decScene(start xml.StartElement, dom *Collada) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decInstanceVisualScene(start xml.StartElement, s *Scene) error {

+ 0 - 2
loader/collada/common.go

@@ -148,7 +148,6 @@ func (d *Decoder) decSource(start xml.StartElement) (*Source, error) {
 			continue
 		}
 	}
-	return source, nil
 }
 
 // decSource decodes the float array from the specified source
@@ -232,7 +231,6 @@ func (d *Decoder) decAcessor(start xml.StartElement, source *Source) error {
 			}
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decParam(start xml.StartElement, accessor *Accessor) error {

+ 0 - 1
loader/collada/geometry.go

@@ -65,7 +65,6 @@ func (d *Decoder) NewGeometry(id string) (geometry.IGeometry, uint32, error) {
 	default:
 		return nil, 0, fmt.Errorf("GeometryElement:%T not supported", gt)
 	}
-	return nil, 0, nil
 }
 
 func newMesh(m *Mesh) (*geometry.Geometry, uint32, error) {

+ 0 - 3
loader/collada/library_animations.go

@@ -116,7 +116,6 @@ func (d *Decoder) decLibraryAnimations(start xml.StartElement, dom *Collada) err
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decAnimation(start xml.StartElement, la *LibraryAnimations) error {
@@ -154,7 +153,6 @@ func (d *Decoder) decAnimation(start xml.StartElement, la *LibraryAnimations) er
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decSampler(start xml.StartElement, anim *Animation) error {
@@ -177,7 +175,6 @@ func (d *Decoder) decSampler(start xml.StartElement, anim *Animation) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decChannel(start xml.StartElement, anim *Animation) error {

+ 0 - 9
loader/collada/library_effects.go

@@ -334,7 +334,6 @@ func (d *Decoder) decLibraryEffects(start xml.StartElement, dom *Collada) error
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decEffect(start xml.StartElement, le *LibraryEffects) error {
@@ -358,7 +357,6 @@ func (d *Decoder) decEffect(start xml.StartElement, le *LibraryEffects) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decEffectProfileCommon(start xml.StartElement, e *Effect) error {
@@ -388,7 +386,6 @@ func (d *Decoder) decEffectProfileCommon(start xml.StartElement, e *Effect) erro
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decProfileCommonNewparam(start xml.StartElement, pc *ProfileCOMMON) error {
@@ -417,7 +414,6 @@ func (d *Decoder) decProfileCommonNewparam(start xml.StartElement, pc *ProfileCO
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decSurface(start xml.StartElement, np *Newparam) error {
@@ -436,7 +432,6 @@ func (d *Decoder) decSurface(start xml.StartElement, np *Newparam) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decSampler2D(start xml.StartElement, np *Newparam) error {
@@ -454,7 +449,6 @@ func (d *Decoder) decSampler2D(start xml.StartElement, np *Newparam) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decProfileCommonTechnique(start xml.StartElement, pc *ProfileCOMMON) error {
@@ -490,7 +484,6 @@ func (d *Decoder) decProfileCommonTechnique(start xml.StartElement, pc *ProfileC
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decBlinn(start xml.StartElement, pc *ProfileCOMMON) error {
@@ -571,7 +564,6 @@ func (d *Decoder) decBlinn(start xml.StartElement, pc *ProfileCOMMON) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decPhong(start xml.StartElement, pc *ProfileCOMMON) error {
@@ -652,7 +644,6 @@ func (d *Decoder) decPhong(start xml.StartElement, pc *ProfileCOMMON) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decColorOrTexture(start xml.StartElement, dest *interface{}) error {

+ 0 - 6
loader/collada/library_geometries.go

@@ -255,7 +255,6 @@ func (d *Decoder) decLibraryGeometries(start xml.StartElement, dom *Collada) err
 			continue
 		}
 	}
-	return nil
 }
 
 // decGeometry receives the start element of a geometry and
@@ -285,7 +284,6 @@ func (d *Decoder) decGeometry(start xml.StartElement, lg *LibraryGeometries) err
 			continue
 		}
 	}
-	return nil
 }
 
 // decMesh decodes the mesh from the specified geometry
@@ -337,7 +335,6 @@ func (d *Decoder) decMesh(start xml.StartElement, geom *Geometry) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decVertices(start xml.StartElement, mesh *Mesh) error {
@@ -360,7 +357,6 @@ func (d *Decoder) decVertices(start xml.StartElement, mesh *Mesh) error {
 			mesh.Vertices.Input = append(mesh.Vertices.Input, inp)
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decInput(start xml.StartElement) (Input, error) {
@@ -403,7 +399,6 @@ func (d *Decoder) decLines(start xml.StartElement, mesh *Mesh) error {
 			ln.P = p
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decPolylist(start xml.StartElement, mesh *Mesh) error {
@@ -447,7 +442,6 @@ func (d *Decoder) decPolylist(start xml.StartElement, mesh *Mesh) error {
 			pl.P = p
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decInputShared(start xml.StartElement) (InputShared, error) {

+ 0 - 2
loader/collada/library_images.go

@@ -89,7 +89,6 @@ func (d *Decoder) decLibraryImages(start xml.StartElement, dom *Collada) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decImage(start xml.StartElement, li *LibraryImages) error {
@@ -112,7 +111,6 @@ func (d *Decoder) decImage(start xml.StartElement, li *LibraryImages) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decImageSource(start xml.StartElement, cdata []byte, img *Image) error {

+ 0 - 4
loader/collada/library_lights.go

@@ -190,7 +190,6 @@ func (d *Decoder) decLibraryLights(start xml.StartElement, dom *Collada) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decLight(start xml.StartElement, ll *LibraryLights) error {
@@ -213,7 +212,6 @@ func (d *Decoder) decLight(start xml.StartElement, ll *LibraryLights) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decLightTechniqueCommon(start xml.StartElement, li *Light) error {
@@ -327,7 +325,6 @@ func (d *Decoder) decPoint(start xml.StartElement, li *Light) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decSpot(start xml.StartElement, li *Light) error {
@@ -388,7 +385,6 @@ func (d *Decoder) decSpot(start xml.StartElement, li *Light) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decFloatValue(start xml.StartElement, cdata []byte) (*FloatValue, error) {

+ 0 - 3
loader/collada/library_materials.go

@@ -88,7 +88,6 @@ func (d *Decoder) decLibraryMaterials(start xml.StartElement, dom *Collada) erro
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decMaterial(start xml.StartElement, lm *LibraryMaterials) error {
@@ -111,7 +110,6 @@ func (d *Decoder) decMaterial(start xml.StartElement, lm *LibraryMaterials) erro
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decInstanceEffect(start xml.StartElement, ie *InstanceEffect) error {
@@ -134,5 +132,4 @@ func (d *Decoder) decInstanceEffect(start xml.StartElement, ie *InstanceEffect)
 			continue
 		}
 	}
-	return nil
 }

+ 0 - 7
loader/collada/library_visual_scenes.go

@@ -258,7 +258,6 @@ func (d *Decoder) decLibraryVisualScenes(start xml.StartElement, dom *Collada) e
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decVisualScene(vsStart xml.StartElement, lv *LibraryVisualScenes) error {
@@ -285,7 +284,6 @@ func (d *Decoder) decVisualScene(vsStart xml.StartElement, lv *LibraryVisualScen
 			}
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decNode(nodeStart xml.StartElement, parent *[]*Node) error {
@@ -350,7 +348,6 @@ func (d *Decoder) decNode(nodeStart xml.StartElement, parent *[]*Node) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decMatrix(cdata []byte, n *Node) error {
@@ -425,7 +422,6 @@ func (d *Decoder) decInstanceGeometry(start xml.StartElement, n *Node) error {
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decBindMaterial(start xml.StartElement, dest **BindMaterial) error {
@@ -445,7 +441,6 @@ func (d *Decoder) decBindMaterial(start xml.StartElement, dest **BindMaterial) e
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decBindMaterialTechniqueCommon(start xml.StartElement, bm *BindMaterial) error {
@@ -464,7 +459,6 @@ func (d *Decoder) decBindMaterialTechniqueCommon(start xml.StartElement, bm *Bin
 			continue
 		}
 	}
-	return nil
 }
 
 func (d *Decoder) decInstanceMaterial(start xml.StartElement, bm *BindMaterial) error {
@@ -494,5 +488,4 @@ func (d *Decoder) decInstanceMaterial(start xml.StartElement, bm *BindMaterial)
 			continue
 		}
 	}
-	return nil
 }

+ 0 - 10
loader/collada/material.go

@@ -68,7 +68,6 @@ func (d *Decoder) NewMaterial(id string) (material.IMaterial, error) {
 	default:
 		return nil, fmt.Errorf("Invalid shader element")
 	}
-	return nil, nil
 }
 
 // GetTexture2D returns a pointer to an instance of the Texture2D
@@ -210,9 +209,6 @@ func getColor(ci interface{}) math32.Color {
 	switch c := ci.(type) {
 	case *Color:
 		return math32.Color{c.Data[0], c.Data[1], c.Data[2]}
-		break
-	default:
-		return math32.Color{}
 	}
 	return math32.Color{}
 }
@@ -222,9 +218,6 @@ func getColor4(ci interface{}) math32.Color4 {
 	switch c := ci.(type) {
 	case Color:
 		return math32.Color4{c.Data[0], c.Data[1], c.Data[2], c.Data[3]}
-		break
-	default:
-		return math32.Color4{}
 	}
 	return math32.Color4{}
 }
@@ -234,9 +227,6 @@ func getFloatOrParam(vi interface{}) float32 {
 	switch v := vi.(type) {
 	case *Float:
 		return v.Data
-		break
-	default:
-		return 0
 	}
 	return 0
 }

+ 2 - 2
material/basic.go

@@ -4,12 +4,12 @@
 
 package material
 
-import ()
-
+// Basic is a simple material that uses the 'basic' shader
 type Basic struct {
 	Material // Embedded material
 }
 
+// NewBasic returns a pointer to a new Basic material
 func NewBasic() *Basic {
 
 	mb := new(Basic)