- Enable Layers
- Start application, display a Brush (on its own layer)
- Load an Anim using LoadAnim()
- Call PlayAnim() and store it in a variable
- Call RemoveLayer(1) to remove the brush layer
- Have an interval to draw the next frame when there is an Anim loaded and a "playing" variable is set to True (i.e. Play button was clicked). The next frame is drawn using AsyncDrawFrame()
Using the above sequence, it seems that as soon as AsyncDrawFrame() is called, Hollywood hits an unhandled exception and it closes down.
Specifically, this exception:
Code: Select all
Unhandled exception at 0x00450914 in Hollywood.exe: 0xC0000005: Access violation reading location 0x00000028.
I understand that it may be a logical error to try and remove a Layer that may be used or is the last one you have, but either way it should never crash Hollywood itself if you do that.
Code snippets below:
This causes a crash:
Code: Select all
@BRUSH 10, "data/cover.png"
@DISPLAY {Color = #BLACK, Title = "AnimPlayer", Sizeable = True, Layers = True}
DisplayBrush(10, #CENTER, #CENTER)
Local f$ = "filename.anim"
LoadAnim(1, f$, {FromDisk = True})
playingAnim = PlayAnim(1, 0, 0, {Speed = #DEFAULTSPEED, Times = 1, Async = True})
RemoveLayer(1)
...
Case "Interval":
If Not IsNil(playingAnim) And playing = True
done = AsyncDrawFrame(playingAnim)
EndIf
Code: Select all
@BRUSH 10, "data/cover.png"
@DISPLAY {Color = #BLACK, Title = "AnimPlayer", Sizeable = True, Layers = True}
DisplayBrush(10, #CENTER, #CENTER)
Local f$ = "filename.anim"
LoadAnim(1, f$, {FromDisk = True})
RemoveLayer(1)
playingAnim = PlayAnim(1, 0, 0, {Speed = #DEFAULTSPEED, Times = 1, Async = True})
...
Case "Interval":
If Not IsNil(playingAnim) And playing = True
done = AsyncDrawFrame(playingAnim)
EndIf
If anything further is required, I'd be happy to make it available to assist narrowing this down.