|
|
# Main loop
|
|
|
Calls:
|
|
|
- TryRunTics
|
|
|
- COM_BufTicker
|
|
|
- D_MapChange
|
|
|
- G_Ticker
|
|
|
- G_CopyTiccmd
|
|
|
- P_Ticker
|
|
|
- P_RunThinkers (also called twice in P_LoadLevel by P_PreTicker)
|
|
|
- various other tickers
|
|
|
- D_Display
|
|
|
|
|
|
Main loop consists of parts:
|
|
|
- Input polling is special: it is part of NetUpdate, which has calls scattered around the code to improve responsiveness when the game is running slowly.
|
|
|
- Game logic: TryRunTics
|
|
|
- If other code (like rendering) has taken too long, multiple tics can be run to compensate and keep the speed of the game consistent.
|
|
|
- Graphics: D_Display
|
|
|
- Has special case for frozen netplay, which allows for moving the camera in that situation too
|
|
|
- Screenshot and movie mode handling happens after drawing, based on flags set somewhere earlier
|
|
|
- Sounds: S_UpdateSounds
|
|
|
- LUA GC: LUA_Step
|
|
|
|
|
|
# TryRunTics
|
|
|
Calls:
|
|
|
- COM_BufTicker
|
|
|
- pending console command execution
|
|
|
- D_MapChange
|
|
|
- NetUpdate
|
|
|
- GetPackets
|
|
|
- G_Ticker
|
|
|
- ExtraDataTicker
|
|
|
- netxcmd stuff
|
|
|
|
|
|
# G_Ticker
|
|
|
Calls:
|
|
|
- G_DoReborn (respawn)
|
|
|
- tickers for various game states (in level, intermission, cutscene etc.)
|
|
|
- in level:
|
|
|
- P_Ticker
|
|
|
- ST_Ticker
|
|
|
- title card logic
|
|
|
- F_TextPromptTicker
|
|
|
- AM_Ticker
|
|
|
- automap logic
|
|
|
- HU_Ticker
|
|
|
- hud logic (not much)
|
|
|
|
|
|
# NetUpdate
|
|
|
Calls:
|
|
|
- Local_Maketic
|
|
|
- I_OsPolling
|
|
|
- D_ProcessEvents
|
|
|
- responders
|
|
|
- G_BuildTiccmd
|
|
|
- LUAh_PlayerCmd
|
|
|
- LUAh_ViewpointSwitch (reset back to self when moving)
|
|
|
- GetPackets
|
|
|
- CL_SendClientCmd
|
|
|
- other network stuff
|
|
|
- M_Ticker
|
|
|
- CON_Ticker
|
|
|
|
|
|
NetUpdate:
|
|
|
- when game is running fast enough, it will get run inside TryRunTics?
|
|
|
- when game is running slowly, it will also get run in various other places scattered in the code
|
|
|
|
|
|
# P_Ticker
|
|
|
- Handles game world.
|
|
|
- Runs player thinking.
|
|
|
- Runs all thinkers.
|
|
|
- Code for various other fixed game logic parts.
|
|
|
- Lua ThinkFrame.
|
|
|
|
|
|
# P_RunThinkers
|
|
|
- Runs functions specified in the thinkers.
|
|
|
- Multiple thinker lists for separate purposes.
|
|
|
- polyobjects
|
|
|
- main
|
|
|
- things that move or do stuff but are not mobjs or polyobjects
|
|
|
- mobjs
|
|
|
- P_MobjThinker
|
|
|
- dynamic slopes
|
|
|
- precipitation
|
|
|
- most precip logic is moved to rendering code with culling, but the current implementation still relies on some code running for every precip thinker
|
|
|
|
|
|
# P_MobjThinker
|
|
|
- Thinker function for all mobjs. Run for every mobj by P_RunThinkers, except for those with nothink.
|
|
|
- Various checks and switch statements for the different mobj types in the game.
|
|
|
- Mobj states and actions.
|
|
|
- Movement physics.
|
|
|
- XY movement
|
|
|
- Z movement
|
|
|
- Scenery gets a separate similar but somewhat simpler code path. |
|
|
\ No newline at end of file |