Difference between revisions of "Source Code Reference"

From FreeSpace Wiki
Jump to: navigation, search
Line 7: Line 7:
  
 
The root also contains the actual Freespace2 code, in the code/ directory. The Freespace2 source code consists in several components, each of which is kept in a separate subdirectory. These components are listed below.
 
The root also contains the actual Freespace2 code, in the code/ directory. The Freespace2 source code consists in several components, each of which is kept in a separate subdirectory. These components are listed below.
 +
 +
== Code organization ==
  
 
=== Alphabetical view ===
 
=== Alphabetical view ===
Line 177: Line 179:
 
** variables/
 
** variables/
  
==Category Browser==
+
=== Category Browser ===
 
The subdirectories above are also categorised by function. See the Category:Source Code to browse this way.
 
The subdirectories above are also categorised by function. See the Category:Source Code to browse this way.
  
 
[[Category:Source Code]]
 
[[Category:Source Code]]

Revision as of 20:18, 26 June 2007

The root directory contains the following external libraries (See msdn.microsoft.com for discussion of the DirectX libraries; for the other libraries, look in the README files for more info):

  • lua: LUA Scripting language
  • libjpeg: Jpeg library
  • oggvorbis: Ogg Vorbis sound library
  • dx8sdk: DirectX 8 SDK
  • dx9sdk: DirectX 9 SDK

The root also contains the actual Freespace2 code, in the code/ directory. The Freespace2 source code consists in several components, each of which is kept in a separate subdirectory. These components are listed below.

Code organization

