Sly 1:Executable: Difference between revisions
→Initialization and main loop: Fixed typos, tweaked wording
TheOnlyZac (talk | contribs) (→Libraries: Tweaked wording) Tags: Mobile edit Mobile web edit |
TheOnlyZac (talk | contribs) (→Initialization and main loop: Fixed typos, tweaked wording) Tags: Mobile edit Mobile web edit |
||
Line 27:
==Initialization and main loop==
The entry point for the executable is
=== Initialization ===
Line 37:
* First, check if <code>g_mpeg</code> has an [[MPEG]] queued to be played. If so:
** <code>FlushFrames(1);</code> – Call some graphics functions and swap the
** <code>CTransition::Execute(&g_transition);</code> – Execute the MPEG on the global transition instance
* Check if <code>g_transition</code> has a pending transition (<code>m_fPending != 0</code>). If so:
**
** 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 (
** <code>FlushFrames(1);</code>
** <code>CTransition::Execute(&g_transition);</code>
* <code>UpdateJoy(&g_joy);</code> – Handle controller input
* <code>UpdateCodes();</code> – Watch for [[Cheat codes|cheat code]] inputs
* <code>unk_save_related(&g_save_related_as4);</code> – This function is not well understood, but [[Saving#Sly 1|saving]] the game is
* <code>UpdateUi(&g_ui);</code> – Update the state of GUI [[BLOT|blots]]
* <code>UpdateGameState(g_clock.dt);</code> – Update the running timers on the [[GS|game state]] structs
Line 54:
** <code>OpenFrame();</code> – Prepare to render the next frame
** <code>MarkClockTick(&g_clock);</code> – Update the global [[clock]] values
** Grab a function pointer from the <code>g_psw</code> struct and execute it if it is not NULL (the function takes <code>g_clock.dt</code> as an argument)
** <code>RenderSw(g_psw,g_pcm);</code> – Render gameobjects on the current frame
** <code>RenderUi();</code> – Render the gui elements on the current frame
|