00001 00005 // /** 00006 // *@defgroup commonsh commons.h 00007 // *defines of all needed macros for the program, this module is global and is included in all other modules 00008 // *@{ 00009 // */ 00010 00011 /*----------------------------------------------------------------------------------------------------------*/ 00012 00013 // Main stucture containing the core data needed to run the game 00014 typedef struct gdata { 00015 ALLEGRO_DISPLAY *display; // Holds the handle to the Allegro canvas 00016 ALLEGRO_EVENT event; // Contains the data on triggered events 00017 ALLEGRO_EVENT_QUEUE *queue; // Holds a list of events to be processed 00018 ALLEGRO_EVENT event2; // Contains the data on triggered events 00019 ALLEGRO_EVENT_QUEUE *queue2; // Holds a list of events to be processed 00020 ALLEGRO_TIMER *timer; // Contains the timer struct, for animation 00021 ALLEGRO_FONT *font; // Contains a font 00022 ALLEGRO_FONT *b_font; // Contains the buttons's font 00023 ALLEGRO_COLOR background_color; // The current background color 00024 ALLEGRO_COLOR text_color; // The current text color 00025 ALLEGRO_BITMAP *icon; // Holds the application icon image 00026 ALLEGRO_BITMAP *cursor; // Image of custom mouse cursor 00027 _Bool exit; // Determines if the game should exit 00028 _Bool gamestarted; // Determines when the game should start 00029 _Bool options; // Set to true when option button is clicked 00030 _Bool highscores; // Set to true when highscore buttion is clicked 00031 _Bool howtoplay; // Set to true when howtoplay button is clicked 00032 _Bool paused; // Set to true when pause button is clicked 00033 } GDATA, *GDATAPTR; 00034 00035 /*----------------------------------------------------------------------------------------------------------*/ 00036 00045 GDATAPTR get_game_data(void); 00046 00047 /*----------------------------------------------------------------------------------------------------------*/ 00048 00049 void cleanup(GDATAPTR game); 00050 00051 /*----------------------------------------------------------------------------------------------------------*/ 00052 00053 // Now everyone understands!!! 00054 typedef char* String; 00055 00056 /*----------------------------------------------------------------------------------------------------------*/ 00057 00058 #define res_width 800 00059 #define res_height 600 00060 00061 #define _I(x) (int*)x 00062 #define _B(x) (double*)x 00063 #define _C(x) (char*)x 00064 #define _D(x) (double*)x 00065 #define __I(x) *(int*)x 00066 #define __B(x) *(_Bool*)x 00067 #define __C(x) *(char*)x 00068 #define __D(x) *(double*)x 00069 00070 /*----------------------------------------------------------------------------------------------------------*/ 00071 00072 // /** 00073 // *@} 00074 // */