Skip to content

Commit

Permalink
Remove old clone interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
qlli committed Oct 14, 2024
1 parent 48bf577 commit ab75a75
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions sprite.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ func cloneSprite(out reflect.Value, outPtr Sprite, in reflect.Value, v specsp) *
}

func Gopt_SpriteImpl_Clone__0(sprite Sprite) {
Gopt_Sprite_Clone__1(sprite, nil)
Gopt_SpriteImpl_Clone__1(sprite, nil)
}

func Gopt_SpriteImpl_Clone__1(sprite Sprite, data interface{}) {
Expand All @@ -436,25 +436,6 @@ func Gopt_SpriteImpl_Clone__1(sprite Sprite, data interface{}) {
}
}

func Gopt_Sprite_Clone__0(sprite Sprite) {
Gopt_Sprite_Clone__1(sprite, nil)
}

func Gopt_Sprite_Clone__1(sprite Sprite, data interface{}) {
src := spriteOf(sprite)
if debugInstr {
log.Println("Clone", src.name)
}
in := reflect.ValueOf(sprite).Elem()
v := reflect.New(in.Type())
out, outPtr := v.Elem(), v.Interface().(Sprite)
dest := cloneSprite(out, outPtr, in, nil)
src.g.addClonedShape(src, dest)
if dest.hasOnCloned {
dest.doWhenCloned(dest, data)
}
}

func (p *SpriteImpl) OnCloned__0(onCloned func(data interface{})) {
p.hasOnCloned = true
p.allWhenCloned = &eventSink{
Expand Down

0 comments on commit ab75a75

Please sign in to comment.