public static void Update() { if (Input2.DelayedButton(FF8TextTagKey.Confirm) || Input2.DelayedButton(FF8TextTagKey.Cancel) || Input2.DelayedButton(Keys.Space)) { //init_debugger_Audio.StopAudio(); //Memory.module = MODULE.MAINMENU_DEBUG; MovieState = STATE_RETURN; } #if DEBUG // lets you move through all the feilds just holding left or right. it will just loop // when it runs out. if (Input2.DelayedButton(FF8TextTagKey.Left)) { init_debugger_Audio.PlaySound(0); Module_main_menu_debug.MoviePointer--; Reset(); } if (Input2.DelayedButton(FF8TextTagKey.Right)) { init_debugger_Audio.PlaySound(0); Module_main_menu_debug.MoviePointer++; Reset(); } #endif switch (MovieState) { case STATE_LOAD: MovieState++; LoadMovie(); break; case STATE_CLEAR: break; case STATE_STARTPLAY: MovieState++; if (FfccAudio != null) { FfccAudio.PlayInTask(); } if (FfccVideo != null) { FfccVideo.Play(); } break; case STATE_PLAYING: //if (FfccAudio != null && !FfccAudio.Ahead) //{ // // if we are behind the timer get the next frame of audio. // FfccAudio.Next(); //} if (FfccVideo == null) { MovieState = STATE_FINISHED; } else if (FfccVideo.Behind) { if (FfccVideo.Next() < 0) { MovieState = STATE_FINISHED; //Memory.SuppressDraw = true; break; } else if (frameTex != null) { frameTex.Dispose(); GC.Collect(); GC.WaitForPendingFinalizers(); frameTex = null; } } else { Memory.SuppressDraw = true; } if (frameTex == null) { if (FfccVideo != null) { if (Memory.State?.Fieldvars != null) { Memory.State.Fieldvars.FMVFrames = (ulong)FfccVideo.CurrentFrameNum; } frameTex = FfccVideo.Texture2D(); } } break; case STATE_PAUSED: //todo add a function to pause sound //pausing the stopwatch will cause the video to pause because it calcs the current frame based on time. break; case STATE_FINISHED: break; case STATE_RESET: Reset(); break; case STATE_RETURN: default: Reset(); Memory.module = ReturnState; ReturnState = MODULE.MAINMENU_DEBUG; break; } }