first batch of documentation

This commit is contained in:
Sebastian Krzyszkowiak 2012-02-28 13:09:12 +01:00
parent 654472f79a
commit cf2f82f5f9
17 changed files with 475 additions and 40 deletions

287
Doxyfile Normal file
View file

@ -0,0 +1,287 @@
# Doxyfile 1.7.6.1
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "Super Derpy: Muffin Attack"
PROJECT_NUMBER =
PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = doc
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING =
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_MEMBERS_CTORS_1ST = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = src
INPUT_ENCODING = UTF-8
FILE_PATTERNS =
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = YES
HTML_ALIGN_MEMBERS = YES
HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
DOCSET_PUBLISHER_NAME = Publisher
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
GENERATE_TREEVIEW = NO
ENUM_VALUES_PER_LINE = 4
USE_INLINE_TREES = NO
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
MATHJAX_EXTENSIONS =
SEARCHENGINE = YES
SERVER_BASED_SEARCH = NO
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4
EXTRA_PACKAGES =
LATEX_HEADER =
LATEX_FOOTER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_NUM_THREADS = 0
DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
INTERACTIVE_SVG = NO
DOT_PATH =
DOTFILE_DIRS =
MSCFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = YES
GENERATE_LEGEND = YES
DOT_CLEANUP = YES

View file

@ -1,3 +1,7 @@
/*! \file about.c
* \brief About screen.
*/
#include <stdio.h>
#include "about.h"

View file

@ -1,3 +1,7 @@
/*! \file about.h
* \brief About screen headers.
*/
#include "main.h"
void About_Draw(struct Game *game);

View file

