Sly 1:Executable: Difference between revisions
→Game loop: Tweaked main game loop
(→IOP module libraries: rename (using official sce terminology), less wonky that way) |
TheOnlyZac (talk | contribs) (→Game loop: Tweaked main game loop) |
||
Line 53:
* First, check if <code>g_mpeg</code> has an [[MPEG]] queued to be played. If so:
** <code>FlushFrames(1)</code> –
** <code>
* Check if <code>g_transition</code> has a pending transition (i.e. <code>m_fPending != 0</code>). If so:
** <code>FlushFrames(1)</code>
** Call a function that calls <code>CMpeg::Execute</code> on the <code>g_transition</code> instance.
* Check '''again''' if <code>g_mpeg</code> has an MPEG queued to be played (this happens if two MPEGs were queued to play back-to-back). If so:
** <code>FlushFrames(1)</code>
** <code>
* <code>UpdateJoy(&g_joy)</code> – Handles [[Sly 1:Input|controller input]]
* <code>UpdateCodes()</code> –
* Call an unknown function that handles saving the game.
* <code>UpdateUi(&g_ui)</code> –
* <code>UpdateGameState(g_clock.dt)</code> –
* <code>if (g_psw != NULLPTR)</code> – If g_psw is
** <code>SetupCm(g_pcm)</code> –
** <code>OpenFrame()</code> –
** <code>MarkClockTick(&g_clock)</code> –
** Grab a particular function pointer from the <code>g_psw</code> struct and execute it if it is not NULL. The function's purpose is unknown but it takes <code>g_clock.dt</code> as an argument, so it's probably an Update function.
** <code>RenderSw(g_psw, g_pcm)</code> –
** <code>RenderUi()</code> –
** <code>DrawSw(g_psw, g_pcm)</code> –
** <code>DrawUi()</code> –
** <code>CloseFrame()</code> –
* Increment the global frame counter, <code>g_cframe</code>.
|