[Fix] Doxygen comments.

This commit is contained in:
Allanis 2013-06-22 21:48:25 +01:00
parent fc80c1c69f
commit 7fd06bd265

View File

@ -64,12 +64,15 @@ static void data_name(void);
/* Update. */ /* Update. */
static void fps_control(void); static void fps_control(void);
static void update_all(void); static void update_all(void);
static void update_routine(double dt);
static void render_all(void); static void render_all(void);
/* @brief The entry point of Lephisto. */ /** @brief The entry point of Lephisto.
/* @param[in] argc Number of arguments. */ * @param[in] argc Number of arguments.
/* @param[in] argv Array of argc arguments. */ * @param[in] argv Array of argc arguments.
* @return EXIT_SUCCESS on success.
*/
#ifdef WIN32 #ifdef WIN32
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine,
int nCmdShow) { int nCmdShow) {
@ -215,6 +218,9 @@ int main(int argc, char** argv) {
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
/**
* Load all the data, makes main() simpler.
*/
void load_all(void) { void load_all(void) {
/* Ordering of these is very important as they are interdependent. */ /* Ordering of these is very important as they are interdependent. */
commodity_load(); commodity_load();
@ -227,7 +233,9 @@ void load_all(void) {
space_load(); space_load();
} }
/* @brief Unloads all data, simplifies main(). */ /**
* @brief Unloads all data, simplifies main().
*/
void unload_all(void) { void unload_all(void) {
/* Data unloading - order should not matter, but inverse load_all is good. */ /* Data unloading - order should not matter, but inverse load_all is good. */
fleet_free(); fleet_free();
@ -239,7 +247,9 @@ void unload_all(void) {
commodity_free(); commodity_free();
} }
/* @brief Slip main loop from main() for secondary loop hack in toolkit.c. */ /**
* @brief Split main loop from main() for secondary loop hack in toolkit.c.
*/
void main_loop(void) { void main_loop(void) {
sound_update(); /* Do sound stuff. */ sound_update(); /* Do sound stuff. */
@ -260,7 +270,9 @@ void main_loop(void) {
static double fps_dt = 1.; static double fps_dt = 1.;
static double dt = 0.; static double dt = 0.;
/* @brief Controls the FPS. */ /**
* @brief Controls the FPS.
*/
static void fps_control(void) { static void fps_control(void) {
unsigned int t; unsigned int t;
@ -279,37 +291,61 @@ static void fps_control(void) {
} }
} }
/* @brief Updates the game itself (player flying around etc). */ const double fps_min = 1./50.0;
/**
* @brief Updates the game itself (player flying around etc).
*/
static void update_all(void) { static void update_all(void) {
#if 0 double tmpdt;
if(dt > 1./30.) {
/* Slow timers down and re-run calculations. */ if(dt > 1.) { /* Slow timers down and rerun calculations */
pause_delay((unsigned int)dt*1000.); pause_delay((unsigned int)dt*1000.);
return; return;
} }
#endif /* We'll force a minimum of 50 FPS. */
else if(dt > fps_min) {
tmpdt = dt - fps_min;
pause_delay((unsigned int)(tmpdt*1000));
update_routine(fps_min);
/* Run as many cycles of dt=fps_min as needed. */
while(tmpdt > fps_min) {
pause_delay((unsigned int)(-fps_min*1000)); /* Increment counters */
update_routine(fps_min);
tmpdt -= fps_min;
}
}
update_routine(dt);
}
/**
* @brief Actually runs the update.
*/
static void update_routine(double dt) {
space_update(dt); space_update(dt);
weapons_update(dt); weapons_update(dt);
spfx_update(dt); spfx_update(dt);
pilots_update(dt); pilots_update(dt);
} }
/* @brief == Renders the game. =========================== */ /**
/* Blitting order. (layers) */ * @brief Renders the game itself (player flying around etc.
/* */ *
/* BG | Stars and planets. */ * Blitting order. (layers)
/* | Background player stuff (planet targetting) */ *
/* | Background particles. */ * BG | Stars and planets.
/* | Back layer weapons. */ * | Background player stuff (planet targetting)
/* X */ * | Background particles.
/* N | NPC ships. */ * | Back layer weapons.
/* | Front layer weapons. */ * X
/* | Normal layer particles (above ships). */ * N | NPC ships.
/* X */ * | Front layer weapons.
/* FG | Player. */ * | Normal layer particles (above ships).
/* | Foreground particles. */ * X
/* | Text and GUI. */ * FG | Player.
/* ======================================================== */ * | Foreground particles.
* | Text and GUI.
*/
static void render_all(void) { static void render_all(void) {
/* Setup. */ /* Setup. */
spfx_start(dt); spfx_start(dt);
@ -331,7 +367,9 @@ static void render_all(void) {
static double fps = 0.; static double fps = 0.;
static double fps_cur = 0.; static double fps_cur = 0.;
/* @brief Displays FPS on the screen. */ /**
* @brief Displays FPS on the screen.
*/
static void display_fps(const double dt) { static void display_fps(const double dt) {
double x, y; double x, y;
fps_dt += dt; fps_dt += dt;
@ -348,7 +386,9 @@ static void display_fps(const double dt) {
gl_print(NULL, x, y, NULL, "%3.2f", fps); gl_print(NULL, x, y, NULL, "%3.2f", fps);
} }
/* @brief Set the data module's name. */ /*
* @brief Set the data module's name.
*/
static void data_name(void) { static void data_name(void) {
uint32_t bufsize; uint32_t bufsize;
char* buf; char* buf;
@ -401,7 +441,9 @@ static void data_name(void) {
xmlCleanupParser(); xmlCleanupParser();
} }
/* @brief Set the window caption. */ /*
* @brief Set the window caption.
*/
static void window_caption(void) { static void window_caption(void) {
char tmp[DATA_NAME_LEN+10]; char tmp[DATA_NAME_LEN+10];