@ -1,30 +1,32 @@
/*! \file config.c
* \brief Configuration manager code.
*
* Please keep in mind that config file has to be well-formed in order to function properly.
*
* Lines starting with '[' contain section name. No additional whitespace
* between braces and name is allowed.
*
* Section CANNOT be declared multiple times.
*
* Lines starting with '#' are ignored.
* All other lines have to look like this one:
* key=value
*
* All whitespace at beginning, end or around '=' char will belong to key or value.
* If multiple '=' are present, the first one is used to split line into key and value.
*
* Keys CANNOT be repeated in the same section.
*
* Rewriting config file removes all comments from it.
*
* If config file is not following this guides, it may be handled incorrectly.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
/* Configuration manager code.
Please keep in mind that config file has to be well-formed in order to function properly.
Lines starting with '[' contain section name. No additional whitespace
between braces and name is allowed.
Section CANNOT be declared multiple times.
Lines starting with '#' are ignored.
All other lines have to look like this one:
key=value
All whitespace at beginning, end or around '=' char will belong to key or value.
If multiple '=' are present, the first one is used to split line into key and value.
Keys CANNOT be repeated in the same section.
Rewriting config file removes all comments from it.
If config file is not following this guides, it may be handled incorrectly.
*/
struct ConfigOption {
char* name;
char* value;

View file

@ -1,3 +1,7 @@
/*! \file config.h
* \brief Configuration manager headers.
*/
void InitConfig();
char* GetConfigOption(char* section, char* name);
char* GetConfigOptionDefault(char* section, char* name, char* def);

View file

@ -1,3 +1,7 @@
/*! \file intro.c
* \brief Intro view with plot description.
*/
#include <math.h>
#include <stdio.h>
#include "intro.h"

View file

@ -1,3 +1,7 @@
/*! \file intro.h
* \brief Intro view headers.
*/
#include "main.h"
void Intro_Draw(struct Game *game);

View file

@ -1,3 +1,7 @@
/*! \file level.c
* \brief Playable Level code.
*/
#include <stdio.h>
#include "level.h"

View file

@ -1,3 +1,7 @@
/*! \file level.h
* \brief Playable Level headers.
*/
#include "main.h"
void Level_Draw(struct Game *game);

View file

@ -1,3 +1,7 @@
/*! \file loading.c
* \brief Loading screen.
*/
#include "loading.h"
void Loading_Draw(struct Game *game) {

View file

@ -1,3 +1,7 @@
/*! \file loading.h
* \brief Loading screen headers.
*/
#include "main.h"
void Loading_Draw(struct Game *game);

View file

@ -1,3 +1,9 @@
/*! \file main.c
* \brief Main file of SuperDerpy engine.
*
* Contains basic functions shared by all views.
*/
#include <stdio.h>
#include "menu.h"
#include "loading.h"
@ -7,13 +13,27 @@
#include "level.h"
#include "config.h"
/*! \brief Macro for preloading gamestate.
*
* Preloading of state happens when loading screen is displayed.
*/
#define PRELOAD_STATE(state, name) case state:\
PrintConsole(game, "Preload %s...", #state); DrawConsole(game); al_flip_display(); name ## _Preload(game); break;
/*! \brief Macro for unloading gamestate.
*
* Unloading of state happens after it's fadeout.
*/
#define UNLOAD_STATE(state, name) case state:\
PrintConsole(game, "Unload %s...", #state); name ## _Unload(game); break;
/*! \brief Macro for loading gamestate.
*
* Loading of state means setting it as active and running it.
*/
#define LOAD_STATE(state, name) case state:\
PrintConsole(game, "Load %s...", #state); name ## _Load(game); break;
/*! \brief Macro for sending keydown events to gamestate. */
#define KEYDOWN_STATE(state, name) else if (game.gamestate==state) { if (name ## _Keydown(&game, &ev)) break; }
/*! \brief Macro for drawing active gamestate. */
#define DRAW_STATE(state, name) case state:\
name ## _Draw(&game); break;

View file

@ -1,3 +1,9 @@
/*! \file main.h
* \brief Headers of main file of SuperDerpy engine.
*
* Contains basic functions shared by all views.
*/
#ifndef MAIN_H
#define MAIN_H
@ -8,6 +14,7 @@
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>
/*! \brief Enum of all available gamestates. */
enum gamestate_enum {
GAMESTATE_LOADING,
GAMESTATE_MENU,
@ -17,63 +24,110 @@ enum gamestate_enum {
GAMESTATE_LEVEL
};
/*! \brief Resources used by Level state. */
struct Level {
ALLEGRO_BITMAP *fade_bitmap, *image, *derpy_walkcycle, *derpy, *derpytmp;
ALLEGRO_BITMAP *fade_bitmap;
ALLEGRO_BITMAP *image;
ALLEGRO_BITMAP *derpy_walkcycle;
ALLEGRO_BITMAP *derpy;
ALLEGRO_BITMAP *derpytmp;
ALLEGRO_SAMPLE *sample;
int current_level, derpy_frame, derpy_frame_tmp;
int current_level;
int derpy_frame;
int derpy_frame_tmp;
double derpy_pos;
};
/*! \brief Resources used by Menu state. */
struct Menu {
ALLEGRO_BITMAP *menu_bitmap, *menu_fade_bitmap, *image;
ALLEGRO_BITMAP *cloud_bitmap, *cloud, *cloud2_bitmap, *cloud2, *pie, *pie_bitmap;
ALLEGRO_BITMAP *pinkcloud_bitmap, *pinkcloud, *rain;
ALLEGRO_BITMAP *mountain_bitmap, *mountain;
float cloud_position, cloud2_position;
ALLEGRO_BITMAP *menu_bitmap;
ALLEGRO_BITMAP *menu_fade_bitmap;
ALLEGRO_BITMAP *image;
ALLEGRO_BITMAP *cloud_bitmap;
ALLEGRO_BITMAP *cloud;
ALLEGRO_BITMAP *cloud2_bitmap;
ALLEGRO_BITMAP *cloud2;
ALLEGRO_BITMAP *pie;
ALLEGRO_BITMAP *pie_bitmap;
ALLEGRO_BITMAP *pinkcloud_bitmap;
ALLEGRO_BITMAP *pinkcloud;
ALLEGRO_BITMAP *rain;
ALLEGRO_BITMAP *mountain_bitmap;
ALLEGRO_BITMAP *mountain;
float cloud_position;
float cloud2_position;
int mountain_position;
ALLEGRO_SAMPLE *sample, *rain_sample, *click_sample;
ALLEGRO_FONT *font_title, *font_subtitle, *font, *font_selected;
ALLEGRO_SAMPLE *sample;
ALLEGRO_SAMPLE *rain_sample;
ALLEGRO_SAMPLE *click_sample;
ALLEGRO_FONT *font_title;
ALLEGRO_FONT *font_subtitle;
ALLEGRO_FONT *font;
ALLEGRO_FONT *font_selected;
int selected;
bool options;
};
/*! \brief Resources used by Loading state. */
struct Loading {
ALLEGRO_BITMAP *loading_bitmap, *image;
ALLEGRO_BITMAP *loading_bitmap;
ALLEGRO_BITMAP *image;
};
/*! \brief Resources used by About state. */
struct About {
ALLEGRO_BITMAP *fade_bitmap, *image, *text_bitmap, *letter;
ALLEGRO_BITMAP *fade_bitmap;
ALLEGRO_BITMAP *image;
ALLEGRO_BITMAP *text_bitmap;
ALLEGRO_BITMAP *letter;
ALLEGRO_SAMPLE *sample;
ALLEGRO_FONT *font;
float x;
};
/*! \brief Resources used by Map state. */
struct Map {
ALLEGRO_BITMAP *map, *background, *map_bg, *highlight, *arrow;
int selected, available;
ALLEGRO_BITMAP *map;
ALLEGRO_BITMAP *background;
ALLEGRO_BITMAP *map_bg;
ALLEGRO_BITMAP *highlight;
ALLEGRO_BITMAP *arrow;
int selected;
int available;
float arrowpos;
ALLEGRO_SAMPLE *sample, *click_sample;
ALLEGRO_SAMPLE *sample;
ALLEGRO_SAMPLE *click_sample;
};
/*! \brief Resources used by Intro state. */
struct Intro {
int position;
int page;
bool in_animation;
ALLEGRO_BITMAP *table, *table_bitmap;
ALLEGRO_BITMAP *table;
ALLEGRO_BITMAP *table_bitmap;
ALLEGRO_FONT *font;
ALLEGRO_SAMPLE *sample;
};
/*! \brief Resources used by Game state. */
struct Game {
ALLEGRO_DISPLAY *display;
ALLEGRO_FONT *font, *font_console;
ALLEGRO_FONT *font;
ALLEGRO_FONT *font_console;
enum gamestate_enum gamestate;
enum gamestate_enum loadstate;
ALLEGRO_EVENT_QUEUE *event_queue;
ALLEGRO_TIMER *timer;
ALLEGRO_BITMAP *console;
bool showconsole, fx, music, fullscreen, debug;
int fps, width, height;
bool showconsole;
bool fx;
bool music;
bool fullscreen;
bool debug;
int fps;
int width;
int height;
struct Menu menu;
struct Loading loading;
struct Intro intro;
@ -82,11 +136,31 @@ struct Game {
struct Level level;
};
/*! \brief Draws text with shadow.
*
* Draws given text two times: once with color (0,0,0,128) and 1px off in both x and y axis,
* and second time with actual given color and position.
*/
void al_draw_text_with_shadow(ALLEGRO_FONT *font, ALLEGRO_COLOR color, float x, float y, int flags, char const *text);
/*! \brief Preloads gamestate set in game->loadstate. */
void PreloadGameState(struct Game *game);
/*! \brief Unloads gamestate set in game->gamestate. */
void UnloadGameState(struct Game *game);
/*! \brief Loads gamestate set in game->loadstate. */
void LoadGameState(struct Game *game);
/*! \brief Print some message on game console.
*
* Draws message on console bitmap, so it'll be displayed when calling DrawConsole.
* If game->debug is true, then it also prints given message on stdout.
* It needs to be called in printf style.
*/
void PrintConsole(struct Game *game, char* format, ...);
/*! \brief Draws console bitmap on screen. */
void DrawConsole(struct Game *game);
#endif

View file

@ -1,3 +1,7 @@
/*! \file map.c
* \brief View with Map of levels.
*/
#include <stdio.h>
#include <math.h>
#include "config.h"

View file

@ -1,3 +1,7 @@
/*! \file map.h
* \brief Map view headers.
*/
#include "main.h"
void Map_Draw(struct Game *game);

View file

@ -1,3 +1,7 @@
/*! \file menu.c
* \brief Main Menu view.
*/
#include <stdio.h>
#include <math.h>
#include "config.h"

View file

@ -1,3 +1,7 @@
/*! \file menu.h
* \brief Main Menu view headers.
*/
#include "main.h"
void Menu_Draw(struct Game *game);