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

global_add.h

Go to the documentation of this file.
00001 #ifndef GLOBAL_ADD_H
00002 #define GLOBAL_ADD_H
00003 
00004 #include "allegro.h"
00005 #include "loader.h"
00006 
00007 #define MAX_OF_PLAYERS 6
00008 #define ITEM_NUMBER 11 
00009 
00013 int SENSEI_DEBUG_ON; 
00014 
00026 typedef struct input{
00027   /* state def */
00028   /* 
00029      call input->state[x]!=0 to know in witch state is the controller<br>
00030      state[0] = up ; state[1] = down ; state[2] = left ; state[3]=  right<br>
00031      state[4] = a ; state[5] = b ; state[6] = c<br>
00032      state[7] = x ; state[8] = y ; state[9] = z<br>
00033      state[10] = start<br>
00034   */
00035   
00036   int state[11];
00037   /* key def */
00038   int keys[11];
00039   int joybuton[7];
00040   int use_joystick;
00041 
00042   int key_waited;
00043   int buton_waited;
00044   int wait_input;
00045 }input;
00046 
00049 typedef struct music_struct{
00050   int type; // 0 = none ; 1 = midi ; 2 = mp3 ; 3 = cda
00051   int loaded;
00052   int loop;
00053   char * path;
00054 }music_struct;
00055 
00059 typedef struct config{
00060   int Difficulty;
00061   int Life;
00062   int Time;
00063   int Game_speed; 
00064 
00065   int Debug_on; /* 0 or 1 */
00066   int Allow_debug; /* 0 or 1 */
00067   
00068   int Width; /* window/screen width */
00069   int Height; /* window/sceen height */
00070   int Depth;
00071 
00072   int Buffer_w; /* buffer/virutal-screen width */
00073   int Buffer_h; /* buffer/virtual-screen height */
00074   int Fullscreen; /* fullscreen or windowed */
00075   int Doubleres;        /* DoubleResolution mode */
00076   int Stretch; /* Stretch image or not */
00077   
00078   int Sound; /* do you want to install sound or not */
00079   int Midi_driver;
00080   int Digi_driver;
00081   int WavVolume;
00082   int MidiVolume;
00083 }config;
00084 
00088 typedef struct background_elt_struct{
00089   char * elt_name;
00090   int elt_type; // 0 = normal ; 1 = anim , 3 = parallax
00091   int actionno;
00092   int spritenog; // sprite group
00093   int spritenoi; // sprite index
00094   int layerno;
00095   int startx;
00096   int starty;
00097   int deltax;
00098   int deltay;
00099   int trans;
00100   int mask;
00101   int tilex;
00102   int tiley;
00103   int tilespacex;
00104   int tilespacey;
00105   int windowx;
00106   int windowy;
00107   int windoww;
00108   int windowh;
00109   int xposition; //add : current absolute x position, changed by velset or axes in anim 
00110   int yposition; //add : current absolute y position, changed by velset or axes in anim
00111   int adj_xposition; // add : adjusted x position with sprite axis
00112   int adj_yposition; // add : adjusted y position with sprite axis;
00113   int tilew; // add
00114   int tileh; // add
00115   int velocityx;
00116   int velocityy;
00117 }background_elt_struct; 
00118 
00122 typedef struct scene_struct{
00123   char * name;
00124   int starttime;
00125   int currenttime;
00126   int endtime;
00127   char * bgm_path;
00128   int fadeintime;
00129   int fadeouttime;
00130   int layerallx;
00131   int layerally;
00132   background_elt_struct bg_array[10];
00133 }scene_struct;
00134 
00138 typedef struct animation_elt_struct{
00139   int spriteno;
00140   int groupeno;
00141   int x;
00142   int y;
00143   int time;
00144   int flipping; // 0:none 1:H 2:V 3:HV
00145   int trans;
00146   int current_time;
00147 }animation_elt_struct;
00148 
00152 typedef struct action_struct{
00153   int number;
00154   int loop_start;
00155   int anim_time;
00156   int current_element;
00157   int nb_elt;
00158   animation_elt_struct * animation_array;
00159 }action_struct;
00160 
00163 typedef struct player_cns{
00164   int scalex;
00165   int scaley;
00166 }player_cns;
00167 
00172 struct Player_variables{
00173   int loaded; // 0 = no ; 1 = yes
00174   input Player_input;
00175   int computer_input; // Is the player computer or not 
00176   int reversed;
00177   int has_control;
00178   int type; // 0 = no player ; 1 = KOF 91 char ; 2 = Mugen's Char
00179   char * def_path; // Or ini for KOF 91 chars
00180 
00181   SFFEntry * player_sff;
00182   char * name;
00183   char * display_name;
00184   char * author;
00185 
00186   char * cmd_path;
00187   char * cns_path;
00188   char * st_path;
00189   char * stcommon_path;
00190   char * sprite_path;
00191   char * anim_path;
00192   char * sound_path;
00193   char * pal1_path;
00194 
00195   action_struct * action_array;
00196   int action_number; // Size of action_array 
00197 };
00198 typedef struct Player_variables * Player_variables;
00199 
00203 typedef struct background_struct{
00204   SFFEntry * bg_sff;
00205   char * bg_path; // pcx, flc or .def path
00206   char * bg_sff_path;
00207   int bg_sff_path_known;
00208   char * name; //[BGnamedef]
00209   background_elt_struct * bg_elt_array;
00210   action_struct * action_array;
00211   int bg_elt_nb;
00212   int action_nb;
00213   int type; // 0 = none ; 1 = KOF 91 pcx ; 2 = KOF 91 flc ; 3 = Mugen's def
00214   int type_front; //(KOF 91 boolean)
00215   BITMAP * Pcx_back;
00216   BITMAP * Pcx_front;
00217   PALETTE Pal_back;
00218   PALETTE Pal_front;
00219 
00220   int startx;
00221   int starty;
00222 
00223   int screenleft;
00224   int screenright;
00225   
00226   int zoffset;
00227 
00228   int camerax;
00229   int cameray;
00230 
00231   int loaded;
00232 }background_struct;
00233 
00237 typedef struct storyboard_struct{
00238   char * path;
00239   int startscene;
00240   SFFEntry * storyboard_sff;
00241   int nb_scene; // number of scenes in the storyboard
00242   int nb_actions; // number of actions in the storyboard
00243   int current_scene;
00244   scene_struct * scene_array;
00245   action_struct * action_array;
00246   int loaded;
00247   int ended;
00248 }storyboard_struct;
00249 
00253 typedef struct story_struct{
00254   char * Path;
00255   int Story_type; // 0 = none ; 1=flc; 2=*.def
00256   int StoryExist;
00257   int StoryEnded;
00258   int Running;
00259   char * Mp3Path;
00260   int Mp3Exist;
00261   music_struct story_music;
00262   storyboard_struct storyboard;
00263 }story_struct;
00264 
00265 
00266 typedef struct coordo_struct{
00267   int x;
00268   int y;
00269 }coordo_struct;
00270 
00274 typedef struct char_ref_struct{
00275   int type; // 0 = none, 1 = KOF91, 2 = mugen
00276   char * path; // path to find .ini or .def file of the char
00277   char * display_name;
00278   BITMAP * b_pic; // Big picture
00279   BITMAP * s_pic; // Small picture
00280   PALETTE b_pic_pal; // for KOF 91 pcx
00281   PALETTE s_pic_pal; // for KOF 91 PCX
00282   RGB * b_pal; // from mugen's sff
00283   RGB * s_pal; // from mugen's sff
00284   int x; // x axis (Mugen)
00285   int y; // y axis (Mugen)
00286 }char_ref_struct;
00287 
00290 typedef struct bg_ref_struct{
00291   int type; // 0 = none, 1 = KOF91, 2 = mugen
00292   char * path; // path to find the pcx,flc or .def file for bgs
00293   char * display_name;
00294 }bg_ref_struct;
00295 
00299 typedef struct select_struct{
00300   int type; // 0 = kof91 ; 1 = mugen's type
00301   int loaded;
00302   int state; // 0 = select mode (team config) ; 1 = select character ; 2 = select stage
00303   SFFEntry * select_sff;
00304   char * sff_path;
00305   char_ref_struct * char_ref_array;
00306   bg_ref_struct * bg_ref_array;
00307   int * char_list; // list of chars as build with auto conf or read from select.def, to fill the tab index
00308   // Ex : 0 1 -1 2 0 1 1 mean the first char is empty, 2nd is the 1st entry of the char_ref_array , 3rd is the random select , etc...
00309   int nb_char; // number of characters in char_ref_array
00310   int s_nb_char; // number of chars in char_list
00311   int nb_bg; // nb of bgs
00312   coordo_struct p1_position; // current position of p1 cursor in select screen
00313   coordo_struct p2_position; // current position of p2 cursor in select screen
00314   int p1_showed; // 1 If p1 cursor and portrait have to be shown
00315   int p2_showed; // 1 If p2 cursor and portrait have to be shown
00316   int p1_controller; // 0 = computer , other = index of player who control p1 cursor
00317   int p2_controller; // 0 = computer , other = index of player who control p2 cursor
00318   int rows;
00319   int columns;
00320   int wrapping;
00321   int posx; // Used for mugen box and for KOF 91 moving blit
00322   int posy; // Used for mugen box and for KOF 91 moving blit
00323   int showemptyboxes;
00324   int moveoveremptyboxes;
00325   int cellsizex;
00326   int cellsizey;
00327   int cellspacing;
00328   int cellbgspri;
00329   int cellbgsprg;
00330   int cellrandi;
00331   int cellrandg;
00332 
00333   int p1startx;
00334   int p1starty;
00335   int p1activei;
00336   int p1activeg;
00337   int p1donei;
00338   int p1doneg;
00339   int p1movesndg;
00340   int p1movesndi;
00341   int p1donesndg;
00342   int p1donesndi;
00343   int p1randomsndg;
00344   int p1randomsndi;
00345 
00346   int p2startx;
00347   int p2starty;
00348   int p2activei;
00349   int p2activeg;
00350   int p2donei;
00351   int p2doneg;
00352   int p2movesndg;
00353   int p2movesndi;
00354   int p2donesndg;
00355   int p2donesndi;
00356   int p2randomsndg;
00357   int p2randomsndi;
00358   
00359   int stagemovesndg;
00360   int stagemovesndi;
00361   int stagedonesndg;
00362   int stagedonesndi;
00363   int cancelsndg;
00364   int cancelsndi;
00365   
00366   int portraitoffsetx;
00367   int portraitoffsety;
00368   double portraitscalex;
00369   double portraitscaley;
00370 
00371   int titleoffsetx;
00372   int titleoffsety;
00373   int titlefonti;
00374   int titlefontcolor;
00375   int titlefontjust;
00376 
00377   int p1faceoffsetx;
00378   int p1faceoffsety;
00379   double p1facescalex;
00380   double p1facescaley;
00381   int p1facefacing;
00382   int p1nameoffsetx;
00383   int p1nameoffsety;
00384   int p1namefonti;
00385   int p1namefontcolor;
00386   int p1namefontjust;
00387   
00388   int p2faceoffsetx;
00389   int p2faceoffsety;
00390   int p2facescalex;
00391   double p2facescaley;
00392   double p2facefacing;
00393   int p2nameoffsetx;
00394   int p2nameoffsety;
00395   int p2namefonti;
00396   int p2namefontcolor;
00397   int p2namefontjust;
00398 
00399   int p1_max_selecter; // Max of players that player 1 can select
00400   int p1_selected[4]; // ref to index of players selected by player 1 as stored in the char_list
00401   int p1_selecter; //range of the player as selected by player 1 (1st of the group or 2nd...)
00402   int p2_max_selecter; // Max of players that player 2 can select
00403   int p2_selected[4]; // same but for player 2
00404   int p2_selecter;
00405   
00406   int stage_showed;
00407   int stageposx;
00408   int stageposy;
00409   int stageactivefonti;
00410   int stageactivefontcolor;
00411   int stageactivefontjust;
00412   int stageactive2fonti;
00413   int stageactive2fontcolor;
00414   int stageactive2fontjust;
00415   int stagedonefonti;
00416   int stagedonefontcolor;
00417   int stagedonefontjust;
00418   int bg_blinked; // !=0 if the blinked color is used
00419   int current_bg; // index of the selected bg ; after select_screen it became the bg to load
00420   int bg_selected; //0 = no
00421   int stage_controller; // 0=IA ; 1=P1 ; 2=P2
00422   int * bg_used; // array of bgs to use numbers refers to bg_ref_array
00423 
00424   BITMAP * faces;
00425 }select_struct;
00426 
00429 typedef struct vs_struct{
00430   int state; // 0 = showing faces ; 1 = loading p1 ; 2 = loading p2 ; 3 = loading p3 etc...
00431   int time;
00432   int currenttime;
00433   int fadeintime;
00434   int fadeouttime;
00435   coordo_struct p1pos;
00436   int p1facing;
00437   double p1scalex;
00438   double p1scaley;
00439   coordo_struct p1namepos;
00440   int p1namefonti;
00441   int p1namefontcolor;
00442   int p1namefontjust;
00443   coordo_struct p2pos;
00444   int p2facing;
00445   double p2scalex;
00446   double p2scaley;
00447   coordo_struct p2namepos;
00448   int p2namefonti;
00449   int p2namefontcolor;
00450   int p2namefontjust;
00451 }vs_struct;
00452 
00456 typedef struct system_struct{
00457   char ** itemname;
00458   int posx;
00459   int posy;
00460   int itemfontnumber;
00461   int itemfontcolor;
00462   int itemfontalignement;
00463   int itemactivefontnumber;
00464   int itemactivefontcolor;
00465   int itemactivefontalignement;
00466   int itemspacingx;
00467   int itemspacingy;
00468   int windowsmarginx;
00469   int windowsmarginy;
00470   int boxvisible;
00471   int visibleitems;
00472   int boxcoordsx;
00473   int boxcoordsy;
00474   int boxcoordsw;
00475   int boxcoordsh;
00476   int currentitem;
00477   int firstitem; /* first item in list to show */
00478    
00479   int transeffect; //how much the box is transparent 
00480   int transadd;  //do we wish to increase or decrease transparency 
00481   int boxposition; // how many item do we pass through
00482    
00483   //Same for option
00484   int Ocurrentitem; //Option item (2 players)
00485   int Ocurrentitem2; //Option item (player 2 only)
00486   int Otranseffect; //how much the box is transparent 
00487   int Otransadd;  //do we wish to increase or decrease transparency 
00488    
00489   story_struct Intro; //ie Mugen's logo
00490   story_struct Open;  //ie Mugen's intro
00491   story_struct Ending;
00492   story_struct Credits;   
00493 
00494   //system fonts data, max 9 fonts, not an array cause I was lazy
00495   FNTInfo* fontInfo0;
00496   int font0exist;
00497   FNTInfo* fontInfo1;
00498   int font1exist;
00499   FNTInfo* fontInfo2;
00500   int font2exist;
00501   FNTInfo* fontInfo3;
00502   int font3exist;
00503   FNTInfo* fontInfo4;
00504   int font4exist;
00505   FNTInfo* fontInfo5;
00506   int font5exist;
00507   FNTInfo* fontInfo6;
00508   int font6exist;
00509   FNTInfo* fontInfo7;
00510   int font7exist;
00511   FNTInfo* fontInfo8;
00512   int font8exist;
00513   FNTInfo* fontInfo9;
00514   int font9exist;
00515  
00516   // system infos
00517   char * select_path; //Path to find select.def file
00518   char * fight_path; //Path to find fight.def file
00519 
00520   //System sound
00521   char * Sndpath;
00522   SNDCollection *Systemsnd;
00523   int Sndexist;
00524 
00525   // Menu sounds
00526   int Mvcursorgrp;
00527   int Mvcursornb;
00528   int Donecursorgrp;
00529   int Donecursornb;
00530   int Cancelgrp;
00531   int Cancelnb;
00532 
00533   //Option sound
00534   int OMvcursorgrp;
00535   int OMvcursornb;
00536   int ODonecursorgrp;
00537   int ODonecursornb;
00538   int OCancelgrp;
00539   int OCancelnb;
00540 
00541   //System musics
00542   music_struct title_music;
00543   music_struct select_music;
00544   music_struct vs_music;
00545   
00546   //Title Background
00547   background_struct Title_bg;
00548    
00549   //Option Background
00550   background_struct Option_bg;
00551 
00552   //Seelect Background
00553   background_struct Select_bg;
00554    
00555   //Vs background
00556   background_struct Vs_bg;
00557 
00558   // Structure to stock info on character select screen
00559   select_struct Select_struct;
00560 
00561   // Structure to stock info on character vs screen
00562   vs_struct Vs_struct;
00563 
00564 }system_struct;
00565 
00568 typedef struct function_keys{
00569   int Esc; /* boolean to know if esc is pressed or not */
00570   int F1;
00571   int F2;
00572 }function_keys;
00573 
00576 struct Game_variables{
00577   int Game_state; /* state of the engine see docs/automat.gif for details*/
00578   char * Path; /* Root to find data files see 'motif' in readme*/
00579   config Game_config; /* game config from 'kof91.cfg' file*/
00580   system_struct System; /* values from 'system.def' file*/
00581   
00582   //Title Background
00583   background_struct Fight_bg; /* BG to fight in */
00584   
00585   function_keys f_keys; // values of functions keys 
00586   int not_show; // debug variable 'cause code isn't clean 
00587   int fps; // Frame per second, for info
00588   
00589 };
00590 typedef struct Game_variables * Game_variables;
00591 #endif /* GLOBAL_ADD_H */

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