The document you read now describes the design of OpenMortal. This page
serves as a starting point. The documentation is generated with doxygen
(http://doxygen.org).
OpenMortal consists of two main parts: the \b frontend and the \b backend.
\li The frontend is a C++ program, responsible for multimedia
(sounds, music, graphics) and general interaction with the players
(menus, keyboard input), and the demo and intro screens.
\li The backend is written in Perl, and is incorporated into the C++
program with Perl embedding.
\section s1 1. Modules
The classes of OpenMortal are organized into the following groups (see Modules above).
\li \ref Media - OpenMortal uses \b SDL (http://libsdl.org) for hardware
access such as screen drawing, music, sound effect and keyboard input. For
information and documentation of SDL, SDL_image, SDL_ttf and SDL_mixer,
please look at the SDL homepage.
\li \ref PlayerSelect
\li \ref Network
\li \ref Demo
\li \ref GameLogic
\section s2 2. Main Functions
These global functions implement important parts of the program. They serve
as entry points into functional parts.
\li DoMenu() - Displays and runs the menu over the current screen
\li GameOver() - Displays the "Final Judgeent" screen
\li DoDemos() - Runs the demos in an endless loop until a game is started or the program ends.
\li DoGame() - Runs the game.
\li DoOnlineChat() - Connects to and runs the MortalNet.
\li CPlayerSelect::DoPlayerSelect() - Runs the player selection screen.
\section s3 3. Definitions
Here are the definitions of terms used in this documentation.
<dl>
<dt>\b Player <dd>
Player refers to one of the two persons playing the game. A player chooses a fighter. The two players are referred to as "Player 1" and "Player 2", even though the C++ and perl code count arrays from 0.
<dt>\b Fighter <dd>
Fighter is one of the many available characters. Usually there are only two fighters loaded at any time. Fighters are static: their properties never change. Maybe Fighter should be renamed to Character?
<dt>\b Game <dd>
One game is the part of the program in which the players actually compete. The game consists of a number of rounds. The player selection, and gameover screen are not part of this definition.
<dt>\b Round <dd>
One round starts with both players at full health, and ends either with a timeout or with a ko.
<dt>\b Doodad <dd>
A graphical element on the game screen that is not the background or the characters. E.g. the "3x combo" text or a thrown projectile are doodads.
<dt>\b Tint <dd>
A tint is a methodical change in a palette. There are many ways to tint (e.g. grayscaling, darkening, green chroma, etc). Usually when two players choose the same fighter, the fighter of player 2 is tinted.
<dt>\b Scene <dd>
The description of a frozen moment in the course of a game. The Backend is responsible for calculating each consecutive scene. The number of scenes calculated per second is constant (except for the "hurry up mode", or if the computer is too slow).
<dt>\b FPS <dd>
Frames Per Second. The FPS indicator on the screen during a game indicates the number of scenes drawn, not the number of scenes calculated by the backend.
</dl>
\section s4 4. C++ Coding conventions
Historically two different coding conventions were mixed in OpenMortal.
Hopefully most of the old conventions are eliminated by now.
Here I will describe the new conventions:
\li <B> Class names: </B> CMixedCaps.
\li <B> Struct names: </B> SMixedCaps.
\li <B> Typedef names: </B> CSomeTypedef (There's some traces of the old TSomeTypedef