Alphabetical view

  • ai (Computer AI)
  • anim (Displaying .ani animated bitmaps)
  • asteroid (Handle asteroids - movement, collisions, creating smaller asteriods when larger ones are blown up etc.)
  • autopilot (Handles autopilot control - where if there are no enemies, travelling a long distance etc. control is temporarily switched to the computer)
  • bmpman (Manage 2d graphics files, such as .bmp, .tga, .jpg etc.)
  • camera (???)
  • cfile (File/directory management routines including .VP file handling that are OS independent eg. handles differences between Linux & Windows)
  • cmdline (Handles command line switches, such as -mipmap etc.)
  • cmeasure (Handles countermeasures - flares that the player & AI can drop to disrupt missiles)
  • controlconfig (Configures keyboard/mouse/joystick controls)
  • cutscene (Handles cutscene viewing)
  • ddsutils (Handles compressed textures for 3d graphics cards that support it)
  • debris (Creates & handles flying debris from exploding ships)
  • debugconsole (Handles debugging console and file)
  • decals (Adds support for painting decals - small 2d textures - onto ships etc.)
  • demo (Allows you to save & playback games to show as demos)
  • directx (Specific includes for the Microsoft DirectX library - Windows only)
  • exceptionhandler (Deals with crashes, saving stack trace, system info etc.)
  • fireball (Displays & handles fireballs and warping effects)
  • freespace2 (Main code - handles engine initialisation, loading resources, plus windows resources like icons & dialog boxes)
  • fs2open_pxo (Network code)
  • gamehelp (Displays context sensitive help text)
  • gamesequence (Handles progression of events during a campaign, such as entering a mission, showing credits etc.)
  • gamesnd (Handles sounds & music)
  • globalincs (Basic global constants & definitions, eg. version, colours)
  • graphics (Low-level wrapper for all 2d & 3d graphics that handles different display engines (DirectX, OpenGL etc)
  • hud (Handles the HUD - all the 2d cockpit graphics that the player can see eg. radar, ammo, escort list, sqaud etc)
  • iff_defs (Handles traitor ships???)
  • io (Handles IO devices, such as keyboard, mouse & joystick)
  • irc (Adds support for an IRC chat client)
  • jpgutils (Opens, reads JPG files)
  • jumpnode (Displays & handles jump nodes)
  • lab (???)
  • lighting (Handles light sources, and their effect on ships)
  • localization (Handles a global string table for translating all written text into foreign languages)
  • math (Library of math routines for handling vectors, splines etc)
  • menuui (Handles all the misc user interface, such as the main menu, tech room, campaign list etc)
  • mission (Handles general mission actions eg. briefing, goals, training info, in-mission messages etc)
  • missionui (Handles UI for general mission actions)
  • mm (Headers for older MS Multimedia library)
  • model (Displays and handles ship models eg. reading files, collission detection etc)
  • nebula (Displays and handles nebulae)
  • network (All multi-player code, eg. UI, network traffic)
  • object (High-level code to handle all objects eg. ships, weapons, debris, asteroids, waypoints, fireballs, shockwaves)
  • observer (???)
  • osapi (Wraps low-level Operating System calls, for different OS, eg. multi-threads, windows event loops, main app window)
  • palman (Handles bitmap palettes - different colour maps for the same 2d bitmap)
  • parse (Handles scripting files, eg. python, LUA etc)
  • particle (Displays and handles particles, such as smoke, fire)
  • pcxutils (Handles 2d .pcx graphics files)
  • physics (Handles realistic physical behaviour of objects, such as ship acceleration/deceleration, rotation etc.)
  • playerman (Handles pilot files & player ship movement)
  • popup (Displays & handles 2d pop-up windows, eg. when the player dies)
  • radar (Displays & handles the radar)
  • render (Low-level 3d rendering code for some primitives)
  • ship (Displays & handles all ship code, eg. shields, afterburner)
  • sound (Low-level sound, speach & music routines)
  • species_defs (Reads species_defs.tbl to handle different behaviour for different species)
  • starfield (Displays & handles background images such as starfields, nebulae etc)
  • stats (Displays & handles player statistics, medals etc)
  • tgautils (Handles .tga 2d graphics files)
  • ui (Low-level user inteface routines eg. buttons, scrollbars)
  • vcodec (Handles player voice streaming for multiplayer ???)
  • weapon (Displays & handles everything to do with weapons)
  • windows_stub (Low-level windows functions that are needed for Unix)

There are also some directories that are only used for generating tools (not part of the main fs2 executable):

  • cfilearchiver (Creates .VP file archives)
  • cfileextractor (Extracts .VP file archives)
  • cryptstring (Creates encrypted strings)
  • fred2 (The FReespace EDitor)
  • inetfile (FTP & HTTP network handlers)
  • scramble (Utility to scramble file tables for the Demo version)
  • variables (???)
  • wxfred2 (Cross-platform version of FRED2)

Layer view

  • Infrastructure
    • System
      • cfile/
      • exceptionhandler/
      • irc/
      • localization/
      • osapi/
    • Math
      • math/
    • Sound
      • sound/
      • vcodec/
    • Windows
      • ui/
      • windows_stub/
    • 2D graphics
      • anim/
      • bmpman/
      • ddsutils/
      • tgautils/
      • jpgutils/
      • pcxutils/
      • palman/
    • 3D graphics
      • decals/
      • mm/
      • directx/
      • graphics/
      • camera/
      • render/
    • User Input
      • controlconfig/
      • io/
  • Freespace2
    • Common
      • globalincs/
      • cutscene/
      • cmdline/
      • debugconsole/
    • In Space
      • ai/
      • asteroid/
      • autopilot/
      • cmeasure/
      • debris/
      • demo/
      • fireball/
      • gamehelp/
      • gamesequence/
      • gamesnd/
      • hud/
      • iff_defs/
      • jumpnode/
      • lighting/
      • nebula/
      • object/
      • observer/
      • model/
      • network/
      • particle/
      • parse/
      • popup/
      • physics/
      • radar/
      • ship/
      • species_defs/
      • starfield/
      • weapon/
    • In Base
      • stats/
      • menuui/
      • mission/
      • missionui/
    • Engine
      • fs2open_pxo/
      • freespace2/
      • playerman/
  • FRED
    • fred2/
    • wxfred2/
  • Tools
    • cfilearchiver/
    • cfileextractor/
    • cryptstring/
    • lab/
    • scramble/
    • inetfile/
    • variables/

Category Browser

The subdirectories above are also categorised by function. See the Category:Source Code to browse this way.