iigs-game-engine/src
2021-11-11 22:22:10 -06:00
..
blitter Fix fast-path return value in PushDirtyTile and correct handling of TS_SPRITE_FLAG 2021-11-11 22:10:54 -06:00
Anim.s Initial Tiled tile animation export support 2021-10-06 07:10:09 -05:00
Core.s Initial shell of generalize sprite size support; just for marking the dirty tiles 2021-11-11 17:06:38 -06:00
Defs.s WIP: manual sprite rendering showing on screen 2021-10-28 21:41:01 -05:00
Graphics.s Initial Tiled tile animation export support 2021-10-06 07:10:09 -05:00
GTE.s Expose the ApplyTiles subroutine 2021-10-29 00:52:29 -05:00
Memory.s Tile rendering reorganization 2021-10-21 08:50:07 -05:00
README.md Add brief readme to start documenting the internals of GTE 2021-10-21 08:47:17 -05:00
Render.s Initial shell of generalize sprite size support; just for marking the dirty tiles 2021-11-11 17:06:38 -06:00
RotData.s Reformat 2021-07-30 08:01:46 -05:00
Script.s Fix bcc/bcs typo when initializing timers 2021-10-07 16:38:20 -05:00
Sprite2.s Initial shell of generalize sprite size support; just for marking the dirty tiles 2021-11-11 17:06:38 -06:00
Sprite.s Clear sprite flag when erasing sprite 2021-11-11 22:22:10 -06:00
TileMap.s WIP: manual sprite rendering showing on screen 2021-10-28 21:41:01 -05:00
Timer.s Fix bcc/bcs typo when initializing timers 2021-10-07 16:38:20 -05:00

= Rendering Pipeline =

The engine run through the following render loop on every frame

  1. Lock in any changes to the play field scroll position
  2. Erase/Redraw dirty sprites into the sprite plane
    • If a sprite has moved a different amount than the scroll position, it's marked dirty
    • If a sprite was just added on this frame, it's marked dirty
    • Any sprite that overlaps a dirty sprite is marked as impacted
    • All dirty sprites are erased from the sprite plane
    • All dirty and impacted sprites are drawn into the sprite plane
    • All of the play field tiles that intersect dirty sprites are marked as dirty with the sprite flag set
  3. If a scroll map is defined
    • Calculate the new regions of the screen that have been scrolled into view
    • For each new tile
      • Copy the tile descriptor from the tile map into the tile store
      • Mark the tile as dirty
  4. For each dirty tile
    • Load the tile descriptor from the tile store
    • Dispatch to the appropriate tile renderer
    • Clear the tile dirty flag
  5. If any Masked Overlays are defined
    • Turn off shadowing
    • Draw the play field on the Overlay rows
    • Turn on shadowing
  6. In top-to-bottom order
    • Draw any Maksed Overlays
    • Draw any Opaque Overlays
    • Draw any play field rows

NOTES

  • The dirty tile list has a fast test to see if a tile has already been marked as dirty it is not added twice
  • The tile renderer is where data from the sprite plane is combined with tile data to show the sprites on-screen.
  • Typically, there will not be Overlays defined and the last step of the renderer is just a single render of all playfield lines at once.