[Add] I think I've been documenting this thing all day. D:

This commit is contained in:
Allanis 2014-05-23 23:05:30 +01:00
parent 5dc8a8f782
commit 81ae76236c
5 changed files with 584 additions and 211 deletions

View File

@ -13,12 +13,12 @@
/* Global. */ /* Global. */
#include <string.h> #include <string.h>
#if defined(LINUX) && !defined(NODEBUG) #if defined(LINUX) && !defined(DEBUGGING)
#include <signal.h> #include <signal.h>
#include <execinfo.h> #include <execinfo.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#endif /* defined(LINUX) && !defined(NODEBUG) */ #endif /* defined(LINUX) && !defined(DEBUGGING) */
/* Local. */ /* Local. */
#include "lephisto.h" #include "lephisto.h"
@ -96,8 +96,6 @@ void main_loop(void); /* dialogue.c */
/** /**
* @fn int main(int argc, char** argv)
*
* @brief The entry point of Lephisto. * @brief The entry point of Lephisto.
* *
* @param[in] argc Number of arguments. * @param[in] argc Number of arguments.
@ -278,8 +276,6 @@ int main(int argc, char** argv) {
} }
/** /**
* @fn void loadscreen_load(void)
*
* @brief Display a loading screen. * @brief Display a loading screen.
*/ */
void loadscreen_load(void) { void loadscreen_load(void) {
@ -309,8 +305,6 @@ void loadscreen_load(void) {
} }
/** /**
* @fn void loadscreen_render(double done, const char* msg)
*
* @brief Render the load screen with message. * @brief Render the load screen with message.
* @param done Amount done (1. == completed). * @param done Amount done (1. == completed).
* @param msg Loading screen message. * @param msg Loading screen message.
@ -356,8 +350,6 @@ void loadscreen_render(double done, const char* msg) {
} }
/** /**
* @fn static void loadscreen_unload(void)
*
* @brief Frees the loading screen. * @brief Frees the loading screen.
*/ */
static void loadscreen_unload(void) { static void loadscreen_unload(void) {
@ -367,8 +359,6 @@ static void loadscreen_unload(void) {
} }
/** /**
* @fn void load_all(void)
*
* @brief Load all the data, makes main() simpler. * @brief Load all the data, makes main() simpler.
*/ */
#define LOADING_STAGES 9. /**< Amount of loading stages. */ #define LOADING_STAGES 9. /**< Amount of loading stages. */
@ -395,8 +385,6 @@ void load_all(void) {
} }
/** /**
* @fn void unload_all(void)
*
* @brief Unloads all data, simplifies main(). * @brief Unloads all data, simplifies main().
*/ */
void unload_all(void) { void unload_all(void) {
@ -462,8 +450,6 @@ static void fps_control(void) {
static const double fps_min = 1./50.0; static const double fps_min = 1./50.0;
/** /**
* @fn static void update_all(void)
*
* @brief Updates the game itself (player flying around etc). * @brief Updates the game itself (player flying around etc).
*/ */
static void update_all(void) { static void update_all(void) {
@ -492,8 +478,6 @@ static void update_all(void) {
} }
/** /**
* @fn static void update_routine(double dt)
*
* @brief Actually runs the update. * @brief Actually runs the update.
* @param[in] dt Current delta tick. * @param[in] dt Current delta tick.
*/ */
@ -506,8 +490,6 @@ static void update_routine(double dt) {
} }
/** /**
* @fn static void render_all(void)
*
* @brief Renders the game itself (player flying around etc). * @brief Renders the game itself (player flying around etc).
* *
* Blitting order. (layers) * Blitting order. (layers)
@ -579,8 +561,6 @@ static void display_fps(const double dt) {
} }
/** /**
* @fn static void window_caption(void)
*
* @brief Set the window caption. * @brief Set the window caption.
*/ */
static void window_caption(void) { static void window_caption(void) {
@ -593,8 +573,6 @@ static void window_caption(void) {
static char human_version[50]; /**< Stores human readable version string. */ static char human_version[50]; /**< Stores human readable version string. */
/** /**
* @fn char* lephisto_version(void)
*
* @brief Return the version in a human readable string. * @brief Return the version in a human readable string.
* *
* @return The human readable version string. * @return The human readable version string.
@ -607,8 +585,6 @@ char* lephisto_version(void) {
} }
/** /**
* @fn static void print print_SDLversion.
*
* @bief Print the SDL version to console. * @bief Print the SDL version to console.
*/ */
static void print_SDLversion(void) { static void print_SDLversion(void) {
@ -628,7 +604,7 @@ static void print_SDLversion(void) {
WARN("SDL is older than compiled version."); WARN("SDL is older than compiled version.");
} }
#if defined(LINUX) && !defined(NODEBUG) #if defined(LINUX) && !defined(DEBUGGING)
/** /**
* @brief Get the string related to the signal code. * @brief Get the string related to the signal code.
* @param sig Signal to which code belongs. * @param sig Signal to which code belongs.
@ -695,7 +671,7 @@ static void debug_sigHandler(int sig, siginfo_t* info, void* unused) {
* @brief Set up the SignalHandler for Linux. * @brief Set up the SignalHandler for Linux.
*/ */
static void debug_sigInit(void) { static void debug_sigInit(void) {
#if defined(LINUX) && !defined(NODEBUG) #if defined(LINUX) && !defined(DEBUGGING)
struct sigaction sa, so; struct sigaction sa, so;
/* Set up handler. */ /* Set up handler. */
@ -714,6 +690,6 @@ static void debug_sigInit(void) {
sigaction(SIGABRT, &sa, &so); sigaction(SIGABRT, &sa, &so);
if(so.sa_handler == SIG_IGN) if(so.sa_handler == SIG_IGN)
DEBUG("Unable to get set up SIGABRT signal handler."); DEBUG("Unable to get set up SIGABRT signal handler.");
#endif /* #if defined(LINUX) && !defined(NODEBUG) */ #endif /* #if defined(LINUX) && !defined(DEBUGGING) */
} }

View File

@ -5,7 +5,7 @@
#include "lualib.h" #include "lualib.h"
/* Debug stuff. */ /* Debug stuff. */
#ifdef NODEBUG #ifdef DEBUGGING
#ifdef DEBUG_PARANOID #ifdef DEBUG_PARANOID
#define LLUA_DEBUG(str, args...) \ #define LLUA_DEBUG(str, args...) \
(fprintf(stdout, "Lua: "str"\n, ## args), abort()) (fprintf(stdout, "Lua: "str"\n, ## args), abort())
@ -24,11 +24,11 @@
luaL_error(L, "Too few arguments for %s.", __func__); \ luaL_error(L, "Too few arguments for %s.", __func__); \
return 0; \ return 0; \
} }
#else /* NODEBUG. */ #else /* DEBUGGING. */
#define LLUA_DEBUG(str, args...) do {;} while(0) #define LLUA_DEBUG(str, args...) do {;} while(0)
#define LLUA_MIN_ARGS(n) do {;} while(0) #define LLUA_MIN_ARGS(n) do {;} while(0)
#define LLUA_INVALID_PARAMETER() do {;} while(0) #define LLUA_INVALID_PARAMETER() do {;} while(0)
#endif /* NODEBUG. */ #endif /* DEBUGGING. */
/* Comfortability macros. */ /* Comfortability macros. */
#define luaL_dobuffer(L, b, n, s) \ #define luaL_dobuffer(L, b, n, s) \

File diff suppressed because it is too large Load Diff

View File

@ -50,11 +50,6 @@ void window_addImageArray(const unsigned int wid,
glTexture** tex, char** caption, int nelem, /* Elements. */ glTexture** tex, char** caption, int nelem, /* Elements. */
void(*call)(unsigned int, char*)); void(*call)(unsigned int, char*));
void window_addScrollbar(const unsigned int wid,
const int x, const int y, /* Position. */
const int w, const int h, /* Size. */
char* name, double value); /* Value. */
void window_addFader(const unsigned int wid, void window_addFader(const unsigned int wid,
const int x, const int y, /* Position. */ const int x, const int y, /* Position. */
const int w, const int h, /* Size, if w > h fader is horizontal, else vertical. */ const int w, const int h, /* Size, if w > h fader is horizontal, else vertical. */
@ -73,9 +68,7 @@ void window_enableButton(const unsigned int wid, char* name);
/* Image. */ /* Image. */
void window_modifyImage(const unsigned int wid, char* name, glTexture* image); void window_modifyImage(const unsigned int wid, char* name, glTexture* image);
void window_imgColour(const unsigned int wid, char* name, glColour* colour); void window_imgColour(const unsigned int wid, char* name, glColour* colour);
/* Scroll bar. */ /* Fader. */
void window_scrollbarValue(const unsigned int wid,
char* name, double value);
void faderValue(const unsigned int wid, void faderValue(const unsigned int wid,
char* name, double value); char* name, double value);
void faderBounds(const unsigned int wid, void faderBounds(const unsigned int wid,
@ -96,7 +89,6 @@ char* toolkit_getList(const unsigned int wid, char* name);
int toolkit_getListPos(const unsigned int wid, char* name); int toolkit_getListPos(const unsigned int wid, char* name);
glTexture* window_getImage(const unsigned int wid, char* name); glTexture* window_getImage(const unsigned int wid, char* name);
double window_getScrollbarValue(const unsigned int wid, char* name);
double window_getFaderValue(const unsigned wid, char* name); double window_getFaderValue(const unsigned wid, char* name);
/* Destroy window. */ /* Destroy window. */

View File

@ -104,12 +104,10 @@ static void diff_hunkSuccess(UniDiff_t* diff, UniHunk_t* hunk);
static void diff_cleanup(UniDiff_t* diff); static void diff_cleanup(UniDiff_t* diff);
static void diff_cleanupHunk(UniHunk_t* hunk); static void diff_cleanupHunk(UniHunk_t* hunk);
/* Externed. */ /* Externed. */
int diff_save(xmlTextWriterPtr writer); int diff_save(xmlTextWriterPtr writer); /**< Used in save.c */
int diff_load(xmlNodePtr parent); int diff_load(xmlNodePtr parent); /**< Used in save.c */
/** /**
* @fn int diff_isApplied(char* name)
*
* @brief Check if a diff is currently applied. * @brief Check if a diff is currently applied.
* @param name Diff to check. * @param name Diff to check.
* @return 0 if it's not applied, 1 if it is. * @return 0 if it's not applied, 1 if it is.
@ -121,8 +119,6 @@ int diff_isApplied(char* name) {
} }
/** /**
* @fn static UniDiff_t* diff_get(char* name)
*
* @brief Get a diff by name. * @brief Get a diff by name.
* @param name Name of the diff to get. * @param name Name of the diff to get.
* @return The diff if found or NULL if not found. * @return The diff if found or NULL if not found.
@ -136,8 +132,6 @@ static UniDiff_t* diff_get(char* name) {
} }
/** /**
* @fn int diff_apply(char* name)
*
* @brief Applies a diff to the universe. * @brief Applies a diff to the universe.
* @param name Diff to apply. * @param name Diff to apply.
* @return 0 on success. * @return 0 on success.
@ -196,8 +190,6 @@ int diff_apply(char* name) {
} }
/** /**
* @fn static int diff_patch(xmlNodePtr parent)
*
* @brief Actually applies a diff in XML node form. * @brief Actually applies a diff in XML node form.
* @param parent Node containing the diff information. * @param parent Node containing the diff information.
* @return 0 on success. * @return 0 on success.
@ -314,8 +306,6 @@ static int diff_patch(xmlNodePtr parent) {
} }
/** /**
* @fn static int diff_patchHunk(UniHunk_t* hunk)
*
* @brief Applies a hunk and adds it to the diff. * @brief Applies a hunk and adds it to the diff.
* @param diff Diff to which the hunk belongs. * @param diff Diff to which the hunk belongs.
* @param hunk Hunk to apply. * @param hunk Hunk to apply.
@ -345,8 +335,6 @@ static int diff_patchHunk(UniHunk_t* hunk) {
} }
/** /**
* @fn static void diff_hunkFailed(UniDiff_t* diff, UniHunk_t* hunk)
*
* @brief Add a hunk to the failed list. * @brief Add a hunk to the failed list.
* @param diff Diff to add hunk to. * @param diff Diff to add hunk to.
* @param hunk Hunk that failed to apply. * @param hunk Hunk that failed to apply.
@ -364,8 +352,6 @@ static void diff_hunkFailed(UniDiff_t* diff, UniHunk_t* hunk) {
} }
/** /**
* @fn static void diff_hunkSuccess(UniDiff_t* diff, UniHunk_t* hunk)
*
* @brief Add a hunk to the applied list. * @brief Add a hunk to the applied list.
* @param diff Diff to add hunk to. * @param diff Diff to add hunk to.
* @param hunk Hunk that applied correctly. * @param hunk Hunk that applied correctly.
@ -383,8 +369,6 @@ static void diff_hunkSuccess(UniDiff_t* diff, UniHunk_t* hunk) {
} }
/** /**
* @fn void diff_remove(char* name)
*
* @brief Remove a diff from the universe. * @brief Remove a diff from the universe.
* @param name Diff to remove. * @param name Diff to remove.
*/ */
@ -400,7 +384,7 @@ void diff_remove(char* name) {
} }
/** /**
* @fn void diff_clear(void) * @brief Remove all active diffs.
*/ */
void diff_clear(void) { void diff_clear(void) {
while(diff_nstack > 0) { while(diff_nstack > 0) {
@ -409,8 +393,6 @@ void diff_clear(void) {
} }
/** /**
* @fn static UniDiff_t* diff_newDiff(void)
*
* @brief Creates a new UniDiff_t for usage. * @brief Creates a new UniDiff_t for usage.
* @return A newly created UniDiff_t. * @return A newly created UniDiff_t.
*/ */
@ -434,8 +416,6 @@ static UniDiff_t* diff_newDiff(void) {
} }
/** /**
* @fn static int diff_removeDiff(UniDiff_t* diff)
*
* @brief Removes a diff. * @brief Removes a diff.
* @param diff Diff to remove. * @param diff Diff to remove.
* @return 0 on success. * @return 0 on success.
@ -481,8 +461,6 @@ static int diff_removeDiff(UniDiff_t* diff) {
} }
/** /**
* @fn static void diff_cleanup(UniDiff_t* diff)
*
* @brief Clean up a diff. * @brief Clean up a diff.
* @param diff Diff to clean up. * @param diff Diff to clean up.
*/ */
@ -502,8 +480,6 @@ static void diff_cleanup(UniDiff_t* diff) {
} }
/** /**
* @fn static void diff_cleanupHunk(UniHunk_t* hunk)
*
* @brief Clean up a hunk. * @brief Clean up a hunk.
* @param hunk Hunk to clean up. * @param hunk Hunk to clean up.
*/ */
@ -525,8 +501,6 @@ static void diff_cleanupHunk(UniHunk_t* hunk) {
} }
/** /**
* @fn int diff_save(xmlTextWriterPtr writer)
*
* @brief Save the active diffs. * @brief Save the active diffs.
* @param writer XML Writer to use. * @param writer XML Writer to use.
* @return 0 on success. * @return 0 on success.
@ -547,8 +521,6 @@ int diff_save(xmlTextWriterPtr writer) {
} }
/** /**
* @fn int diff_load(xmlNodePtr parent)
*
* @brief Loads the diffs. * @brief Loads the diffs.
* @param parent Parent node containing diffs. * @param parent Parent node containing diffs.
* @return 0 on success. * @return 0 on success.