2012-02-16 15:40:58 +01:00
|
|
|
#ifndef MAIN_H
|
|
|
|
#define MAIN_H
|
|
|
|
|
|
|
|
#include <allegro5/allegro.h>
|
|
|
|
#include <allegro5/allegro_audio.h>
|
|
|
|
#include <allegro5/allegro_acodec.h>
|
|
|
|
#include <allegro5/allegro_image.h>
|
|
|
|
#include <allegro5/allegro_font.h>
|
|
|
|
#include <allegro5/allegro_ttf.h>
|
|
|
|
|
|
|
|
enum gamestate_enum {
|
|
|
|
GAMESTATE_LOADING,
|
2012-02-17 00:19:21 +01:00
|
|
|
GAMESTATE_MENU,
|
|
|
|
GAMESTATE_ABOUT,
|
2012-02-18 05:53:39 +01:00
|
|
|
GAMESTATE_INTRO,
|
2012-02-21 23:33:02 +01:00
|
|
|
GAMESTATE_MAP,
|
|
|
|
GAMESTATE_LEVEL
|
2012-02-16 15:40:58 +01:00
|
|
|
};
|
|
|
|
|
2012-02-22 12:43:14 +01:00
|
|
|
struct Level {
|
|
|
|
ALLEGRO_BITMAP *fade_bitmap, *image;
|
|
|
|
ALLEGRO_SAMPLE *sample;
|
|
|
|
int current_level;
|
|
|
|
};
|
|
|
|
|
2012-02-16 15:40:58 +01:00
|
|
|
struct Menu {
|
|
|
|
ALLEGRO_BITMAP *menu_bitmap, *menu_fade_bitmap, *image;
|
2012-02-16 23:04:17 +01:00
|
|
|
ALLEGRO_BITMAP *cloud_bitmap, *cloud, *cloud2_bitmap, *cloud2, *pie, *pie_bitmap;
|
2012-02-16 22:11:34 +01:00
|
|
|
ALLEGRO_BITMAP *pinkcloud_bitmap, *pinkcloud, *rain;
|
2012-02-16 17:05:16 +01:00
|
|
|
ALLEGRO_BITMAP *mountain_bitmap, *mountain;
|
2012-02-16 17:51:52 +01:00
|
|
|
float cloud_position, cloud2_position;
|
2012-02-16 17:05:16 +01:00
|
|
|
int mountain_position;
|
2012-02-19 20:18:28 +01:00
|
|
|
ALLEGRO_SAMPLE *sample, *rain_sample, *click_sample;
|
2012-02-16 23:36:25 +01:00
|
|
|
ALLEGRO_FONT *font_title, *font_subtitle, *font, *font_selected;
|
|
|
|
int selected;
|
2012-02-17 00:06:01 +01:00
|
|
|
bool options;
|
2012-02-16 15:40:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Loading {
|
|
|
|
ALLEGRO_BITMAP *loading_bitmap, *image;
|
|
|
|
};
|
|
|
|
|
2012-02-18 06:26:58 +01:00
|
|
|
struct About {
|
2012-02-22 14:55:21 +01:00
|
|
|
ALLEGRO_BITMAP *fade_bitmap, *image, *text_bitmap, *letter;
|
2012-02-19 20:18:28 +01:00
|
|
|
ALLEGRO_SAMPLE *sample;
|
2012-02-22 13:38:56 +01:00
|
|
|
ALLEGRO_FONT *font;
|
|
|
|
float x;
|
2012-02-18 06:26:58 +01:00
|
|
|
};
|
|
|
|
|
2012-02-18 18:49:35 +01:00
|
|
|
struct Map {
|
2012-02-21 23:33:02 +01:00
|
|
|
ALLEGRO_BITMAP *map, *background, *map_bg, *highlight, *arrow;
|
2012-02-18 18:49:35 +01:00
|
|
|
int selected, available;
|
2012-02-21 23:33:02 +01:00
|
|
|
float arrowpos;
|
|
|
|
ALLEGRO_SAMPLE *sample, *click_sample;
|
2012-02-18 18:49:35 +01:00
|
|
|
};
|
|
|
|
|
2012-02-18 04:14:35 +01:00
|
|
|
struct Intro {
|
|
|
|
int position;
|
|
|
|
int page;
|
|
|
|
bool in_animation;
|
|
|
|
ALLEGRO_BITMAP *table, *table_bitmap;
|
2012-02-18 05:53:39 +01:00
|
|
|
ALLEGRO_FONT *font;
|
2012-02-19 20:18:28 +01:00
|
|
|
ALLEGRO_SAMPLE *sample;
|
2012-02-18 04:14:35 +01:00
|
|
|
};
|
|
|
|
|
2012-02-16 15:40:58 +01:00
|
|
|
struct Game {
|
|
|
|
ALLEGRO_DISPLAY *display;
|
2012-02-17 13:25:06 +01:00
|
|
|
ALLEGRO_FONT *font, *font_console;
|
2012-02-16 15:40:58 +01:00
|
|
|
enum gamestate_enum gamestate;
|
|
|
|
enum gamestate_enum loadstate;
|
|
|
|
ALLEGRO_EVENT_QUEUE *event_queue;
|
|
|
|
ALLEGRO_TIMER *timer;
|
2012-02-17 13:25:06 +01:00
|
|
|
ALLEGRO_BITMAP *console;
|
2012-02-17 13:30:03 +01:00
|
|
|
bool showconsole;
|
2012-02-16 15:40:58 +01:00
|
|
|
struct Menu menu;
|
|
|
|
struct Loading loading;
|
2012-02-18 04:14:35 +01:00
|
|
|
struct Intro intro;
|
2012-02-18 06:26:58 +01:00
|
|
|
struct About about;
|
2012-02-18 18:49:35 +01:00
|
|
|
struct Map map;
|
2012-02-22 12:43:14 +01:00
|
|
|
struct Level level;
|
2012-02-16 15:40:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
void PreloadGameState(struct Game *game);
|
|
|
|
void UnloadGameState(struct Game *game);
|
|
|
|
void LoadGameState(struct Game *game);
|
2012-02-19 22:54:33 +01:00
|
|
|
void PrintConsole(struct Game *game, char* format, ...);
|
2012-02-17 13:25:06 +01:00
|
|
|
void DrawConsole(struct Game *game);
|
2012-02-16 15:40:58 +01:00
|
|
|
|
|
|
|
#endif
|