Main Page | Alphabetical List | Data Structures | File List | Globals

main.h

Go to the documentation of this file.
00001 /*
00002     main.h - Main code
00003     //template//
00004 */
00005 #ifndef MAIN_H
00006 #define MAIN_H
00007 
00008 #include "config.h"
00009 #include <string.h>
00010 #include "allegro.h"
00011 #include "macros.h"
00012 #include "loads.h"
00013 #include "almp3.h"
00014 #include "loader.h"
00015 
00019 struct
00020 {
00021   struct
00022   {
00023     int port;
00024     int volume;
00025     char *name;
00026   }
00027     output;
00028 }
00029 Options;
00030 
00031 /************************** MP3 ******/
00032 /* Because there's could be only 1 MP3 a time data's are stored in a global var */
00033 /* mp3 == where to load the mp3 file */
00034 /* mp3status == 1 mp3 is open / 0 mp3 is closed, finished */
00035 /* mp3_loop == 1 mp3 have to be looped ; 0 mp3 have not to bee looped */
00036 
00037 typedef struct {
00038   PACKFILE *f;
00039   ALMP3_MP3STREAM *s;
00040 } MP3FILE;
00041 
00042 int mp3status;
00043 int mp3_loop;
00044 MP3FILE *mp3;
00045 
00046 /*************************************************/
00047 
00048 /******************* Necessary for the font loader *********/
00049 FNTInfo* fontInfo;
00050 PALETTE* pal[16];
00051 /******************************************************/
00052 
00053 
00054 // global variables
00055 DATAFILE *creditflic;
00056 DATAFILE *fonts_dat;
00057 FONT *small_font;
00058 MIDI *music;
00059 SAMPLE *rd1;
00060 SAMPLE *rd2;
00061 SAMPLE *rd3;
00062 SAMPLE *fight;
00063 SAMPLE *hit_alwa;
00064 SAMPLE *hit_good;
00065 SAMPLE *wp_alwa;
00066 SAMPLE *wk_alwa;
00067 SAMPLE *sp_alwa;
00068 SAMPLE *sk_alwa;
00069 SAMPLE *hit1;
00070 SAMPLE *hit2;
00071 SAMPLE *block_snd;
00072 SAMPLE *hadoken1;
00073 SAMPLE *hadoken2;
00074 SAMPLE *copter1;
00075 SAMPLE *copter2;
00076 SAMPLE *dragon1;
00077 SAMPLE *dragon2;
00078 SAMPLE *hadokenx1;
00079 SAMPLE *hadokenx2;
00080 SAMPLE *copterx1;
00081 SAMPLE *copterx2;
00082 SAMPLE *dragonx1;
00083 SAMPLE *dragonx2;
00084 SAMPLE *done;
00085 SAMPLE *bing;
00086 SAMPLE *buzz;
00087 SAMPLE *prfct_snd;
00088 SAMPLE *ko_snd;
00089 SAMPLE *to_snd;
00090 SAMPLE *argh_snd;
00091 SAMPLE *female_snd;
00092 BITMAP *virtscreen;             /* virtual screen                   */
00093 BITMAP *zoomscreen;
00094 BITMAP *scanliner;              /* blit screen for scanlines        */
00095 PALLETE Pal;
00096 PALLETE TPal;
00097 BITMAP *Title;
00098 BITMAP *Selecteur1;
00099 BITMAP *Selecteur2;
00100 BITMAP *LBbanner;
00101 BITMAP *LBbanner2;
00102 BITMAP *Bar;
00103 BITMAP *Bar2;
00104 BITMAP *Power;
00105 BITMAP *PBar;
00106 BITMAP *WImpact[ 11 ];
00107 BITMAP *SImpact[ 11 ];
00108 BITMAP *BlockImpact[ 11 ];
00109 BITMAP *B_Temp;
00110 BITMAP *Carton_R1;
00111 BITMAP *Carton_R2;
00112 BITMAP *Carton_R3;
00113 BITMAP *Carton_FT;
00114 BITMAP *Carton_WN;
00115 BITMAP *Carton_KO;
00116 #if TIMEOVER == 1
00117 BITMAP *Carton_TO;
00118 #endif
00119 BITMAP *novic0;
00120 BITMAP *novic1;
00121 BITMAP *avic0;
00122 BITMAP *avic1;
00123 BITMAP *Face1;
00124 BITMAP *Face2;
00125 BITMAP *Icon1;
00126 BITMAP *Icon2;
00127 BITMAP *Lock;
00128 BITMAP *Bkgd;
00129 BITMAP *Frgd;
00130 /* BITMAP *Blood; */
00131 #if TIMEOVER > 0
00132 BITMAP *B_clock[ 11 ];
00133 #endif
00134 #if PERFECT == 1
00135 BITMAP *B_prfct;
00136 #endif 
00137 /******************************************/
00138 struct PLAYER_BMP_STRUCT
00139 {
00140         BITMAP *Static[ 999 ];
00141         BITMAP *Walk[ 999 ];
00142         BITMAP *Single[ 999 ];
00143         BITMAP *Punch[ 999 ];
00144         BITMAP *WPunch[ 999 ];
00145         BITMAP *Kick[ 999 ];
00146         BITMAP *WKick[ 999 ];
00147         BITMAP *Jump[ 999 ];
00148         BITMAP *KO[ 999 ];
00149         BITMAP *Hurt[ 999 ];
00150         BITMAP *GHurt[ 999 ];
00151         BITMAP *AKick[ 999 ];
00152         BITMAP *APunch[ 999 ];
00153         BITMAP *GKick[ 999 ];
00154         BITMAP *GPunch[ 999 ];
00155         BITMAP *FireB[ 999 ];
00156         BITMAP *FBall[ 999 ];
00157         BITMAP *Rush[ 999 ];
00158         BITMAP *SMove[ 999 ];
00159         BITMAP *FireBX[ 999 ];
00160         BITMAP *FBallX[ 999 ];
00161         BITMAP *RushX[ 999 ];
00162         BITMAP *SMoveX[ 999 ];
00163         BITMAP *NMoves[ 999 ][ 999 ];
00164 };
00165 struct MOVE
00166 {
00167         int w;
00168         char nbf, spd;
00169         int defx , defy;
00170 };
00171 struct AMOVE
00172 {
00173         int w;
00174         char nbf, spd;
00175         int defx , defy;
00176         char hit, dmg;
00177         int offx , offy;
00178 };
00179 struct SMOVE
00180 {
00181         int w;
00182         char nbf, spd;
00183         int defx , defy;
00184         char hit, dmg;
00185         int offx , offy;
00186         char flg, rot, pix, end, succ, spec, sflg;
00187         char exec[255] ;
00188         char seq[ 40 ];
00189         char nb;
00190 };
00191 struct PLAYER_DATA_STRUCT
00192 {
00193         char flag;
00194         int height, width;
00195         int limoffx , limoffy;
00196         int limdefx , limdefy;
00197         int wimpact_ct;
00198         int simpact_ct;
00199         int bimpact_ct;
00200         struct MOVE statik;
00201         struct MOVE walk;
00202         struct MOVE crouch;
00203         struct MOVE hurt;
00204         struct MOVE ghurt;
00205         struct MOVE jump;
00206         struct MOVE intro;
00207         struct MOVE outwin;
00208         struct MOVE ko;
00209         struct AMOVE wpunch;
00210         struct AMOVE spunch;
00211         struct AMOVE apunch;
00212         struct AMOVE gpunch;
00213         struct AMOVE wkick;
00214         struct AMOVE skick;
00215         struct AMOVE gkick;
00216         struct AMOVE akick;
00217         struct SMOVE fireb;
00218         struct SMOVE fball;
00219         struct SMOVE rush;
00220         struct SMOVE smove;
00221         struct SMOVE firebx;
00222         struct SMOVE fballx;
00223         struct SMOVE rushx;
00224         struct SMOVE smovex;
00225 };
00226 
00227 struct PLAYER_BMP_STRUCT Player1;
00228 struct PLAYER_BMP_STRUCT Player2;
00229 struct PLAYER_DATA_STRUCT p1;
00230 struct PLAYER_DATA_STRUCT p2;
00231 
00232 char animated;
00233 char foreground;
00234 char bkgd_counter;
00235 char bkgd_delay;
00236 int bkgdlim;
00237 int zoomsup;
00238 int zoomwidth = 320;
00239 unsigned char j;
00240 char gmode , diff;
00241 // story variables
00242 char story;
00243 int sel1, sel2;
00244 // string and key variables
00245 char charname [ 1000 ][ 30 ];
00246 char bkgdname [ 1000 ][ 30 ];
00247 char flcname  [ 1000 ][ 30 ];
00248 int nbchar;
00249 int nbbkgd;
00250 int nbflc;
00251 char defeated[ 1000 ];
00252 char present[ 1000 ];
00253 char secretchar[ 1000 ];
00254 int num;
00255 char tilenum[ 4 ];
00256 char charn1[ 40 ];
00257 char charn2[ 40 ];
00258 char bkgdnum[ 4 ];
00259 char file[ 200 ];
00260 char passeur[ 100 ];
00261 char sectn[ 50 ];
00262 char temp_strg[ 2 ];
00263 char last_char;
00264 char get_kstatus ( char strg[] );
00265 char check_kstatus1 ( char ctrl_key );
00266 char check_kstatus2 ( char ctrl_key );
00267 char last_status1;
00268 char last_status2;
00269 int fball_h1 , fball_h2;
00270 int fballx_h1 , fballx_h2;
00271 char autho_ht1 , autho_ht2;
00272 char wimpact_nbf;
00273 char simpact_nbf;
00274 char bimpact_nbf;
00275 // control keys variables
00276 int p1_up , p2_up;
00277 int p1_down , p2_down;
00278 int p1_left , p2_left;
00279 int p1_right , p2_right;
00280 int p1_wpunch , p2_wpunch;
00281 int p1_spunch , p2_spunch;
00282 int p1_wkick , p2_wkick;
00283 int p1_skick , p2_skick;
00284 // AI variables
00285 int offense , defense;
00286 char easy_def , easy_off;
00287 char medium_def , medium_off;
00288 char hard_def , hard_off;
00289 int ai_walkf , ai_walkb;
00290 int ai_static;
00291 
00292 int mp3_on;
00293 int intro_delay;
00294 int pan = 128;
00295 int pitch = 1000;
00296 int snd_vol , midi_vol;
00297 int start_x , start_y;
00298 //char gfmode;
00299 int gfmode;
00300 int screen_height;
00301 int screen_width;
00302 int screen_depth;
00303 int stretch;
00304 char autorise;
00305 void Intro( void );
00306 /* Display: clock, Life bars, Power bars*/
00307 int life1 , life2;
00308 int spower1 , spower2;
00309 char vic_flag;
00310 char vic1 , vic2;
00311 #if TIMEOVER > 0
00312 int t_clock;
00313 #endif
00314 
00315 int clone = 0;
00316 char inverted = 0;
00317 char log_mess[ 80 ];
00318 
00319 char c;
00320 int cx, cy;                         // Current X and Y position in the bkgd + misc
00321 int x, y;                           // Used in for loops  + misc
00322 int fx, fy;
00323 int ok = 1;                         // Loop until ok==0
00324 int s = 2;                          // Scroll speed (2 pixels per frame)
00325 int misc;
00326 //long t1, t2,
00327 long n;                         // For calculating FPS
00328 int flag = 0;                     // sprite cycling flags
00329 int flag2 = 0;
00330 char hflag = 0, hflag2 = 0;
00331 char frameskip = 0;
00332 char skp_flag = 0;
00333 int sens1 = 0;                     // jump flags
00334 int sens2 = 0;
00335 int i;
00336 int g , h , nb;        // Miscellaneous variables
00337 char com_block = 0;
00338 char com_gblock = 0;
00339 char com_walkf = 0;
00340 char com_walkb = 0;
00341 int spr1x = 60 , spr1y = 77;       // Sprites coordinates
00342 int spr2x = 210, spr2y = 77;
00343 char oldsel1 , oldsel2;
00344 char last_sel1 = 1, last_sel2 = 1; // INITIALIZING Selection of chars
00345 char p2_sel;
00346 int angle;
00347 char bgd;
00348 int sel_player1 , sel_player2;
00349 int alt_color , tcolor , bcolor;
00350 int sel_bkgd;
00351 int text_color;
00352 int deb;
00353 // char round;
00354 int actual = 0;                 // actual sprite status
00355 int actual2 = 0;
00356 char ak , ak2 = 0;          // flag air-kick
00357 char apch , apch2 = 0;      // flag air-punch
00358 char limak , limak2 = 1;
00359 signed char limp1 , limp2 ;
00360 char nbpar = 0;
00361 char vsynch = 0;
00362 int delayer = 2;
00363 /* character size info */
00364 int sol1 = 0 , sol2 = 0; // INITIALIZING
00365 int tol1 , tol2;
00366 int jump_how1 , jump_how2;
00367 int hitfram1 = 0, hitfram2 = 0; // INITIALIZING HIT FRAME
00368 char female1 , female2;
00369 // character animation info
00370 int rush_stop1 , rush_stop2;
00371 int smove_stop1 , smove_stop2;
00372 int rushx_stop1 , rushx_stop2;
00373 int smovex_stop1 , smovex_stop2;
00374 char damag1 , damag2;
00375 char fball1 , fball2;
00376 int fb1x = 0 , fb2x = 0; // INITIALIZING FIREBALL X,Y COORDENATES
00377 int fb1y = 0 , fb2y = 0; // INITIALIZING FIREBALL X,Y COORDENATES
00378 int fball_cx1 = 0 , fball_cx2 = 0; // INITIALIZING FIREBALL X,Y COORDENATES
00379 int fball_cy1 = 0 , fball_cy2 = 0; // INITIALIZING FIREBALL X,Y COORDENATES
00380 char fball_flg1 = 0 , fball_flg2 = 0; // INITIALIZING FIREBALL X,Y COORDENATES
00381 char fballx1 , fballx2;
00382 int fbx1x = 0 , fbx2x = 0; // INITIALIZING FIREBALL X,Y COORDENATES
00383 int fbx1y = 0 , fbx2y = 0; // INITIALIZING FIREBALL X,Y COORDENATES
00384 int fballx_cx1 = 0 , fballx_cx2 = 0; // INITIALIZING FIREBALL X,Y COORDENATES
00385 int fballx_cy1 = 0 , fballx_cy2 = 0; // INITIALIZING FIREBALL X,Y COORDENATES
00386 char fballx_flg1 = 0 , fballx_flg2 = 0; // INITIALIZING FIREBALL FLAGS
00387 char accel_flag , gfx_flag;
00388 char snd_flag , midi_flag;
00389 char wind_flag;
00390 char tnt2 = 0;
00391 char open1[ 40 ];
00392 char open2[ 40 ];
00393 char open3[ 40 ];
00394 char open4[ 40 ];
00395 char open5[ 40 ];
00396 char title[ 20 ];
00397 // END OF GLOBAL DEFINITIONS
00398 
00399 // declarações de variaveis para o KOF2003
00400 BITMAP *tface1;                         //p1 face pequena ao lado da barra
00401 BITMAP *tface2;                         //p2 face pequena ao lado da barra
00402 
00403 char file2[200];                        //var para carregar pcx's
00404 char buffer[200];                       //var tb para carregar pcx's
00405 
00406 int opt;                                //int para realizar comparações
00407 
00408 #endif //MAIN_H

Generated on Thu Jan 13 14:13:03 2005 for KOF91 by  doxygen 1.3.9.1