Monday, July 21, 2008

Total Startup Change

MHQuake startup has been totally changed. This was a sensible thing that had been on my mind for a while, but now it's done. There are 4 phases to startup:

  1. Bringing on all baseline stuff. This mainly involves bringing on all Cvars and Cmds, as well as all items that are always required irrespective of the game selected.
  2. Bring on the filesystem, then exec quake.rc in a special "cvars only" mode ("exec" itself is the only command allowed) - this gets the cvars up to user-defined values, and will be the entry point when starting a new game or changing games.
  3. Bring on everything else: video, sound, input, etc. Deferring these until here will mean that MHQuake will be able to initialize them at user-defined values on first run.
  4. Do another "exec quake.rc", allowing commands as well as cvars this time. This will be a second run of the cvars, but my change-tracking code will prevent things from being shut-down and re-initialized.
I'm pleased as punch with this, as it's going to let me write dedicated startup and shutdown functions for everything, and re-run them as many times as I like with a good measure of total control.

Now I need to go back and rewrite the video startup to support this fully...!

0 comments: