# main.h

## Defines
#define | ALLEGRO_STATICLINK 1
## Functions
int | main (int argc, char **argv)
| The entry point of the game.
_Bool | main_loop (void)
| Everything happens here!
_Bool | data_init (void)
| Initializes the gdata structure.
void | loader (void)

## Detailed Description

The entry point of the program and contains the main_loop function.

## Define Documentation

#define ALLEGRO_STATICLINK 1

Definition at line 68 of file main.h.

## Function Documentation

_Bool data_init | ( | void |  | ) |

Initializes the gdata structure.

Initializes all members of the gdata structure, *data. Specifically, the screen is set, timer started, keyboard and mouse installed, allegro events registered and other important routines are executed.

Returns:
  Returns true if all initializes were executed correctly, otherwise false is returned and program will then exit

Definition at line 188 of file main.c.

void loader | ( | void |  | ) |

Definition at line 438 of file main.c.

int main | ( | int | argc,
|  | char ** | argv |
| ) |  |  |

The entry point of the game.

Initializes all needed assets and transfer control to the main_loop.

Parameters:

  `[in]` | argc | The number of command line arguments passed to the program for processing
  `[in]` | *argv[] | The commands passed to the program, contained in an array of char*'s

Returns:
  Returns 1 and exits if any of the initialization functions fail, otherwise it returns 0 at the end of program execution.

See also:
  gdata
  data_init
  init_core_sprites
  init_buttons
  main_loop

Todo:
  remove init_core_sprites, put instead ini_base_images, instead of initializing sprites at startup, initialize them before the game starts. This way the sprites can be reset to their default x and y coordinates without the need of additional functions. Also, empty sprite list when the game is exited back to the menu.

Definition at line 147 of file main.c.

_Bool main_loop | ( | void |  | ) |

Everything happens here!

The main game loop, all other function are directly or indirectly called from this function. The fucntion does not return until the game quits, i.e. when the user hits the escape key or closes the Allegro window.

Returns:
  Returns true when the game exits.

Note:
  A good place to start when tracing errors!

Definition at line 302 of file main.c.