mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 19:16:44 +01:00
moar docs
This commit is contained in:
parent
e0e34e71ce
commit
7e4b6e7a14
4 changed files with 28 additions and 15 deletions
4
TODO
Normal file
4
TODO
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
- memory bitmaps for scaling big textures
|
||||||
|
- FPS independent timings
|
||||||
|
- moar documentation
|
||||||
|
- autodetect latencies on drawing when fading in menu
|
14
src/config.c
14
src/config.c
|
@ -9,7 +9,9 @@
|
||||||
* Section CANNOT be declared multiple times.
|
* Section CANNOT be declared multiple times.
|
||||||
*
|
*
|
||||||
* Lines starting with '#' are ignored.
|
* Lines starting with '#' are ignored.
|
||||||
|
*
|
||||||
* All other lines have to look like this one:
|
* All other lines have to look like this one:
|
||||||
|
*
|
||||||
* key=value
|
* key=value
|
||||||
*
|
*
|
||||||
* All whitespace at beginning, end or around '=' char will belong to key or value.
|
* All whitespace at beginning, end or around '=' char will belong to key or value.
|
||||||
|
@ -27,15 +29,17 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
/*! \brief One config option in list of options. */
|
||||||
struct ConfigOption {
|
struct ConfigOption {
|
||||||
char* name;
|
char* name; /*!< Name of the config entry. */
|
||||||
char* value;
|
char* value; /*!< Value of the config entry. */
|
||||||
char* section;
|
char* section; /*!< Section of the config entry (including braces). */
|
||||||
struct ConfigOption *next;
|
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) {
|
void AppendToConfig(char* section, char* name, char* value) {
|
||||||
struct ConfigOption *new = malloc(sizeof(struct ConfigOption));
|
struct ConfigOption *new = malloc(sizeof(struct ConfigOption));
|
||||||
new->next = NULL;
|
new->next = NULL;
|
||||||
|
|
|
@ -2,8 +2,13 @@
|
||||||
* \brief Configuration manager headers.
|
* \brief Configuration manager headers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*! \brief Reads config from file into memory. */
|
||||||
void InitConfig();
|
void InitConfig();
|
||||||
|
/*! \brief Returns value of requested config entry. */
|
||||||
char* GetConfigOption(char* section, char* name);
|
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);
|
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);
|
void SetConfigOption(char* section, char* name, char* value);
|
||||||
|
/*! \brief Writes config from memory to file. */
|
||||||
void DeinitConfig();
|
void DeinitConfig();
|
||||||
|
|
20
src/main.h
20
src/main.h
|
@ -26,16 +26,16 @@ enum gamestate_enum {
|
||||||
|
|
||||||
/*! \brief Resources used by Level state. */
|
/*! \brief Resources used by Level state. */
|
||||||
struct Level {
|
struct Level {
|
||||||
ALLEGRO_BITMAP *fade_bitmap;
|
ALLEGRO_BITMAP *fade_bitmap; /*!< Bitmap used on fade-in and fade-out animations. */
|
||||||
ALLEGRO_BITMAP *image;
|
ALLEGRO_BITMAP *image; /*!< Background texture. */
|
||||||
ALLEGRO_BITMAP *derpy_walkcycle;
|
ALLEGRO_BITMAP *derpy_walkcycle; /*!< Derpy walk cycle spritesheet. */
|
||||||
ALLEGRO_BITMAP *derpy;
|
ALLEGRO_BITMAP *derpy; /*!< Derpy sprite. */
|
||||||
ALLEGRO_BITMAP *derpytmp;
|
ALLEGRO_BITMAP *derpytmp; /*!< Unscaled Derpy sprite. */
|
||||||
ALLEGRO_SAMPLE *sample;
|
ALLEGRO_SAMPLE *sample; /*!< Sample with background music. */
|
||||||
int current_level;
|
int current_level; /*!< Level number. */
|
||||||
int derpy_frame;
|
int derpy_frame; /*!< Current frame of Derpy animation. */
|
||||||
int derpy_frame_tmp;
|
int derpy_frame_tmp; /*!< Counter used to slow down Derpy animation. */
|
||||||
double derpy_pos;
|
double derpy_pos; /*!< Position of Derpy on screen. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! \brief Resources used by Menu state. */
|
/*! \brief Resources used by Menu state. */
|
||||||
|
|
Loading…
Reference in a new issue