moar docs

This commit is contained in:
Sebastian Krzyszkowiak 2012-02-28 23:16:55 +01:00
parent e0e34e71ce
commit 7e4b6e7a14
4 changed files with 28 additions and 15 deletions

4
TODO Normal file
View file

@ -0,0 +1,4 @@
- memory bitmaps for scaling big textures
- FPS independent timings
- moar documentation
- autodetect latencies on drawing when fading in menu

View file

@ -9,7 +9,9 @@
* 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.
@ -27,15 +29,17 @@
#include <string.h>
#include <stdbool.h>
/*! \brief One config option in list of options. */
struct ConfigOption {
char* name;
char* value;
char* section;
struct ConfigOption *next;
char* name; /*!< Name of the config entry. */
char* value; /*!< Value of the config entry. */
char* section; /*!< Section of the config entry (including braces). */
struct ConfigOption *next; /*!< Pointer to next option in list, or NULL if there is no more. */
};
struct ConfigOption *config;
struct ConfigOption *config; /*!< Pointer to first config entry in list. */
/*! \brief Adds new config entry. */
void AppendToConfig(char* section, char* name, char* value) {
struct ConfigOption *new = malloc(sizeof(struct ConfigOption));
new->next = NULL;

View file

@ -2,8 +2,13 @@
* \brief Configuration manager headers.
*/
/*! \brief Reads config from file into memory. */
void InitConfig();
/*! \brief Returns value of requested config entry. */
char* GetConfigOption(char* section, char* name);
/*! \brief Returns value of requested config entry, or def if no such entry exists. */
char* GetConfigOptionDefault(char* section, char* name, char* def);
/*! \brief Sets new value of requested config entry, or created new if no such entry exists. */
void SetConfigOption(char* section, char* name, char* value);
/*! \brief Writes config from memory to file. */
void DeinitConfig();

View file

@ -26,16 +26,16 @@ enum gamestate_enum {
/*! \brief Resources used by Level state. */
struct Level {
ALLEGRO_BITMAP *fade_bitmap;
ALLEGRO_BITMAP *image;
ALLEGRO_BITMAP *derpy_walkcycle;
ALLEGRO_BITMAP *derpy;
ALLEGRO_BITMAP *derpytmp;
ALLEGRO_SAMPLE *sample;
int current_level;
int derpy_frame;
int derpy_frame_tmp;
double derpy_pos;
ALLEGRO_BITMAP *fade_bitmap; /*!< Bitmap used on fade-in and fade-out animations. */
ALLEGRO_BITMAP *image; /*!< Background texture. */
ALLEGRO_BITMAP *derpy_walkcycle; /*!< Derpy walk cycle spritesheet. */
ALLEGRO_BITMAP *derpy; /*!< Derpy sprite. */
ALLEGRO_BITMAP *derpytmp; /*!< Unscaled Derpy sprite. */
ALLEGRO_SAMPLE *sample; /*!< Sample with background music. */
int current_level; /*!< Level number. */
int derpy_frame; /*!< Current frame of Derpy animation. */
int derpy_frame_tmp; /*!< Counter used to slow down Derpy animation. */
double derpy_pos; /*!< Position of Derpy on screen. */
};
/*! \brief Resources used by Menu state. */