File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -631,15 +631,16 @@ export class WindWakerRenderer implements Viewer.SceneGfx {
631
631
632
632
public serializeSaveState ( dst : ArrayBuffer , offs : number ) : number {
633
633
const view = new DataView ( dst ) ;
634
- view . setUint8 ( offs ++ , this . isPaused ? 1 : 0 ) ;
635
- view . setUint16 ( offs , this . globals . scnPlay . demo . getFrame ( ) ) ;
634
+ const isDemo = this . globals . scnPlay . demo . getMode ( ) == EDemoMode . Playing ;
635
+ view . setUint8 ( offs ++ , ( isDemo && this . isPaused ) ? 1 : 0 ) ;
636
+ view . setUint16 ( offs , isDemo ? this . globals . scnPlay . demo . getFrame ( ) : 0 ) ;
636
637
return offs + 2 ;
637
638
}
638
639
639
640
public deserializeSaveState ( src : ArrayBuffer , offs : number , byteLength : number ) : number {
640
641
const view = new DataView ( src ) ;
641
642
this . isPaused = ! ! view . getUint8 ( offs ++ ) ;
642
- this . globals . scnPlay . demo . setFrame ( view . getUint16 ( offs ) ) ;
643
+ this . globals . scnPlay . demo . setFrame ( view . getUint16 ( offs ) ) ; // @TODO : This won't work when loading without re-creating the scene
643
644
this . togglePlayPause ( ! this . isPaused ) ;
644
645
return offs + 2 ;
645
646
}
You can’t perform that action at this time.
0 commit comments