Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=======================================================
- //--- Instruction Processing Order and General Timing ---
- =========================================================
- 1. Instructions in Global script Init (if starting a new game)
- 2. Instructions in Global Script OnContinue (is resuming a game)
- 3. Instructions immediately inside the run() function of a global active script.
- 4. Instructions in the global active script's infinite loop prior to Waitdraw,
- if (5) does not exist, or on the first frame of the game.
- 5. Instructions from an ffc script positioned after (an illegal)
- Waitdraw() instruction in that script from the previous frame.
- Note: Requires being on at least the second frame of a game session.
- 6. Instructions in the global active script prior to Waitdraw().
- 7. Instructions in an ffc script, other than (5), excluding draw commands.
- 8. Screen Scrolling (2.50.2, or later)
- 9. Instructions from item scripts.
- 10. Waitdraw() in a global active script.
- 11. Engine writing to Link->Dir and Link->Tile.
- 12. Instructions in the global active script, called after Waitdraw()
- 12(b). Screen Scrolling ( 2.50.0, and 2.50.1 )
- 13. Drawing from FFCs
- 14. Instructions in an OnExit script, if the game is exiting.
- 15. Return to (5).
- void Waitdraw(); ZASM Instruction:
- WAITDRAW
- /**
- * Halts execution of the script until ZC's internal code has been run (movement,
- * collision detection, etc.), but before the screen is drawn. This can only
- * be used in the active global script.
- * Waitdraw() may only be called from the global active script; not from FFC scripts.
- * The sequence of ZC actions is as follows:
- * FFCs (in numerical sequence, from FFC 01, to FFC 32)
- * Enemies
- * EWeapons
- * Link
- * LWeapons
- * Hookshot
- * Collision Checking
- * Store Link->Input / Link->Press
- * Waitdraw()
- * Drawing
- * Rendering of the Screen
- * Screen Scrolling
- * Drawing from FFCs
- *
- * Note: Drawing from FFCs technically occurs with other Drawing, but as it is issued after Waitdraw(),
- * it is offset (a frame late) and renders after screen scrolling, and after any other drawing in the same
- * frame as draw instructions from ffcs are called. To ensure that drawing done by ffcs is in sync with
- * other drawing, it is imperative to call it from your global script, using the ffc to trigger global
- * conditions that cause global drawing instructions that are called before Waitdraw() in your global
- * active script to evaluate true.
- *
- * Anything placed after Waitdraw() will not present graphical effects until the next frame.
- * It is possible { ! CHECK } to read/store Link->Tile, Link->Dir and other variables *after* Waitdraw()
- * in one frame, and then use these values to modify other pointer members so that they are drawn correctly
- * at the next execution of Waitdraw().
- *
- *
- */ Example Use:
- Waitdraw();
- //! Submit bug report that Link->Dir and Link->Tile are incorrect before Waitdraw.
- * Waitdraw() in ffc scripts ///
- * --------------------------///
- * Althouth technically illegal, it is possible to call Waitdraw() in an *ffc script*. Doing this has the
- * following effects, and/or consequences:
- *
- * 1. The Compiler will report an error, and print the error to Allegro log:
- * 'Warning: Waitdraw() may only be used in global scripts.'
- * 2. Any instruction sint he ffc script that are called before the Waitdraw() instruction in the ffc script
- * will run this frame, after Waitdraw() in your global active script.
- * 3. Any instructions called *after* Waitdraw() in the ffc script, will run BEFORE BOTH Waitdraw() in your
- * global active script, and BEFORE any other instructions in your global active script's infinite loop.
- *
- * This behaviour may change in future versions of ZC, and using Waitdraw() in ffc scripts is not advised.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement