Difference between revisions of "Doom source code"

From DoomWiki.org

[unchecked revision][unchecked revision]
(should refer to people by their surname)
(some extra function prefixes)
Line 24: Line 24:
 
* w_*:  Wad file loading  
 
* w_*:  Wad file loading  
 
* z_*:  Zone memory allocation system
 
* z_*:  Zone memory allocation system
 +
 +
The following are common prefixes for functions although they do not denote a particular subsystem and there are no files with these prefixes:
 +
 +
* a_*:  Action functions invoked in sprite movement frames (these are the functions used in [[Dehacked]] "code pointers")
 +
* pit_*: Callback functions passed to P_BlockThingsIterator (see p_maputl.c)
 +
* t_*: "Thinker" functions set to be called each clock tic for some purpose (eg, moving platforms or flickering lights)
  
 
A detailed list of files and their purposes can be found in [[Doom source code: files]].
 
A detailed list of files and their purposes can be found in [[Doom source code: files]].

Revision as of 06:01, 12 January 2005

The Doom source code was released December 23 1997, initially under a not-for-profit license. Later, permission was granted to re-release the source code under the GNU GPL.

Before release, the source code was apparently tidied up by Bernd Kreimeier; the source release includes a ChangeLog of his contributions. Several documentation files are also included. The original plan for the source code release involved a book Kreimeier was to write on the Doom engine; however, due to Doom's decreasing relevance in the gaming community it was eventually judged not to be a marketable idea and the project was abandoned. The source code was released to the public.

Because of legal issues regarding the sound library used for Doom, the release was of the source code to the Linux port of Doom. Despite this, within several months several ports had been made back to DOS. As a result several source ports exist.

Source code structure

The source code can be divided into sections. Files and functions within the source code have one or two-letter prefixes to denote their subsystem.

  • am_*: Automap code
  • d_*: Initialisation/general code
  • f_*: "Finale" (end of game) and "screen melt" code.
  • g_*: Main game loop/control
  • hu_*: Heads-up display
  • i_*: System-independent code
  • m_*: Miscellaneous (includes the menu)
  • p_*: Game logic/behaviour
  • r_*: Rendering engine
  • s_*: Sound code
  • st_*: Status bar
  • v_*: General graphic rendering
  • wi_*: End-of level "intermission" screen
  • w_*: Wad file loading
  • z_*: Zone memory allocation system

The following are common prefixes for functions although they do not denote a particular subsystem and there are no files with these prefixes:

  • a_*: Action functions invoked in sprite movement frames (these are the functions used in Dehacked "code pointers")
  • pit_*: Callback functions passed to P_BlockThingsIterator (see p_maputl.c)
  • t_*: "Thinker" functions set to be called each clock tic for some purpose (eg, moving platforms or flickering lights)

A detailed list of files and their purposes can be found in Doom source code: files.

External links

Doomworld - 10 years of Doom - some history of the Doom source release.